# Interactive Video (H5P.InteractiveVideo)

A video with questions, text and links appearing over it at set times, a bookmark menu, and a summary task at the end.

- `interactiveVideo.video.files` is the video: a file beside the source (`.mp4` or `.webm`), a web address of one, or the address of a video on YouTube, Vimeo, Panopto or Echo360, which plays from there.
- Each item of `interactiveVideo.assets.interactions` shows its `action` (sub-content) from `duration.from` to `duration.to`, in seconds. `pause: true` stops the video for it; `displayType` `"button"` shows an icon to open it, `"poster"` shows it open over the video. The build places each interaction; give `x` and `y` (percent of the picture) to place one yourself.
- The build sizes a poster by what it holds: a question 17 by 16, room for four short answers and its buttons; a text as wide as keeps it short; a picture in its own shape. `width` and `height` size one yourself, in em: the video is 40 wide and 22.5 tall at 16:9. Check posters in the preview; on a phone they show as buttons.
- Bookmarks: `interactiveVideo.assets.bookmarks`, `[{ "time": 30, "label": "…" }]`.
- The summary task at the end is H5P.Summary at `interactiveVideo.summary.task`, shown at `interactiveVideo.summary.displayAt` seconds before the end; leave it out and there is none.
- Know the video's length, and keep every time within it.

## Example

```json
{
  "type": "H5P.InteractiveVideo",
  "params": {
    "interactiveVideo": {
      "video": { "files": [{ "path": "clip.mp4" }], "startScreenOptions": { "title": "A river in spring" } },
      "assets": {
        "interactions": [
          { "duration": { "from": 2, "to": 6 }, "label": "Where does it go?", "action": { "library": "H5P.Text", "params": { "text": "All of this water ends in the sea." } } },
          {
            "duration": { "from": 7, "to": 9 },
            "pause": true,
            "displayType": "poster",
            "action": { "library": "H5P.TrueFalse", "params": { "question": "This river flows uphill.", "correct": "false" } }
          }
        ],
        "bookmarks": [{ "time": 7, "label": "Question" }]
      }
    }
  }
}
```

<!-- Generated by `h5p-author schema --markdown` from the pinned pack. Do not edit by hand. -->

## Fields of H5P.InteractiveVideo 1.28

The example is `type` and `params` alone, and `params` holds the fields below. A source also names its own `title`, `language`, `license` and `authors`, all four required: the build refuses a source that leaves out any of them. The author's name and the licence are the user's: ask for what they have not given. For a name they skip, write the one you know them by, or "Unknown"; for a licence they skip, `U`.

- `interactiveVideo` group — Interactive Video Editor
  - `video` group — Upload/embed video
    - `files` video files, required — Add a video
    - `startScreenOptions` group — Start screen options (unsupported for YouTube videos)
      - `title` text = "Interactive Video" — The title of this interactive video: Used in summaries, statistics etc.
      - `hideStartTitle` boolean = false — Hide title on video start screen
      - `shortStartDescription` text — Short description (Optional): Optional. Display a short description text on the video start screen. Does not work for YouTube videos.
      - `poster` image file — Poster image
    - `textTracks` group — Text tracks (unsupported for YouTube videos)
      - `videoTrack` list of — Available text tracks
        - `label` text = "Subtitles" — Track label: Used if you offer multiple tracks and the user has to choose a track. For instance 'Spanish subtitles' could be the label of a Spanish subtitle track.
        - `kind` one of "subtitles" | "captions" | "descriptions" = "subtitles" — Type of text track
        - `srcLang` text = "en" — Source language, must be defined for subtitles: Must be a valid BCP 47 language tag. If 'Subtitles' is the type of text track selected, the source language of the track must be defined.
        - `track` file, required — Track source (WebVTT file)
      - `defaultTrackLabel` text — Default text track: If left empty or not matching any of the text tracks the first text track will be used as the default.
  - `assets` group — Add interactions
    - `interactions` list of
      - `duration` group — Display time
        - `from` number, required
        - `to` number, required
      - `pause` boolean — Pause video
      - `displayType` one of "button" | "poster" = "button" — Display as: Button is a collapsed interaction the user must press to open. Poster is an expanded interaction displayed directly on top of the video
      - `buttonOnMobile` boolean = false — Turn into button on small screens
      - `label` html — Label: Label displayed next to interaction icon.
      - `action` sub-content: H5P.Nil | H5P.Text | H5P.Table | H5P.Link | H5P.Image | H5P.Summary | H5P.SingleChoiceSet | H5P.MultiChoice | H5P.TrueFalse | H5P.Blanks | H5P.DragQuestion | H5P.MarkTheWords | H5P.DragText | H5P.GoToQuestion | H5P.IVHotspot | H5P.Questionnaire | H5P.FreeTextQuestion | H5P.MultiMediaChoice, required
      - `adaptivity` group — Adaptivity
        - `correct` group — Action on all correct
          - `seekTo` number, required — Seek to: Enter timecode in the format M:SS
          - `allowOptOut` boolean — Allow the user to opt out and continue
          - `message` html: strong em del a code, required — Message
          - `seekLabel` text, required — Label for seek button
        - `wrong` group — Action on wrong
          - `seekTo` number, required — Seek to: Enter timecode in the format M:SS
          - `allowOptOut` boolean — Allow the user to opt out and continue
          - `message` html: strong em del a code, required — Message
          - `seekLabel` text, required — Label for seek button
        - `requireCompletion` boolean — Require full score for task before proceeding
      - `visuals` group — Visuals
        - `backgroundColor` text = "rgb(255, 255, 255)" — Background color
        - `boxShadow` boolean = true — Box shadow
      - `goto` group — Go to on click
        - `type` one of "timecode" | "url" — Type
        - `time` number — Go To: The target time the user will be taken to upon pressing the hotspot. Enter timecode in the format M:SS.
        - `url` group — URL
          - `protocol` one of "http://" | "https://" | "/" | "other" = "http://" — Protocol
          - `url` text — URL
        - `visualize` boolean — Visualize
    - `bookmarks` list of
      - `time` number, required
      - `label` text, required
    - `endscreens` list of
      - `time` number, required
      - `label` text, required
  - `summary` group — Summary task
    - `task` sub-content: H5P.Summary = {"library":"H5P.Summary 1.10","params":{}}
    - `displayAt` number = 3 — Display at: Number of seconds before the video ends.
- `override` group — Behavioural settings
  - `startVideoAt` number — Start video at: Enter timecode in the format M:SS
  - `autoplay` boolean = false — Auto-play video
  - `loop` boolean = false — Loop the video
  - `hasNoAutoPause` boolean = false — Deactivate auto-pause
  - `showSolutionButton` one of "on" | "off" — Override "Show Solution" button: This option determines if the "Show Solution" button will be shown for all questions, disabled for all or configured for each question individually.
  - `retryButton` one of "on" | "off", required — Override "Retry" button: This option determines if the "Retry" button will be shown for all questions, disabled for all or configured for each question individually.
  - `showBookmarksmenuOnLoad` boolean = false — Start with bookmarks menu open
  - `showRewind10` boolean = false — Show button for rewinding 10 seconds
  - `preventSkippingMode` one of "none" | "forward" | "both" = "none" — Disable navigation: These options will disable user video navigation as specified.
  - `deactivateSound` boolean = false — Deactivate sound

47 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.InteractiveVideo --all` lists them, for a source to set one.

<!-- End of the generated section. -->
