Video.js Service
A service for interacting with Video.js.
Methods
initVideoJsPlayer
Description
- Creates a videojs player instance on an HTMLElement.
Return Value: A DIGIDECK Core VideoPlayer instance, which wrappers a video.js Player instance.
Options:
element: HTMLElementElement to instantiate videojs on. Must be a video element with a unique id on it.sources: ArrayDIGIDECK Video sources.options: ObjectOptions for initializing player.
Code Example
this.player = await digideckCore.videoJsService.initVideoJsPlayer(this.videoEl, this.source, {
config: {
controls: controls,
muted: !this.audio,
poster: this.posterImage,
loop: this.loop,
autoplay: false,
fill: this.stretching == 'fill' ? true : false
},
onPlayerReady: () => {}
});