# @times-stories/transcript-page

> > The transcript page for the `@times-stories` suite of packages

Latest version **1.2.2** (published 2019-05-07) · 0 weekly downloads

## Install

```sh
npm install @times-stories/transcript-page
pnpm add @times-stories/transcript-page
yarn add @times-stories/transcript-page
bun add @times-stories/transcript-page
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2019-05-07 |
| First published | 2018-11-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | chrishutchinson, flashcheeks |

## Links

- npm: https://www.npmjs.com/package/@times-stories/transcript-page
- npm.io page: https://npm.io/package/@times-stories/transcript-page

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^16.6.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.6.1
- [@times-stories/style-guide](https://npm.io/package/@times-stories/style-guide.md) ^1.2.2
- [@times-stories/image-container](https://npm.io/package/@times-stories/image-container.md) ^1.2.2

## Recent versions

- 1.2.2 (latest) — 2019-05-07
- 1.2.1 — 2019-04-04
- 1.1.2 — 2019-03-22
- 1.1.1 — 2019-03-20
- 1.1.0 — 2019-03-20
- 1.0.16 — 2018-12-19
- 1.0.15 — 2018-12-19
- 1.0.14 — 2018-12-19
- 1.0.13 — 2018-12-17
- 1.0.12 — 2018-12-17
- 1.0.11 — 2018-12-17
- 1.0.9 — 2018-11-09
- 1.0.8 — 2018-11-09
- 1.0.7 — 2018-11-09
- 1.0.6 — 2018-11-09
- … 2 more at https://npm.io/package/@times-stories/transcript-page/versions

## README

# @times-stories/transcript-page

> The transcript page for the `@times-stories` suite of packages

## Installation

```bash
$ yarn add @times-stories/transcript-page
```

## Usage

This component allows you to render an auto-playing (muted by default) audio
player with scrolling transcript words.

You must provide both the audio source, and the transcribed words (with start
time, duration, and the word itself – see below for an example). Services such
as [Trint](https://trint.com/) can provide data in a similar format to this. You
can find a full example in `stories/fixtures/words.js`.

The `showMuteOnboarding` and `onMuteOnboardingClose` props are left for you to
determine the logic. You may choose to store a flag in `localstorage` so the
unmute logic is not shown in the future, or you may choose to show it on the
first slide. By default, the template will not close the tooltip when dismissed
unless you implement `onMuteOnboardingClose`.

```js
import Story from "@times-stories/story";
import Page from "@times-stories/page";
import TranscriptPage from "@times-stories/transcript-page";

const backgroundImage = {
  src: "url/to/image",
  focusPoint: {
    x: 50,
    y: 50
  }
};

const words = [
  { start: 700, duration: 15, word: "Hello" },
  { start: 715, duration: 20, word: "world" }
];

class MyStory extends React.Component {
  state = {
    showOnboarding: true
  };

  toggleOnboarding = () => {
    this.setState(({ showOnboarding }) => ({
      showOnboarding: !showOnboarding
    }));
  };

  render() {
    const { showOnboarding } = this.state;

    return (
      <Story>
        <Page>
          {props => (
            <TranscriptPage
              {...props}
              source="/path/to/audio/file.mp3"
              words={words}
              backgroundImage={{
                src: backgroundImage,
                focusPoint: {
                  x: 50,
                  y: 50
                }
              }}
              showMuteOnboarding={showOnboarding}
              onMuteOnboardingClose={this.toggleOnboarding}
            />
          )}
        </Page>
      </Story>
    );
  }
}
```

---
_Source: https://npm.io/package/@times-stories/transcript-page · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
