Constructor
new ThumbnailLoopOnImageHover(imageElement, imageElementDataAttributeWebVTTUrl, timeIntervalMilliseconds)
Create a canvas element on top of an image element where thumbnails are shown when the image is hovered.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
imageElement |
Object | Image element that provides the url to the webVTT file as data attribute. | |
imageElementDataAttributeWebVTTUrl |
string | data-src-webvtt | Name of the data attribute in the image element. |
timeIntervalMilliseconds |
Number | 100 | Time interval between thumbnail images. Allows playback speed control. |
Methods
(static) playThumbnailLoop(imageElement, vttUrl, currentFrame, timeIntervalMilliseconds, reversePlayback, timestampTextElement, timestampTextOnRemove)
Play a loop of thumbnail images provided via a webVTT file.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
imageElement |
Object | Image element where thumbnail loop is attached as sibling. | |
vttUrl |
String | URL to the webVTT file. | |
currentFrame |
Number | 0 | Current thumbnail frame. Starts with zero. |
timeIntervalMilliseconds |
Number | 100 | Time interval between thumbnail images. Allows playback speed control. |
reversePlayback |
Boolean | false | If true play thumbnails in reverse order. |
timestampTextElement |
Object | null | Text element to show timestamps as inner text. |
timestampTextOnRemove |
String | Timestamp text that is shown when the thumbnail loop is removed. |