videojs-chapter-thumbnails
Video.js plugin for supporting WebVTT chapter thumbnails.
Getting Started
Include
<!-- optional: default styles -->
Enable
;
Note: There are multiple ways to enable plugins. For more information, please visit Video.js.
Options
label
Type: string
Default: English
language
Type: string
Default: en
src
Type: string
template
Type: Function
Default:
{ let cueText; // NOTE: if `cue.text` isn't parseable, just send it through instead of blowing up. // DRAGON: this probably opens up a possible script injection try cueText = JSON; catch e cueText = cuetext; const image title = cueText; const template = document; templateclassName = 'vjs-chapters-thumbnails-item'; if image const img = document; imgclassName = 'vjs-chapters-thumbnails-item-image'; imgsrc = image; template; if title const span = document; spanclassName = 'vjs-chapters-thumbnails-item-title'; spaninnerHTML = title; template; return template;}
Provides for custom chapter templating. Must return either HTMLElement
or string
.
Example WebVTT file
Define chapters plugin by specifying a WebVTT spec.
WEBVTT
Chapter 1
00:00:00.000 --> 00:00:10.000
{
"title":"Chapter 1",
"image":"asset/img/chapter_1.png"
}
Contributing + Example
npm install -g grunt-cli npm install npm start
License
Code licensed under The MIT License.