Chapters plugin
0.5 KB gzipLoads chapters from an array or a WebVTT file, draws markers on the seek bar, shows the chapter title in the preview and emits a plugin:chapterchange event.
Hover the seek bar to see the chapter markers and titles.
Install
npm i @tomato-player/plugin-chapters
Usage
player.ts — tsimport { createPlayer } from '@tomato-player/core';import { minimal } from '@tomato-player/skin-minimal';import { chapters } from '@tomato-player/plugin-chapters';createPlayer('#player', {src: 'movie.mp4',skin: minimal(),plugins: [chapters({ chapters: '/chapters.vtt' })],});
Options
| Option | Type | Description |
|---|---|---|
| chapters | Chapter[] | string | Array of { start, end?, title } or a WebVTT URL. |