Class: VideoComponent

VideoComponent(dataObjectopt, optionsopt)

VideoComponent displays a single video. If you want to display controls, use VideoPlayerComponent.

Constructor

new VideoComponent(dataObjectopt, optionsopt)

Parameters:
Name Type Attributes Default Description
dataObject DataObject <optional>
null
options Object <optional>
{}
Properties
Name Type Attributes Default Description
preview string <optional>
null the URL to a still image to show until the user plays the video
video string <optional>
null the URL to a video
mimeType string <optional>
null the mimeType for the video
Source:
Example
const component = new VideoComponent(undefined, {
	preview: '/static/preview-image.png',
	video: '/static/video.mp4',
	mimeType: 'video/mp4'
})

Members

currentTime

Source:

duration

Source:

Methods

loadVideo()

Call this to start loading the video
Source:

pause()

Pause the video, loading it if it isn't already.
Source:

play()

Play the video, loading it if it isn't already.
Source:

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'
Source:

toggle()

Call this to switch between playing and paused states.
Source: