diff --git a/src/video-player.js b/src/video-player.js index 9f7f6ae9..701c4493 100644 --- a/src/video-player.js +++ b/src/video-player.js @@ -74,7 +74,9 @@ class VideoPlayer extends Utils.mixin(Eventable) { this.videoElement.classList.add('video-js'); // Handle WebFont loading - Utils.fontFace(this.videoElement, this.playerOptions); + if (this.playerOptions.cloudinary.fontFace) { + Utils.fontFace(this.videoElement, this.playerOptions.cloudinary.fontFace); + } // Handle play button options Utils.playButton(this.videoElement, this._videojsOptions); @@ -228,19 +230,25 @@ class VideoPlayer extends Utils.mixin(Eventable) { const kinds = Object.keys(conf); const allTracks = []; for (const kind of kinds) { - const tracks = Array.isArray(conf[kind]) ? conf[kind] : [conf[kind]]; - for (const track of tracks) { - allTracks.push({ - ...track, - kind: kind, - label: track.label, - srclang: track.language, - default: !!(track.default), - src: track.url - }); + if (kind !== 'options') { + const tracks = Array.isArray(conf[kind]) ? conf[kind] : [conf[kind]]; + for (const track of tracks) { + allTracks.push({ + ...track, + kind: kind, + label: track.label, + srclang: track.language, + default: !!(track.default), + src: track.url + }); + } } } - Utils.filterAndAddTextTracks(allTracks, this.videojs); + Utils.addTextTracks(allTracks, this.videojs); + + if (conf.options && this.videojs.styledTextTracks) { + this.videojs.styledTextTracks(conf.options); + } } }