Constructor
new VideoComponent(dataObjectopt, optionsopt)
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dataObject |
DataObject |
<optional> |
null | |||||||||||||||||||||
options |
Object |
<optional> |
{} |
Properties
|
Example
const component = new VideoComponent(undefined, {
preview: '/static/preview-image.png',
video: '/static/video.mp4',
mimeType: 'video/mp4'
})
Members
currentTime
duration
Methods
loadVideo()
Call this to start loading the video
pause()
Pause the video, loading it if it isn't already.
play()
Play the video, loading it if it isn't already.
setSourceAttributes(url, mimeType)
Sets the attributes on the `video` HTMLElement.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | the relative or full URL to the video |
mimeType |
string | a mime type like 'video/mp4' |
toggle()
Call this to switch between playing and paused states.