From 4aaaabb0da5e5e1a4a821a9f9c9932749e49a14c Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Fri, 7 Apr 2017 10:59:11 +0800 Subject: [PATCH] MDL-58530 media_videojs: upgrade videojs to 5.18.4 --- .../videojs/amd/build/Youtube-lazy.min.js | 2 +- .../videojs/amd/build/video-lazy.min.js | 17 +- media/player/videojs/amd/src/Youtube-lazy.js | 123 +- media/player/videojs/amd/src/video-lazy.js | 15750 +++++++++------- media/player/videojs/fonts/VideoJS.svg | 2 +- media/player/videojs/readme_moodle.txt | 2 +- media/player/videojs/styles.css | 10 +- media/player/videojs/thirdpartylibs.xml | 6 +- media/player/videojs/videojs/lang/ru.js | 16 +- media/player/videojs/videojs/lang/uk.js | 16 +- media/player/videojs/videojs/lang/zh-TW.js | 15 +- media/player/videojs/videojs/video-js.swf | Bin 16916 -> 17117 bytes 12 files changed, 9035 insertions(+), 6924 deletions(-) diff --git a/media/player/videojs/amd/build/Youtube-lazy.min.js b/media/player/videojs/amd/build/Youtube-lazy.min.js index 7e010eac46c..60fbe7d4d84 100644 --- a/media/player/videojs/amd/build/Youtube-lazy.min.js +++ b/media/player/videojs/amd/build/Youtube-lazy.min.js @@ -1 +1 @@ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("video.js")):"function"==typeof define&&define.amd?define(["media_videojs/video-lazy"],function(c){return a.Youtube=b(c)}):a.Youtube=b(a.videojs)}(this,function(a){"use strict";function b(){YT.ready(function(){g.isApiReady=!0;for(var a=0;a0}var f=a.getComponent("Tech"),g=a.extend(f,{constructor:function(a,b){f.call(this,a,b),this.setPoster(a.poster),this.setSrc(this.options_.source,!0),setTimeout(function(){this.el_.parentNode.className+=" vjs-youtube",h&&(this.el_.parentNode.className+=" vjs-youtube-mobile"),g.isApiReady?this.initYTPlayer():g.apiReadyQueue.push(this)}.bind(this))},dispose:function(){if(this.ytPlayer)this.ytPlayer.stopVideo(),this.ytPlayer.destroy();else{var a=g.apiReadyQueue.indexOf(this);a!==-1&&g.apiReadyQueue.splice(a,1)}this.ytPlayer=null,this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile",""),this.el_.remove(),f.prototype.dispose.call(this)},createEl:function(){var a=document.createElement("div");a.setAttribute("id",this.options_.techId),a.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute"),a.setAttribute("class","vjs-tech");var b=document.createElement("div");if(b.appendChild(a),!h&&!this.options_.ytControls){var c=document.createElement("div");c.setAttribute("class","vjs-iframe-blocker"),c.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%"),c.onclick=function(){this.pause()}.bind(this),b.appendChild(c)}return b},initYTPlayer:function(){var a={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};"undefined"!=typeof this.options_.autohide&&(a.autohide=this.options_.autohide),"undefined"!=typeof this.options_.cc_load_policy&&(a.cc_load_policy=this.options_.cc_load_policy),"undefined"!=typeof this.options_.ytControls&&(a.controls=this.options_.ytControls),"undefined"!=typeof this.options_.disablekb&&(a.disablekb=this.options_.disablekb),"undefined"!=typeof this.options_.end&&(a.end=this.options_.end),"undefined"!=typeof this.options_.color&&(a.color=this.options_.color),a.controls?"undefined"!=typeof this.options_.fs&&(a.fs=this.options_.fs):a.fs=0,"undefined"!=typeof this.options_.end&&(a.end=this.options_.end),"undefined"!=typeof this.options_.hl?a.hl=this.options_.hl:"undefined"!=typeof this.options_.language&&(a.hl=this.options_.language.substr(0,2)),"undefined"!=typeof this.options_.iv_load_policy&&(a.iv_load_policy=this.options_.iv_load_policy),"undefined"!=typeof this.options_.list?a.list=this.options_.list:this.url&&"undefined"!=typeof this.url.listId&&(a.list=this.url.listId),"undefined"!=typeof this.options_.listType&&(a.listType=this.options_.listType),"undefined"!=typeof this.options_.modestbranding&&(a.modestbranding=this.options_.modestbranding),"undefined"!=typeof this.options_.playlist&&(a.playlist=this.options_.playlist),"undefined"!=typeof this.options_.playsinline&&(a.playsinline=this.options_.playsinline),"undefined"!=typeof this.options_.rel&&(a.rel=this.options_.rel),"undefined"!=typeof this.options_.showinfo&&(a.showinfo=this.options_.showinfo),"undefined"!=typeof this.options_.start&&(a.start=this.options_.start),"undefined"!=typeof this.options_.theme&&(a.theme=this.options_.theme),this.activeVideoId=this.url?this.url.videoId:null,this.activeList=a.list,this.ytPlayer=new YT.Player(this.options_.techId,{videoId:this.activeVideoId,playerVars:a,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onError:this.onPlayerError.bind(this)}})},onPlayerReady:function(){this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.ytPlayer.cueVideoById(this.url.videoId),this.activeVideoId=this.url.videoId)},onPlayerPlaybackQualityChange:function(){},onPlayerStateChange:function(a){var b=a.data;if(b!==this.lastState&&!this.errorNumber)switch(this.lastState=b,b){case-1:this.trigger("loadstart"),this.trigger("loadedmetadata"),this.trigger("durationchange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate"),this.trigger("durationchange"),this.trigger("playing"),this.trigger("play"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting")}},onPlayerError:function(a){this.errorNumber=a.data,this.trigger("error"),this.ytPlayer.stopVideo()},error:function(){switch(this.errorNumber){case 5:return{code:"Error while trying to play the video"};case 2:case 100:return{code:"Unable to find the video"};case 101:case 150:return{code:"Playback on other Websites has been disabled by the video owner."}}return{code:"YouTube unknown error ("+this.errorNumber+")"}},src:function(a){return a&&this.setSrc({src:a}),this.source},poster:function(){return h?null:this.poster_},setPoster:function(a){this.poster_=a},setSrc:function(a){a&&a.src&&(delete this.errorNumber,this.source=a,this.url=g.parseUrl(a.src),this.options_.poster||this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!h?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.ytPlayer.cueVideoById(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))},autoplay:function(){return this.options_.autoplay},setAutoplay:function(a){this.options_.autoplay=a},loop:function(){return this.options_.loop},setLoop:function(a){this.options_.loop=a},play:function(){this.url&&this.url.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.ytPlayer.loadVideoById(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))},pause:function(){this.ytPlayer&&this.ytPlayer.pauseVideo()},paused:function(){return!this.ytPlayer||this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING},currentTime:function(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0},setCurrentTime:function(a){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(a,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==a&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval(function(){this.lastState===YT.PlayerState.PAUSED&&this.isSeeking?this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked()):clearInterval(this.checkSeekedInPauseInterval)}.bind(this),250))},seeking:function(){return this.isSeeking},seekable:function(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}};var a=this.ytPlayer.getDuration();return{length:this.ytPlayer.getDuration(),start:function(){return 0},end:function(){return a}}},onSeeked:function(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")},playbackRate:function(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1},setPlaybackRate:function(a){this.ytPlayer&&(this.ytPlayer.setPlaybackRate(a),this.trigger("ratechange"))},duration:function(){return this.ytPlayer?this.ytPlayer.getDuration():0},currentSrc:function(){return this.source&&this.source.src},ended:function(){return!!this.ytPlayer&&this.lastState===YT.PlayerState.ENDED},volume:function(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1},setVolume:function(a){this.ytPlayer&&(this.ytPlayer.setVolume(100*a),this.setTimeout(function(){this.trigger("volumechange")},50))},muted:function(){return!!this.ytPlayer&&this.ytPlayer.isMuted()},setMuted:function(a){this.ytPlayer&&(this.muted(!0),a?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(function(){this.trigger("volumechange")},50))},buffered:function(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}};var a=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return{length:this.ytPlayer.getDuration(),start:function(){return 0},end:function(){return a}}},preload:function(){},load:function(){},reset:function(){},supportsFullScreen:function(){return!0},checkHighResPoster:function(){var a="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var b=new Image;b.onload=function(){if("naturalHeight"in b){if(b.naturalHeight<=90||b.naturalWidth<=120)return}else if(b.height<=90||b.width<=120)return;this.poster_=a,this.trigger("posterchange")}.bind(this),b.onerror=function(){},b.src=a}catch(c){}}});g.isSupported=function(){return!0},g.canPlaySource=function(a){return g.canPlayType(a.type)},g.canPlayType=function(a){return"video/youtube"===a};var h=a.browser.IS_IOS||e();g.parseUrl=function(a){var b={videoId:null},c=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,d=a.match(c);d&&11===d[2].length&&(b.videoId=d[2]);var e=/[?&]list=([^#\&\?]+)/;return d=a.match(e),d&&d[1]&&(b.listId=d[1]),b},g.apiReadyQueue=[],c("https://www.youtube.com/iframe_api",b),d(),"undefined"!=typeof a.registerTech?a.registerTech("Youtube",g):a.registerComponent("Youtube",g)}); \ No newline at end of file +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("video.js")):"function"==typeof define&&define.amd?define(["media_videojs/video-lazy"],function(c){return a.Youtube=b(c)}):a.Youtube=b(a.videojs)}(this,function(a){"use strict";function b(){YT.ready(function(){g.isApiReady=!0;for(var a=0;a1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)},onPlayerPlaybackQualityChange:function(){},onPlayerPlaybackRateChange:function(){this.trigger("ratechange")},onPlayerStateChange:function(a){var b=a.data;if(b!==this.lastState&&!this.errorNumber)switch(this.lastState=b,b){case-1:this.trigger("loadstart"),this.trigger("loadedmetadata"),this.trigger("durationchange"),this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate"),this.trigger("durationchange"),this.trigger("playing"),this.trigger("play"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting")}},onPlayerError:function(a){this.errorNumber=a.data,this.trigger("pause"),this.trigger("error")},error:function(){var a=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:a,message:"Error while trying to play the video"};case 2:case 100:return{code:a,message:"Unable to find the video"};case 101:case 150:return{code:a,message:"Playback on other Websites has been disabled by the video owner."}}return{code:a,message:"YouTube unknown error ("+this.errorNumber+")"}},loadVideoById_:function(a){var b={videoId:a};this.options_.start&&(b.startSeconds=this.options_.start),this.options_.end&&(b.endEnd=this.options_.end),this.ytPlayer.loadVideoById(b)},cueVideoById_:function(a){var b={videoId:a};this.options_.start&&(b.startSeconds=this.options_.start),this.options_.end&&(b.endEnd=this.options_.end),this.ytPlayer.cueVideoById(b)},src:function(a){return a&&this.setSrc({src:a}),this.source},poster:function(){return e?null:this.poster_},setPoster:function(a){this.poster_=a},setSrc:function(a){a&&a.src&&(delete this.errorNumber,this.source=a,this.url=g.parseUrl(a.src),this.options_.poster||this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!e?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))},autoplay:function(){return this.options_.autoplay},setAutoplay:function(a){this.options_.autoplay=a},loop:function(){return this.options_.loop},setLoop:function(a){this.options_.loop=a},play:function(){this.url&&this.url.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))},pause:function(){this.ytPlayer&&this.ytPlayer.pauseVideo()},paused:function(){return!this.ytPlayer||this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING},currentTime:function(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0},setCurrentTime:function(a){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(a,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==a&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval(function(){this.lastState===YT.PlayerState.PAUSED&&this.isSeeking?this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked()):clearInterval(this.checkSeekedInPauseInterval)}.bind(this),250))},seeking:function(){return this.isSeeking},seekable:function(){return this.ytPlayer?a.createTimeRange(0,this.ytPlayer.getDuration()):a.createTimeRange()},onSeeked:function(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")},playbackRate:function(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1},setPlaybackRate:function(a){this.ytPlayer&&this.ytPlayer.setPlaybackRate(a)},duration:function(){return this.ytPlayer?this.ytPlayer.getDuration():0},currentSrc:function(){return this.source&&this.source.src},ended:function(){return!!this.ytPlayer&&this.lastState===YT.PlayerState.ENDED},volume:function(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1},setVolume:function(a){this.ytPlayer&&(this.ytPlayer.setVolume(100*a),this.setTimeout(function(){this.trigger("volumechange")},50))},muted:function(){return!!this.ytPlayer&&this.ytPlayer.isMuted()},setMuted:function(a){this.ytPlayer&&(this.muted(!0),a?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(function(){this.trigger("volumechange")},50))},buffered:function(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return a.createTimeRange();var b=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return a.createTimeRange(0,b)},preload:function(){},load:function(){},reset:function(){},supportsFullScreen:function(){return!0},checkHighResPoster:function(){var a="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var b=new Image;b.onload=function(){if("naturalHeight"in b){if(b.naturalHeight<=90||b.naturalWidth<=120)return}else if(b.height<=90||b.width<=120)return;this.poster_=a,this.trigger("posterchange")}.bind(this),b.onerror=function(){},b.src=a}catch(c){}}});g.isSupported=function(){return!0},g.canPlaySource=function(a){return g.canPlayType(a.type)},g.canPlayType=function(a){return"video/youtube"===a},g.parseUrl=function(a){var b={videoId:null},c=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,d=a.match(c);d&&11===d[2].length&&(b.videoId=d[2]);var e=/[?&]list=([^#\&\?]+)/;return d=a.match(e),d&&d[1]&&(b.listId=d[1]),b},g.apiReadyQueue=[],c("https://www.youtube.com/iframe_api",b),d(),"undefined"!=typeof a.registerTech?a.registerTech("Youtube",g):a.registerComponent("Youtube",g)}); \ No newline at end of file diff --git a/media/player/videojs/amd/build/video-lazy.min.js b/media/player/videojs/amd/build/video-lazy.min.js index 6692d51394d..a4af910c994 100644 --- a/media/player/videojs/amd/build/video-lazy.min.js +++ b/media/player/videojs/amd/build/video-lazy.min.js @@ -1,9 +1,8 @@ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.videojs=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0&&void 0!==arguments[0]?arguments[0]:"button",b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b=(0,o["default"])({className:this.buildCSSClass()},b),"button"!==a&&(m["default"].warn("Creating a Button with an HTML element of "+a+" is deprecated; use ClickableComponent instead."),b=(0,o["default"])({tabIndex:0},b),c=(0,o["default"])({role:"button"},c)),c=(0,o["default"])({type:"button","aria-live":"polite"},c);var d=k["default"].prototype.createEl.call(this,a,b,c);return this.createControlTextEl(d),d},b.prototype.addChild=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=this.constructor.name;return m["default"].warn("Adding an actionable (user controllable) child to a Button ("+c+") is not supported; use a ClickableComponent instead."),k["default"].prototype.addChild.call(this,a,b)},b.prototype.handleKeyPress=function(b){32!==b.which&&13!==b.which&&a.prototype.handleKeyPress.call(this,b)},b}(i["default"]);k["default"].registerComponent("Button",p),c["default"]=p},{136:136,3:3,5:5,85:85}],3:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(80),l=d(k),m=a(81),n=d(m),o=a(82),p=d(o),q=a(85),r=e(q),s=a(92),t=e(s),u=a(136),v=e(u),w=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.emitTapEvents(),e.on("tap",e.handleClick),e.on("click",e.handleClick),e.on("focus",e.handleFocus),e.on("blur",e.handleBlur),e}return h(b,a),b.prototype.createEl=function(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};c=(0,v["default"])({className:this.buildCSSClass(),tabIndex:0},c),"button"===b&&r["default"].error("Creating a ClickableComponent with an HTML element of "+b+" is not supported; use a Button instead."),d=(0,v["default"])({role:"button","aria-live":"polite"},d);var e=a.prototype.createEl.call(this,b,c,d);return this.createControlTextEl(e),e},b.prototype.createControlTextEl=function(a){return this.controlTextEl_=l.createEl("span",{className:"vjs-control-text"}),a&&a.appendChild(this.controlTextEl_),this.controlText(this.controlText_,a),this.controlTextEl_},b.prototype.controlText=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(!a)return this.controlText_||"Need Text";var c=this.localize(a);return this.controlText_=a,this.controlTextEl_.innerHTML=c,b.setAttribute("title",c),this},b.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+a.prototype.buildCSSClass.call(this)},b.prototype.addChild=function(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.prototype.addChild.call(this,b,c)},b.prototype.enable=function(){return this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),this},b.prototype.disable=function(){return this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),this},b.prototype.handleClick=function(){},b.prototype.handleFocus=function(){n.on(t["default"],"keydown",p.bind(this,this.handleKeyPress))},b.prototype.handleKeyPress=function(b){32===b.which||13===b.which?(b.preventDefault(),this.handleClick(b)):a.prototype.handleKeyPress&&a.prototype.handleKeyPress.call(this,b)},b.prototype.handleBlur=function(){n.off(t["default"],"keydown",p.bind(this,this.handleKeyPress))},b}(j["default"]);j["default"].registerComponent("ClickableComponent",w),c["default"]=w},{136:136,5:5,80:80,81:81,82:82,85:85,92:92}],4:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(2),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return g.controlText(d&&d.controlText||g.localize("Close")),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(){this.trigger({type:"close",bubbles:!1})},b}(i["default"]);k["default"].registerComponent("CloseButton",l),c["default"]=l},{2:2,5:5}],5:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a(93),h=e(g),i=a(80),j=d(i),k=a(82),l=d(k),m=a(84),n=d(m),o=a(81),p=d(o),q=a(85),r=e(q),s=a(89),t=e(s),u=a(86),v=e(u),w=function(){function a(b,c,d){if(f(this,a),!b&&this.play?this.player_=b=this:this.player_=b,this.options_=(0,v["default"])({},this.options_),c=this.options_=(0,v["default"])(this.options_,c),this.id_=c.id||c.el&&c.el.id,!this.id_){var e=b&&b.id&&b.id()||"no_player";this.id_=e+"_component_"+n.newGUID()}this.name_=c.name||null,c.el?this.el_=c.el:c.createEl!==!1&&(this.el_=this.createEl()),this.children_=[],this.childIndex_={},this.childNameIndex_={},c.initChildren!==!1&&this.initChildren(),this.ready(d),c.reportTouchActivity!==!1&&this.enableTouchActivity()}return a.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var a=this.children_.length-1;a>=0;a--)this.children_[a].dispose&&this.children_[a].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.off(),this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),j.removeElData(this.el_),this.el_=null},a.prototype.player=function(){return this.player_},a.prototype.options=function(a){return r["default"].warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),a?(this.options_=(0,v["default"])(this.options_,a),this.options_):this.options_},a.prototype.el=function(){return this.el_},a.prototype.createEl=function(a,b,c){return j.createEl(a,b,c)},a.prototype.localize=function(a){var b=this.player_.language&&this.player_.language(),c=this.player_.languages&&this.player_.languages();if(!b||!c)return a;var d=c[b];if(d&&d[a])return d[a];var e=b.split("-")[0],f=c[e];return f&&f[a]?f[a]:a},a.prototype.contentEl=function(){return this.contentEl_||this.el_},a.prototype.id=function(){return this.id_},a.prototype.name=function(){return this.name_},a.prototype.children=function(){return this.children_},a.prototype.getChildById=function(a){return this.childIndex_[a]},a.prototype.getChild=function(a){return this.childNameIndex_[a]},a.prototype.addChild=function(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,e=void 0,f=void 0;if("string"==typeof b){f=b,c||(c={}),c===!0&&(r["default"].warn("Initializing a child component with `true` is deprecated. Children should be defined in an array when possible, but if necessary use an object instead of `true`."),c={});var g=c.componentClass||(0,t["default"])(f);c.name=f;var h=a.getComponent(g);if(!h)throw new Error("Component "+g+" does not exist");if("function"!=typeof h)return null;e=new h(this.player_||this,c)}else e=b;if(this.children_.splice(d,0,e),"function"==typeof e.id&&(this.childIndex_[e.id()]=e),f=f||e.name&&e.name(),f&&(this.childNameIndex_[f]=e),"function"==typeof e.el&&e.el()){var i=this.contentEl().children,j=i[d]||null;this.contentEl().insertBefore(e.el(),j)}return e},a.prototype.removeChild=function(a){if("string"==typeof a&&(a=this.getChild(a)),a&&this.children_){for(var b=!1,c=this.children_.length-1;c>=0;c--)if(this.children_[c]===a){b=!0,this.children_.splice(c,1);break}if(b){this.childIndex_[a.id()]=null,this.childNameIndex_[a.name()]=null;var d=a.el();d&&d.parentNode===this.contentEl()&&this.contentEl().removeChild(a.el())}}},a.prototype.initChildren=function(){var b=this,c=this.options_.children;c&&!function(){var d=b.options_,e=function(a){var c=a.name,e=a.opts;if(void 0!==d[c]&&(e=d[c]),e!==!1){e===!0&&(e={}),e.playerOptions=b.options_.playerOptions;var f=b.addChild(c,e);f&&(b[c]=f)}},f=void 0,g=a.getComponent("Tech");f=Array.isArray(c)?c:Object.keys(c),f.concat(Object.keys(b.options_).filter(function(a){return!f.some(function(b){return"string"==typeof b?a===b:a===b.name})})).map(function(a){var d=void 0,e=void 0;return"string"==typeof a?(d=a,e=c[d]||b.options_[d]||{}):(d=a.name,e=a),{name:d,opts:e}}).filter(function(b){var c=a.getComponent(b.opts.componentClass||(0,t["default"])(b.name));return c&&!g.isTech(c)}).forEach(e)}()},a.prototype.buildCSSClass=function(){return""},a.prototype.on=function(a,b,c){var d=this;return"string"==typeof a||Array.isArray(a)?p.on(this.el_,a,l.bind(this,b)):!function(){var e=a,f=b,g=l.bind(d,c),h=function(){return d.off(e,f,g)};h.guid=g.guid,d.on("dispose",h);var i=function(){return d.off("dispose",h)};i.guid=g.guid,a.nodeName?(p.on(e,f,g),p.on(e,"dispose",i)):"function"==typeof a.on&&(e.on(f,g),e.on("dispose",i))}(),this},a.prototype.off=function(a,b,c){if(!a||"string"==typeof a||Array.isArray(a))p.off(this.el_,a,b);else{var d=a,e=b,f=l.bind(this,c);this.off("dispose",f),a.nodeName?(p.off(d,e,f),p.off(d,"dispose",f)):(d.off(e,f),d.off("dispose",f))}return this},a.prototype.one=function(a,b,c){var d=this,e=arguments;return"string"==typeof a||Array.isArray(a)?p.one(this.el_,a,l.bind(this,b)):!function(){var f=a,g=b,h=l.bind(d,c),i=function j(){d.off(f,g,j),h.apply(null,e)};i.guid=h.guid,d.on(f,g,i)}(),this},a.prototype.trigger=function(a,b){return p.trigger(this.el_,a,b),this},a.prototype.ready=function(a){var b=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a&&(this.isReady_?b?a.call(this):this.setTimeout(a,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(a))),this},a.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var a=this.readyQueue_;this.readyQueue_=[],a&&a.length>0&&a.forEach(function(a){a.call(this)},this),this.trigger("ready")},1)},a.prototype.$=function(a,b){return j.$(a,b||this.contentEl())},a.prototype.$$=function(a,b){return j.$$(a,b||this.contentEl())},a.prototype.hasClass=function(a){return j.hasElClass(this.el_,a)},a.prototype.addClass=function(a){return j.addElClass(this.el_,a),this},a.prototype.removeClass=function(a){return j.removeElClass(this.el_,a),this},a.prototype.toggleClass=function(a,b){return j.toggleElClass(this.el_,a,b),this},a.prototype.show=function(){return this.removeClass("vjs-hidden"),this},a.prototype.hide=function(){return this.addClass("vjs-hidden"),this},a.prototype.lockShowing=function(){return this.addClass("vjs-lock-showing"),this},a.prototype.unlockShowing=function(){return this.removeClass("vjs-lock-showing"),this},a.prototype.width=function(a,b){return this.dimension("width",a,b)},a.prototype.height=function(a,b){return this.dimension("height",a,b)},a.prototype.dimensions=function(a,b){return this.width(a,!0).height(b)},a.prototype.dimension=function(a,b,c){if(void 0!==b)return null!==b&&b===b||(b=0),(""+b).indexOf("%")!==-1||(""+b).indexOf("px")!==-1?this.el_.style[a]=b:"auto"===b?this.el_.style[a]="":this.el_.style[a]=b+"px",c||this.trigger("resize"),this;if(!this.el_)return 0;var d=this.el_.style[a],e=d.indexOf("px");return e!==-1?parseInt(d.slice(0,e),10):parseInt(this.el_["offset"+(0,t["default"])(a)],10)},a.prototype.currentDimension=function(a){var b=0;if("width"!==a&&"height"!==a)throw new Error("currentDimension only accepts width or height value");if("function"==typeof h["default"].getComputedStyle){var c=h["default"].getComputedStyle(this.el_);b=c.getPropertyValue(a)||c[a]}else if(this.el_.currentStyle){var d="offset"+(0,t["default"])(a);b=this.el_[d]}return b=parseFloat(b)},a.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},a.prototype.currentWidth=function(){return this.currentDimension("width")},a.prototype.currentHeight=function(){return this.currentDimension("height")},a.prototype.emitTapEvents=function(){var a=0,b=null,c=10,d=200,e=void 0;this.on("touchstart",function(c){1===c.touches.length&&(b={pageX:c.touches[0].pageX,pageY:c.touches[0].pageY},a=(new Date).getTime(),e=!0)}),this.on("touchmove",function(a){if(a.touches.length>1)e=!1;else if(b){var d=a.touches[0].pageX-b.pageX,f=a.touches[0].pageY-b.pageY,g=Math.sqrt(d*d+f*f);g>c&&(e=!1)}});var f=function(){e=!1};this.on("touchleave",f),this.on("touchcancel",f),this.on("touchend",function(c){if(b=null,e===!0){var f=(new Date).getTime()-a;f1&&void 0!==arguments[1]?arguments[1]:{};e(this,b),d.tracks=c.audioTracks&&c.audioTracks();var g=f(this,a.call(this,c,d));return g.el_.setAttribute("aria-label","Audio Menu"),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-audio-button "+a.prototype.buildCSSClass.call(this)},b.prototype.createItems=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=this.player_.audioTracks&&this.player_.audioTracks();if(!b)return a;for(var c=0;c'+this.localize("Stream Type")+""+this.localize("LIVE")},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateShowing=function(){this.player().duration()===1/0?this.show():this.hide()},b}(j["default"]);j["default"].registerComponent("LiveDisplay",m),c["default"]=m},{5:5,80:80}],11:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(2),j=e(i),k=a(5),l=e(k),m=a(80),n=d(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"volumechange",e.update),c.tech_&&c.tech_.featuresVolumeControl===!1&&e.addClass("vjs-hidden"),e.on(c,"loadstart",function(){this.update(),c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}),e}return h(b,a),b.prototype.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(){this.player_.muted(!this.player_.muted())},b.prototype.update=function(){var a=this.player_.volume(),b=3;0===a||this.player_.muted()?b=0:a<.33?b=1:a<.67&&(b=2);var c=this.player_.muted()?"Unmute":"Mute";this.controlText()!==c&&this.controlText(c);for(var d=0;d<4;d++)n.removeElClass(this.el_,"vjs-vol-"+d);n.addElClass(this.el_,"vjs-vol-"+b)},b}(j["default"]);o.prototype.controlText_="Mute",l["default"].registerComponent("MuteToggle",o),c["default"]=o},{2:2,5:5,80:80}],12:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(2),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return g.on(c,"play",g.handlePlay),g.on(c,"pause",g.handlePause),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(){this.player_.paused()?this.player_.play():this.player_.pause()},b.prototype.handlePlay=function(){this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},b.prototype.handlePause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},b}(i["default"]);l.prototype.controlText_="Play",k["default"].registerComponent("PlayToggle",l),c["default"]=l},{2:2,5:5}],13:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(47),j=e(i),k=a(49),l=e(k),m=a(14),n=e(m),o=a(5),p=e(o),q=a(80),r=d(q),s=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.updateVisibility(),e.updateLabel(),e.on(c,"loadstart",e.updateVisibility),e.on(c,"ratechange",e.updateLabel),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this);return this.labelEl_=r.createEl("div",{className:"vjs-playback-rate-value",innerHTML:1}),b.appendChild(this.labelEl_),b},b.prototype.buildCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildCSSClass.call(this)},b.prototype.createMenu=function(){var a=new l["default"](this.player()),b=this.playbackRates();if(b)for(var c=b.length-1;c>=0;c--)a.addChild(new n["default"](this.player(),{rate:b[c]+"x"}));return a},b.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},b.prototype.handleClick=function(){for(var a=this.player().playbackRate(),b=this.playbackRates(),c=b[0],d=0;da){c=b[d];break}this.player().playbackRate(c)},b.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},b.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},b.prototype.updateVisibility=function(){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},b.prototype.updateLabel=function(){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},b}(j["default"]);s.prototype.controlText_="Playback Rate",p["default"].registerComponent("PlaybackRateMenuButton",s),c["default"]=s},{14:14,47:47,49:49,5:5,80:80}],14:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function"); -}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(48),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b);var g=d.rate,h=parseFloat(g,10);d.label=g,d.selected=1===h;var i=f(this,a.call(this,c,d));return i.label=g,i.rate=h,i.on(c,"ratechange",i.update),i}return g(b,a),b.prototype.handleClick=function(){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},b.prototype.update=function(){this.selected(this.player().playbackRate()===this.rate)},b}(i["default"]);l.prototype.contentElType="button",k["default"].registerComponent("PlaybackRateMenuItem",l),c["default"]=l},{48:48,5:5}],15:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(80),l=d(k),m=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.partEls_=[],e.on(c,"progress",e.update),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},b.prototype.update=function(){var a=this.player_.buffered(),b=this.player_.duration(),c=this.player_.bufferedEnd(),d=this.partEls_,e=function(a,b){var c=a/b||0;return 100*(c>=1?1:c)+"%"};this.el_.style.width=e(c,b);for(var f=0;fa.length;j--)this.el_.removeChild(d[j-1]);d.length=a.length},b}(j["default"]);j["default"].registerComponent("LoadProgressBar",m),c["default"]=m},{5:5,80:80}],16:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(93),j=e(i),k=a(5),l=e(k),m=a(80),n=d(m),o=a(82),p=d(o),q=a(83),r=e(q),s=a(98),t=e(s),u=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(e.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),e.keepTooltipsInside&&(e.tooltip=n.createEl("div",{className:"vjs-time-tooltip"}),e.el().appendChild(e.tooltip),e.addClass("vjs-keep-tooltips-inside")),e.update(0,0),c.on("ready",function(){e.on(c.controlBar.progressControl.el(),"mousemove",(0,t["default"])(p.bind(e,e.handleMouseMove),25))}),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},b.prototype.handleMouseMove=function(a){var b=this.player_.duration(),c=this.calculateDistance(a)*b,d=a.pageX-n.findElPosition(this.el().parentNode).left;this.update(c,d)},b.prototype.update=function(a,b){var c=(0,r["default"])(a,this.player_.duration());if(this.el().style.left=b+"px",this.el().setAttribute("data-current-time",c),this.keepTooltipsInside){var d=this.clampPosition_(b),e=b-d+1,f=parseFloat(j["default"].getComputedStyle(this.tooltip).width),g=f/2;this.tooltip.innerHTML=c,this.tooltip.style.right="-"+(g-e)+"px"}},b.prototype.calculateDistance=function(a){return n.getPointerPosition(this.el().parentNode,a).x},b.prototype.clampPosition_=function(a){if(!this.keepTooltipsInside)return a;var b=parseFloat(j["default"].getComputedStyle(this.player().el()).width),c=parseFloat(j["default"].getComputedStyle(this.tooltip).width),d=c/2,e=a;return ab-d&&(e=Math.floor(b-d)),e},b}(l["default"]);l["default"].registerComponent("MouseTimeDisplay",u),c["default"]=u},{5:5,80:80,82:82,83:83,93:93,98:98}],17:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(82),l=d(k),m=a(83),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.updateDataAttr(),e.on(c,"timeupdate",e.updateDataAttr),c.ready(l.bind(e,e.updateDataAttr)),d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(e.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),e.keepTooltipsInside&&e.addClass("vjs-keep-tooltips-inside"),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},b.prototype.updateDataAttr=function(){var a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("data-current-time",(0,n["default"])(a,this.player_.duration()))},b}(j["default"]);j["default"].registerComponent("PlayProgressBar",o),c["default"]=o},{5:5,82:82,83:83}],18:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h);a(19),a(16);var j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},b}(i["default"]);j.prototype.options_={children:["seekBar"]},i["default"].registerComponent("ProgressControl",j),c["default"]=j},{16:16,19:19,5:5}],19:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(93),j=e(i),k=a(57),l=e(k),m=a(5),n=e(m),o=a(82),p=d(o),q=a(83),r=e(q);a(15),a(17),a(20);var s=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"timeupdate",e.updateProgress),e.on(c,"ended",e.updateProgress),c.ready(p.bind(e,e.updateProgress)),d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(e.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),e.keepTooltipsInside&&(e.tooltipProgressBar=e.addChild("TooltipProgressBar")),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":"progress bar"})},b.prototype.updateProgress=function(){if(this.updateAriaAttributes(this.el_),this.keepTooltipsInside){this.updateAriaAttributes(this.tooltipProgressBar.el_),this.tooltipProgressBar.el_.style.width=this.bar.el_.style.width;var a=parseFloat(j["default"].getComputedStyle(this.player().el()).width),b=parseFloat(j["default"].getComputedStyle(this.tooltipProgressBar.tooltip).width),c=this.tooltipProgressBar.el().style;c.maxWidth=Math.floor(a-b/2)+"px",c.minWidth=Math.ceil(b/2)+"px",c.right="-"+b/2+"px"}},b.prototype.updateAriaAttributes=function(a){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.setAttribute("aria-valuenow",(100*this.getPercent()).toFixed(2)),a.setAttribute("aria-valuetext",(0,r["default"])(b,this.player_.duration()))},b.prototype.getPercent=function(){var a=this.player_.currentTime()/this.player_.duration();return a>=1?1:a},b.prototype.handleMouseDown=function(b){a.prototype.handleMouseDown.call(this,b),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause()},b.prototype.handleMouseMove=function(a){var b=this.calculateDistance(a)*this.player_.duration();b===this.player_.duration()&&(b-=.1),this.player_.currentTime(b)},b.prototype.handleMouseUp=function(b){a.prototype.handleMouseUp.call(this,b),this.player_.scrubbing(!1),this.videoWasPlaying&&this.player_.play()},b.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},b.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},b}(l["default"]);s.prototype.options_={children:["loadProgressBar","mouseTimeDisplay","playProgressBar"],barName:"playProgressBar"},s.prototype.playerEvent="timeupdate",n["default"].registerComponent("SeekBar",s),c["default"]=s},{15:15,17:17,20:20,5:5,57:57,82:82,83:83,93:93}],20:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(82),l=d(k),m=a(83),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.updateDataAttr(),e.on(c,"timeupdate",e.updateDataAttr),c.ready(l.bind(e,e.updateDataAttr)),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-tooltip-progress-bar vjs-slider-bar",innerHTML:'
\n '+this.localize("Progress")+": 0%"});return this.tooltip=b.querySelector(".vjs-time-tooltip"),b},b.prototype.updateDataAttr=function(){var a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),b=(0,n["default"])(a,this.player_.duration());this.el_.setAttribute("data-current-time",b),this.tooltip.innerHTML=b},b}(j["default"]);j["default"].registerComponent("TooltipProgressBar",o),c["default"]=o},{5:5,82:82,83:83}],21:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(22),i=d(h),j=a(5),k=d(j),l=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,{className:this.buildCSSClass()});return b.innerHTML=" ",b},b}(i["default"]);k["default"].registerComponent("CustomControlSpacer",l),c["default"]=l},{22:22,5:5}],22:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},b}(i["default"]);i["default"].registerComponent("Spacer",j),c["default"]=j},{5:5}],23:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(31),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b),d.track={player:c,kind:d.kind,label:d.kind+" settings",selectable:!1,"default":!1,mode:"disabled"},d.selectable=!1;var g=f(this,a.call(this,c,d));return g.addClass("vjs-texttrack-settings"),g.controlText(", opens "+d.kind+" settings dialog"),g}return g(b,a),b.prototype.handleClick=function(){this.player().getChild("textTrackSettings").show(),this.player().getChild("textTrackSettings").el_.focus()},b}(i["default"]);k["default"].registerComponent("CaptionSettingsMenuItem",l),c["default"]=l},{31:31,5:5}],24:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(30),i=d(h),j=a(5),k=d(j),l=a(23),m=d(l),n=function(a){function b(c,d,g){e(this,b);var h=f(this,a.call(this,c,d,g));return h.el_.setAttribute("aria-label","Captions Menu"),h}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-captions-button "+a.prototype.buildCSSClass.call(this)},b.prototype.update=function(){var b=2;a.prototype.update.call(this),this.player().tech_&&this.player().tech_.featuresNativeTextTracks&&(b=1),this.items&&this.items.length>b?this.show():this.hide()},b.prototype.createItems=function(){var b=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||b.push(new m["default"](this.player_,{kind:this.kind_})),a.prototype.createItems.call(this,b)},b}(i["default"]);n.prototype.kind_="captions",n.prototype.controlText_="Captions",k["default"].registerComponent("CaptionsButton",n),c["default"]=n},{23:23,30:30,5:5}],25:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(30),j=e(i),k=a(5),l=e(k),m=a(31),n=e(m),o=a(26),p=e(o),q=a(49),r=e(q),s=a(80),t=d(s),u=a(89),v=e(u),w=function(a){function b(c,d,e){f(this,b);var h=g(this,a.call(this,c,d,e));return h.el_.setAttribute("aria-label","Chapters Menu"),h}return h(b,a),b.prototype.buildCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildCSSClass.call(this)},b.prototype.createItems=function(){var a=[],b=this.player_.textTracks();if(!b)return a;for(var c=0;c=0;e--){var f=b[e];if(f.kind===this.kind_){c=f;break}}var g=this.menu;if(void 0===g){g=new r["default"](this.player_);var h=t.createEl("li",{className:"vjs-menu-title",innerHTML:(0,v["default"])(this.kind_),tabIndex:-1});g.children_.unshift(h),t.insertElFirst(h,g.contentEl())}else d.forEach(function(a){return g.removeChild(a)}),d=[];if(c&&(null===c.cues||void 0===c.cues)){c.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(c);i&&i.addEventListener("load",function(b){return a.update()})}if(c&&c.cues&&c.cues.length>0)for(var j=c.cues,k=0,l=j.length;k0&&this.show(),this.items=d,g},b}(j["default"]);w.prototype.kind_="chapters",w.prototype.controlText_="Chapters",l["default"].registerComponent("ChaptersButton",w),c["default"]=w},{26:26,30:30,31:31,49:49,5:5,80:80,89:89}],26:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(48),j=e(i),k=a(5),l=e(k),m=a(82),n=d(m),o=function(a){function b(c,d){f(this,b);var e=d.track,h=d.cue,i=c.currentTime();d.label=h.text,d.selected=h.startTime<=i&&i1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),d.tracks=c.textTracks(),f(this,a.call(this,c,d))}return g(b,a),b.prototype.createItems=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a.push(new o["default"](this.player_,{kind:this.kind_}));var b=this.player_.textTracks();if(!b)return a;for(var c=0;cCurrent Time 0:00'},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(){var a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),b=this.localize("Current Time"),c=(0,n["default"])(a,this.player_.duration());c!==this.formattedTime_&&(this.formattedTime_=c,this.contentEl_.innerHTML=''+b+" "+c)},b}(j["default"]);j["default"].registerComponent("CurrentTimeDisplay",o),c["default"]=o},{5:5,80:80,83:83}],33:[function(a,b,c){"use strict"; -function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(80),l=d(k),m=a(83),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"durationchange",e.updateContent),e.on(c,"timeupdate",e.updateContent),e.on(c,"loadedmetadata",e.updateContent),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-duration vjs-time-control vjs-control"});return this.contentEl_=l.createEl("div",{className:"vjs-duration-display",innerHTML:''+this.localize("Duration Time")+" 0:00"},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(){var a=this.player_.duration();if(a&&this.duration_!==a){this.duration_=a;var b=this.localize("Duration Time"),c=(0,n["default"])(a);this.contentEl_.innerHTML=''+b+" "+c}},b}(j["default"]);j["default"].registerComponent("DurationDisplay",o),c["default"]=o},{5:5,80:80,83:83}],34:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(80),l=d(k),m=a(83),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"timeupdate",e.updateContent),e.on(c,"durationchange",e.updateContent),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-remaining-time vjs-time-control vjs-control"});return this.contentEl_=l.createEl("div",{className:"vjs-remaining-time-display",innerHTML:''+this.localize("Remaining Time")+" -0:00"},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(){if(this.player_.duration()){var a=this.localize("Remaining Time"),b=(0,n["default"])(this.player_.remainingTime());b!==this.formattedTime_&&(this.formattedTime_=b,this.contentEl_.innerHTML=''+a+" -"+b)}},b}(j["default"]);j["default"].registerComponent("RemainingTimeDisplay",o),c["default"]=o},{5:5,80:80,83:83}],35:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},b}(i["default"]);i["default"].registerComponent("TimeDivider",j),c["default"]=j},{5:5}],36:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(47),j=e(i),k=a(5),l=e(k),m=a(82),n=d(m),o=function(a){function b(c,d){f(this,b);var e=d.tracks,h=g(this,a.call(this,c,d));if(h.items.length<=1&&h.hide(),!e)return g(h);var i=n.bind(h,h.update);return e.addEventListener("removetrack",i),e.addEventListener("addtrack",i),h.player_.on("dispose",function(){e.removeEventListener("removetrack",i),e.removeEventListener("addtrack",i)}),h}return h(b,a),b}(j["default"]);l["default"].registerComponent("TrackButton",o),c["default"]=o},{47:47,5:5,82:82}],37:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(57),j=e(i),k=a(5),l=e(k),m=a(82),n=d(m);a(39);var o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"volumechange",e.updateARIAAttributes),c.ready(n.bind(e,e.updateARIAAttributes)),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":"volume level"})},b.prototype.handleMouseMove=function(a){this.checkMuted(),this.player_.volume(this.calculateDistance(a))},b.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},b.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},b.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},b.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},b.prototype.updateARIAAttributes=function(){var a=(100*this.player_.volume()).toFixed(2);this.el_.setAttribute("aria-valuenow",a),this.el_.setAttribute("aria-valuetext",a+"%")},b}(j["default"]);o.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},o.prototype.playerEvent="volumechange",l["default"].registerComponent("VolumeBar",o),c["default"]=o},{39:39,5:5,57:57,82:82}],38:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h);a(37);var j=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return c.tech_&&c.tech_.featuresVolumeControl===!1&&g.addClass("vjs-hidden"),g.on(c,"loadstart",function(){c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}),g}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control"})},b}(i["default"]);j.prototype.options_={children:["volumeBar"]},i["default"].registerComponent("VolumeControl",j),c["default"]=j},{37:37,5:5}],39:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},b}(i["default"]);i["default"].registerComponent("VolumeLevel",j),c["default"]=j},{5:5}],40:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(82),j=e(i),k=a(5),l=d(k),m=a(54),n=d(m),o=a(53),p=d(o),q=a(11),r=d(q),s=a(37),t=d(s),u=function(a){function b(c){function d(){c.tech_&&c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};f(this,b),void 0===e.inline&&(e.inline=!0),void 0===e.vertical&&(e.inline?e.vertical=!1:e.vertical=!0),e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=!!e.vertical;var h=g(this,a.call(this,c,e));return h.on(c,"volumechange",h.volumeUpdate),h.on(c,"loadstart",h.volumeUpdate),d.call(h),h.on(c,"loadstart",d),h.on(h.volumeBar,["slideractive","focus"],function(){this.addClass("vjs-slider-active")}),h.on(h.volumeBar,["sliderinactive","blur"],function(){this.removeClass("vjs-slider-active")}),h.on(h.volumeBar,["focus"],function(){this.addClass("vjs-lock-showing")}),h.on(h.volumeBar,["blur"],function(){this.removeClass("vjs-lock-showing")}),h}return h(b,a),b.prototype.buildCSSClass=function(){var b="";return b=this.options_.vertical?"vjs-volume-menu-button-vertical":"vjs-volume-menu-button-horizontal","vjs-volume-menu-button "+a.prototype.buildCSSClass.call(this)+" "+b},b.prototype.createPopup=function(){var a=new n["default"](this.player_,{contentElType:"div"}),b=new t["default"](this.player_,this.options_.volumeBar);return a.addChild(b),this.menuContent=a,this.volumeBar=b,this.attachVolumeBarEvents(),a},b.prototype.handleClick=function(){r["default"].prototype.handleClick.call(this),a.prototype.handleClick.call(this)},b.prototype.attachVolumeBarEvents=function(){this.menuContent.on(["mousedown","touchdown"],j.bind(this,this.handleMouseDown))},b.prototype.handleMouseDown=function(a){this.on(["mousemove","touchmove"],j.bind(this.volumeBar,this.volumeBar.handleMouseMove)),this.on(this.el_.ownerDocument,["mouseup","touchend"],this.handleMouseUp)},b.prototype.handleMouseUp=function(a){this.off(["mousemove","touchmove"],j.bind(this.volumeBar,this.volumeBar.handleMouseMove))},b}(p["default"]);u.prototype.volumeUpdate=r["default"].prototype.update,u.prototype.controlText_="Mute",l["default"].registerComponent("VolumeMenuButton",u),c["default"]=u},{11:11,37:37,5:5,53:53,54:54,82:82}],41:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=a(50),k=d(j),l=a(86),m=d(l),n=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return g.on(c,"error",g.open),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},b.prototype.content=function(){var a=this.player().error();return a?this.localize(a.message):""},b}(k["default"]);n.prototype.options_=(0,m["default"])(k["default"].prototype.options_,{fillAlways:!0,temporary:!1,uncloseable:!0}),i["default"].registerComponent("ErrorDisplay",n),c["default"]=n},{5:5,50:50,86:86}],42:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}c.__esModule=!0;var e=a(81),f=d(e),g=function(){};g.prototype.allowedEvents_={},g.prototype.on=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},f.on(this,a,b),this.addEventListener=c},g.prototype.addEventListener=g.prototype.on,g.prototype.off=function(a,b){f.off(this,a,b)},g.prototype.removeEventListener=g.prototype.off,g.prototype.one=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},f.one(this,a,b),this.addEventListener=c},g.prototype.trigger=function(a){var b=a.type||a;"string"==typeof a&&(a={type:b}),a=f.fixEvent(a),this.allowedEvents_[b]&&this["on"+b]&&this["on"+b](a),f.trigger(this,a)},g.prototype.dispatchEvent=g.prototype.trigger,c["default"]=g},{81:81}],43:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},f=a(85),g=d(f),h=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof b?"undefined":e(b)));a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.super_=b)},i=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=function(){a.apply(this,arguments)},d={};"object"===("undefined"==typeof b?"undefined":e(b))?("function"==typeof b.init&&(g["default"].warn("Constructor logic via init() is deprecated; please use constructor() instead."),b.constructor=b.init),b.constructor!==Object.prototype.constructor&&(c=b.constructor),d=b):"function"==typeof b&&(c=b),h(c,a);for(var f in d)d.hasOwnProperty(f)&&(c.prototype[f]=d[f]);return c};c["default"]=i},{85:85}],44:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;for(var e=a(92),f=d(e),g={},h=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=h[0],j=void 0,k=0;k1&&void 0!==arguments[1]?arguments[1]:{};f(this,b);var e=g(this,a.call(this,c,d));return e.update(),e.enabled_=!0,e.el_.setAttribute("aria-haspopup","true"),e.el_.setAttribute("role","menuitem"),e.on("keydown",e.handleSubmenuKeyPress),e}return h(b,a),b.prototype.update=function(){var a=this.createMenu();this.menu&&this.removeChild(this.menu),this.menu=a,this.addChild(a),this.buttonPressed_=!1,this.el_.setAttribute("aria-expanded","false"),this.items&&0===this.items.length?this.hide():this.items&&this.items.length>1&&this.show()},b.prototype.createMenu=function(){var a=new n["default"](this.player_);if(this.options_.title){var b=p.createEl("li",{className:"vjs-menu-title",innerHTML:(0,t["default"])(this.options_.title),tabIndex:-1});a.children_.unshift(b),p.insertElFirst(b,a.contentEl())}if(this.items=this.createItems(),this.items)for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:0,b=this.children().slice(),c=b.length&&b[0].className&&/vjs-menu-title/.test(b[0].className);c&&b.shift(),b.length>0&&(a<0?a=0:a>=b.length&&(a=b.length-1),this.focusedChild_=a,b[a].el_.focus())},b}(j["default"]);j["default"].registerComponent("Menu",q),c["default"]=q},{5:5,80:80,81:81,82:82}],50:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(80),j=e(i),k=a(82),l=e(k),m=a(5),n=d(m),o="vjs-modal-dialog",p=27,q=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.opened_=e.hasBeenOpened_=e.hasBeenFilled_=!1,e.closeable(!e.options_.uncloseable),e.content(e.options_.content),e.contentEl_=j.createEl("div",{className:o+"-content"},{role:"document"}),e.descEl_=j.createEl("p",{className:o+"-description vjs-offscreen",id:e.el().getAttribute("aria-describedby")}),j.textContent(e.descEl_,e.description()),e.el_.appendChild(e.descEl_),e.el_.appendChild(e.contentEl_),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},b.prototype.buildCSSClass=function(){return o+" vjs-hidden "+a.prototype.buildCSSClass.call(this)},b.prototype.handleKeyPress=function(a){a.which===p&&this.closeable()&&this.close()},b.prototype.label=function(){return this.options_.label||this.localize("Modal Window")},b.prototype.description=function(){var a=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(a+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),a},b.prototype.open=function(){if(!this.opened_){var a=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!a.paused(),this.wasPlaying_&&a.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",l.bind(this,this.handleKeyPress)),a.controls(!1),this.show(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}return this},b.prototype.opened=function(a){return"boolean"==typeof a&&this[a?"open":"close"](),this.opened_},b.prototype.close=function(){if(this.opened_){var a=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&a.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",l.bind(this,this.handleKeyPress)),a.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.options_.temporary&&this.dispose()}return this},b.prototype.closeable=function c(a){if("boolean"==typeof a){var c=this.closeable_=!!a,b=this.getChild("closeButton");if(c&&!b){var d=this.contentEl_;this.contentEl_=this.el_,b=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=d,this.on(b,"close",this.close)}!c&&b&&(this.off(b,"close",this.close),this.removeChild(b),b.dispose())}return this.closeable_},b.prototype.fill=function(){return this.fillWith(this.content())},b.prototype.fillWith=function(a){var b=this.contentEl(),c=b.parentNode,d=b.nextSibling;return this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,c.removeChild(b),this.empty(),j.insertContent(b,a),this.trigger("modalfill"),d?c.insertBefore(b,d):c.appendChild(b),this},b.prototype.empty=function(){return this.trigger("beforemodalempty"),j.emptyEl(this.contentEl()),this.trigger("modalempty"),this},b.prototype.content=function(a){return"undefined"!=typeof a&&(this.content_=a),this.content_},b}(n["default"]);q.prototype.options_={temporary:!0},n["default"].registerComponent("ModalDialog",q),c["default"]=q},{5:5,80:80,82:82}],51:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")} -function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(92),l=e(k),m=a(93),n=e(m),o=a(81),p=d(o),q=a(80),r=d(q),s=a(82),t=d(s),u=a(84),v=d(u),w=a(78),x=d(w),y=a(85),z=e(y),A=a(89),B=e(A),C=a(88),D=a(79),E=a(87),F=d(E),G=a(44),H=e(G),I=a(46),J=e(I),K=a(145),L=e(K),M=a(136),N=e(M),O=a(86),P=e(O),Q=a(69),R=e(Q),S=a(50),T=e(S),U=a(62),V=e(U),W=a(63),X=e(W),Y=a(76),Z=e(Y);a(61),a(59),a(55),a(68),a(45),a(1),a(4),a(8),a(41),a(71),a(60);var $=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","ratechange","volumechange","texttrackchange"],_=function(a){function b(c,d,e){if(f(this,b),c.id=c.id||"vjs_video_"+v.newGUID(),d=(0,N["default"])(b.getTagSettings(c),d),d.initChildren=!1,d.createEl=!1,d.reportTouchActivity=!1,!d.language)if("function"==typeof c.closest){var h=c.closest("[lang]");h&&(d.language=h.getAttribute("lang"))}else for(var i=c;i&&1===i.nodeType;){if(r.getElAttributes(i).hasOwnProperty("lang")){d.language=i.getAttribute("lang");break}i=i.parentNode}var j=g(this,a.call(this,null,d,e));if(!j.options_||!j.options_.techOrder||!j.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");j.tag=c,j.tagAttributes=c&&r.getElAttributes(c),j.language(j.options_.language),d.languages?!function(){var a={};Object.getOwnPropertyNames(d.languages).forEach(function(b){a[b.toLowerCase()]=d.languages[b]}),j.languages_=a}():j.languages_=b.prototype.options_.languages,j.cache_={},j.poster_=d.poster||"",j.controls_=!!d.controls,c.controls=!1,j.scrubbing_=!1,j.el_=j.createEl();var k=(0,P["default"])(j.options_);return d.plugins&&!function(){var a=d.plugins;Object.getOwnPropertyNames(a).forEach(function(b){"function"==typeof this[b]?this[b](a[b]):z["default"].error("Unable to find plugin:",b)},j)}(),j.options_.playerOptions=k,j.initChildren(),j.isAudio("audio"===c.nodeName.toLowerCase()),j.controls()?j.addClass("vjs-controls-enabled"):j.addClass("vjs-controls-disabled"),j.el_.setAttribute("role","region"),j.isAudio()?j.el_.setAttribute("aria-label","audio player"):j.el_.setAttribute("aria-label","video player"),j.isAudio()&&j.addClass("vjs-audio"),j.flexNotSupported_()&&j.addClass("vjs-no-flex"),x.IS_IOS||j.addClass("vjs-workinghover"),b.players[j.id_]=j,j.userActive(!0),j.reportUserActivity(),j.listenForUserActivity_(),j.on("fullscreenchange",j.handleFullscreenChange_),j.on("stageclick",j.handleStageClick_),j}return h(b,a),b.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&this.styleEl_.parentNode.removeChild(this.styleEl_),b.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&this.tech_.dispose(),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var b=this.el_=a.prototype.createEl.call(this,"div"),c=this.tag;c.removeAttribute("width"),c.removeAttribute("height");var d=r.getElAttributes(c);if(Object.getOwnPropertyNames(d).forEach(function(a){"class"===a?b.className=d[a]:b.setAttribute(a,d[a])}),c.playerId=c.id,c.id+="_html5_api",c.className="vjs-tech",c.player=b.player=this,this.addClass("vjs-paused"),n["default"].VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=F.createStyleElement("vjs-styles-dimensions");var e=r.$(".vjs-styles-defaults"),f=r.$("head");f.insertBefore(this.styleEl_,e?e.nextSibling:f.firstChild)}this.width(this.options_.width),this.height(this.options_.height),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var g=c.getElementsByTagName("a"),h=0;h=0&&(c.width=a),b>=0&&(c.height=b)))}var d=void 0,e=void 0,f=void 0,g=void 0;f=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9";var h=f.split(":"),i=h[1]/h[0];d=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/i:this.videoWidth()||300,e=void 0!==this.height_?this.height_:d*i,g=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(g),F.setTextContent(this.styleEl_,"\n ."+g+" {\n width: "+d+"px;\n height: "+e+"px;\n }\n\n ."+g+".vjs-fluid {\n padding-top: "+100*i+"%;\n }\n ")},b.prototype.loadTech_=function(a,b){var c=this;this.tech_&&this.unloadTech_(),"Html5"!==a&&this.tag&&(V["default"].getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=a,this.isReady_=!1;var d=(0,N["default"])({source:b,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+a+"_api",videoTracks:this.videoTracks_,textTracks:this.textTracks_,audioTracks:this.audioTracks_,autoplay:this.options_.autoplay,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),"vtt.js":this.options_["vtt.js"]},this.options_[a.toLowerCase()]);this.tag&&(d.tag=this.tag),b&&(this.currentType_=b.type,b.src===this.cache_.src&&this.cache_.currentTime>0&&(d.startTime=this.cache_.currentTime),this.cache_.src=b.src);var e=V["default"].getTech(a);e||(e=j["default"].getComponent(a)),this.tech_=new e(d),this.tech_.ready(t.bind(this,this.handleTechReady_),!0),R["default"].jsonToTextTracks(this.textTracksJson_||[],this.tech_),$.forEach(function(a){c.on(c.tech_,a,c["handleTech"+(0,B["default"])(a)+"_"])}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"canplay",this.handleTechCanPlay_),this.on(this.tech_,"canplaythrough",this.handleTechCanPlayThrough_),this.on(this.tech_,"playing",this.handleTechPlaying_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"seeked",this.handleTechSeeked_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===a&&this.tag||r.insertElFirst(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},b.prototype.unloadTech_=function(){this.videoTracks_=this.videoTracks(),this.textTracks_=this.textTracks(),this.audioTracks_=this.audioTracks(),this.textTracksJson_=R["default"].textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1},b.prototype.tech=function(a){if(a&&a.IWillNotUseThisInPlugins)return this.tech_;var b="\n Please make sure that you are not using this inside of a plugin.\n To disable this alert and error, please pass in an object with\n `IWillNotUseThisInPlugins` to the `tech` method. See\n https://github.com/videojs/video.js/issues/2617 for more info.\n ";throw n["default"].alert(b),new Error(b)},b.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},b.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},b.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused()){try{delete this.tag.poster}catch(a){(0,z["default"])("deleting tag.poster throws in some browsers",a)}this.play()}},b.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay"))},b.prototype.hasStarted=function(a){return void 0!==a?(this.hasStarted_!==a&&(this.hasStarted_=a,a?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started")),this):!!this.hasStarted_},b.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},b.prototype.handleTechWaiting_=function(){var a=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return a.removeClass("vjs-waiting")})},b.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},b.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},b.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},b.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},b.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},b.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&this.currentTime(this.options_.starttime),this.addClass("vjs-has-started"),this.trigger("firstplay")},b.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},b.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},b.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},b.prototype.handleTechClick_=function(a){0===a.button&&this.controls()&&(this.paused()?this.play():this.pause())},b.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},b.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},b.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},b.prototype.handleTechTouchEnd_=function(a){a.preventDefault()},b.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},b.prototype.handleStageClick_=function(){this.reportUserActivity()},b.prototype.handleTechFullscreenChange_=function(a,b){b&&this.isFullscreen(b.isFullscreen),this.trigger("fullscreenchange")},b.prototype.handleTechError_=function(){var a=this.tech_.error();this.error(a)},b.prototype.handleTechTextData_=function(){var a=null;arguments.length>1&&(a=arguments[1]),this.trigger("textdata",a)},b.prototype.getCache=function(){return this.cache_},b.prototype.techCall_=function(a,b){if(this.tech_&&!this.tech_.isReady_)this.tech_.ready(function(){this[a](b)},!0);else try{this.tech_&&this.tech_[a](b)}catch(c){throw(0,z["default"])(c),c}},b.prototype.techGet_=function(a){if(this.tech_&&this.tech_.isReady_)try{return this.tech_[a]()}catch(b){throw void 0===this.tech_[a]?(0,z["default"])("Video.js: "+a+" method not defined for "+this.techName_+" playback technology.",b):"TypeError"===b.name?((0,z["default"])("Video.js: "+a+" unavailable on "+this.techName_+" playback technology element.",b),this.tech_.isReady_=!1):(0,z["default"])(b),b}},b.prototype.play=function(){return this.src()||this.currentSrc()?this.techCall_("play"):this.tech_.one("loadstart",function(){this.play()}),this},b.prototype.pause=function(){return this.techCall_("pause"),this},b.prototype.paused=function(){return this.techGet_("paused")!==!1},b.prototype.scrubbing=function(a){return void 0!==a?(this.scrubbing_=!!a,a?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing"),this):this.scrubbing_},b.prototype.currentTime=function(a){return void 0!==a?(this.techCall_("setCurrentTime",a),this):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},b.prototype.duration=function(a){return void 0===a?this.cache_.duration||0:(a=parseFloat(a)||0,a<0&&(a=1/0),a!==this.cache_.duration&&(this.cache_.duration=a,a===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange")),this)},b.prototype.remainingTime=function(){return this.duration()-this.currentTime()},b.prototype.buffered=function c(){var c=this.techGet_("buffered");return c&&c.length||(c=(0,C.createTimeRange)(0,0)),c},b.prototype.bufferedPercent=function(){return(0,D.bufferedPercent)(this.buffered(),this.duration())},b.prototype.bufferedEnd=function(){var a=this.buffered(),b=this.duration(),c=a.end(a.length-1);return c>b&&(c=b),c},b.prototype.volume=function(a){var b=void 0;return void 0!==a?(b=Math.max(0,Math.min(1,parseFloat(a))),this.cache_.volume=b,this.techCall_("setVolume",b),this):(b=parseFloat(this.techGet_("volume")),isNaN(b)?1:b)},b.prototype.muted=function(a){return void 0!==a?(this.techCall_("setMuted",a),this):this.techGet_("muted")||!1},b.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},b.prototype.isFullscreen=function(a){return void 0!==a?(this.isFullscreen_=!!a,this):!!this.isFullscreen_},b.prototype.requestFullscreen=function(){var a=H["default"];return this.isFullscreen(!0),a.requestFullscreen?(p.on(l["default"],a.fullscreenchange,t.bind(this,function b(c){this.isFullscreen(l["default"][a.fullscreenElement]),this.isFullscreen()===!1&&p.off(l["default"],a.fullscreenchange,b),this.trigger("fullscreenchange")})),this.el_[a.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange")),this},b.prototype.exitFullscreen=function(){var a=H["default"];return this.isFullscreen(!1),a.requestFullscreen?l["default"][a.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange")),this},b.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=l["default"].documentElement.style.overflow,p.on(l["default"],"keydown",t.bind(this,this.fullWindowOnEscKey)),l["default"].documentElement.style.overflow="hidden",r.addElClass(l["default"].body,"vjs-full-window"),this.trigger("enterFullWindow")},b.prototype.fullWindowOnEscKey=function(a){27===a.keyCode&&(this.isFullscreen()===!0?this.exitFullscreen():this.exitFullWindow())},b.prototype.exitFullWindow=function(){this.isFullWindow=!1,p.off(l["default"],"keydown",this.fullWindowOnEscKey),l["default"].documentElement.style.overflow=this.docOrigOverflow,r.removeElClass(l["default"].body,"vjs-full-window"),this.trigger("exitFullWindow")},b.prototype.canPlayType=function(a){for(var b=void 0,c=0,d=this.options_.techOrder;c0&&(h=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},a))}},250)},b.prototype.playbackRate=function(a){return void 0!==a?(this.techCall_("setPlaybackRate",a),this):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("playbackRate"):1},b.prototype.isAudio=function(a){return void 0!==a?(this.isAudio_=!!a,this):!!this.isAudio_},b.prototype.videoTracks=function(){return this.tech_?this.tech_.videoTracks():(this.videoTracks_=this.videoTracks_||new Z["default"],this.videoTracks_)},b.prototype.audioTracks=function(){return this.tech_?this.tech_.audioTracks():(this.audioTracks_=this.audioTracks_||new X["default"],this.audioTracks_)},b.prototype.textTracks=function(){if(this.tech_)return this.tech_.textTracks()},b.prototype.remoteTextTracks=function(){if(this.tech_)return this.tech_.remoteTextTracks()},b.prototype.remoteTextTrackEls=function(){if(this.tech_)return this.tech_.remoteTextTrackEls()},b.prototype.addTextTrack=function(a,b,c){if(this.tech_)return this.tech_.addTextTrack(a,b,c)},b.prototype.addRemoteTextTrack=function(a){if(this.tech_)return this.tech_.addRemoteTextTrack(a)},b.prototype.removeRemoteTextTrack=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.track,c=void 0===b?arguments[0]:b;if(this.tech_)return this.tech_.removeRemoteTextTrack(c)},b.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},b.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},b.prototype.language=function(a){return void 0===a?this.language_:(this.language_=String(a).toLowerCase(),this)},b.prototype.languages=function(){return(0,P["default"])(b.prototype.options_.languages,this.languages_)},b.prototype.toJSON=function(){var a=(0,P["default"])(this.options_),b=a.tracks;a.tracks=[];for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:{};e(this,b);var g=f(this,a.call(this,c,d));return g.update(),g}return g(b,a),b.prototype.update=function(){var a=this.createPopup();this.popup&&this.removeChild(this.popup),this.popup=a,this.addChild(a),this.items&&0===this.items.length?this.hide():this.items&&this.items.length>1&&this.show()},b.prototype.createPopup=function(){},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},b.prototype.buildCSSClass=function(){var b="vjs-menu-button";return b+=this.options_.inline===!0?"-inline":"-popup","vjs-menu-button "+b+" "+a.prototype.buildCSSClass.call(this)},b}(i["default"]);k["default"].registerComponent("PopupButton",l),c["default"]=l},{3:3,5:5}],54:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(80),l=d(k),m=a(82),n=d(m),o=a(81),p=d(o),q=function(a){function b(){return f(this,b),g(this,a.apply(this,arguments))}return h(b,a),b.prototype.addItem=function(a){this.addChild(a),a.on("click",n.bind(this,function(){this.unlockShowing()}))},b.prototype.createEl=function(){var b=this.options_.contentElType||"ul";this.contentEl_=l.createEl(b,{className:"vjs-menu-content"});var c=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return c.appendChild(this.contentEl_),p.on(c,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),c},b}(j["default"]);j["default"].registerComponent("Popup",q),c["default"]=q},{5:5,80:80,81:81,82:82}],55:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(3),j=e(i),k=a(5),l=e(k),m=a(82),n=d(m),o=a(80),p=d(o),q=a(78),r=d(q),s=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.update(),c.on("posterchange",n.bind(e,e.update)),e}return h(b,a),b.prototype.dispose=function(){this.player().off("posterchange",this.update),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var a=p.createEl("div",{className:"vjs-poster",tabIndex:-1});return r.BACKGROUND_SIZE_SUPPORTED||(this.fallbackImg_=p.createEl("img"),a.appendChild(this.fallbackImg_)),a},b.prototype.update=function(){var a=this.player().poster();this.setSrc(a),a?this.show():this.hide()},b.prototype.setSrc=function(a){if(this.fallbackImg_)this.fallbackImg_.src=a;else{var b="";a&&(b='url("'+a+'")'),this.el_.style.backgroundImage=b}},b.prototype.handleClick=function(){this.player_.paused()?this.player_.play():this.player_.pause()},b}(j["default"]);l["default"].registerComponent("PosterImage",s),c["default"]=s},{3:3,5:5,78:78,80:80,82:82}],56:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){b&&(n=b),setTimeout(o,a)}c.__esModule=!0,c.hasLoaded=c.autoSetupTimeout=c.autoSetup=void 0;var g=a(81),h=e(g),i=a(92),j=d(i),k=a(93),l=d(k),m=!1,n=void 0,o=function(){var a=j["default"].getElementsByTagName("video"),b=j["default"].getElementsByTagName("audio"),c=[];if(a&&a.length>0)for(var d=0,e=a.length;d0)for(var g=0,h=b.length;g0)for(var i=0,k=c.length;i1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c.className=c.className+" vjs-slider",c=(0,n["default"])({tabIndex:0},c),d=(0,n["default"])({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},d),a.prototype.createEl.call(this,b,c,d)},b.prototype.handleMouseDown=function(a){var b=this.bar.el_.ownerDocument;a.preventDefault(),l.blockTextSelection(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(b,"mousemove",this.handleMouseMove),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchmove",this.handleMouseMove),this.on(b,"touchend",this.handleMouseUp),this.handleMouseMove(a)},b.prototype.handleMouseMove=function(){},b.prototype.handleMouseUp=function(){var a=this.bar.el_.ownerDocument;l.unblockTextSelection(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(a,"mousemove",this.handleMouseMove),this.off(a,"mouseup",this.handleMouseUp),this.off(a,"touchmove",this.handleMouseMove),this.off(a,"touchend",this.handleMouseUp),this.update()},b.prototype.update=function(){if(this.el_){var a=this.getPercent(),b=this.bar;if(b){("number"!=typeof a||a!==a||a<0||a===1/0)&&(a=0);var c=(100*a).toFixed(2)+"%";this.vertical()?b.el().style.height=c:b.el().style.width=c}}},b.prototype.calculateDistance=function(a){var b=l.getPointerPosition(this.el_,a);return this.vertical()?b.y:b.x},b.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepBack()):38!==a.which&&39!==a.which||(a.preventDefault(),this.stepForward())},b.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleClick=function(a){a.stopImmediatePropagation(),a.preventDefault()},b.prototype.vertical=function(a){return void 0===a?this.vertical_||!1:(this.vertical_=!!a,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal"),this)},b}(j["default"]);j["default"].registerComponent("Slider",o),c["default"]=o},{136:136,5:5,80:80}],58:[function(a,b,c){"use strict";function d(a){return a.streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},a.streamFromParts=function(a,b){return a+"&"+b},a.streamToParts=function(a){var b={connection:"",stream:""};if(!a)return b;var c=a.search(/&(?!\w+=)/),d=void 0;return c!==-1?d=c+1:(c=d=a.lastIndexOf("/")+1,0===c&&(c=d=a.length)),b.connection=a.substring(0,c),b.stream=a.substring(d,a.length),b},a.isStreamingType=function(b){return b in a.streamingFormats},a.RTMP_RE=/^rtmp[set]?:\/\//i,a.isStreamingSrc=function(b){return a.RTMP_RE.test(b)},a.rtmpSourceHandler={},a.rtmpSourceHandler.canPlayType=function(b){return a.isStreamingType(b)?"maybe":""},a.rtmpSourceHandler.canHandleSource=function(b,c){var d=a.rtmpSourceHandler.canPlayType(b.type);return d?d:a.isStreamingSrc(b.src)?"maybe":""},a.rtmpSourceHandler.handleSource=function(b,c,d){var e=a.streamToParts(b.src);c.setRtmpConnection(e.connection),c.setRtmpStream(e.stream)},a.registerSourceHandler(a.rtmpSourceHandler),a}c.__esModule=!0,c["default"]=d},{}],59:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function i(a){var b=a.charAt(0).toUpperCase()+a.slice(1);B["set"+b]=function(b){return this.el_.vjs_setProperty(a,b)}}function j(a){B[a]=function(){return this.el_.vjs_getProperty(a)}}c.__esModule=!0;for(var k=a(62),l=e(k),m=a(80),n=d(m),o=a(90),p=d(o),q=a(88),r=a(58),s=e(r),t=a(5),u=e(t),v=a(93),w=e(v),x=a(136),y=e(x),z=w["default"].navigator,A=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return c.source&&e.ready(function(){this.setSource(c.source)},!0),c.startTime&&e.ready(function(){this.load(),this.play(),this.currentTime(c.startTime)},!0),w["default"].videojs=w["default"].videojs||{},w["default"].videojs.Flash=w["default"].videojs.Flash||{},w["default"].videojs.Flash.onReady=b.onReady,w["default"].videojs.Flash.onEvent=b.onEvent,w["default"].videojs.Flash.onError=b.onError,e.on("seeked",function(){this.lastSeekTarget_=void 0}),e}return h(b,a),b.prototype.createEl=function(){var a=this.options_;if(!a.swf){var c="5.1.0";a.swf="//vjs.zencdn.net/swf/"+c+"/video-js.swf"}var d=a.techId,e=(0,y["default"])({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:a.autoplay,preload:a.preload,loop:a.loop,muted:a.muted},a.flashVars),f=(0,y["default"])({wmode:"opaque",bgcolor:"#000000"},a.params),g=(0,y["default"])({id:d,name:d,"class":"vjs-tech"},a.attributes);return this.el_=b.embed(a.swf,e,f,g),this.el_.tech=this,this.el_},b.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},b.prototype.pause=function(){this.el_.vjs_pause()},b.prototype.src=function(a){return void 0===a?this.currentSrc():this.setSrc(a)},b.prototype.setSrc=function(a){var b=this;a=p.getAbsoluteURL(a),this.el_.vjs_src(a),this.autoplay()&&this.setTimeout(function(){return b.play()},0)},b.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},b.prototype.setCurrentTime=function(b){var c=this.seekable();c.length&&(b=b>c.start(0)?b:c.start(0),b=b=0?c:1/0},b.prototype.load=function(){this.el_.vjs_load()},b.prototype.poster=function(){this.el_.vjs_getProperty("poster")},b.prototype.setPoster=function(){},b.prototype.seekable=function(){var a=this.duration();return 0===a?(0,q.createTimeRange)():(0,q.createTimeRange)(0,a)},b.prototype.buffered=function(){var a=this.el_.vjs_getProperty("buffered");return 0===a.length?(0,q.createTimeRange)():(0,q.createTimeRange)(a[0][0],a[0][1])},b.prototype.supportsFullScreen=function(){return!1},b.prototype.enterFullScreen=function(){return!1},b}(l["default"]),B=A.prototype,C="rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted".split(","),D="networkState,readyState,initialTime,startOffsetTime,paused,ended,videoWidth,videoHeight".split(","),E=0;E=10},l["default"].withSourceHandlers(A),A.nativeSourceHandler={},A.nativeSourceHandler.canPlayType=function(a){return a in A.formats?"maybe":""},A.nativeSourceHandler.canHandleSource=function(a,b){function c(a){var b=p.getFileExtension(a);return b?"video/"+b:""}var d=void 0;return d=a.type?a.type.replace(/;.*/,"").toLowerCase():c(a.src),A.nativeSourceHandler.canPlayType(d)},A.nativeSourceHandler.handleSource=function(a,b,c){b.setSrc(a.src)},A.nativeSourceHandler.dispose=function(){},A.registerSourceHandler(A.nativeSourceHandler),A.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},A.onReady=function(a){var b=n.getEl(a),c=b&&b.tech;c&&c.el()&&A.checkReady(c)},A.checkReady=function(a){a.el()&&(a.el().vjs_getProperty?a.triggerReady():this.setTimeout(function(){A.checkReady(a)},50))},A.onEvent=function(a,b){var c=n.getEl(a).tech;c.trigger(b,Array.prototype.slice.call(arguments,2))},A.onError=function(a,b){var c=n.getEl(a).tech;return"srcnotfound"===b?c.error(4):void c.error("FLASH: "+b)},A.version=function(){var a="0,0,0";try{a=new w["default"].ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(b){try{z.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(a=(z.plugins["Shockwave Flash 2.0"]||z.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(c){}}return a.split(",")},A.embed=function(a,b,c,d){var e=A.getEmbedCode(a,b,c,d),f=n.createEl("div",{innerHTML:e}).childNodes[0];return f},A.getEmbedCode=function(a,b,c,d){var e=''}),d=(0,y["default"])({data:a,width:"100%",height:"100%"},d),Object.getOwnPropertyNames(d).forEach(function(a){h+=a+'="'+d[a]+'" '}),""+e+h+">"+g+""},(0,s["default"])(A),u["default"].registerComponent("Flash",A),l["default"].registerTech("Flash",A),c["default"]=A},{136:136,5:5,58:58,62:62,80:80,88:88,90:90,93:93}],60:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){return a.raw=b,a}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function i(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},k=f(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),l=a(62),m=e(l),n=a(5),o=e(n),p=a(80),q=d(p),r=a(90),s=d(r),t=a(82),u=d(t),v=a(85),w=e(v),x=a(146),y=e(x),z=a(78),A=d(z),B=a(92),C=e(B),D=a(93),E=e(D),F=a(136),G=e(F),H=a(86),I=e(H),J=a(89),K=e(J),L=function(a){function b(c,d){g(this,b);var e=h(this,a.call(this,c,d)),f=c.source,i=!1;if(f&&(e.el_.currentSrc!==f.src||c.tag&&3===c.tag.initNetworkState_)?e.setSource(f):e.handleLateInit_(e.el_),e.el_.hasChildNodes()){for(var j=e.el_.childNodes,l=j.length,m=[];l--;){var n=j[l],o=n.nodeName.toLowerCase();"track"===o&&(e.featuresNativeTextTracks?(e.remoteTextTrackEls().addTrackElement_(n),e.remoteTextTracks().addTrack_(n.track),i||e.el_.hasAttribute("crossorigin")||!s.isCrossOrigin(n.src)||(i=!0)):m.push(n))}for(var p=0;p=0;g--){var h=f[g],i={};"undefined"!=typeof this.options_[h]&&(i[h]=this.options_[h]),q.setElAttributes(a,i)}return a},b.prototype.handleLateInit_=function(a){var b=this;if(0!==a.networkState&&3!==a.networkState){if(0===a.readyState){var c=function(){var a=!1,c=function(){a=!0};b.on("loadstart",c);var d=function(){a||this.trigger("loadstart")};return b.on("loadedmetadata",d),b.ready(function(){this.off("loadstart",c),this.off("loadedmetadata",d),a||this.trigger("loadstart")}),{v:void 0}}();if("object"===("undefined"==typeof c?"undefined":j(c)))return c.v}var d=["loadstart"];d.push("loadedmetadata"),a.readyState>=2&&d.push("loadeddata"),a.readyState>=3&&d.push("canplay"),a.readyState>=4&&d.push("canplaythrough"),this.ready(function(){d.forEach(function(a){this.trigger(a)},this)})}},b.prototype.proxyNativeTextTracks_=function(){var a=this.el().textTracks;if(a){for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:{};if(!this.featuresNativeTextTracks)return a.prototype.addRemoteTextTrack.call(this,b);var c=C["default"].createElement("track");return b.kind&&(c.kind=b.kind),b.label&&(c.label=b.label),(b.language||b.srclang)&&(c.srclang=b.language||b.srclang),b["default"]&&(c["default"]=b["default"]),b.id&&(c.id=b.id),b.src&&(c.src=b.src),this.el().appendChild(c),this.remoteTextTrackEls().addTrackElement_(c),this.remoteTextTracks().addTrack_(c.track),c},b.prototype.removeRemoteTextTrack=function(b){if(!this.featuresNativeTextTracks)return a.prototype.removeRemoteTextTrack.call(this,b);var c=this.remoteTextTrackEls().getTrackElementByTrack_(b);this.remoteTextTrackEls().removeTrackElement_(c),this.remoteTextTracks().removeTrack_(b);for(var d=this.$$("track"),e=d.length;e--;)b!==d[e]&&b!==d[e].track||this.el().removeChild(d[e])},b}(m["default"]);L.TEST_VID=C["default"].createElement("video");var M=C["default"].createElement("track");M.kind="captions",M.srclang="en",M.label="English",L.TEST_VID.appendChild(M),L.isSupported=function(){try{L.TEST_VID.volume=.5}catch(a){return!1}return!!L.TEST_VID.canPlayType},L.canControlVolume=function(){try{var a=L.TEST_VID.volume;return L.TEST_VID.volume=a/2+.1,a!==L.TEST_VID.volume}catch(b){return!1}},L.canControlPlaybackRate=function(){if(A.IS_ANDROID&&A.IS_CHROME)return!1;try{var a=L.TEST_VID.playbackRate;return L.TEST_VID.playbackRate=a/2+.1,a!==L.TEST_VID.playbackRate}catch(b){return!1}},L.supportsNativeTextTracks=function(){var a=void 0;return a=!!L.TEST_VID.textTracks,a&&L.TEST_VID.textTracks.length>0&&(a="number"!=typeof L.TEST_VID.textTracks[0].mode),a&&A.IS_FIREFOX&&(a=!1),!a||"onremovetrack"in L.TEST_VID.textTracks||(a=!1),a},L.supportsNativeVideoTracks=function(){var a=!!L.TEST_VID.videoTracks;return a},L.supportsNativeAudioTracks=function(){var a=!!L.TEST_VID.audioTracks;return a},L.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","volumechange"],L.prototype.featuresVolumeControl=L.canControlVolume(),L.prototype.featuresPlaybackRate=L.canControlPlaybackRate(),L.prototype.movingMediaElementInDOM=!A.IS_IOS,L.prototype.featuresFullscreenResize=!0,L.prototype.featuresProgressEvents=!0,L.prototype.featuresTimeupdateEvents=!0,L.prototype.featuresNativeTextTracks=L.supportsNativeTextTracks(),L.prototype.featuresNativeVideoTracks=L.supportsNativeVideoTracks(),L.prototype.featuresNativeAudioTracks=L.supportsNativeAudioTracks();var N=void 0,O=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,P=/^video\/mp4/i;L.patchCanPlayType=function(){A.ANDROID_VERSION>=4&&!A.IS_FIREFOX&&(N||(N=L.TEST_VID.constructor.prototype.canPlayType),L.TEST_VID.constructor.prototype.canPlayType=function(a){return a&&O.test(a)?"maybe":N.call(this,a)}),A.IS_OLD_ANDROID&&(N||(N=L.TEST_VID.constructor.prototype.canPlayType),L.TEST_VID.constructor.prototype.canPlayType=function(a){return a&&P.test(a)?"maybe":N.call(this,a)})},L.unpatchCanPlayType=function(){var a=L.TEST_VID.constructor.prototype.canPlayType;return L.TEST_VID.constructor.prototype.canPlayType=N,N=null,a},L.patchCanPlayType(),L.disposeMediaElement=function(a){if(a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},L.resetMediaElement=function(a){if(a){for(var b=a.querySelectorAll("source"),c=b.length;c--;)a.removeChild(b[c]);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},["paused","currentTime","buffered","volume","muted","poster","preload","autoplay","controls","loop","error","seeking","seekable","ended","defaultMuted","playbackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(a){L.prototype[a]=function(){return this.el_[a]}}),["volume","muted","src","poster","preload","autoplay","loop","playbackRate"].forEach(function(a){L.prototype["set"+(0,K["default"])(a)]=function(b){this.el_[a]=b}}),["pause","load"].forEach(function(a){L.prototype[a]=function(){return this.el_[a]()}}),m["default"].withSourceHandlers(L),L.nativeSourceHandler={},L.nativeSourceHandler.canPlayType=function(a){try{return L.TEST_VID.canPlayType(a)}catch(b){return""}},L.nativeSourceHandler.canHandleSource=function(a,b){if(a.type)return L.nativeSourceHandler.canPlayType(a.type);if(a.src){var c=s.getFileExtension(a.src);return L.nativeSourceHandler.canPlayType("video/"+c)}return""},L.nativeSourceHandler.handleSource=function(a,b,c){b.setSrc(a.src)},L.nativeSourceHandler.dispose=function(){},L.registerSourceHandler(L.nativeSourceHandler),o["default"].registerComponent("Html5",L),m["default"].registerTech("Html5",L),c["default"]=L},{136:136,146:146,5:5,62:62,78:78,80:80,82:82,85:85,86:86,89:89,90:90,92:92,93:93}],61:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=a(62),k=d(j),l=a(89),m=d(l),n=function(a){function b(c,d,g){e(this,b);var h=f(this,a.call(this,c,d,g));if(d.playerOptions.sources&&0!==d.playerOptions.sources.length)c.src(d.playerOptions.sources);else for(var j=0,l=d.playerOptions.techOrder;j4&&void 0!==arguments[4]?arguments[4]:{},f=a.textTracks();e.kind=b,c&&(e.label=c),d&&(e.language=d),e.tech=a;var g=new s["default"](e);return f.addTrack_(g),g}c.__esModule=!0;var j=a(5),k=e(j),l=a(66),m=e(l),n=a(65),o=e(n),p=a(86),q=e(p),r=a(72),s=e(r),t=a(70),u=e(t),v=a(76),w=e(v),x=a(63),y=e(x),z=a(82),A=d(z),B=a(85),C=e(B),D=a(88),E=a(79),F=a(46),G=e(F),H=a(93),I=e(H),J=a(92),K=e(J),L=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};f(this,b),c.reportTouchActivity=!1;var e=g(this,a.call(this,null,c,d));return e.hasStarted_=!1,e.on("playing",function(){this.hasStarted_=!0}),e.on("loadstart",function(){this.hasStarted_=!1}),e.textTracks_=c.textTracks,e.videoTracks_=c.videoTracks,e.audioTracks_=c.audioTracks,e.featuresProgressEvents||e.manualProgressOn(),e.featuresTimeupdateEvents||e.manualTimeUpdatesOn(),c.nativeCaptions!==!1&&c.nativeTextTracks!==!1||(e.featuresNativeTextTracks=!1),e.featuresNativeTextTracks||e.on("ready",e.emulateTextTracks),e.initTextTrackListeners(),e.initTrackListeners(),e.emitTapEvents(),e}return h(b,a),b.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},b.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},b.prototype.trackProgress=function(){this.stopTrackingProgress(),this.progressInterval=this.setInterval(A.bind(this,function(){var a=this.bufferedPercent();this.bufferedPercent_!==a&&this.trigger("progress"),this.bufferedPercent_=a,1===a&&this.stopTrackingProgress()}),500)},b.prototype.onDurationChange=function(){this.duration_=this.duration()},b.prototype.buffered=function(){return(0,D.createTimeRange)(0,0)},b.prototype.bufferedPercent=function(){return(0,E.bufferedPercent)(this.buffered(),this.duration_)},b.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},b.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},b.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},b.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},b.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.dispose=function(){this.clearTracks(["audio","video","text"]),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),a.prototype.dispose.call(this)},b.prototype.clearTracks=function(a){var b=this;a=[].concat(a),a.forEach(function(a){for(var c=b[a+"Tracks"]()||[],d=c.length;d--;){var e=c[d];"text"===a&&b.removeRemoteTextTrack(e),c.removeTrack_(e)}})},b.prototype.reset=function(){},b.prototype.error=function(a){return void 0!==a&&(this.error_=new G["default"](a),this.trigger("error")),this.error_},b.prototype.played=function(){return this.hasStarted_?(0,D.createTimeRange)(0,0):(0,D.createTimeRange)()},b.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.initTextTrackListeners=function(){var a=A.bind(this,function(){this.trigger("texttrackchange")}),b=this.textTracks();b&&(b.addEventListener("removetrack",a),b.addEventListener("addtrack",a),this.on("dispose",A.bind(this,function(){b.removeEventListener("removetrack",a),b.removeEventListener("addtrack",a)})))},b.prototype.initTrackListeners=function(){var a=this,b=["video","audio"];b.forEach(function(b){var c=function(){a.trigger(b+"trackchange")},d=a[b+"Tracks"]();d.addEventListener("removetrack",c),d.addEventListener("addtrack",c),a.on("dispose",function(){d.removeEventListener("removetrack",c),d.removeEventListener("addtrack",c)})})},b.prototype.emulateTextTracks=function(){var a=this,b=this.textTracks();if(b){I["default"].WebVTT||null===this.el().parentNode||void 0===this.el().parentNode||!function(){var b=K["default"].createElement("script");b.src=a.options_["vtt.js"]||"https://cdn.rawgit.com/gkatsev/vtt.js/vjs-v0.12.1/dist/vtt.min.js",b.onload=function(){a.trigger("vttjsloaded")},b.onerror=function(){a.trigger("vttjserror")},a.on("dispose",function(){b.onload=null,b.onerror=null}),I["default"].WebVTT=!0,a.el().parentNode.appendChild(b)}();var c=function(){return a.trigger("texttrackchange")},d=function(){c();for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:[];f(this,b);for(var h=void 0,i=e.length-1;i>=0;i--)if(e[i].enabled){o(e,e[i]);break}if(l.IS_IE8){h=n["default"].createElement("custom");for(var k in j["default"].prototype)"constructor"!==k&&(h[k]=j["default"].prototype[k]);for(var m in b.prototype)"constructor"!==m&&(h[m]=b.prototype[m])}return h=c=g(this,a.call(this,e,h)),h.changing_=!1,d=h,g(c,d)}return h(b,a),b.prototype.addTrack_=function(b){var c=this;b.enabled&&o(this,b),a.prototype.addTrack_.call(this,b),b.addEventListener&&b.addEventListener("enabledchange",function(){c.changing_||(c.changing_=!0,o(c,b),c.changing_=!1,c.trigger("change"))})},b.prototype.addTrack=function(a){this.addTrack_(a)},b.prototype.removeTrack=function(b){a.prototype.removeTrack_.call(this,b)},b}(j["default"]);c["default"]=p},{74:74,78:78,92:92}],64:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(73),j=a(75),k=e(j),l=a(86),m=e(l),n=a(78),o=d(n),p=function(a){function b(){var c,d,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var h=(0,m["default"])(e,{kind:i.AudioTrackKind[e.kind]||""}),j=c=g(this,a.call(this,h)),k=!1;if(o.IS_IE8)for(var l in b.prototype)"constructor"!==l&&(j[l]=b.prototype[l]);return Object.defineProperty(j,"enabled",{get:function(){return k},set:function(a){"boolean"==typeof a&&a!==k&&(k=a,this.trigger("enabledchange"))}}),h.enabled&&(j.enabled=h.enabled),j.loaded_=!0,d=j,g(c,d)}return h(b,a),b}(k["default"]);c["default"]=p},{73:73,75:75,78:78,86:86}],65:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a(78),h=e(g),i=a(92),j=d(i),k=function(){function a(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];f(this,a);var c=this;if(h.IS_IE8){c=j["default"].createElement("custom");for(var d in a.prototype)"constructor"!==d&&(c[d]=a.prototype[d])}c.trackElements_=[],Object.defineProperty(c,"length",{get:function(){return this.trackElements_.length}});for(var e=0,g=b.length;e0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var d=g(this,a.call(this)),e=void 0,h=d;if(j.IS_IE8){h=l["default"].createElement("custom");for(var i in b.prototype)"constructor"!==i&&(h[i]=b.prototype[i])}var k=new p["default"](c);if(h.kind=k.kind,h.src=k.src,h.srclang=k.language,h.label=k.label,h["default"]=k["default"],Object.defineProperty(h,"readyState",{get:function(){return e}}),Object.defineProperty(h,"track",{get:function(){return k}}),e=q,k.addEventListener("loadeddata",function(){e=s,h.trigger({type:"load",target:h})}),j.IS_IE8){var m;return m=h,g(d,m)}return d}return h(b,a),b}(n["default"]);u.prototype.allowedEvents_={load:"load"},u.NONE=q,u.LOADING=r,u.LOADED=s,u.ERROR=t,c["default"]=u},{42:42,72:72,78:78,92:92}],67:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a(78),h=e(g),i=a(92),j=d(i),k=function(){function a(b){f(this,a);var c=this;if(h.IS_IE8){c=j["default"].createElement("custom");for(var d in a.prototype)"constructor"!==d&&(c[d]=a.prototype[d])}if(a.prototype.setCues_.call(c,b),Object.defineProperty(c,"length",{get:function(){return this.length_}}),h.IS_IE8)return c}return a.prototype.setCues_=function(a){var b=this.length||0,c=0,d=a.length;this.cues_=a,this.length_=a.length;var e=function(a){""+a in this||Object.defineProperty(this,""+a,{get:function(){return this.cues_[a]}})};if(b0&&void 0!==arguments[0]?arguments[0]:[];f(this,b);var h=void 0;if(n.IS_IE8){h=p["default"].createElement("custom");for(var i in j["default"].prototype)"constructor"!==i&&(h[i]=j["default"].prototype[i]);for(var k in b.prototype)"constructor"!==k&&(h[k]=b.prototype[k])}return h=c=g(this,a.call(this,e,h)),d=h,g(c,d)}return h(b,a),b.prototype.addTrack_=function(b){a.prototype.addTrack_.call(this,b),b.addEventListener("modechange",l.bind(this,function(){this.trigger("change")}))},b.prototype.removeTrack_=function(a){for(var b=void 0,c=0,d=this.length;cCaptions Settings Dialog\n
Beginning of dialog window. Escape will cancel and close the window.
\n
\n
\n
\n Text\n \n \n \n \n \n \n
\n
\n Background\n \n \n \n \n \n \n
\n
\n Window\n \n \n \n \n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n \n ';return d}function j(a){var b=void 0;return a.selectedOptions?b=a.selectedOptions[0]:a.options&&(b=a.options[a.options.selectedIndex]),b.value}function k(a,b){if(b){var c=void 0;for(c=0;c select").selectedIndex=0,this.$(".vjs-bg-color > select").selectedIndex=0,this.$(".window-color > select").selectedIndex=0,this.$(".vjs-text-opacity > select").selectedIndex=0,this.$(".vjs-bg-opacity > select").selectedIndex=0,this.$(".vjs-window-opacity > select").selectedIndex=0,this.$(".vjs-edge-style select").selectedIndex=0,this.$(".vjs-font-family select").selectedIndex=0,this.$(".vjs-font-percent select").selectedIndex=2,this.updateDisplay()})),o.on(e.$(".vjs-fg-color > select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".vjs-bg-color > select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".window-color > select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".vjs-text-opacity > select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".vjs-bg-opacity > select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".vjs-window-opacity > select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".vjs-font-percent select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".vjs-edge-style select"),"change",q.bind(e,e.updateDisplay)),o.on(e.$(".vjs-font-family select"),"change",q.bind(e,e.updateDisplay)),e.options_.persistTextTrackSettings&&e.restoreSettings(),e}return h(b,a),b.prototype.createEl=function(){var b=this.id_,c="TTsettingsDialogLabel-"+b,d="TTsettingsDialogDescription-"+b;return a.prototype.createEl.call(this,"div",{className:"vjs-caption-settings vjs-modal-overlay",innerHTML:i(b,c,d),tabIndex:-1},{role:"dialog","aria-labelledby":c,"aria-describedby":d})},b.prototype.getValues=function(){var a=j(this.$(".vjs-edge-style select")),b=j(this.$(".vjs-font-family select")),c=j(this.$(".vjs-fg-color > select")),d=j(this.$(".vjs-text-opacity > select")),e=j(this.$(".vjs-bg-color > select")),f=j(this.$(".vjs-bg-opacity > select")),g=j(this.$(".window-color > select")),h=j(this.$(".vjs-window-opacity > select")),i=w["default"].parseFloat(j(this.$(".vjs-font-percent > select"))),k={fontPercent:i,fontFamily:b,textOpacity:d,windowColor:g,windowOpacity:h,backgroundOpacity:f,edgeStyle:a,color:c,backgroundColor:e};for(var l in k)(""===k[l]||"none"===k[l]||"fontPercent"===l&&1===k[l])&&delete k[l];return k},b.prototype.setValues=function(a){k(this.$(".vjs-edge-style select"),a.edgeStyle),k(this.$(".vjs-font-family select"),a.fontFamily),k(this.$(".vjs-fg-color > select"),a.color),k(this.$(".vjs-text-opacity > select"),a.textOpacity),k(this.$(".vjs-bg-color > select"),a.backgroundColor),k(this.$(".vjs-bg-opacity > select"),a.backgroundOpacity),k(this.$(".window-color > select"),a.windowColor),k(this.$(".vjs-window-opacity > select"),a.windowOpacity);var b=a.fontPercent;b&&(b=b.toFixed(2)),k(this.$(".vjs-font-percent > select"),b)},b.prototype.restoreSettings=function(){var a=void 0,b=void 0;try{var c=(0,u["default"])(w["default"].localStorage.getItem("vjs-text-track-settings"));a=c[0],b=c[1],a&&s["default"].error(a)}catch(d){s["default"].warn(d)}b&&this.setValues(b)},b.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var a=this.getValues();try{Object.getOwnPropertyNames(a).length>0?w["default"].localStorage.setItem("vjs-text-track-settings",JSON.stringify(a)):w["default"].localStorage.removeItem("vjs-text-track-settings")}catch(b){s["default"].warn(b)}}},b.prototype.updateDisplay=function(){var a=this.player_.getChild("textTrackDisplay");a&&a.updateDisplay()},b}(m["default"]);m["default"].registerComponent("TextTrackSettings",x),c["default"]=x},{145:145,5:5,81:81,82:82,85:85,93:93}],72:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(67),j=e(i),k=a(82),l=d(k),m=a(73),n=a(85),o=e(n),p=a(93),q=e(p),r=a(75),s=e(r),t=a(90),u=a(147),v=e(u),w=a(86),x=e(w),y=a(78),z=d(y),A=function(a,b){var c=new q["default"].WebVTT.Parser(q["default"],q["default"].vttjs,q["default"].WebVTT.StringDecoder()),d=[];c.oncue=function(a){b.addCue(a)},c.onparsingerror=function(a){d.push(a)},c.onflush=function(){b.trigger({type:"loadeddata",target:b})},c.parse(a),d.length>0&&(q["default"].console&&q["default"].console.groupCollapsed&&q["default"].console.groupCollapsed("Text Track parsing errors for "+b.src),d.forEach(function(a){return o["default"].error(a)}),q["default"].console&&q["default"].console.groupEnd&&q["default"].console.groupEnd()),c.flush()},B=function(a,b){var c={uri:a},d=(0,t.isCrossOrigin)(a);d&&(c.cors=d),(0,v["default"])(c,l.bind(this,function(a,c,d){return a?o["default"].error(a,c):(b.loaded_=!0,void("function"!=typeof q["default"].WebVTT?b.tech_&&!function(){var a=function(){return A(d,b)};b.tech_.on("vttjsloaded",a),b.tech_.on("vttjserror",function(){o["default"].error("vttjs failed to load, stopping trying to process "+b.src),b.tech_.off("vttjsloaded",a)})}():A(d,b)))}))},C=function(a){function b(){var c,d,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(f(this,b),!e.tech)throw new Error("A tech was not provided.");var h=(0,x["default"])(e,{kind:m.TextTrackKind[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=m.TextTrackMode[h.mode]||"disabled",k=h["default"];"metadata"!==h.kind&&"chapters"!==h.kind||(i="hidden");var n=c=g(this,a.call(this,h));if(n.tech_=h.tech,z.IS_IE8)for(var o in b.prototype)"constructor"!==o&&(n[o]=b.prototype[o]);n.cues_=[],n.activeCues_=[];var p=new j["default"](n.cues_),q=new j["default"](n.activeCues_),r=!1,s=l.bind(n,function(){ -this.activeCues,r&&(this.trigger("cuechange"),r=!1)});return"disabled"!==i&&n.tech_.on("timeupdate",s),Object.defineProperty(n,"default",{get:function(){return k},set:function(){}}),Object.defineProperty(n,"mode",{get:function(){return i},set:function(a){m.TextTrackMode[a]&&(i=a,"showing"===i&&this.tech_.on("timeupdate",s),this.trigger("modechange"))}}),Object.defineProperty(n,"cues",{get:function(){return this.loaded_?p:null},set:function(){}}),Object.defineProperty(n,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return q;for(var a=this.tech_.currentTime(),b=[],c=0,d=this.cues.length;c=a?b.push(e):e.startTime===e.endTime&&e.startTime<=a&&e.startTime+.5>=a&&b.push(e)}if(r=!1,b.length!==this.activeCues_.length)r=!0;else for(var f=0;f0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;f(this,b);var h=g(this,a.call(this));if(!e&&(e=h,l.IS_IE8)){e=n["default"].createElement("custom");for(var i in b.prototype)"constructor"!==i&&(e[i]=b.prototype[i])}e.tracks_=[],Object.defineProperty(e,"length",{get:function(){return this.tracks_.length}});for(var j=0;j0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var e=g(this,a.call(this)),h=e;if(j.IS_IE8){h=l["default"].createElement("custom");for(var i in b.prototype)"constructor"!==i&&(h[i]=b.prototype[i])}var k={id:d.id||"vjs_track_"+n.newGUID(),kind:d.kind||"",label:d.label||"",language:d.language||""},m=function(a){Object.defineProperty(h,a,{get:function(){return k[a]},set:function(){}})};for(var o in k)m(o);return c=h,g(e,c)}return h(b,a),b}(p["default"]);c["default"]=q},{42:42,78:78,84:84,92:92}],76:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(74),j=e(i),k=a(78),l=d(k),m=a(92),n=e(m),o=function(a,b){for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:[];f(this,b);for(var h=void 0,i=e.length-1;i>=0;i--)if(e[i].selected){o(e,e[i]);break}if(l.IS_IE8){h=n["default"].createElement("custom");for(var k in j["default"].prototype)"constructor"!==k&&(h[k]=j["default"].prototype[k]);for(var m in b.prototype)"constructor"!==m&&(h[m]=b.prototype[m])}return h=c=g(this,a.call(this,e,h)),h.changing_=!1,Object.defineProperty(h,"selectedIndex",{get:function(){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var h=(0,m["default"])(e,{kind:i.VideoTrackKind[e.kind]||""}),j=c=g(this,a.call(this,h)),k=!1;if(o.IS_IE8)for(var l in b.prototype)"constructor"!==l&&(j[l]=b.prototype[l]);return Object.defineProperty(j,"selected",{get:function(){return k},set:function(a){"boolean"==typeof a&&a!==k&&(k=a,this.trigger("selectedchange"))}}),h.selected&&(j.selected=h.selected),d=j,g(c,d)}return h(b,a),b}(k["default"]);c["default"]=p},{73:73,75:75,78:78,86:86}],78:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0,c.BACKGROUND_SIZE_SUPPORTED=c.TOUCH_ENABLED=c.IE_VERSION=c.IS_IE8=c.IS_CHROME=c.IS_EDGE=c.IS_FIREFOX=c.IS_NATIVE_ANDROID=c.IS_OLD_ANDROID=c.ANDROID_VERSION=c.IS_ANDROID=c.IOS_VERSION=c.IS_IOS=c.IS_IPOD=c.IS_IPHONE=c.IS_IPAD=void 0;var e=a(92),f=d(e),g=a(93),h=d(g),i=h["default"].navigator&&h["default"].navigator.userAgent||"",j=/AppleWebKit\/([\d.]+)/i.exec(i),k=j?parseFloat(j.pop()):null,l=c.IS_IPAD=/iPad/i.test(i),m=c.IS_IPHONE=/iPhone/i.test(i)&&!l,n=c.IS_IPOD=/iPod/i.test(i),o=(c.IS_IOS=m||l||n,c.IOS_VERSION=function(){var a=i.match(/OS (\d+)_/i);return a&&a[1]?a[1]:null}(),c.IS_ANDROID=/Android/i.test(i)),p=c.ANDROID_VERSION=function(){var a=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!a)return null;var b=a[1]&&parseFloat(a[1]),c=a[2]&&parseFloat(a[2]);return b&&c?parseFloat(a[1]+"."+a[2]):b?b:null}(),q=(c.IS_OLD_ANDROID=o&&/webkit/i.test(i)&&p<2.3,c.IS_NATIVE_ANDROID=o&&p<5&&k<537,c.IS_FIREFOX=/Firefox/i.test(i),c.IS_EDGE=/Edge/i.test(i));c.IS_CHROME=!q&&/Chrome/i.test(i),c.IS_IE8=/MSIE\s8\.0/.test(i),c.IE_VERSION=function(a){return a&&parseFloat(a[1])}(/MSIE\s(\d+)\.\d/.exec(i)),c.TOUCH_ENABLED=!!("ontouchstart"in h["default"]||h["default"].DocumentTouch&&f["default"]instanceof h["default"].DocumentTouch),c.BACKGROUND_SIZE_SUPPORTED="backgroundSize"in f["default"].createElement("video").style},{92:92,93:93}],79:[function(a,b,c){"use strict";function d(a,b){var c=0,d=void 0,f=void 0;if(!b)return 0;a&&a.length||(a=(0,e.createTimeRange)(0,0));for(var g=0;gb&&(f=b),c+=f-d;return c/b}c.__esModule=!0,c.bufferedPercent=d;var e=a(88)},{88:88}],80:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){return a.raw=b,a}function g(a){return"string"==typeof a&&/\S/.test(a)}function h(a){if(/\s/.test(a))throw new Error("class has illegal whitespace characters")}function i(a){return new RegExp("(^|\\s)"+a+"($|\\s)")}function j(a){return!!a&&"object"===("undefined"==typeof a?"undefined":H(a))&&1===a.nodeType}function k(a){return function(b,c){if(!g(b))return K["default"][a](null);g(c)&&(c=K["default"].querySelector(c));var d=j(c)?c:K["default"];return d[a]&&d[a](b)}}function l(a){return 0===a.indexOf("#")&&(a=a.slice(1)),K["default"].getElementById(a)}function m(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=K["default"].createElement(a);return Object.getOwnPropertyNames(b).forEach(function(a){var c=b[a];a.indexOf("aria-")!==-1||"role"===a||"type"===a?(Q["default"].warn((0,S["default"])(I,a,c)),d.setAttribute(a,c)):d[a]=c}),Object.getOwnPropertyNames(c).forEach(function(a){d.setAttribute(a,c[a])}),d}function n(a,b){"undefined"==typeof a.textContent?a.innerText=b:a.textContent=b}function o(a,b){b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a)}function p(a){var b=a[U];return b||(b=a[U]=O.newGUID()),T[b]||(T[b]={}),T[b]}function q(a){var b=a[U];return!!b&&!!Object.getOwnPropertyNames(T[b]).length}function r(a){var b=a[U];if(b){delete T[b];try{delete a[U]}catch(c){a.removeAttribute?a.removeAttribute(U):a[U]=null}}}function s(a,b){return h(b),a.classList?a.classList.contains(b):i(b).test(a.className)}function t(a,b){return a.classList?a.classList.add(b):s(a,b)||(a.className=(a.className+" "+b).trim()),a}function u(a,b){return a.classList?a.classList.remove(b):(h(b),a.className=a.className.split(/\s+/).filter(function(a){return a!==b}).join(" ")),a}function v(a,b,c){var d=s(a,b);if("function"==typeof c&&(c=c(a,b)),"boolean"!=typeof c&&(c=!d),c!==d)return c?t(a,b):u(a,b),a}function w(a,b){Object.getOwnPropertyNames(b).forEach(function(c){var d=b[c];null===d||"undefined"==typeof d||d===!1?a.removeAttribute(c):a.setAttribute(c,d===!0?"":d)})}function x(a){var b={},c=",autoplay,controls,loop,muted,default,";if(a&&a.attributes&&a.attributes.length>0)for(var d=a.attributes,e=d.length-1;e>=0;e--){var f=d[e].name,g=d[e].value;"boolean"!=typeof a[f]&&c.indexOf(","+f+",")===-1||(g=null!==g),b[f]=g}return b}function y(){K["default"].body.focus(),K["default"].onselectstart=function(){return!1}}function z(){K["default"].onselectstart=function(){return!0}}function A(a){var b=void 0;if(a.getBoundingClientRect&&a.parentNode&&(b=a.getBoundingClientRect()),!b)return{left:0,top:0};var c=K["default"].documentElement,d=K["default"].body,e=c.clientLeft||d.clientLeft||0,f=M["default"].pageXOffset||d.scrollLeft,g=b.left+f-e,h=c.clientTop||d.clientTop||0,i=M["default"].pageYOffset||d.scrollTop,j=b.top+i-h;return{left:Math.round(g),top:Math.round(j)}}function B(a,b){var c={},d=A(a),e=a.offsetWidth,f=a.offsetHeight,g=d.top,h=d.left,i=b.pageY,j=b.pageX;return b.changedTouches&&(j=b.changedTouches[0].pageX,i=b.changedTouches[0].pageY),c.y=Math.max(0,Math.min(1,(g-i+f)/f)),c.x=Math.max(0,Math.min(1,(j-h)/e)),c}function C(a){return!!a&&"object"===("undefined"==typeof a?"undefined":H(a))&&3===a.nodeType}function D(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function E(a){return"function"==typeof a&&(a=a()),(Array.isArray(a)?a:[a]).map(function(a){return"function"==typeof a&&(a=a()),j(a)||C(a)?a:"string"==typeof a&&/\S/.test(a)?K["default"].createTextNode(a):void 0}).filter(function(a){return a})}function F(a,b){return E(b).forEach(function(b){return a.appendChild(b)}),a}function G(a,b){return F(D(a),b)}c.__esModule=!0,c.$$=c.$=void 0;var H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},I=f(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);c.isEl=j,c.getEl=l,c.createEl=m,c.textContent=n,c.insertElFirst=o,c.getElData=p,c.hasElData=q,c.removeElData=r,c.hasElClass=s,c.addElClass=t,c.removeElClass=u,c.toggleElClass=v,c.setElAttributes=w,c.getElAttributes=x,c.blockTextSelection=y,c.unblockTextSelection=z,c.findElPosition=A,c.getPointerPosition=B,c.isTextNode=C,c.emptyEl=D,c.normalizeContent=E,c.appendContent=F,c.insertContent=G;var J=a(92),K=e(J),L=a(93),M=e(L),N=a(84),O=d(N),P=a(85),Q=e(P),R=a(146),S=e(R),T={},U="vdata"+(new Date).getTime();c.$=k("querySelector"),c.$$=k("querySelectorAll")},{146:146,84:84,85:85,92:92,93:93}],81:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){var c=n.getElData(a);0===c.handlers[b].length&&(delete c.handlers[b],a.removeEventListener?a.removeEventListener(b,c.dispatcher,!1):a.detachEvent&&a.detachEvent("on"+b,c.dispatcher)),Object.getOwnPropertyNames(c.handlers).length<=0&&(delete c.handlers,delete c.dispatcher,delete c.disabled),0===Object.getOwnPropertyNames(c).length&&n.removeElData(a)}function g(a,b,c,d){c.forEach(function(c){a(b,c,d)})}function h(a){function b(){return!0}function c(){return!1}return a&&a.isPropagationStopped||!function(){var d=a||t["default"].event;a={};for(var e in d)"layerX"!==e&&"layerY"!==e&&"keyLocation"!==e&&"webkitMovementX"!==e&&"webkitMovementY"!==e&&("returnValue"===e&&d.preventDefault||(a[e]=d[e]));if(a.target||(a.target=a.srcElement||v["default"]),a.relatedTarget||(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.preventDefault=function(){d.preventDefault&&d.preventDefault(),a.returnValue=!1,d.returnValue=!1,a.defaultPrevented=!0},a.defaultPrevented=!1,a.stopPropagation=function(){d.stopPropagation&&d.stopPropagation(),a.cancelBubble=!0,d.cancelBubble=!0,a.isPropagationStopped=b},a.isPropagationStopped=c,a.stopImmediatePropagation=function(){d.stopImmediatePropagation&&d.stopImmediatePropagation(),a.isImmediatePropagationStopped=b,a.stopPropagation()},a.isImmediatePropagationStopped=c,null!==a.clientX&&void 0!==a.clientX){var f=v["default"].documentElement,g=v["default"].body;a.pageX=a.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=a.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)}a.which=a.charCode||a.keyCode,null!==a.button&&void 0!==a.button&&(a.button=1&a.button?0:4&a.button?1:2&a.button?2:0)}(),a}function i(a,b,c){if(Array.isArray(b))return g(i,a,b,c);var d=n.getElData(a);d.handlers||(d.handlers={}),d.handlers[b]||(d.handlers[b]=[]),c.guid||(c.guid=p.newGUID()),d.handlers[b].push(c),d.dispatcher||(d.disabled=!1,d.dispatcher=function(b,c){if(!d.disabled){b=h(b);var e=d.handlers[b.type];if(e)for(var f=e.slice(0),g=0,i=f.length;g1&&void 0!==arguments[1]?arguments[1]:a;a=a<0?0:a;var c=Math.floor(a%60),d=Math.floor(a/60%60),e=Math.floor(a/3600),f=Math.floor(b/60%60),g=Math.floor(b/3600);return(isNaN(a)||a===1/0)&&(e=d=c="-"),e=e>0||g>0?e+":":"",d=((e||f>=10)&&d<10?"0"+d:d)+":",c=c<10?"0"+c:c,e+d+c}c.__esModule=!0,c["default"]=d},{}],84:[function(a,b,c){"use strict";function d(){return e++}c.__esModule=!0,c.newGUID=d;var e=1},{}],85:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0,c.logByType=void 0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},f=a(93),g=d(f),h=a(78),i=void 0,j=c.logByType=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!!h.IE_VERSION&&h.IE_VERSION<11;"log"!==a&&b.unshift(a.toUpperCase()+":"),i.history.push(b),b.unshift("VIDEOJS:");var d=g["default"].console&&g["default"].console[a];d&&(c&&(b=b.map(function(a){if(a&&"object"===("undefined"==typeof a?"undefined":e(a))||Array.isArray(a))try{return JSON.stringify(a)}catch(b){return String(a)}return String(a)}).join(" ")),d.apply?d[Array.isArray(b)?"apply":"call"](g["default"].console,b):d(b))};i=function(){for(var a=arguments.length,b=Array(a),c=0;cc)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+b+") is greater than or equal to the maximum bound ("+c+").")}function f(a,b,c,d){return void 0===d&&(j["default"].warn("DEPRECATED: Function '"+a+"' on 'TimeRanges' called without an index argument."),d=0),e(a,d,c.length-1),c[d][b]}function g(a){return void 0===a||0===a.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:a.length,start:f.bind(null,"start",0,a),end:f.bind(null,"end",1,a)}}function h(a,b){return Array.isArray(a)?g(a):void 0===a||void 0===b?g():g([[a,b]])}c.__esModule=!0,c.createTimeRange=void 0,c.createTimeRanges=h;var i=a(85),j=d(i);c.createTimeRange=h},{85:85}],89:[function(a,b,c){"use strict";function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}c.__esModule=!0,c["default"]=d},{}],90:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0,c.isCrossOrigin=c.getFileExtension=c.getAbsoluteURL=c.parseUrl=void 0;var e=a(92),f=d(e),g=a(93),h=d(g),i=c.parseUrl=function(a){var b=["protocol","hostname","port","pathname","search","hash","host"],c=f["default"].createElement("a");c.href=a;var d=""===c.host&&"file:"!==c.protocol,e=void 0;d&&(e=f["default"].createElement("div"),e.innerHTML='',c=e.firstChild,e.setAttribute("style","display:none; position:absolute;"),f["default"].body.appendChild(e));for(var g={},h=0;hx',a=b.firstChild.href}return a},c.getFileExtension=function(a){if("string"==typeof a){var b=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,c=b.exec(a);if(c)return c.pop().toLowerCase()}return""},c.isCrossOrigin=function(a){var b=h["default"].location,c=i(a),d=":"===c.protocol?b.protocol:c.protocol,e=d+c.host!==b.protocol+b.host;return e}},{92:92,93:93}],91:[function(b,c,d){"use strict";function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a){return a&&a.__esModule?a:{"default":a}}function g(a,b,c){var d=void 0;if("string"==typeof a){if(0===a.indexOf("#")&&(a=a.slice(1)),g.getPlayers()[a])return b&&O["default"].warn('Player "'+a+'" is already initialised. Options will not be applied.'),c&&g.getPlayers()[a].ready(c),g.getPlayers()[a];d=Q.getEl(a)}else d=a;if(!d||!d.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return d.player||x["default"].players[d.playerId]||new x["default"](d,b,c)}d.__esModule=!0;var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},i=b(93),j=f(i),k=b(92),l=f(k),m=b(56),n=e(m),o=b(87),p=e(o),q=b(5),r=f(q),s=b(42),t=f(s),u=b(81),v=e(u),w=b(51),x=f(w),y=b(52),z=f(y),A=b(86),B=f(A),C=b(82),D=e(C),E=b(72),F=f(E),G=b(64),H=f(G),I=b(77),J=f(I),K=b(88),L=b(83),M=f(L),N=b(85),O=f(N),P=b(80),Q=e(P),R=b(78),S=e(R),T=b(90),U=e(T),V=b(43),W=f(V),X=b(131),Y=f(X),Z=b(147),$=f(Z),_=b(62),aa=f(_);if("undefined"==typeof HTMLVideoElement&&j["default"].document&&j["default"].document.createElement&&(l["default"].createElement("video"),l["default"].createElement("audio"),l["default"].createElement("track")),j["default"].VIDEOJS_NO_DYNAMIC_STYLE!==!0){var ba=Q.$(".vjs-styles-defaults");if(!ba){ba=p.createStyleElement("vjs-styles-defaults");var ca=Q.$("head");ca&&ca.insertBefore(ba,ca.firstChild),p.setTextContent(ba,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}n.autoSetupTimeout(1,g),g.VERSION="5.12.6",g.options=x["default"].prototype.options_,g.getPlayers=function(){return x["default"].players},g.players=x["default"].players,g.getComponent=r["default"].getComponent,g.registerComponent=function(a,b){aa["default"].isTech(b)&&O["default"].warn("The "+a+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),r["default"].registerComponent.call(r["default"],a,b)},g.getTech=aa["default"].getTech,g.registerTech=aa["default"].registerTech,g.browser=S,g.TOUCH_ENABLED=S.TOUCH_ENABLED,g.extend=W["default"],g.mergeOptions=B["default"],g.bind=D.bind,g.plugin=z["default"],g.addLanguage=function(a,b){var c;return a=(""+a).toLowerCase(),(0,Y["default"])(g.options.languages,(c={},c[a]=b,c))[a]},g.log=O["default"],g.createTimeRange=g.createTimeRanges=K.createTimeRanges,g.formatTime=M["default"],g.parseUrl=U.parseUrl,g.isCrossOrigin=U.isCrossOrigin,g.EventTarget=t["default"],g.on=v.on,g.one=v.one,g.off=v.off,g.trigger=v.trigger,g.xhr=$["default"],g.TextTrack=F["default"],g.AudioTrack=H["default"],g.VideoTrack=J["default"],g.isEl=Q.isEl,g.isTextNode=Q.isTextNode,g.createEl=Q.createEl,g.hasClass=Q.hasElClass,g.addClass=Q.addElClass,g.removeClass=Q.removeElClass,g.toggleClass=Q.toggleElClass,g.setAttributes=Q.setElAttributes,g.getAttributes=Q.getElAttributes,g.emptyEl=Q.emptyEl,g.appendContent=Q.appendContent,g.insertContent=Q.insertContent,"function"==typeof a&&a.amd?a("videojs",[],function(){return g}):"object"===("undefined"==typeof d?"undefined":h(d))&&"object"===("undefined"==typeof c?"undefined":h(c))&&(c.exports=g),d["default"]=g},{131:131,147:147,42:42,43:43,5:5,51:51,52:52,56:56,62:62,64:64,72:72,77:77,78:78,80:80,81:81,82:82,83:83,85:85,86:86,87:87,88:88,90:90,92:92,93:93}],92:[function(a,b,c){(function(c){var d="undefined"!=typeof c?c:"undefined"!=typeof window?window:{},e=a(94);if("undefined"!=typeof document)b.exports=document;else{var f=d["__GLOBAL_DOCUMENT_CACHE@4"];f||(f=d["__GLOBAL_DOCUMENT_CACHE@4"]=e),b.exports=f}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{94:94}],93:[function(a,b,c){(function(a){"undefined"!=typeof window?b.exports=window:"undefined"!=typeof a?b.exports=a:"undefined"!=typeof self?b.exports=self:b.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],94:[function(a,b,c){},{}],95:[function(a,b,c){var d=a(111),e=d(Date,"now"),f=e||function(){return(new Date).getTime()};b.exports=f},{111:111}],96:[function(a,b,c){function d(a,b,c){function d(){r&&clearTimeout(r),n&&clearTimeout(n),t=0,n=r=s=void 0}function i(b,c){c&&clearTimeout(c),n=r=s=void 0,b&&(t=f(),o=a.apply(q,m),r||n||(m=q=void 0))}function j(){var a=b-(f()-p);a<=0||a>b?i(s,n):r=setTimeout(j,a)}function k(){i(v,r)}function l(){if(m=arguments,p=f(),q=this,s=v&&(r||!w),u===!1)var c=w&&!r;else{n||w||(t=p);var d=u-(p-t),e=d<=0||d>u;e?(n&&(n=clearTimeout(n)),t=p,o=a.apply(q,m)):n||(n=setTimeout(k,d))}return e&&r?r=clearTimeout(r):r||b===u||(r=setTimeout(j,b)),c&&(e=!0,o=a.apply(q,m)),!e||r||n||(m=q=void 0),o}var m,n,o,p,q,r,s,t=0,u=!1,v=!0;if("function"!=typeof a)throw new TypeError(g);if(b=b<0?0:+b||0,c===!0){var w=!0;v=!1}else e(c)&&(w=!!c.leading,u="maxWait"in c&&h(+c.maxWait||0,b),v="trailing"in c?!!c.trailing:v);return l.cancel=d,l}var e=a(124),f=a(95),g="Expected a function",h=Math.max;b.exports=d},{124:124,95:95}],97:[function(a,b,c){function d(a,b){if("function"!=typeof a)throw new TypeError(e);return b=f(void 0===b?a.length-1:+b||0,0),function(){for(var c=arguments,d=-1,e=f(c.length-b,0),g=Array(e);++d2?c[g-2]:void 0,i=g>2?c[2]:void 0,j=g>1?c[g-1]:void 0;for("function"==typeof h?(h=e(h,j,5),g-=2):(h="function"==typeof j?j:void 0,g-=h?1:0),i&&f(c[0],c[1],i)&&(h=g<3?void 0:h,g=1);++d-1&&a%1==0&&a-1&&a%1==0&&a<=e}var e=9007199254740991;b.exports=d},{}],117:[function(a,b,c){function d(a){return!!a&&"object"==typeof a}b.exports=d},{}],118:[function(a,b,c){function d(a){for(var b=j(a),c=b.length,d=c&&a.length,k=!!d&&h(d)&&(f(a)||e(a)||i(a)),m=-1,n=[];++m0,r=m.enumErrorProps&&(a===x||a instanceof Error),s=m.enumPrototypes&&h(a);++d2?arguments[2]:{},g=d(b);f&&(g=g.concat(Object.getOwnPropertySymbols(b))),e(g,function(d){k(a,d,b[d],c[d])})};l.supportsDescriptors=!!j,b.exports=l},{138:138,141:141}],138:[function(a,b,c){var d=Object.prototype.hasOwnProperty,e=Object.prototype.toString;b.exports=function(a,b,c){if("[object Function]"!==e.call(b))throw new TypeError("iterator must be a function");var f=a.length;if(f===+f)for(var g=0;g0&&!d.call(a,0))for(var n=0;n0)for(var p=0;p=0&&"[object Function]"===d.call(a.callee)),c}},{}],143:[function(a,b,c){"use strict";var d=a(135),e=function(){if(!Object.assign)return!1;for(var a="abcdefghijklmnopqrst",b=a.split(""),c={},d=0;d0&&(o=setTimeout(function(){n=!0,j.abort("timeout");var a=new Error("XMLHttpRequest timeout");a.code="ETIMEDOUT",d(a)},a.timeout)),j.setRequestHeader)for(l in s)s.hasOwnProperty(l)&&j.setRequestHeader(l,s[l]);else if(a.headers&&!e(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(j.responseType=a.responseType),"beforeSend"in a&&"function"==typeof a.beforeSend&&a.beforeSend(j),j.send(r),j}function i(){}var j=a(93),k=a(149),l=a(148),m=a(152),n=a(153);b.exports=g,g.XMLHttpRequest=j.XMLHttpRequest||i,g.XDomainRequest="withCredentials"in new g.XMLHttpRequest?g.XMLHttpRequest:j.XDomainRequest,d(["get","put","post","patch","head","delete"],function(a){g["delete"===a?"del":a]=function(b,c,d){return c=f(b,c,d),c.method=a.toUpperCase(),h(c)}})},{148:148,149:149,152:152,153:153,93:93}],148:[function(a,b,c){function d(a){var b=e.call(a);return"[object Function]"===b||"function"==typeof a&&"[object RegExp]"!==b||"undefined"!=typeof window&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}b.exports=d;var e=Object.prototype.toString},{}],149:[function(a,b,c){function d(a){var b=!1;return function(){if(!b)return b=!0,a.apply(this,arguments)}}b.exports=d,d.proto=d(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return d(this)},configurable:!0})})},{}],150:[function(a,b,c){function d(a,b,c){if(!h(b))throw new TypeError("iterator must be a function");arguments.length<3&&(c=this),"[object Array]"===i.call(a)?e(a,b,c):"string"==typeof a?f(a,b,c):g(a,b,c)}function e(a,b,c){for(var d=0,e=a.length;d100)throw new Error("Position must be between 0 and 100.");u=a,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",e({},j,{get:function(){return v},set:function(a){var b=d(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",e({},j,{get:function(){return w},set:function(a){if(a<0||a>100)throw new Error("Size must be between 0 and 100.");w=a,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",e({},j,{get:function(){return x},set:function(a){var b=d(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");x=b,this.hasBeenReset=!0}})),h.displayState=void 0,i)return h}var g="auto",h={"":!0,lr:!0,rl:!0},i={start:!0,middle:!0,end:!0,left:!0,right:!0};f.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},a.VTTCue=a.VTTCue||f,b.VTTCue=f}(this,this.vttjs||{}),function(a,b){function c(a){if("string"!=typeof a)return!1;var b=f[a.toLowerCase()];return!!b&&a.toLowerCase()}function d(a){return"number"==typeof a&&a>=0&&a<=100}function e(){var a=100,b=3,e=0,f=100,g=0,h=100,i="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(b){if(!d(b))throw new Error("Width must be between 0 and 100.");a=b}},lines:{enumerable:!0,get:function(){return b},set:function(a){if("number"!=typeof a)throw new TypeError("Lines must be set to a number.");b=a}},regionAnchorY:{enumerable:!0,get:function(){return f},set:function(a){if(!d(a))throw new Error("RegionAnchorX must be between 0 and 100.");f=a}},regionAnchorX:{enumerable:!0,get:function(){return e},set:function(a){if(!d(a))throw new Error("RegionAnchorY must be between 0 and 100.");e=a}},viewportAnchorY:{enumerable:!0,get:function(){return h},set:function(a){if(!d(a))throw new Error("ViewportAnchorY must be between 0 and 100.");h=a}},viewportAnchorX:{enumerable:!0,get:function(){return g},set:function(a){if(!d(a))throw new Error("ViewportAnchorX must be between 0 and 100.");g=a}},scroll:{enumerable:!0,get:function(){return i},set:function(a){var b=c(a);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");i=b}}})}var f={"":!0,up:!0};a.VTTRegion=a.VTTRegion||e,b.VTTRegion=e}(this,this.vttjs||{}),function(a){function b(a,b){this.name="ParsingError",this.code=a.code,this.message=b||a.message}function c(a){function b(a,b,c,d){return 3600*(0|a)+60*(0|b)+(0|c)+(0|d)/1e3}var c=a.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return c?c[3]?b(c[1],c[2],c[3].replace(":",""),c[4]):c[1]>59?b(c[1],c[2],0,c[4]):b(0,c[1],c[2],c[4]):null}function d(){this.values=o(null)}function e(a,b,c,d){var e=d?a.split(d):[a];for(var f in e)if("string"==typeof e[f]){var g=e[f].split(c);if(2===g.length){var h=g[0],i=g[1];b(h,i)}}}function f(a,f,g){function h(){var d=c(a);if(null===d)throw new b(b.Errors.BadTimeStamp,"Malformed timestamp: "+k);return a=a.replace(/^[^\sa-zA-Z-]+/,""),d}function i(a,b){var c=new d;e(a,function(a,b){switch(a){case"region":for(var d=g.length-1;d>=0;d--)if(g[d].id===b){c.set(a,g[d].region);break}break;case"vertical":c.alt(a,b,["rl","lr"]);break;case"line":var e=b.split(","),f=e[0];c.integer(a,f),c.percent(a,f)?c.set("snapToLines",!1):null,c.alt(a,f,["auto"]),2===e.length&&c.alt("lineAlign",e[1],["start","middle","end"]);break;case"position":e=b.split(","),c.percent(a,e[0]),2===e.length&&c.alt("positionAlign",e[1],["start","middle","end"]);break;case"size":c.percent(a,b);break;case"align":c.alt(a,b,["start","middle","end","left","right"])}},/:/,/\s/),b.region=c.get("region",null),b.vertical=c.get("vertical",""),b.line=c.get("line","auto"),b.lineAlign=c.get("lineAlign","start"),b.snapToLines=c.get("snapToLines",!0),b.size=c.get("size",100),b.align=c.get("align","middle"),b.position=c.get("position",{start:0,left:0,middle:50,end:100,right:100},b.align),b.positionAlign=c.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},b.align)}function j(){a=a.replace(/^\s+/,"")}var k=a;if(j(),f.startTime=h(),j(),"-->"!==a.substr(0,3))throw new b(b.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+k);a=a.substr(3),j(),f.endTime=h(),j(),i(a,f)}function g(a,b){function d(){function a(a){return b=b.substr(a.length),a}if(!b)return null;var c=b.match(/^([^<]*)(<[^>]+>?)?/);return a(c[1]?c[1]:c[2])}function e(a){return p[a]}function f(a){for(;o=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(o[0],e);return a}function g(a,b){return!s[b.localName]||s[b.localName]===a.localName}function h(b,c){var d=q[b];if(!d)return null;var e=a.document.createElement(d);e.localName=d;var f=r[b];return f&&c&&(e[f]=c.trim()),e}for(var i,j=a.document.createElement("div"),k=j,l=[];null!==(i=d());)if("<"!==i[0])k.appendChild(a.document.createTextNode(f(i)));else{if("/"===i[1]){l.length&&l[l.length-1]===i.substr(2).replace(">","")&&(l.pop(),k=k.parentNode);continue}var m,n=c(i.substr(1,i.length-2));if(n){m=a.document.createProcessingInstruction("timestamp",n),k.appendChild(m);continue}var o=i.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!o)continue;if(m=h(o[1],o[3]),!m)continue;if(!g(k,m))continue;o[2]&&(m.className=o[2].substr(1).replace("."," ")),l.push(o[1]),k.appendChild(m),k=m}return j}function h(a){function b(a,b){for(var c=b.childNodes.length-1;c>=0;c--)a.push(b.childNodes[c])}function c(a){if(!a||!a.length)return null;var d=a.pop(),e=d.textContent||d.innerText;if(e){var f=e.match(/^.*(\n|\r)/);return f?(a.length=0,f[0]):e}return"ruby"===d.tagName?c(a):d.childNodes?(b(a,d),c(a)):void 0}var d,e=[],f="";if(!a||!a.childNodes)return"ltr";for(b(e,a);f=c(e);)for(var g=0;g=0&&a.line<=100))return a.line;if(!a.track||!a.track.textTrackList||!a.track.textTrackList.mediaElement)return-1;for(var b=a.track,c=b.textTrackList,d=0,e=0;ei&&(e=new l(a),g=i),a=new l(f)}return e||f}var f=new l(b),g=b.cue,h=i(g),j=[];if(g.snapToLines){var k;switch(g.vertical){case"":j=["+y","-y"],k="height";break;case"rl":j=["+x","-x"],k="width";break;case"lr":j=["-x","+x"],k="width"}var m=f.lineHeight,n=m*Math.round(h),o=c[k]+m,p=j[0];Math.abs(n)>o&&(n=n<0?-1:1,n*=Math.ceil(o/m)*m),h<0&&(n+=""===g.vertical?c.height:c.width,j=j.reverse()),f.move(p,n)}else{var q=f.lineHeight/c.height*100;switch(g.lineAlign){case"middle":h-=q/2;break;case"end":h-=q}switch(g.vertical){case"":b.applyStyles({top:b.formatStyle(h,"%")});break;case"rl":b.applyStyles({left:b.formatStyle(h,"%")});break;case"lr":b.applyStyles({right:b.formatStyle(h,"%")})}j=["+y","-x","+x","-y"],f=new l(b)}var r=e(f,j);b.move(r.toCSSCompatValues(c))}function n(){}var o=Object.create||function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return a.prototype=b,new a}}();b.prototype=o(Error.prototype),b.prototype.constructor=b,b.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},d.prototype={set:function(a,b){this.get(a)||""===b||(this.values[a]=b)},get:function(a,b,c){return c?this.has(a)?this.values[a]:b[c]:this.has(a)?this.values[a]:b},has:function(a){return a in this.values},alt:function(a,b,c){for(var d=0;d=0&&b<=100))&&(this.set(a,b),!0)}};var p={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},q={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},r={v:"title",lang:"lang"},s={rt:"ruby"},t=[1470,1472,1475,1478,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1520,1521,1522,1523,1524,1544,1547,1549,1563,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1645,1646,1647,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1765,1766,1774,1775,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1807,1808,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1969,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2e3,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2036,2037,2042,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2074,2084,2088,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2142,2208,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,8207,64285,64287,64288,64289,64290,64291,64292,64293,64294,64295,64296,64298,64299,64300,64301,64302,64303,64304,64305,64306,64307,64308,64309,64310,64312,64313,64314,64315,64316,64318,64320,64321,64323,64324,64326,64327,64328,64329,64330,64331,64332,64333,64334,64335,64336,64337,64338,64339,64340,64341,64342,64343,64344,64345,64346,64347,64348,64349,64350,64351,64352,64353,64354,64355,64356,64357,64358,64359,64360,64361,64362,64363,64364,64365,64366,64367,64368,64369,64370,64371,64372,64373,64374,64375,64376,64377,64378,64379,64380,64381,64382,64383,64384,64385,64386,64387,64388,64389,64390,64391,64392,64393,64394,64395,64396,64397,64398,64399,64400,64401,64402,64403,64404,64405,64406,64407,64408,64409,64410,64411,64412,64413,64414,64415,64416,64417,64418,64419,64420,64421,64422,64423,64424,64425,64426,64427,64428,64429,64430,64431,64432,64433,64434,64435,64436,64437,64438,64439,64440,64441,64442,64443,64444,64445,64446,64447,64448,64449,64467,64468,64469,64470,64471,64472,64473,64474,64475,64476,64477,64478,64479,64480,64481,64482,64483,64484,64485,64486,64487,64488,64489,64490,64491,64492,64493,64494,64495,64496,64497,64498,64499,64500,64501,64502,64503,64504,64505,64506,64507,64508,64509,64510,64511,64512,64513,64514,64515,64516,64517,64518,64519,64520,64521,64522,64523,64524,64525,64526,64527,64528,64529,64530,64531,64532,64533,64534,64535,64536,64537,64538,64539,64540,64541,64542,64543,64544,64545,64546,64547,64548,64549,64550,64551,64552,64553,64554,64555,64556,64557,64558,64559,64560,64561,64562,64563,64564,64565,64566,64567,64568,64569,64570,64571,64572,64573,64574,64575,64576,64577,64578,64579,64580,64581,64582,64583,64584,64585,64586,64587,64588,64589,64590,64591,64592,64593,64594,64595,64596,64597,64598,64599,64600,64601,64602,64603,64604,64605,64606,64607,64608,64609,64610,64611,64612,64613,64614,64615,64616,64617,64618,64619,64620,64621,64622,64623,64624,64625,64626,64627,64628,64629,64630,64631,64632,64633,64634,64635,64636,64637,64638,64639,64640,64641,64642,64643,64644,64645,64646,64647,64648,64649,64650,64651,64652,64653,64654,64655,64656,64657,64658,64659,64660,64661,64662,64663,64664,64665,64666,64667,64668,64669,64670,64671,64672,64673,64674,64675,64676,64677,64678,64679,64680,64681,64682,64683,64684,64685,64686,64687,64688,64689,64690,64691,64692,64693,64694,64695,64696,64697,64698,64699,64700,64701,64702,64703,64704,64705,64706,64707,64708,64709,64710,64711,64712,64713,64714,64715,64716,64717,64718,64719,64720,64721,64722,64723,64724,64725,64726,64727,64728,64729,64730,64731,64732,64733,64734,64735,64736,64737,64738,64739,64740,64741,64742,64743,64744,64745,64746,64747,64748,64749,64750,64751,64752,64753,64754,64755,64756,64757,64758,64759,64760,64761,64762,64763,64764,64765,64766,64767,64768,64769,64770,64771,64772,64773,64774,64775,64776,64777,64778,64779,64780,64781,64782,64783,64784,64785,64786,64787,64788,64789,64790,64791,64792,64793,64794,64795,64796,64797,64798,64799,64800,64801,64802,64803,64804,64805,64806,64807,64808,64809,64810,64811,64812,64813,64814,64815,64816,64817,64818,64819,64820,64821,64822,64823,64824,64825,64826,64827,64828,64829,64848,64849,64850,64851,64852,64853,64854,64855,64856,64857,64858,64859,64860,64861,64862,64863,64864,64865,64866,64867,64868,64869,64870,64871,64872,64873,64874,64875,64876,64877,64878,64879,64880,64881,64882,64883,64884,64885,64886,64887,64888,64889,64890,64891,64892,64893,64894,64895,64896,64897,64898,64899,64900,64901,64902,64903,64904,64905,64906,64907,64908,64909,64910,64911,64914,64915,64916,64917,64918,64919,64920,64921,64922,64923,64924,64925,64926,64927,64928,64929,64930,64931,64932,64933,64934,64935,64936,64937,64938,64939,64940,64941,64942,64943,64944,64945,64946,64947,64948,64949,64950,64951,64952,64953,64954,64955,64956,64957,64958,64959,64960,64961,64962,64963,64964,64965,64966,64967,65008,65009,65010,65011,65012,65013,65014,65015,65016,65017,65018,65019,65020,65136,65137,65138,65139,65140,65142,65143,65144,65145,65146,65147,65148,65149,65150,65151,65152,65153,65154,65155,65156,65157,65158,65159,65160,65161,65162,65163,65164,65165,65166,65167,65168,65169,65170,65171,65172,65173,65174,65175,65176,65177,65178,65179,65180,65181,65182,65183,65184,65185,65186,65187,65188,65189,65190,65191,65192,65193,65194,65195,65196,65197,65198,65199,65200,65201,65202,65203,65204,65205,65206,65207,65208,65209,65210,65211,65212,65213,65214,65215,65216,65217,65218,65219,65220,65221,65222,65223,65224,65225,65226,65227,65228,65229,65230,65231,65232,65233,65234,65235,65236,65237,65238,65239,65240,65241,65242,65243,65244,65245,65246,65247,65248,65249,65250,65251,65252,65253,65254,65255,65256,65257,65258,65259,65260,65261,65262,65263,65264,65265,65266,65267,65268,65269,65270,65271,65272,65273,65274,65275,65276,67584,67585,67586,67587,67588,67589,67592,67594,67595,67596,67597,67598,67599,67600,67601,67602,67603,67604,67605,67606,67607,67608,67609,67610,67611,67612,67613,67614,67615,67616,67617,67618,67619,67620,67621,67622,67623,67624,67625,67626,67627,67628,67629,67630,67631,67632,67633,67634,67635,67636,67637,67639,67640,67644,67647,67648,67649,67650,67651,67652,67653,67654,67655,67656,67657,67658,67659,67660,67661,67662,67663,67664,67665,67666,67667,67668,67669,67671,67672,67673,67674,67675,67676,67677,67678,67679,67840,67841,67842,67843,67844,67845,67846,67847,67848,67849,67850,67851,67852,67853,67854,67855,67856,67857,67858,67859,67860,67861,67862,67863,67864,67865,67866,67867,67872,67873,67874,67875,67876,67877,67878,67879,67880,67881,67882,67883,67884,67885,67886,67887,67888,67889,67890,67891,67892,67893,67894,67895,67896,67897,67903,67968,67969,67970,67971,67972,67973,67974,67975,67976,67977,67978,67979,67980,67981,67982,67983,67984,67985,67986,67987,67988,67989,67990,67991,67992,67993,67994,67995,67996,67997,67998,67999,68e3,68001,68002,68003,68004,68005,68006,68007,68008,68009,68010,68011,68012,68013,68014,68015,68016,68017,68018,68019,68020,68021,68022,68023,68030,68031,68096,68112,68113,68114,68115,68117,68118,68119,68121,68122,68123,68124,68125,68126,68127,68128,68129,68130,68131,68132,68133,68134,68135,68136,68137,68138,68139,68140,68141,68142,68143,68144,68145,68146,68147,68160,68161,68162,68163,68164,68165,68166,68167,68176,68177,68178,68179,68180,68181,68182,68183,68184,68192,68193,68194,68195,68196,68197,68198,68199,68200,68201,68202,68203,68204,68205,68206,68207,68208,68209,68210,68211,68212,68213,68214,68215,68216,68217,68218,68219,68220,68221,68222,68223,68352,68353,68354,68355,68356,68357,68358,68359,68360,68361,68362,68363,68364,68365,68366,68367,68368,68369,68370,68371,68372,68373,68374,68375,68376,68377,68378,68379,68380,68381,68382,68383,68384,68385,68386,68387,68388,68389,68390,68391,68392,68393,68394,68395,68396,68397,68398,68399,68400,68401,68402,68403,68404,68405,68416,68417,68418,68419,68420,68421,68422,68423,68424,68425,68426,68427,68428,68429,68430,68431,68432,68433,68434,68435,68436,68437,68440,68441,68442,68443,68444,68445,68446,68447,68448,68449,68450,68451,68452,68453,68454,68455,68456,68457,68458,68459,68460,68461,68462,68463,68464,68465,68466,68472,68473,68474,68475,68476,68477,68478,68479,68608,68609,68610,68611,68612,68613,68614,68615,68616,68617,68618,68619,68620,68621,68622,68623,68624,68625,68626,68627,68628,68629,68630,68631,68632,68633,68634,68635,68636,68637,68638,68639,68640,68641,68642,68643,68644,68645,68646,68647,68648,68649,68650,68651,68652,68653,68654,68655,68656,68657,68658,68659,68660,68661,68662,68663,68664,68665,68666,68667,68668,68669,68670,68671,68672,68673,68674,68675,68676,68677,68678,68679,68680,126464,126465,126466,126467,126469,126470,126471,126472,126473,126474,126475,126476,126477,126478,126479,126480,126481,126482,126483,126484,126485,126486,126487,126488,126489,126490,126491,126492,126493,126494,126495,126497,126498,126500,126503,126505,126506,126507,126508,126509,126510,126511,126512,126513,126514,126516,126517,126518,126519,126521,126523,126530,126535,126537,126539,126541,126542,126543,126545,126546,126548,126551,126553,126555,126557,126559,126561,126562,126564,126567,126568,126569,126570,126572,126573,126574,126575,126576,126577,126578,126580,126581,126582,126583,126585,126586,126587,126588,126590,126592,126593,126594,126595,126596,126597,126598,126599,126600,126601,126603,126604,126605,126606,126607,126608,126609,126610,126611,126612,126613,126614,126615,126616,126617,126618,126619,126625,126626,126627,126629,126630,126631,126632,126633,126635,126636,126637,126638,126639,126640,126641,126642,126643,126644,126645,126646,126647,126648,126649,126650,126651,1114109]; -j.prototype.applyStyles=function(a,b){b=b||this.div;for(var c in a)a.hasOwnProperty(c)&&(b.style[c]=a[c])},j.prototype.formatStyle=function(a,b){return 0===a?0:a+b},k.prototype=o(j.prototype),k.prototype.constructor=k,l.prototype.move=function(a,b){switch(b=void 0!==b?b:this.lineHeight,a){case"+x":this.left+=b,this.right+=b;break;case"-x":this.left-=b,this.right-=b;break;case"+y":this.top+=b,this.bottom+=b;break;case"-y":this.top-=b,this.bottom-=b}},l.prototype.overlaps=function(a){return this.lefta.left&&this.topa.top},l.prototype.overlapsAny=function(a){for(var b=0;b=a.top&&this.bottom<=a.bottom&&this.left>=a.left&&this.right<=a.right},l.prototype.overlapsOppositeAxis=function(a,b){switch(b){case"+x":return this.lefta.right;case"+y":return this.topa.bottom}},l.prototype.intersectPercentage=function(a){var b=Math.max(0,Math.min(this.right,a.right)-Math.max(this.left,a.left)),c=Math.max(0,Math.min(this.bottom,a.bottom)-Math.max(this.top,a.top)),d=b*c;return d/(this.height*this.width)},l.prototype.toCSSCompatValues=function(a){return{top:this.top-a.top,bottom:a.bottom-this.bottom,left:this.left-a.left,right:a.right-this.right,height:this.height,width:this.width}},l.getSimpleBoxPosition=function(a){var b=a.div?a.div.offsetHeight:a.tagName?a.offsetHeight:0,c=a.div?a.div.offsetWidth:a.tagName?a.offsetWidth:0,d=a.div?a.div.offsetTop:a.tagName?a.offsetTop:0;a=a.div?a.div.getBoundingClientRect():a.tagName?a.getBoundingClientRect():a;var e={left:a.left,right:a.right,top:a.top||d,height:a.height||b,bottom:a.bottom||d+(a.height||b),width:a.width||c};return e},n.StringDecoder=function(){return{decode:function(a){if(!a)return"";if("string"!=typeof a)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}},n.convertCueToDOMTree=function(a,b){return a&&b?g(a,b):null};var u=.05,v="sans-serif",w="1.5%";n.processCues=function(a,b,c){function d(a){for(var b=0;b")===-1){i.cue.id=j;continue}case"CUE":try{f(j,i.cue,i.regionList)}catch(m){i.reportOrThrowError(m),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var n=j.indexOf("-->")!==-1;if(!j||n&&(l=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=j;continue;case"BADCUE":j||(i.state="ID");continue}}}catch(m){i.reportOrThrowError(m),"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||"HEADER"===a.state)&&(a.buffer+="\n\n",a.parse()),"INITIAL"===a.state)throw new b(b.Errors.BadSignature)}catch(c){a.reportOrThrowError(c)}return a.onflush&&a.onflush(),this}},a.WebVTT=n}(this,this.vttjs||{}); \ No newline at end of file +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.videojs=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0&&void 0!==arguments[0]?arguments[0]:"button",b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b=(0,n.assign)({className:this.buildCSSClass()},b),"button"!==a&&(m["default"].warn("Creating a Button with an HTML element of "+a+" is deprecated; use ClickableComponent instead."),b=(0,n.assign)({tabIndex:0},b),c=(0,n.assign)({role:"button"},c)),c=(0,n.assign)({type:"button","aria-live":"polite"},c);var d=k["default"].prototype.createEl.call(this,a,b,c);return this.createControlTextEl(d),d},b.prototype.addChild=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=this.constructor.name;return m["default"].warn("Adding an actionable (user controllable) child to a Button ("+c+") is not supported; use a ClickableComponent instead."),k["default"].prototype.addChild.call(this,a,b)},b.prototype.enable=function(){a.prototype.enable.call(this),this.el_.removeAttribute("disabled")},b.prototype.disable=function(){a.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},b.prototype.handleKeyPress=function(b){32!==b.which&&13!==b.which&&a.prototype.handleKeyPress.call(this,b)},b}(i["default"]);k["default"].registerComponent("Button",o),c["default"]=o},{3:3,5:5,86:86,88:88}],3:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(81),l=d(k),m=a(82),n=d(m),o=a(83),p=d(o),q=a(86),r=e(q),s=a(94),t=e(s),u=a(88),v=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.emitTapEvents(),e.enable(),e}return h(b,a),b.prototype.createEl=function(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};c=(0,u.assign)({className:this.buildCSSClass(),tabIndex:0},c),"button"===b&&r["default"].error("Creating a ClickableComponent with an HTML element of "+b+" is not supported; use a Button instead."),d=(0,u.assign)({role:"button","aria-live":"polite"},d),this.tabIndex_=c.tabIndex;var e=a.prototype.createEl.call(this,b,c,d);return this.createControlTextEl(e),e},b.prototype.createControlTextEl=function(a){return this.controlTextEl_=l.createEl("span",{className:"vjs-control-text"}),a&&a.appendChild(this.controlTextEl_),this.controlText(this.controlText_,a),this.controlTextEl_},b.prototype.controlText=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(!a)return this.controlText_||"Need Text";var c=this.localize(a);return this.controlText_=a,this.controlTextEl_.innerHTML=c,this.nonIconControl||b.setAttribute("title",c),this},b.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+a.prototype.buildCSSClass.call(this)},b.prototype.enable=function(){return this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!=typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on("tap",this.handleClick),this.on("click",this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this},b.prototype.disable=function(){return this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!=typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("tap",this.handleClick),this.off("click",this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this},b.prototype.handleClick=function(a){},b.prototype.handleFocus=function(a){n.on(t["default"],"keydown",p.bind(this,this.handleKeyPress))},b.prototype.handleKeyPress=function(b){32===b.which||13===b.which?(b.preventDefault(),this.handleClick(b)):a.prototype.handleKeyPress&&a.prototype.handleKeyPress.call(this,b)},b.prototype.handleBlur=function(a){n.off(t["default"],"keydown",p.bind(this,this.handleKeyPress))},b}(j["default"]);j["default"].registerComponent("ClickableComponent",v),c["default"]=v},{5:5,81:81,82:82,83:83,86:86,88:88,94:94}],4:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(2),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return g.controlText(d&&d.controlText||g.localize("Close")),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){this.trigger({type:"close",bubbles:!1})},b}(i["default"]);k["default"].registerComponent("CloseButton",l),c["default"]=l},{2:2,5:5}],5:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a(95),h=e(g),i=a(81),j=d(i),k=a(83),l=d(k),m=a(85),n=d(m),o=a(82),p=d(o),q=a(86),r=e(q),s=a(91),t=e(s),u=a(87),v=e(u),w=function(){function a(b,c,d){if(f(this,a),!b&&this.play?this.player_=b=this:this.player_=b,this.options_=(0,v["default"])({},this.options_),c=this.options_=(0,v["default"])(this.options_,c),this.id_=c.id||c.el&&c.el.id,!this.id_){var e=b&&b.id&&b.id()||"no_player";this.id_=e+"_component_"+n.newGUID()}this.name_=c.name||null,c.el?this.el_=c.el:c.createEl!==!1&&(this.el_=this.createEl()),this.children_=[],this.childIndex_={},this.childNameIndex_={},c.initChildren!==!1&&this.initChildren(),this.ready(d),c.reportTouchActivity!==!1&&this.enableTouchActivity()}return a.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var a=this.children_.length-1;a>=0;a--)this.children_[a].dispose&&this.children_[a].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.off(),this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),j.removeElData(this.el_),this.el_=null},a.prototype.player=function(){return this.player_},a.prototype.options=function(a){return r["default"].warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),a?(this.options_=(0,v["default"])(this.options_,a),this.options_):this.options_},a.prototype.el=function(){return this.el_},a.prototype.createEl=function(a,b,c){return j.createEl(a,b,c)},a.prototype.localize=function(a){var b=this.player_.language&&this.player_.language(),c=this.player_.languages&&this.player_.languages();if(!b||!c)return a;var d=c[b];if(d&&d[a])return d[a];var e=b.split("-")[0],f=c[e];return f&&f[a]?f[a]:a},a.prototype.contentEl=function(){return this.contentEl_||this.el_},a.prototype.id=function(){return this.id_},a.prototype.name=function(){return this.name_},a.prototype.children=function(){return this.children_},a.prototype.getChildById=function(a){return this.childIndex_[a]},a.prototype.getChild=function(a){if(a)return a=(0,t["default"])(a),this.childNameIndex_[a]},a.prototype.addChild=function(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,e=void 0,f=void 0;if("string"==typeof b){f=(0,t["default"])(b),c||(c={}),c===!0&&(r["default"].warn("Initializing a child component with `true` is deprecated.Children should be defined in an array when possible, but if necessary use an object instead of `true`."),c={});var g=c.componentClass||f;c.name=f;var h=a.getComponent(g);if(!h)throw new Error("Component "+g+" does not exist");if("function"!=typeof h)return null;e=new h(this.player_||this,c)}else e=b;if(this.children_.splice(d,0,e),"function"==typeof e.id&&(this.childIndex_[e.id()]=e),f=f||e.name&&(0,t["default"])(e.name()),f&&(this.childNameIndex_[f]=e),"function"==typeof e.el&&e.el()){var i=this.contentEl().children,j=i[d]||null;this.contentEl().insertBefore(e.el(),j)}return e},a.prototype.removeChild=function(a){if("string"==typeof a&&(a=this.getChild(a)),a&&this.children_){for(var b=!1,c=this.children_.length-1;c>=0;c--)if(this.children_[c]===a){b=!0,this.children_.splice(c,1);break}if(b){this.childIndex_[a.id()]=null,this.childNameIndex_[a.name()]=null;var d=a.el();d&&d.parentNode===this.contentEl()&&this.contentEl().removeChild(a.el())}}},a.prototype.initChildren=function(){var b=this,c=this.options_.children;if(c){var d=this.options_,e=function(a){var c=a.name,e=a.opts;if(void 0!==d[c]&&(e=d[c]),e!==!1){e===!0&&(e={}),e.playerOptions=b.options_.playerOptions;var f=b.addChild(c,e);f&&(b[c]=f)}},f=void 0,g=a.getComponent("Tech");f=Array.isArray(c)?c:Object.keys(c),f.concat(Object.keys(this.options_).filter(function(a){return!f.some(function(b){return"string"==typeof b?a===b:a===b.name})})).map(function(a){var d=void 0,e=void 0;return"string"==typeof a?(d=a,e=c[d]||b.options_[d]||{}):(d=a.name,e=a),{name:d,opts:e}}).filter(function(b){var c=a.getComponent(b.opts.componentClass||(0,t["default"])(b.name));return c&&!g.isTech(c)}).forEach(e)}},a.prototype.buildCSSClass=function(){return""},a.prototype.on=function(a,b,c){var d=this;if("string"==typeof a||Array.isArray(a))p.on(this.el_,a,l.bind(this,b));else{var e=a,f=b,g=l.bind(this,c),h=function(){return d.off(e,f,g)};h.guid=g.guid,this.on("dispose",h);var i=function(){return d.off("dispose",h)};i.guid=g.guid,a.nodeName?(p.on(e,f,g),p.on(e,"dispose",i)):"function"==typeof a.on&&(e.on(f,g),e.on("dispose",i))}return this},a.prototype.off=function(a,b,c){if(!a||"string"==typeof a||Array.isArray(a))p.off(this.el_,a,b);else{var d=a,e=b,f=l.bind(this,c);this.off("dispose",f),a.nodeName?(p.off(d,e,f),p.off(d,"dispose",f)):(d.off(e,f),d.off("dispose",f))}return this},a.prototype.one=function(a,b,c){var d=this,e=arguments;if("string"==typeof a||Array.isArray(a))p.one(this.el_,a,l.bind(this,b));else{var f=a,g=b,h=l.bind(this,c),i=function j(){d.off(f,g,j),h.apply(null,e)};i.guid=h.guid,this.on(f,g,i)}return this},a.prototype.trigger=function(a,b){return p.trigger(this.el_,a,b),this},a.prototype.ready=function(a){var b=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a&&(this.isReady_?b?a.call(this):this.setTimeout(a,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(a))),this},a.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var a=this.readyQueue_;this.readyQueue_=[],a&&a.length>0&&a.forEach(function(a){a.call(this)},this),this.trigger("ready")},1)},a.prototype.$=function(a,b){return j.$(a,b||this.contentEl())},a.prototype.$$=function(a,b){return j.$$(a,b||this.contentEl())},a.prototype.hasClass=function(a){return j.hasElClass(this.el_,a)},a.prototype.addClass=function(a){return j.addElClass(this.el_,a),this},a.prototype.removeClass=function(a){return j.removeElClass(this.el_,a),this},a.prototype.toggleClass=function(a,b){return j.toggleElClass(this.el_,a,b),this},a.prototype.show=function(){return this.removeClass("vjs-hidden"),this},a.prototype.hide=function(){return this.addClass("vjs-hidden"),this},a.prototype.lockShowing=function(){return this.addClass("vjs-lock-showing"),this},a.prototype.unlockShowing=function(){return this.removeClass("vjs-lock-showing"),this},a.prototype.getAttribute=function(a){return j.getAttribute(this.el_,a)},a.prototype.setAttribute=function(a,b){return j.setAttribute(this.el_,a,b),this},a.prototype.removeAttribute=function(a){return j.removeAttribute(this.el_,a),this},a.prototype.width=function(a,b){return this.dimension("width",a,b)},a.prototype.height=function(a,b){return this.dimension("height",a,b)},a.prototype.dimensions=function(a,b){return this.width(a,!0).height(b)},a.prototype.dimension=function(a,b,c){if(void 0!==b)return null!==b&&b===b||(b=0),(""+b).indexOf("%")!==-1||(""+b).indexOf("px")!==-1?this.el_.style[a]=b:"auto"===b?this.el_.style[a]="":this.el_.style[a]=b+"px",c||this.trigger("resize"),this;if(!this.el_)return 0;var d=this.el_.style[a],e=d.indexOf("px");return e!==-1?parseInt(d.slice(0,e),10):parseInt(this.el_["offset"+(0,t["default"])(a)],10)},a.prototype.currentDimension=function(a){var b=0;if("width"!==a&&"height"!==a)throw new Error("currentDimension only accepts width or height value");if("function"==typeof h["default"].getComputedStyle){var c=h["default"].getComputedStyle(this.el_);b=c.getPropertyValue(a)||c[a]}if(b=parseFloat(b),0===b){var d="offset"+(0,t["default"])(a);b=this.el_[d]}return b},a.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},a.prototype.currentWidth=function(){return this.currentDimension("width")},a.prototype.currentHeight=function(){return this.currentDimension("height")},a.prototype.focus=function(){this.el_.focus()},a.prototype.blur=function(){this.el_.blur()},a.prototype.emitTapEvents=function(){var a=0,b=null,c=10,d=200,e=void 0;this.on("touchstart",function(c){1===c.touches.length&&(b={pageX:c.touches[0].pageX,pageY:c.touches[0].pageY},a=(new Date).getTime(),e=!0)}),this.on("touchmove",function(a){if(a.touches.length>1)e=!1;else if(b){var d=a.touches[0].pageX-b.pageX,f=a.touches[0].pageY-b.pageY,g=Math.sqrt(d*d+f*f);g>c&&(e=!1)}});var f=function(){e=!1};this.on("touchleave",f),this.on("touchcancel",f),this.on("touchend",function(c){if(b=null,e===!0){var f=(new Date).getTime()-a;f0&&Object.keys(d.players).map(function(a){return d.players[a]}).every(Boolean))throw new Error("Can not register Player component after player has been created")}return a.components_[b]=c,c}},a.getComponent=function(b){if(b)return b=(0,t["default"])(b),a.components_&&a.components_[b]?a.components_[b]:h["default"]&&h["default"].videojs&&h["default"].videojs[b]?(r["default"].warn("The "+b+" component was added to the videojs object when it should be registered using videojs.registerComponent(name, component)"),h["default"].videojs[b]):void 0},a.extend=function(b){b=b||{},r["default"].warn("Component.extend({}) has been deprecated, use videojs.extend(Component, {}) instead");var c=b.init||b.init||this.prototype.init||this.prototype.init||function(){},d=function(){c.apply(this,arguments)};d.prototype=Object.create(this.prototype),d.prototype.constructor=d,d.extend=a.extend;for(var e in b)b.hasOwnProperty(e)&&(d.prototype[e]=b[e]);return d},a}();w.registerComponent("Component",w),c["default"]=w},{81:81,82:82,83:83,85:85,86:86,87:87,91:91,95:95}],6:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(36),i=d(h),j=a(5),k=d(j),l=a(7),m=d(l),n=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(this,b),d.tracks=c.audioTracks&&c.audioTracks();var g=f(this,a.call(this,c,d));return g.el_.setAttribute("aria-label","Audio Menu"),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-audio-button "+a.prototype.buildCSSClass.call(this)},b.prototype.createItems=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=this.player_.audioTracks&&this.player_.audioTracks();if(!b)return a;for(var c=0;c'+this.localize("Stream Type")+""+this.localize("LIVE")},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateShowing=function(a){this.player().duration()===1/0?this.show():this.hide()},b}(j["default"]);j["default"].registerComponent("LiveDisplay",m),c["default"]=m},{5:5,81:81}],11:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(2),j=e(i),k=a(5),l=e(k),m=a(81),n=d(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"volumechange",e.update),c.tech_&&c.tech_.featuresVolumeControl===!1&&e.addClass("vjs-hidden"),e.on(c,"loadstart",function(){this.update(),c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}),e}return h(b,a),b.prototype.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){this.player_.muted(!this.player_.muted())},b.prototype.update=function(a){var b=this.player_.volume(),c=3;0===b||this.player_.muted()?c=0:b<.33?c=1:b<.67&&(c=2);var d=this.player_.muted()?"Unmute":"Mute";this.controlText()!==d&&this.controlText(d);for(var e=0;e<4;e++)n.removeElClass(this.el_,"vjs-vol-"+e);n.addElClass(this.el_,"vjs-vol-"+c)},b}(j["default"]);o.prototype.controlText_="Mute",l["default"].registerComponent("MuteToggle",o),c["default"]=o},{2:2,5:5,81:81}],12:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(2),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return g.on(c,"play",g.handlePlay),g.on(c,"pause",g.handlePause),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){this.player_.paused()?this.player_.play():this.player_.pause()},b.prototype.handlePlay=function(a){this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},b.prototype.handlePause=function(a){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},b}(i["default"]);l.prototype.controlText_="Play",k["default"].registerComponent("PlayToggle",l),c["default"]=l},{2:2,5:5}],13:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(47),j=e(i),k=a(49),l=e(k),m=a(14),n=e(m),o=a(5),p=e(o),q=a(81),r=d(q),s=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.updateVisibility(),e.updateLabel(),e.on(c,"loadstart",e.updateVisibility),e.on(c,"ratechange",e.updateLabel),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this);return this.labelEl_=r.createEl("div",{className:"vjs-playback-rate-value",innerHTML:1}),b.appendChild(this.labelEl_),b},b.prototype.buildCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildCSSClass.call(this)},b.prototype.createMenu=function(){var a=new l["default"](this.player()),b=this.playbackRates();if(b)for(var c=b.length-1;c>=0;c--)a.addChild(new n["default"](this.player(),{ +rate:b[c]+"x"}));return a},b.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},b.prototype.handleClick=function(a){for(var b=this.player().playbackRate(),c=this.playbackRates(),d=c[0],e=0;eb){d=c[e];break}this.player().playbackRate(d)},b.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},b.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},b.prototype.updateVisibility=function(a){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},b.prototype.updateLabel=function(a){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},b}(j["default"]);s.prototype.controlText_="Playback Rate",p["default"].registerComponent("PlaybackRateMenuButton",s),c["default"]=s},{14:14,47:47,49:49,5:5,81:81}],14:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(48),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b);var g=d.rate,h=parseFloat(g,10);d.label=g,d.selected=1===h,d.selectable=!0;var i=f(this,a.call(this,c,d));return i.label=g,i.rate=h,i.on(c,"ratechange",i.update),i}return g(b,a),b.prototype.handleClick=function(b){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},b.prototype.update=function(a){this.selected(this.player().playbackRate()===this.rate)},b}(i["default"]);l.prototype.contentElType="button",k["default"].registerComponent("PlaybackRateMenuItem",l),c["default"]=l},{48:48,5:5}],15:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(81),l=d(k),m=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.partEls_=[],e.on(c,"progress",e.update),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},b.prototype.update=function(a){var b=this.player_.buffered(),c=this.player_.duration(),d=this.player_.bufferedEnd(),e=this.partEls_,f=function(a,b){var c=a/b||0;return 100*(c>=1?1:c)+"%"};this.el_.style.width=f(d,c);for(var g=0;gb.length;k--)this.el_.removeChild(e[k-1]);e.length=b.length},b}(j["default"]);j["default"].registerComponent("LoadProgressBar",m),c["default"]=m},{5:5,81:81}],16:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(81),l=d(k),m=a(83),n=d(m),o=a(84),p=e(o),q=a(80),r=e(q),s=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(e.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),e.keepTooltipsInside&&(e.tooltip=l.createEl("div",{className:"vjs-time-tooltip"}),e.el().appendChild(e.tooltip),e.addClass("vjs-keep-tooltips-inside")),e.update(0,0),c.on("ready",function(){e.on(c.controlBar.progressControl.el(),"mousemove",n.throttle(n.bind(e,e.handleMouseMove),25))}),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},b.prototype.handleMouseMove=function(a){var b=this.player_.duration(),c=this.calculateDistance(a)*b,d=a.pageX-l.findElPosition(this.el().parentNode).left;this.update(c,d)},b.prototype.update=function(a,b){var c=(0,p["default"])(a,this.player_.duration());if(this.el().style.left=b+"px",this.el().setAttribute("data-current-time",c),this.keepTooltipsInside){var d=this.clampPosition_(b),e=b-d+1,f=parseFloat((0,r["default"])(this.tooltip,"width")),g=f/2;this.tooltip.innerHTML=c,this.tooltip.style.right="-"+(g-e)+"px"}},b.prototype.calculateDistance=function(a){return l.getPointerPosition(this.el().parentNode,a).x},b.prototype.clampPosition_=function(a){if(!this.keepTooltipsInside)return a;var b=parseFloat((0,r["default"])(this.player().el(),"width")),c=parseFloat((0,r["default"])(this.tooltip,"width")),d=c/2,e=a;return ab-d&&(e=Math.floor(b-d)),e},b}(j["default"]);j["default"].registerComponent("MouseTimeDisplay",s),c["default"]=s},{5:5,80:80,81:81,83:83,84:84}],17:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(83),l=d(k),m=a(84),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.updateDataAttr(),e.on(c,"timeupdate",e.updateDataAttr),c.ready(l.bind(e,e.updateDataAttr)),d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(e.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),e.keepTooltipsInside&&e.addClass("vjs-keep-tooltips-inside"),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},b.prototype.updateDataAttr=function(a){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("data-current-time",(0,n["default"])(b,this.player_.duration()))},b}(j["default"]);j["default"].registerComponent("PlayProgressBar",o),c["default"]=o},{5:5,83:83,84:84}],18:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h);a(19),a(16);var j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},b}(i["default"]);j.prototype.options_={children:["seekBar"]},i["default"].registerComponent("ProgressControl",j),c["default"]=j},{16:16,19:19,5:5}],19:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(57),j=e(i),k=a(5),l=e(k),m=a(83),n=d(m),o=a(84),p=e(o),q=a(80),r=e(q);a(15),a(17),a(20);var s=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"timeupdate",e.updateProgress),e.on(c,"ended",e.updateProgress),c.ready(n.bind(e,e.updateProgress)),d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(e.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),e.keepTooltipsInside&&(e.tooltipProgressBar=e.addChild("TooltipProgressBar")),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":"progress bar"})},b.prototype.updateProgress=function(a){if(this.updateAriaAttributes(this.el_),this.keepTooltipsInside){this.updateAriaAttributes(this.tooltipProgressBar.el_),this.tooltipProgressBar.el_.style.width=this.bar.el_.style.width;var b=parseFloat((0,r["default"])(this.player().el(),"width")),c=parseFloat((0,r["default"])(this.tooltipProgressBar.tooltip,"width")),d=this.tooltipProgressBar.el().style;d.maxWidth=Math.floor(b-c/2)+"px",d.minWidth=Math.ceil(c/2)+"px",d.right="-"+c/2+"px"}},b.prototype.updateAriaAttributes=function(a){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.setAttribute("aria-valuenow",(100*this.getPercent()).toFixed(2)),a.setAttribute("aria-valuetext",(0,p["default"])(b,this.player_.duration()))},b.prototype.getPercent=function(){var a=this.player_.currentTime()/this.player_.duration();return a>=1?1:a},b.prototype.handleMouseDown=function(b){this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,b)},b.prototype.handleMouseMove=function(a){var b=this.calculateDistance(a)*this.player_.duration();b===this.player_.duration()&&(b-=.1),this.player_.currentTime(b)},b.prototype.handleMouseUp=function(b){a.prototype.handleMouseUp.call(this,b),this.player_.scrubbing(!1),this.videoWasPlaying&&this.player_.play()},b.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},b.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},b}(j["default"]);s.prototype.options_={children:["loadProgressBar","mouseTimeDisplay","playProgressBar"],barName:"playProgressBar"},s.prototype.playerEvent="timeupdate",l["default"].registerComponent("SeekBar",s),c["default"]=s},{15:15,17:17,20:20,5:5,57:57,80:80,83:83,84:84}],20:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(83),l=d(k),m=a(84),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.updateDataAttr(),e.on(c,"timeupdate",e.updateDataAttr),c.ready(l.bind(e,e.updateDataAttr)),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-tooltip-progress-bar vjs-slider-bar",innerHTML:'
\n '+this.localize("Progress")+": 0%"});return this.tooltip=b.querySelector(".vjs-time-tooltip"),b},b.prototype.updateDataAttr=function(a){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),c=(0,n["default"])(b,this.player_.duration());this.el_.setAttribute("data-current-time",c),this.tooltip.innerHTML=c},b}(j["default"]);j["default"].registerComponent("TooltipProgressBar",o),c["default"]=o},{5:5,83:83,84:84}],21:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(22),i=d(h),j=a(5),k=d(j),l=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,{className:this.buildCSSClass()});return b.innerHTML=" ",b},b}(i["default"]);k["default"].registerComponent("CustomControlSpacer",l),c["default"]=l},{22:22,5:5}],22:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},b}(i["default"]);i["default"].registerComponent("Spacer",j),c["default"]=j},{5:5}],23:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(31),i=d(h),j=a(5),k=d(j),l=function(a){function b(c,d){e(this,b),d.track={player:c,kind:d.kind,label:d.kind+" settings",selectable:!1,"default":!1,mode:"disabled"},d.selectable=!1;var g=f(this,a.call(this,c,d));return g.addClass("vjs-texttrack-settings"),g.controlText(", opens "+d.kind+" settings dialog"),g}return g(b,a),b.prototype.handleClick=function(a){this.player().getChild("textTrackSettings").show(),this.player().getChild("textTrackSettings").el_.focus()},b}(i["default"]);k["default"].registerComponent("CaptionSettingsMenuItem",l),c["default"]=l},{31:31,5:5}],24:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(30),i=d(h),j=a(5),k=d(j),l=a(23),m=d(l),n=function(a){function b(c,d,g){e(this,b);var h=f(this,a.call(this,c,d,g));return h.el_.setAttribute("aria-label","Captions Menu"),h}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-captions-button "+a.prototype.buildCSSClass.call(this)},b.prototype.createItems=function(){var b=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||(b.push(new m["default"](this.player_,{kind:this.kind_})),this.hideThreshold_+=1),a.prototype.createItems.call(this,b)},b}(i["default"]);n.prototype.kind_="captions",n.prototype.controlText_="Captions",k["default"].registerComponent("CaptionsButton",n),c["default"]=n},{23:23,30:30,5:5}],25:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(30),i=d(h),j=a(5),k=d(j),l=a(26),m=d(l),n=a(91),o=d(n),p=function(a){function b(c,d,g){e(this,b);var h=f(this,a.call(this,c,d,g));return h.el_.setAttribute("aria-label","Chapters Menu"),h}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildCSSClass.call(this)},b.prototype.update=function(b){this.track_&&(!b||"addtrack"!==b.type&&"removetrack"!==b.type)||this.setTrack(this.findChaptersTrack()),a.prototype.update.call(this)},b.prototype.setTrack=function(a){if(this.track_!==a){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var b=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);b&&b.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=a,this.track_){this.track_.mode="hidden";var c=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);c&&c.addEventListener("load",this.updateHandler_)}}},b.prototype.findChaptersTrack=function(){for(var a=this.player_.textTracks()||[],b=a.length-1;b>=0;b--){var c=a[b];if(c.kind===this.kind_)return c}},b.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize((0,o["default"])(this.kind_))},b.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),a.prototype.createMenu.call(this)},b.prototype.createItems=function(){var a=[];if(!this.track_)return a;var b=this.track_.cues;if(!b)return a;for(var c=0,d=b.length;c1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),d.tracks=c.textTracks(),f(this,a.call(this,c,d))}return g(b,a),b.prototype.createItems=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a.push(new o["default"](this.player_,{kind:this.kind_})),this.hideThreshold_+=1;var b=this.player_.textTracks();if(!b)return a;for(var c=0;cCurrent Time 0:00'},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(a){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),c=this.localize("Current Time"),d=(0,n["default"])(b,this.player_.duration());d!==this.formattedTime_&&(this.formattedTime_=d,this.contentEl_.innerHTML=''+c+" "+d)},b}(j["default"]);j["default"].registerComponent("CurrentTimeDisplay",o),c["default"]=o},{5:5,81:81,84:84}],33:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(81),l=d(k),m=a(84),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"durationchange",e.updateContent),e.on(c,"timeupdate",e.updateContent),e.on(c,"loadedmetadata",e.updateContent),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-duration vjs-time-control vjs-control"});return this.contentEl_=l.createEl("div",{className:"vjs-duration-display",innerHTML:''+this.localize("Duration Time")+" 0:00"},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(a){var b=this.player_.duration();if(b&&this.duration_!==b){this.duration_=b;var c=this.localize("Duration Time"),d=(0,n["default"])(b);this.contentEl_.innerHTML=''+c+" "+d}},b}(j["default"]);j["default"].registerComponent("DurationDisplay",o),c["default"]=o},{5:5,81:81,84:84}],34:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(81),l=d(k),m=a(84),n=e(m),o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"timeupdate",e.updateContent),e.on(c,"durationchange",e.updateContent),e}return h(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-remaining-time vjs-time-control vjs-control"});return this.contentEl_=l.createEl("div",{className:"vjs-remaining-time-display",innerHTML:''+this.localize("Remaining Time")+" -0:00"},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(a){if(this.player_.duration()){var b=this.localize("Remaining Time"),c=(0,n["default"])(this.player_.remainingTime());c!==this.formattedTime_&&(this.formattedTime_=c,this.contentEl_.innerHTML=''+b+" -"+c)}},b}(j["default"]);j["default"].registerComponent("RemainingTimeDisplay",o),c["default"]=o},{5:5,81:81,84:84}],35:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},b}(i["default"]);i["default"].registerComponent("TimeDivider",j),c["default"]=j},{5:5}],36:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(47),j=e(i),k=a(5),l=e(k),m=a(83),n=d(m),o=function(a){function b(c,d){f(this,b);var e=d.tracks,h=g(this,a.call(this,c,d));if(h.items.length<=1&&h.hide(),!e)return g(h);var i=n.bind(h,h.update);return e.addEventListener("removetrack",i),e.addEventListener("addtrack",i),h.player_.on("dispose",function(){e.removeEventListener("removetrack",i),e.removeEventListener("addtrack",i)}),h}return h(b,a),b}(j["default"]);l["default"].registerComponent("TrackButton",o),c["default"]=o},{47:47,5:5,83:83}],37:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(57),j=e(i),k=a(5),l=e(k),m=a(83),n=d(m);a(39);var o=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.on(c,"volumechange",e.updateARIAAttributes),c.ready(n.bind(e,e.updateARIAAttributes)),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":"volume level"})},b.prototype.handleMouseMove=function(a){this.checkMuted(),this.player_.volume(this.calculateDistance(a))},b.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},b.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},b.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},b.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},b.prototype.updateARIAAttributes=function(a){var b=(100*this.player_.volume()).toFixed(2);this.el_.setAttribute("aria-valuenow",b),this.el_.setAttribute("aria-valuetext",b+"%")},b}(j["default"]);o.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},o.prototype.playerEvent="volumechange",l["default"].registerComponent("VolumeBar",o),c["default"]=o},{39:39,5:5,57:57,83:83}],38:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h);a(37);var j=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return c.tech_&&c.tech_.featuresVolumeControl===!1&&g.addClass("vjs-hidden"),g.on(c,"loadstart",function(){c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}),g}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control"})},b}(i["default"]);j.prototype.options_={children:["volumeBar"]},i["default"].registerComponent("VolumeControl",j),c["default"]=j},{37:37,5:5}],39:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=function(a){function b(){return e(this,b),f(this,a.apply(this,arguments))}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},b}(i["default"]);i["default"].registerComponent("VolumeLevel",j),c["default"]=j},{5:5}],40:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(83),j=e(i),k=a(5),l=d(k),m=a(54),n=d(m),o=a(53),p=d(o),q=a(11),r=d(q),s=a(37),t=d(s),u=function(a){function b(c){function d(){c.tech_&&c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};f(this,b),void 0===e.inline&&(e.inline=!0),void 0===e.vertical&&(e.inline?e.vertical=!1:e.vertical=!0),e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=!!e.vertical;var h=g(this,a.call(this,c,e));return h.on(c,"volumechange",h.volumeUpdate),h.on(c,"loadstart",h.volumeUpdate),d.call(h),h.on(c,"loadstart",d),h.on(h.volumeBar,["slideractive","focus"],function(){this.addClass("vjs-slider-active")}),h.on(h.volumeBar,["sliderinactive","blur"],function(){this.removeClass("vjs-slider-active")}),h.on(h.volumeBar,["focus"],function(){this.addClass("vjs-lock-showing")}),h.on(h.volumeBar,["blur"],function(){this.removeClass("vjs-lock-showing")}),h}return h(b,a),b.prototype.buildCSSClass=function(){var b="";return b=this.options_.vertical?"vjs-volume-menu-button-vertical":"vjs-volume-menu-button-horizontal","vjs-volume-menu-button "+a.prototype.buildCSSClass.call(this)+" "+b},b.prototype.createPopup=function(){var a=new n["default"](this.player_,{contentElType:"div"}),b=new t["default"](this.player_,this.options_.volumeBar);return a.addChild(b),this.menuContent=a,this.volumeBar=b,this.attachVolumeBarEvents(),a},b.prototype.handleClick=function(b){r["default"].prototype.handleClick.call(this),a.prototype.handleClick.call(this)},b.prototype.attachVolumeBarEvents=function(){this.menuContent.on(["mousedown","touchdown"],j.bind(this,this.handleMouseDown))},b.prototype.handleMouseDown=function(a){this.on(["mousemove","touchmove"],j.bind(this.volumeBar,this.volumeBar.handleMouseMove)),this.on(this.el_.ownerDocument,["mouseup","touchend"],this.handleMouseUp)},b.prototype.handleMouseUp=function(a){this.off(["mousemove","touchmove"],j.bind(this.volumeBar,this.volumeBar.handleMouseMove))},b}(p["default"]);u.prototype.volumeUpdate=r["default"].prototype.update,u.prototype.controlText_="Mute",l["default"].registerComponent("VolumeMenuButton",u),c["default"]=u},{11:11,37:37,5:5,53:53,54:54,83:83}],41:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=a(50),k=d(j),l=a(87),m=d(l),n=function(a){function b(c,d){e(this,b);var g=f(this,a.call(this,c,d));return g.on(c,"error",g.open),g}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},b.prototype.content=function(){var a=this.player().error();return a?this.localize(a.message):""},b}(k["default"]);n.prototype.options_=(0,m["default"])(k["default"].prototype.options_,{fillAlways:!0,temporary:!1,uncloseable:!0}),i["default"].registerComponent("ErrorDisplay",n),c["default"]=n},{5:5,50:50,87:87}],42:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}c.__esModule=!0;var e=a(82),f=d(e),g=function(){};g.prototype.allowedEvents_={},g.prototype.on=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},f.on(this,a,b),this.addEventListener=c},g.prototype.addEventListener=g.prototype.on,g.prototype.off=function(a,b){f.off(this,a,b)},g.prototype.removeEventListener=g.prototype.off,g.prototype.one=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},f.one(this,a,b),this.addEventListener=c},g.prototype.trigger=function(a){var b=a.type||a;"string"==typeof a&&(a={type:b}),a=f.fixEvent(a),this.allowedEvents_[b]&&this["on"+b]&&this["on"+b](a),f.trigger(this,a)},g.prototype.dispatchEvent=g.prototype.trigger,c["default"]=g},{82:82}],43:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},f=a(86),g=d(f),h=a(88),i=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof b?"undefined":e(b)));a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.super_=b)},j=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=function(){a.apply(this,arguments)},d={};(0,h.isObject)(b)?("function"==typeof b.init&&(g["default"].warn("Constructor logic via init() is deprecated; please use constructor() instead."),b.constructor=b.init),b.constructor!==Object.prototype.constructor&&(c=b.constructor),d=b):"function"==typeof b&&(c=b),i(c,a);for(var e in d)d.hasOwnProperty(e)&&(c.prototype[e]=d[e]);return c};c["default"]=j},{86:86,88:88}],44:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;for(var e=a(94),f=d(e),g={},h=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=h[0],j=void 0,k=0;k1&&void 0!==arguments[1]?arguments[1]:{};f(this,b);var e=g(this,a.call(this,c,d));return e.update(),e.enabled_=!0,e.el_.setAttribute("aria-haspopup","true"),e.el_.setAttribute("role","menuitem"),e.on("keydown",e.handleSubmenuKeyPress),e}return h(b,a),b.prototype.update=function(){var a=this.createMenu();this.menu&&this.removeChild(this.menu),this.menu=a,this.addChild(a),this.buttonPressed_=!1,this.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},b.prototype.createMenu=function(){var a=new n["default"](this.player_);if(this.hideThreshold_=0,this.options_.title){var b=p.createEl("li",{className:"vjs-menu-title",innerHTML:(0,t["default"])(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,a.children_.unshift(b),p.insertElFirst(b,a.contentEl())}if(this.items=this.createItems(),this.items)for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:0,b=this.children().slice(),c=b.length&&b[0].className&&/vjs-menu-title/.test(b[0].className);c&&b.shift(),b.length>0&&(a<0?a=0:a>=b.length&&(a=b.length-1),this.focusedChild_=a,b[a].el_.focus())},b}(j["default"]);j["default"].registerComponent("Menu",q),c["default"]=q},{5:5,81:81,82:82,83:83}],50:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(81),j=e(i),k=a(83),l=e(k),m=a(5),n=d(m),o="vjs-modal-dialog",p=27,q=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.opened_=e.hasBeenOpened_=e.hasBeenFilled_=!1,e.closeable(!e.options_.uncloseable),e.content(e.options_.content),e.contentEl_=j.createEl("div",{className:o+"-content"},{role:"document"}),e.descEl_=j.createEl("p",{className:o+"-description vjs-offscreen",id:e.el().getAttribute("aria-describedby")}),j.textContent(e.descEl_,e.description()),e.el_.appendChild(e.descEl_),e.el_.appendChild(e.contentEl_),e}return h(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},b.prototype.buildCSSClass=function(){return o+" vjs-hidden "+a.prototype.buildCSSClass.call(this)},b.prototype.handleKeyPress=function(a){a.which===p&&this.closeable()&&this.close()},b.prototype.label=function(){return this.options_.label||this.localize("Modal Window")},b.prototype.description=function(){var a=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(a+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),a},b.prototype.open=function(){if(!this.opened_){var a=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!a.paused(),this.wasPlaying_&&a.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",l.bind(this,this.handleKeyPress)),a.controls(!1),this.show(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}return this},b.prototype.opened=function(a){return"boolean"==typeof a&&this[a?"open":"close"](),this.opened_},b.prototype.close=function(){if(this.opened_){var a=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&a.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",l.bind(this,this.handleKeyPress)),a.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.options_.temporary&&this.dispose()}return this},b.prototype.closeable=function c(a){if("boolean"==typeof a){var c=this.closeable_=!!a,b=this.getChild("closeButton");if(c&&!b){var d=this.contentEl_;this.contentEl_=this.el_,b=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=d,this.on(b,"close",this.close)}!c&&b&&(this.off(b,"close",this.close),this.removeChild(b),b.dispose())}return this.closeable_},b.prototype.fill=function(){return this.fillWith(this.content())},b.prototype.fillWith=function(a){var b=this.contentEl(),c=b.parentNode,d=b.nextSibling;return this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,c.removeChild(b),this.empty(),j.insertContent(b,a),this.trigger("modalfill"),d?c.insertBefore(b,d):c.appendChild(b), +this},b.prototype.empty=function(){return this.trigger("beforemodalempty"),j.emptyEl(this.contentEl()),this.trigger("modalempty"),this},b.prototype.content=function(a){return"undefined"!=typeof a&&(this.content_=a),this.content_},b}(n["default"]);q.prototype.options_={temporary:!0},n["default"].registerComponent("ModalDialog",q),c["default"]=q},{5:5,81:81,83:83}],51:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(94),l=e(k),m=a(95),n=e(m),o=a(82),p=d(o),q=a(81),r=d(q),s=a(83),t=d(s),u=a(85),v=d(u),w=a(78),x=d(w),y=a(86),z=e(y),A=a(91),B=e(A),C=a(90),D=a(79),E=a(89),F=d(E),G=a(44),H=e(G),I=a(46),J=e(I),K=a(97),L=e(K),M=a(88),N=a(87),O=e(N),P=a(69),Q=e(P),R=a(50),S=e(R),T=a(62),U=e(T),V=a(63),W=e(V),X=a(76),Y=e(X);a(61),a(59),a(55),a(68),a(45),a(1),a(4),a(8),a(41),a(71),a(60);var Z=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","ratechange","volumechange","texttrackchange"],$=function(a){function b(c,d,e){if(f(this,b),c.id=c.id||"vjs_video_"+v.newGUID(),d=(0,M.assign)(b.getTagSettings(c),d),d.initChildren=!1,d.createEl=!1,d.reportTouchActivity=!1,!d.language)if("function"==typeof c.closest){var h=c.closest("[lang]");h&&(d.language=h.getAttribute("lang"))}else for(var i=c;i&&1===i.nodeType;){if(r.getElAttributes(i).hasOwnProperty("lang")){d.language=i.getAttribute("lang");break}i=i.parentNode}var j=g(this,a.call(this,null,d,e));if(!j.options_||!j.options_.techOrder||!j.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(j.tag=c,j.tagAttributes=c&&r.getElAttributes(c),j.language(j.options_.language),d.languages){var k={};Object.getOwnPropertyNames(d.languages).forEach(function(a){k[a.toLowerCase()]=d.languages[a]}),j.languages_=k}else j.languages_=b.prototype.options_.languages;j.cache_={},j.poster_=d.poster||"",j.controls_=!!d.controls,c.controls=!1,j.scrubbing_=!1,j.el_=j.createEl();var l=(0,O["default"])(j.options_);if(d.plugins){var m=d.plugins;Object.getOwnPropertyNames(m).forEach(function(a){"function"==typeof this[a]?this[a](m[a]):z["default"].error("Unable to find plugin:",a)},j)}return j.options_.playerOptions=l,j.initChildren(),j.isAudio("audio"===c.nodeName.toLowerCase()),j.controls()?j.addClass("vjs-controls-enabled"):j.addClass("vjs-controls-disabled"),j.el_.setAttribute("role","region"),j.isAudio()?j.el_.setAttribute("aria-label","audio player"):j.el_.setAttribute("aria-label","video player"),j.isAudio()&&j.addClass("vjs-audio"),j.flexNotSupported_()&&j.addClass("vjs-no-flex"),x.IS_IOS||j.addClass("vjs-workinghover"),b.players[j.id_]=j,j.userActive(!0),j.reportUserActivity(),j.listenForUserActivity_(),j.on("fullscreenchange",j.handleFullscreenChange_),j.on("stageclick",j.handleStageClick_),j}return h(b,a),b.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&this.styleEl_.parentNode.removeChild(this.styleEl_),b.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&this.tech_.dispose(),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var b=this.tag,c=void 0,d=this.playerElIngest_=b.parentNode&&b.parentNode.hasAttribute&&b.parentNode.hasAttribute("data-vjs-player");c=d?this.el_=b.parentNode:this.el_=a.prototype.createEl.call(this,"div"),b.setAttribute("tabindex","-1"),b.removeAttribute("width"),b.removeAttribute("height");var e=r.getElAttributes(b);if(Object.getOwnPropertyNames(e).forEach(function(a){"class"===a?c.className+=" "+e[a]:c.setAttribute(a,e[a])}),b.playerId=b.id,b.id+="_html5_api",b.className="vjs-tech",b.player=c.player=this,this.addClass("vjs-paused"),n["default"].VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=F.createStyleElement("vjs-styles-dimensions");var f=r.$(".vjs-styles-defaults"),g=r.$("head");g.insertBefore(this.styleEl_,f?f.nextSibling:g.firstChild)}this.width(this.options_.width),this.height(this.options_.height),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var h=b.getElementsByTagName("a"),i=0;i=0&&(c.width=a),b>=0&&(c.height=b)))}var d=void 0,e=void 0,f=void 0,g=void 0;f=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var h=f.split(":"),i=h[1]/h[0];d=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/i:this.videoWidth()||300,e=void 0!==this.height_?this.height_:d*i,g=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(g),F.setTextContent(this.styleEl_,"\n ."+g+" {\n width: "+d+"px;\n height: "+e+"px;\n }\n\n ."+g+".vjs-fluid {\n padding-top: "+100*i+"%;\n }\n ")},b.prototype.loadTech_=function(a,b){var c=this;this.tech_&&this.unloadTech_(),"Html5"!==a&&this.tag&&(U["default"].getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=a,this.isReady_=!1;var d=(0,M.assign)({source:b,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+a+"_api",videoTracks:this.videoTracks_,textTracks:this.textTracks_,audioTracks:this.audioTracks_,autoplay:this.options_.autoplay,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"]},this.options_[a.toLowerCase()]);this.tag&&(d.tag=this.tag),b&&(this.currentType_=b.type,b.src===this.cache_.src&&this.cache_.currentTime>0&&(d.startTime=this.cache_.currentTime),this.cache_.sources=null,this.cache_.source=b,this.cache_.src=b.src);var e=U["default"].getTech(a);e||(e=j["default"].getComponent(a)),this.tech_=new e(d),this.tech_.ready(t.bind(this,this.handleTechReady_),!0),Q["default"].jsonToTextTracks(this.textTracksJson_||[],this.tech_),Z.forEach(function(a){c.on(c.tech_,a,c["handleTech"+(0,B["default"])(a)+"_"])}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"canplay",this.handleTechCanPlay_),this.on(this.tech_,"canplaythrough",this.handleTechCanPlayThrough_),this.on(this.tech_,"playing",this.handleTechPlaying_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"seeked",this.handleTechSeeked_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===a&&this.tag||r.insertElFirst(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},b.prototype.unloadTech_=function(){this.videoTracks_=this.videoTracks(),this.textTracks_=this.textTracks(),this.audioTracks_=this.audioTracks(),this.textTracksJson_=Q["default"].textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1},b.prototype.tech=function(a){if(a&&a.IWillNotUseThisInPlugins)return this.tech_;var b="\n Please make sure that you are not using this inside of a plugin.\n To disable this alert and error, please pass in an object with\n `IWillNotUseThisInPlugins` to the `tech` method. See\n https://github.com/videojs/video.js/issues/2617 for more info.\n ";throw n["default"].alert(b),new Error(b)},b.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},b.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},b.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused()){try{delete this.tag.poster}catch(a){(0,z["default"])("deleting tag.poster throws in some browsers",a)}this.play()}},b.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay"))},b.prototype.hasStarted=function(a){return void 0!==a?(this.hasStarted_!==a&&(this.hasStarted_=a,a?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started")),this):!!this.hasStarted_},b.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},b.prototype.handleTechWaiting_=function(){var a=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return a.removeClass("vjs-waiting")})},b.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},b.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},b.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},b.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},b.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},b.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(z["default"].warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},b.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},b.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},b.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},b.prototype.handleTechClick_=function(a){0===a.button&&this.controls()&&(this.paused()?this.play():this.pause())},b.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},b.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},b.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},b.prototype.handleTechTouchEnd_=function(a){a.preventDefault()},b.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},b.prototype.handleStageClick_=function(){this.reportUserActivity()},b.prototype.handleTechFullscreenChange_=function(a,b){b&&this.isFullscreen(b.isFullscreen),this.trigger("fullscreenchange")},b.prototype.handleTechError_=function(){var a=this.tech_.error();this.error(a)},b.prototype.handleTechTextData_=function(){var a=null;arguments.length>1&&(a=arguments[1]),this.trigger("textdata",a)},b.prototype.getCache=function(){return this.cache_},b.prototype.techCall_=function(a,b){if(this.tech_&&!this.tech_.isReady_)this.tech_.ready(function(){this[a](b)},!0);else try{this.tech_&&this.tech_[a](b)}catch(c){throw(0,z["default"])(c),c}},b.prototype.techGet_=function(a){if(this.tech_&&this.tech_.isReady_)try{return this.tech_[a]()}catch(b){throw void 0===this.tech_[a]?(0,z["default"])("Video.js: "+a+" method not defined for "+this.techName_+" playback technology.",b):"TypeError"===b.name?((0,z["default"])("Video.js: "+a+" unavailable on "+this.techName_+" playback technology element.",b),this.tech_.isReady_=!1):(0,z["default"])(b),b}},b.prototype.play=function(){return this.src()||this.currentSrc()?this.techCall_("play"):this.tech_.one("loadstart",function(){this.play()}),this},b.prototype.pause=function(){return this.techCall_("pause"),this},b.prototype.paused=function(){return this.techGet_("paused")!==!1},b.prototype.scrubbing=function(a){return void 0!==a?(this.scrubbing_=!!a,a?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing"),this):this.scrubbing_},b.prototype.currentTime=function(a){return void 0!==a?(this.techCall_("setCurrentTime",a),this):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},b.prototype.duration=function(a){return void 0===a?this.cache_.duration||0:(a=parseFloat(a)||0,a<0&&(a=1/0),a!==this.cache_.duration&&(this.cache_.duration=a,a===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange")),this)},b.prototype.remainingTime=function(){return this.duration()-this.currentTime()},b.prototype.buffered=function c(){var c=this.techGet_("buffered");return c&&c.length||(c=(0,C.createTimeRange)(0,0)),c},b.prototype.bufferedPercent=function(){return(0,D.bufferedPercent)(this.buffered(),this.duration())},b.prototype.bufferedEnd=function(){var a=this.buffered(),b=this.duration(),c=a.end(a.length-1);return c>b&&(c=b),c},b.prototype.volume=function(a){var b=void 0;return void 0!==a?(b=Math.max(0,Math.min(1,parseFloat(a))),this.cache_.volume=b,this.techCall_("setVolume",b),this):(b=parseFloat(this.techGet_("volume")),isNaN(b)?1:b)},b.prototype.muted=function(a){return void 0!==a?(this.techCall_("setMuted",a),this):this.techGet_("muted")||!1},b.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},b.prototype.isFullscreen=function(a){return void 0!==a?(this.isFullscreen_=!!a,this):!!this.isFullscreen_},b.prototype.requestFullscreen=function(){var a=H["default"];return this.isFullscreen(!0),a.requestFullscreen?(p.on(l["default"],a.fullscreenchange,t.bind(this,function b(c){this.isFullscreen(l["default"][a.fullscreenElement]),this.isFullscreen()===!1&&p.off(l["default"],a.fullscreenchange,b),this.trigger("fullscreenchange")})),this.el_[a.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange")),this},b.prototype.exitFullscreen=function(){var a=H["default"];return this.isFullscreen(!1),a.requestFullscreen?l["default"][a.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange")),this},b.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=l["default"].documentElement.style.overflow,p.on(l["default"],"keydown",t.bind(this,this.fullWindowOnEscKey)),l["default"].documentElement.style.overflow="hidden",r.addElClass(l["default"].body,"vjs-full-window"),this.trigger("enterFullWindow")},b.prototype.fullWindowOnEscKey=function(a){27===a.keyCode&&(this.isFullscreen()===!0?this.exitFullscreen():this.exitFullWindow())},b.prototype.exitFullWindow=function(){this.isFullWindow=!1,p.off(l["default"],"keydown",this.fullWindowOnEscKey),l["default"].documentElement.style.overflow=this.docOrigOverflow,r.removeElClass(l["default"].body,"vjs-full-window"),this.trigger("exitFullWindow")},b.prototype.canPlayType=function(a){for(var b=void 0,c=0,d=this.options_.techOrder;c0&&(h=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},a))}},250)},b.prototype.playbackRate=function(a){return void 0!==a?(this.techCall_("setPlaybackRate",a),this):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("playbackRate"):1},b.prototype.isAudio=function(a){return void 0!==a?(this.isAudio_=!!a,this):!!this.isAudio_},b.prototype.videoTracks=function(){return this.tech_?this.tech_.videoTracks():(this.videoTracks_=this.videoTracks_||new Y["default"],this.videoTracks_)},b.prototype.audioTracks=function(){return this.tech_?this.tech_.audioTracks():(this.audioTracks_=this.audioTracks_||new W["default"],this.audioTracks_)},b.prototype.textTracks=function(){if(this.tech_)return this.tech_.textTracks()},b.prototype.remoteTextTracks=function(){if(this.tech_)return this.tech_.remoteTextTracks()},b.prototype.remoteTextTrackEls=function(){if(this.tech_)return this.tech_.remoteTextTrackEls()},b.prototype.addTextTrack=function(a,b,c){if(this.tech_)return this.tech_.addTextTrack(a,b,c)},b.prototype.addRemoteTextTrack=function(a,b){if(this.tech_)return this.tech_.addRemoteTextTrack(a,b)},b.prototype.removeRemoteTextTrack=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.track,c=void 0===b?arguments[0]:b;if(this.tech_)return this.tech_.removeRemoteTextTrack(c)},b.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},b.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},b.prototype.language=function(a){return void 0===a?this.language_:(this.language_=String(a).toLowerCase(),this)},b.prototype.languages=function(){return(0,O["default"])(b.prototype.options_.languages,this.languages_)},b.prototype.toJSON=function(){var a=(0,O["default"])(this.options_),b=a.tracks;a.tracks=[];for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:{};e(this,b);var g=f(this,a.call(this,c,d));return g.update(),g}return g(b,a),b.prototype.update=function(){var a=this.createPopup();this.popup&&this.removeChild(this.popup),this.popup=a,this.addChild(a),this.items&&0===this.items.length?this.hide():this.items&&this.items.length>1&&this.show()},b.prototype.createPopup=function(){},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},b.prototype.buildCSSClass=function(){var b="vjs-menu-button";return b+=this.options_.inline===!0?"-inline":"-popup","vjs-menu-button "+b+" "+a.prototype.buildCSSClass.call(this)},b}(i["default"]);k["default"].registerComponent("PopupButton",l),c["default"]=l},{3:3,5:5}],54:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(5),j=e(i),k=a(81),l=d(k),m=a(83),n=d(m),o=a(82),p=d(o),q=function(a){function b(){return f(this,b),g(this,a.apply(this,arguments))}return h(b,a),b.prototype.addItem=function(a){this.addChild(a),a.on("click",n.bind(this,function(){this.unlockShowing()}))},b.prototype.createEl=function(){var b=this.options_.contentElType||"ul";this.contentEl_=l.createEl(b,{className:"vjs-menu-content"});var c=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return c.appendChild(this.contentEl_),p.on(c,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),c},b}(j["default"]);j["default"].registerComponent("Popup",q),c["default"]=q},{5:5,81:81,82:82,83:83}],55:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(3),j=e(i),k=a(5),l=e(k),m=a(83),n=d(m),o=a(81),p=d(o),q=a(78),r=d(q),s=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.update(),c.on("posterchange",n.bind(e,e.update)),e}return h(b,a),b.prototype.dispose=function(){this.player().off("posterchange",this.update),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var a=p.createEl("div",{ +className:"vjs-poster",tabIndex:-1});return r.BACKGROUND_SIZE_SUPPORTED||(this.fallbackImg_=p.createEl("img"),a.appendChild(this.fallbackImg_)),a},b.prototype.update=function(a){var b=this.player().poster();this.setSrc(b),b?this.show():this.hide()},b.prototype.setSrc=function(a){if(this.fallbackImg_)this.fallbackImg_.src=a;else{var b="";a&&(b='url("'+a+'")'),this.el_.style.backgroundImage=b}},b.prototype.handleClick=function(a){this.player_.controls()&&(this.player_.paused()?this.player_.play():this.player_.pause())},b}(j["default"]);l["default"].registerComponent("PosterImage",s),c["default"]=s},{3:3,5:5,78:78,81:81,83:83}],56:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){b&&(p=b),n["default"].setTimeout(q,a)}c.__esModule=!0,c.hasLoaded=c.autoSetupTimeout=c.autoSetup=void 0;var g=a(81),h=e(g),i=a(82),j=e(i),k=a(94),l=d(k),m=a(95),n=d(m),o=!1,p=void 0,q=function(){if(h.isReal()){var a=l["default"].getElementsByTagName("video"),b=l["default"].getElementsByTagName("audio"),c=[];if(a&&a.length>0)for(var d=0,e=a.length;d0)for(var g=0,i=b.length;g0)for(var j=0,k=c.length;j1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c.className=c.className+" vjs-slider",c=(0,m.assign)({tabIndex:0},c),d=(0,m.assign)({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},d),a.prototype.createEl.call(this,b,c,d)},b.prototype.handleMouseDown=function(a){var b=this.bar.el_.ownerDocument;a.preventDefault(),l.blockTextSelection(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(b,"mousemove",this.handleMouseMove),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchmove",this.handleMouseMove),this.on(b,"touchend",this.handleMouseUp),this.handleMouseMove(a)},b.prototype.handleMouseMove=function(a){},b.prototype.handleMouseUp=function(){var a=this.bar.el_.ownerDocument;l.unblockTextSelection(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(a,"mousemove",this.handleMouseMove),this.off(a,"mouseup",this.handleMouseUp),this.off(a,"touchmove",this.handleMouseMove),this.off(a,"touchend",this.handleMouseUp),this.update()},b.prototype.update=function(){if(this.el_){var a=this.getPercent(),b=this.bar;if(b){("number"!=typeof a||a!==a||a<0||a===1/0)&&(a=0);var c=(100*a).toFixed(2)+"%";this.vertical()?b.el().style.height=c:b.el().style.width=c}}},b.prototype.calculateDistance=function(a){var b=l.getPointerPosition(this.el_,a);return this.vertical()?b.y:b.x},b.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepBack()):38!==a.which&&39!==a.which||(a.preventDefault(),this.stepForward())},b.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleClick=function(a){a.stopImmediatePropagation(),a.preventDefault()},b.prototype.vertical=function(a){return void 0===a?this.vertical_||!1:(this.vertical_=!!a,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal"),this)},b}(j["default"]);j["default"].registerComponent("Slider",n),c["default"]=n},{5:5,81:81,88:88}],58:[function(a,b,c){"use strict";function d(a){return a.streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},a.streamFromParts=function(a,b){return a+"&"+b},a.streamToParts=function(a){var b={connection:"",stream:""};if(!a)return b;var c=a.search(/&(?!\w+=)/),d=void 0;return c!==-1?d=c+1:(c=d=a.lastIndexOf("/")+1,0===c&&(c=d=a.length)),b.connection=a.substring(0,c),b.stream=a.substring(d,a.length),b},a.isStreamingType=function(b){return b in a.streamingFormats},a.RTMP_RE=/^rtmp[set]?:\/\//i,a.isStreamingSrc=function(b){return a.RTMP_RE.test(b)},a.rtmpSourceHandler={},a.rtmpSourceHandler.canPlayType=function(b){return a.isStreamingType(b)?"maybe":""},a.rtmpSourceHandler.canHandleSource=function(b,c){var d=a.rtmpSourceHandler.canPlayType(b.type);return d?d:a.isStreamingSrc(b.src)?"maybe":""},a.rtmpSourceHandler.handleSource=function(b,c,d){var e=a.streamToParts(b.src);c.setRtmpConnection(e.connection),c.setRtmpStream(e.stream)},a.registerSourceHandler(a.rtmpSourceHandler),a}c.__esModule=!0,c["default"]=d},{}],59:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function i(a){var b=a.charAt(0).toUpperCase()+a.slice(1);A["set"+b]=function(b){return this.el_.vjs_setProperty(a,b)}}function j(a){A[a]=function(){return this.el_.vjs_getProperty(a)}}c.__esModule=!0;for(var k=a(62),l=e(k),m=a(81),n=d(m),o=a(92),p=d(o),q=a(90),r=a(58),s=e(r),t=a(5),u=e(t),v=a(95),w=e(v),x=a(88),y=w["default"].navigator,z=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return c.source&&e.ready(function(){this.setSource(c.source)},!0),c.startTime&&e.ready(function(){this.load(),this.play(),this.currentTime(c.startTime)},!0),w["default"].videojs=w["default"].videojs||{},w["default"].videojs.Flash=w["default"].videojs.Flash||{},w["default"].videojs.Flash.onReady=b.onReady,w["default"].videojs.Flash.onEvent=b.onEvent,w["default"].videojs.Flash.onError=b.onError,e.on("seeked",function(){this.lastSeekTarget_=void 0}),e}return h(b,a),b.prototype.createEl=function(){var a=this.options_;if(!a.swf){var c="5.3.0";a.swf="//vjs.zencdn.net/swf/"+c+"/video-js.swf"}var d=a.techId,e=(0,x.assign)({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:a.autoplay,preload:a.preload,loop:a.loop,muted:a.muted},a.flashVars),f=(0,x.assign)({wmode:"opaque",bgcolor:"#000000"},a.params),g=(0,x.assign)({id:d,name:d,"class":"vjs-tech"},a.attributes);return this.el_=b.embed(a.swf,e,f,g),this.el_.tech=this,this.el_},b.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},b.prototype.pause=function(){this.el_.vjs_pause()},b.prototype.src=function(a){return void 0===a?this.currentSrc():this.setSrc(a)},b.prototype.setSrc=function(a){var b=this;a=p.getAbsoluteURL(a),this.el_.vjs_src(a),this.autoplay()&&this.setTimeout(function(){return b.play()},0)},b.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},b.prototype.setCurrentTime=function(b){var c=this.seekable();c.length&&(b=b>c.start(0)?b:c.start(0),b=b=0?c:1/0},b.prototype.load=function(){this.el_.vjs_load()},b.prototype.poster=function(){this.el_.vjs_getProperty("poster")},b.prototype.setPoster=function(){},b.prototype.seekable=function(){var a=this.duration();return 0===a?(0,q.createTimeRange)():(0,q.createTimeRange)(0,a)},b.prototype.buffered=function(){var a=this.el_.vjs_getProperty("buffered");return 0===a.length?(0,q.createTimeRange)():(0,q.createTimeRange)(a[0][0],a[0][1])},b.prototype.supportsFullScreen=function(){return!1},b.prototype.enterFullScreen=function(){return!1},b}(l["default"]),A=z.prototype,B="rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted".split(","),C="networkState,readyState,initialTime,startOffsetTime,paused,ended,videoWidth,videoHeight".split(","),D=0;D=10},l["default"].withSourceHandlers(z),z.nativeSourceHandler={},z.nativeSourceHandler.canPlayType=function(a){return a in z.formats?"maybe":""},z.nativeSourceHandler.canHandleSource=function(a,b){function c(a){var b=p.getFileExtension(a);return b?"video/"+b:""}var d=void 0;return d=a.type?a.type.replace(/;.*/,"").toLowerCase():c(a.src),z.nativeSourceHandler.canPlayType(d)},z.nativeSourceHandler.handleSource=function(a,b,c){b.setSrc(a.src)},z.nativeSourceHandler.dispose=function(){},z.registerSourceHandler(z.nativeSourceHandler),z.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},z.onReady=function(a){var b=n.getEl(a),c=b&&b.tech;c&&c.el()&&z.checkReady(c)},z.checkReady=function(a){a.el()&&(a.el().vjs_getProperty?a.triggerReady():this.setTimeout(function(){z.checkReady(a)},50))},z.onEvent=function(a,b){var c=n.getEl(a).tech,d=Array.prototype.slice.call(arguments,2);c.setTimeout(function(){c.trigger(b,d)},1)},z.onError=function(a,b){var c=n.getEl(a).tech;return"srcnotfound"===b?c.error(4):void c.error("FLASH: "+b)},z.version=function(){var a="0,0,0";try{a=new w["default"].ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(b){try{y.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(a=(y.plugins["Shockwave Flash 2.0"]||y.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(c){}}return a.split(",")},z.embed=function(a,b,c,d){var e=z.getEmbedCode(a,b,c,d),f=n.createEl("div",{innerHTML:e}).childNodes[0];return f},z.getEmbedCode=function(a,b,c,d){var e=''}),d=(0,x.assign)({data:a,width:"100%",height:"100%"},d),Object.getOwnPropertyNames(d).forEach(function(a){h+=a+'="'+d[a]+'" '}),""+e+h+">"+g+""},(0,s["default"])(z),u["default"].registerComponent("Flash",z),l["default"].registerTech("Flash",z),c["default"]=z},{5:5,58:58,62:62,81:81,88:88,90:90,92:92,95:95}],60:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){return a.raw=b,a}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function i(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var j=f(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),k=a(62),l=e(k),m=a(5),n=e(m),o=a(81),p=d(o),q=a(92),r=d(q),s=a(83),t=d(s),u=a(86),v=e(u),w=a(98),x=e(w),y=a(78),z=d(y),A=a(94),B=e(A),C=a(95),D=e(C),E=a(88),F=a(87),G=e(F),H=a(91),I=e(H),J=function(a){function b(c,d){g(this,b);var e=h(this,a.call(this,c,d)),f=c.source,i=!1;if(f&&(e.el_.currentSrc!==f.src||c.tag&&3===c.tag.initNetworkState_)?e.setSource(f):e.handleLateInit_(e.el_),e.el_.hasChildNodes()){for(var k=e.el_.childNodes,l=k.length,m=[];l--;){var n=k[l],o=n.nodeName.toLowerCase();"track"===o&&(e.featuresNativeTextTracks?(e.remoteTextTrackEls().addTrackElement_(n),e.remoteTextTracks().addTrack_(n.track),i||e.el_.hasAttribute("crossorigin")||!r.isCrossOrigin(n.src)||(i=!0)):m.push(n))}for(var p=0;p=0;g--){var h=f[g],i={};"undefined"!=typeof this.options_[h]&&(i[h]=this.options_[h]),p.setElAttributes(a,i)}return a},b.prototype.handleLateInit_=function(a){if(0!==a.networkState&&3!==a.networkState){if(0===a.readyState){var b=!1,c=function(){b=!0};this.on("loadstart",c);var d=function(){b||this.trigger("loadstart")};return this.on("loadedmetadata",d),void this.ready(function(){this.off("loadstart",c),this.off("loadedmetadata",d),b||this.trigger("loadstart")})}var e=["loadstart"];e.push("loadedmetadata"),a.readyState>=2&&e.push("loadeddata"),a.readyState>=3&&e.push("canplay"),a.readyState>=4&&e.push("canplaythrough"),this.ready(function(){e.forEach(function(a){this.trigger(a)},this)})}},b.prototype.proxyNativeTextTracks_=function(){var a=this.el().textTracks;if(a){for(var b=0;b0&&(a.el_.duration===1/0&&a.trigger("durationchange"),a.off("timeupdate",c))};return this.on("timeupdate",b),NaN}return this.el_.duration||NaN},b.prototype.width=function(){return this.el_.offsetWidth},b.prototype.height=function(){return this.el_.offsetHeight},b.prototype.proxyWebkitFullscreen_=function(){var a=this;if("webkitDisplayingFullscreen"in this.el_){var b=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},c=function(){this.one("webkitendfullscreen",b),this.trigger("fullscreenchange",{isFullscreen:!0})};this.on("webkitbeginfullscreen",c),this.on("dispose",function(){a.off("webkitbeginfullscreen",c),a.off("webkitendfullscreen",b)})}},b.prototype.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var a=D["default"].navigator&&D["default"].navigator.userAgent||"";if(/Android/.test(a)||!/Chrome|Mac OS X 10.5/.test(a))return!0}return!1},b.prototype.enterFullScreen=function(){var a=this.el_;a.paused&&a.networkState<=a.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){a.pause(),a.webkitEnterFullScreen()},0)):a.webkitEnterFullScreen()},b.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},b.prototype.src=function(a){return void 0===a?this.el_.src:void this.setSrc(a)},b.prototype.reset=function(){b.resetMediaElement(this.el_)},b.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},b.prototype.setControls=function(a){this.el_.controls=!!a},b.prototype.addTextTrack=function(b,c,d){return this.featuresNativeTextTracks?this.el_.addTextTrack(b,c,d):a.prototype.addTextTrack.call(this,b,c,d)},b.prototype.createRemoteTextTrack=function(b){if(!this.featuresNativeTextTracks)return a.prototype.createRemoteTextTrack.call(this,b);var c=B["default"].createElement("track");return b.kind&&(c.kind=b.kind),b.label&&(c.label=b.label),(b.language||b.srclang)&&(c.srclang=b.language||b.srclang),b["default"]&&(c["default"]=b["default"]),b.id&&(c.id=b.id),b.src&&(c.src=b.src),c},b.prototype.addRemoteTextTrack=function(b,c){var d=a.prototype.addRemoteTextTrack.call(this,b,c);return this.featuresNativeTextTracks&&this.el().appendChild(d),d},b.prototype.removeRemoteTextTrack=function(b){if(a.prototype.removeRemoteTextTrack.call(this,b),this.featuresNativeTextTracks)for(var c=this.$$("track"),d=c.length;d--;)b!==c[d]&&b!==c[d].track||this.el().removeChild(c[d])},b}(l["default"]);if(p.isReal()){J.TEST_VID=B["default"].createElement("video");var K=B["default"].createElement("track");K.kind="captions",K.srclang="en",K.label="English",J.TEST_VID.appendChild(K)}J.isSupported=function(){try{J.TEST_VID.volume=.5}catch(a){return!1}return!(!J.TEST_VID||!J.TEST_VID.canPlayType)},J.canControlVolume=function(){try{var a=J.TEST_VID.volume;return J.TEST_VID.volume=a/2+.1,a!==J.TEST_VID.volume}catch(b){return!1}},J.canControlPlaybackRate=function(){if(z.IS_ANDROID&&z.IS_CHROME)return!1;try{var a=J.TEST_VID.playbackRate;return J.TEST_VID.playbackRate=a/2+.1,a!==J.TEST_VID.playbackRate}catch(b){return!1}},J.supportsNativeTextTracks=function(){return z.IS_ANY_SAFARI},J.supportsNativeVideoTracks=function(){return!(!J.TEST_VID||!J.TEST_VID.videoTracks)},J.supportsNativeAudioTracks=function(){return!(!J.TEST_VID||!J.TEST_VID.audioTracks)},J.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","volumechange"],J.prototype.featuresVolumeControl=J.canControlVolume(),J.prototype.featuresPlaybackRate=J.canControlPlaybackRate(),J.prototype.movingMediaElementInDOM=!z.IS_IOS,J.prototype.featuresFullscreenResize=!0,J.prototype.featuresProgressEvents=!0,J.prototype.featuresTimeupdateEvents=!0,J.prototype.featuresNativeTextTracks=J.supportsNativeTextTracks(),J.prototype.featuresNativeVideoTracks=J.supportsNativeVideoTracks(),J.prototype.featuresNativeAudioTracks=J.supportsNativeAudioTracks();var L=J.TEST_VID&&J.TEST_VID.constructor.prototype.canPlayType,M=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,N=/^video\/mp4/i;J.patchCanPlayType=function(){z.ANDROID_VERSION>=4&&!z.IS_FIREFOX?J.TEST_VID.constructor.prototype.canPlayType=function(a){return a&&M.test(a)?"maybe":L.call(this,a)}:z.IS_OLD_ANDROID&&(J.TEST_VID.constructor.prototype.canPlayType=function(a){return a&&N.test(a)?"maybe":L.call(this,a)})},J.unpatchCanPlayType=function(){var a=J.TEST_VID.constructor.prototype.canPlayType;return J.TEST_VID.constructor.prototype.canPlayType=L,a},J.patchCanPlayType(),J.disposeMediaElement=function(a){if(a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},J.resetMediaElement=function(a){if(a){for(var b=a.querySelectorAll("source"),c=b.length;c--;)a.removeChild(b[c]);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},["paused","currentTime","buffered","volume","muted","poster","preload","autoplay","controls","loop","error","seeking","seekable","ended","defaultMuted","playbackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(a){J.prototype[a]=function(){return this.el_[a]}}),["volume","muted","src","poster","preload","autoplay","loop","playbackRate"].forEach(function(a){J.prototype["set"+(0,I["default"])(a)]=function(b){this.el_[a]=b}}),["pause","load"].forEach(function(a){J.prototype[a]=function(){return this.el_[a]()}}),l["default"].withSourceHandlers(J),J.nativeSourceHandler={},J.nativeSourceHandler.canPlayType=function(a){try{return J.TEST_VID.canPlayType(a)}catch(b){return""}},J.nativeSourceHandler.canHandleSource=function(a,b){if(a.type)return J.nativeSourceHandler.canPlayType(a.type);if(a.src){var c=r.getFileExtension(a.src);return J.nativeSourceHandler.canPlayType("video/"+c)}return""},J.nativeSourceHandler.handleSource=function(a,b,c){b.setSrc(a.src)},J.nativeSourceHandler.dispose=function(){},J.registerSourceHandler(J.nativeSourceHandler),n["default"].registerComponent("Html5",J),l["default"].registerTech("Html5",J),c["default"]=J},{5:5,62:62,78:78,81:81,83:83,86:86,87:87,88:88,91:91,92:92,94:94,95:95,98:98}],61:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var h=a(5),i=d(h),j=a(62),k=d(j),l=a(91),m=d(l),n=function(a){function b(c,d,g){e(this,b);var h=f(this,a.call(this,c,d,g));if(d.playerOptions.sources&&0!==d.playerOptions.sources.length)c.src(d.playerOptions.sources);else for(var j=0,l=d.playerOptions.techOrder;j4&&void 0!==arguments[4]?arguments[4]:{},f=a.textTracks();e.kind=b,c&&(e.label=c),d&&(e.language=d),e.tech=a;var g=new s["default"](e);return f.addTrack_(g),g}c.__esModule=!0;var j=a(5),k=e(j),l=a(66),m=e(l),n=a(65),o=e(n),p=a(87),q=e(p),r=a(72),s=e(r),t=a(70),u=e(t),v=a(76),w=e(v),x=a(63),y=e(x),z=a(83),A=d(z),B=a(86),C=e(B),D=a(90),E=a(79),F=a(46),G=e(F),H=a(95),I=e(H),J=a(94),K=e(J),L=a(88),M=function(b){function c(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};f(this,c),a.reportTouchActivity=!1;var e=g(this,b.call(this,null,a,d));return e.hasStarted_=!1,e.on("playing",function(){this.hasStarted_=!0}),e.on("loadstart",function(){this.hasStarted_=!1}),e.textTracks_=a.textTracks,e.videoTracks_=a.videoTracks,e.audioTracks_=a.audioTracks,e.featuresProgressEvents||e.manualProgressOn(),e.featuresTimeupdateEvents||e.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(b){a["native"+b+"Tracks"]===!1&&(e["featuresNative"+b+"Tracks"]=!1)}),a.nativeCaptions===!1&&(e.featuresNativeTextTracks=!1),e.featuresNativeTextTracks||e.emulateTextTracks(),e.autoRemoteTextTracks_=new u["default"],e.initTextTrackListeners(),e.initTrackListeners(),a.nativeControlsForTouch||e.emitTapEvents(),e.constructor&&(e.name_=e.constructor.name||"Unknown Tech"),e}return h(c,b),c.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},c.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},c.prototype.trackProgress=function(a){this.stopTrackingProgress(),this.progressInterval=this.setInterval(A.bind(this,function(){var a=this.bufferedPercent();this.bufferedPercent_!==a&&this.trigger("progress"),this.bufferedPercent_=a,1===a&&this.stopTrackingProgress()}),500)},c.prototype.onDurationChange=function(a){this.duration_=this.duration()},c.prototype.buffered=function(){return(0,D.createTimeRange)(0,0)},c.prototype.bufferedPercent=function(){return(0,E.bufferedPercent)(this.buffered(),this.duration_)},c.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},c.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},c.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},c.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},c.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},c.prototype.dispose=function(){this.clearTracks(["audio","video","text"]),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),b.prototype.dispose.call(this)},c.prototype.clearTracks=function(a){var b=this;a=[].concat(a),a.forEach(function(a){for(var c=b[a+"Tracks"]()||[],d=c.length;d--;){var e=c[d];"text"===a&&b.removeRemoteTextTrack(e),c.removeTrack_(e)}})},c.prototype.cleanupAutoTextTracks=function(){for(var a=this.autoRemoteTextTracks_||[],b=a.length;b--;){var c=a[b];this.removeRemoteTextTrack(c)}},c.prototype.reset=function(){},c.prototype.error=function(a){return void 0!==a&&(this.error_=new G["default"](a),this.trigger("error")),this.error_},c.prototype.played=function(){return this.hasStarted_?(0,D.createTimeRange)(0,0):(0,D.createTimeRange)()},c.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},c.prototype.initTextTrackListeners=function(){var a=A.bind(this,function(){this.trigger("texttrackchange")}),b=this.textTracks();b&&(b.addEventListener("removetrack",a),b.addEventListener("addtrack",a),this.on("dispose",A.bind(this,function(){b.removeEventListener("removetrack",a),b.removeEventListener("addtrack",a)})))},c.prototype.initTrackListeners=function(){var a=this,b=["video","audio"];b.forEach(function(b){var c=function(){a.trigger(b+"trackchange")},d=a[b+"Tracks"]();d.addEventListener("removetrack",c),d.addEventListener("addtrack",c),a.on("dispose",function(){d.removeEventListener("removetrack",c),d.removeEventListener("addtrack",c)})})},c.prototype.addWebVttScript_=function(){var b=this;if(!I["default"].WebVTT)if(K["default"].body.contains(this.el())){ +var c=a(105);if(!this.options_["vtt.js"]&&(0,L.isPlain)(c)&&Object.keys(c).length>0)return void this.trigger("vttjsloaded");var d=K["default"].createElement("script");d.src=this.options_["vtt.js"]||"https://cdn.rawgit.com/gkatsev/vtt.js/vjs-v0.12.1/dist/vtt.min.js",d.onload=function(){b.trigger("vttjsloaded")},d.onerror=function(){b.trigger("vttjserror")},this.on("dispose",function(){d.onload=null,d.onerror=null}),I["default"].WebVTT=!0,this.el().parentNode.appendChild(d)}else this.ready(this.addWebVttScript_)},c.prototype.emulateTextTracks=function(){var a=this,b=this.textTracks();if(b){var c=this.remoteTextTracks(),d=function(a){return b.addTrack_(a.track)},e=function(a){return b.removeTrack_(a.track)};c.on("addtrack",d),c.on("removetrack",e),this.addWebVttScript_();var f=function(){return a.trigger("texttrackchange")},g=function(){f();for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},b=arguments[1],c=this.createRemoteTextTrack(a);return b!==!0&&b!==!1&&(C["default"].warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),b=!0),this.remoteTextTrackEls().addTrackElement_(c),this.remoteTextTracks().addTrack_(c.track),b!==!0&&this.autoRemoteTextTracks_.addTrack_(c.track),c},c.prototype.removeRemoteTextTrack=function(a){var b=this.remoteTextTrackEls().getTrackElementByTrack_(a);this.remoteTextTrackEls().removeTrackElement_(b),this.remoteTextTracks().removeTrack_(a),this.autoRemoteTextTracks_.removeTrack_(a)},c.prototype.setPoster=function(){},c.prototype.canPlayType=function(){return""},c.isTech=function(a){return a.prototype instanceof c||a instanceof c||a===c},c.registerTech=function(a,b){if(c.techs_||(c.techs_={}),!c.isTech(b))throw new Error("Tech "+a+" must be a Tech");return c.techs_[a]=b,b},c.getTech=function(a){return c.techs_&&c.techs_[a]?c.techs_[a]:I["default"]&&I["default"].videojs&&I["default"].videojs[a]?(C["default"].warn("The "+a+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),I["default"].videojs[a]):void 0},c}(k["default"]);M.prototype.textTracks_,M.prototype.audioTracks_,M.prototype.videoTracks_,M.prototype.featuresVolumeControl=!0,M.prototype.featuresFullscreenResize=!1,M.prototype.featuresPlaybackRate=!1,M.prototype.featuresProgressEvents=!1,M.prototype.featuresTimeupdateEvents=!1,M.prototype.featuresNativeTextTracks=!1,M.withSourceHandlers=function(a){a.registerSourceHandler=function(b,c){var d=a.sourceHandlers;d||(d=a.sourceHandlers=[]),void 0===c&&(c=d.length),d.splice(c,0,b)},a.canPlayType=function(b){for(var c=a.sourceHandlers||[],d=void 0,e=0;e0&&void 0!==arguments[0]?arguments[0]:[];f(this,b);for(var h=void 0,i=e.length-1;i>=0;i--)if(e[i].enabled){o(e,e[i]);break}if(l.IS_IE8){h=n["default"].createElement("custom");for(var k in j["default"].prototype)"constructor"!==k&&(h[k]=j["default"].prototype[k]);for(var m in b.prototype)"constructor"!==m&&(h[m]=b.prototype[m])}return h=c=g(this,a.call(this,e,h)),h.changing_=!1,d=h,g(c,d)}return h(b,a),b.prototype.addTrack_=function(b){var c=this;b.enabled&&o(this,b),a.prototype.addTrack_.call(this,b),b.addEventListener&&b.addEventListener("enabledchange",function(){c.changing_||(c.changing_=!0,o(c,b),c.changing_=!1,c.trigger("change"))})},b.prototype.addTrack=function(a){this.addTrack_(a)},b.prototype.removeTrack=function(b){a.prototype.removeTrack_.call(this,b)},b}(j["default"]);c["default"]=p},{74:74,78:78,94:94}],64:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(73),j=a(75),k=e(j),l=a(87),m=e(l),n=a(78),o=d(n),p=function(a){function b(){var c,d,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var h=(0,m["default"])(e,{kind:i.AudioTrackKind[e.kind]||""}),j=c=g(this,a.call(this,h)),k=!1;if(o.IS_IE8)for(var l in b.prototype)"constructor"!==l&&(j[l]=b.prototype[l]);return Object.defineProperty(j,"enabled",{get:function(){return k},set:function(a){"boolean"==typeof a&&a!==k&&(k=a,this.trigger("enabledchange"))}}),h.enabled&&(j.enabled=h.enabled),j.loaded_=!0,d=j,g(c,d)}return h(b,a),b}(k["default"]);c["default"]=p},{73:73,75:75,78:78,87:87}],65:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a(78),h=e(g),i=a(94),j=d(i),k=function(){function a(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];f(this,a);var c=this;if(h.IS_IE8){c=j["default"].createElement("custom");for(var d in a.prototype)"constructor"!==d&&(c[d]=a.prototype[d])}c.trackElements_=[],Object.defineProperty(c,"length",{get:function(){return this.trackElements_.length}});for(var e=0,g=b.length;e0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var d=g(this,a.call(this)),e=void 0,h=d;if(j.IS_IE8){h=l["default"].createElement("custom");for(var i in b.prototype)"constructor"!==i&&(h[i]=b.prototype[i])}var k=new p["default"](c);if(h.kind=k.kind,h.src=k.src,h.srclang=k.language,h.label=k.label,h["default"]=k["default"],Object.defineProperty(h,"readyState",{get:function(){return e}}),Object.defineProperty(h,"track",{get:function(){return k}}),e=q,k.addEventListener("loadeddata",function(){e=s,h.trigger({type:"load",target:h})}),j.IS_IE8){var m;return m=h,g(d,m)}return d}return h(b,a),b}(n["default"]);u.prototype.allowedEvents_={load:"load"},u.NONE=q,u.LOADING=r,u.LOADED=s,u.ERROR=t,c["default"]=u},{42:42,72:72,78:78,94:94}],67:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a(78),h=e(g),i=a(94),j=d(i),k=function(){function a(b){f(this,a);var c=this;if(h.IS_IE8){c=j["default"].createElement("custom");for(var d in a.prototype)"constructor"!==d&&(c[d]=a.prototype[d])}if(a.prototype.setCues_.call(c,b),Object.defineProperty(c,"length",{get:function(){return this.length_}}),h.IS_IE8)return c}return a.prototype.setCues_=function(a){var b=this.length||0,c=0,d=a.length;this.cues_=a,this.length_=a.length;var e=function(a){""+a in this||Object.defineProperty(this,""+a,{get:function(){return this.cues_[a]}})};if(b0&&void 0!==arguments[0]?arguments[0]:[];f(this,b);var h=void 0;if(n.IS_IE8){h=p["default"].createElement("custom");for(var i in j["default"].prototype)"constructor"!==i&&(h[i]=j["default"].prototype[i]);for(var k in b.prototype)"constructor"!==k&&(h[k]=b.prototype[k])}return h=c=g(this,a.call(this,e,h)),d=h,g(c,d)}return h(b,a),b.prototype.addTrack_=function(b){a.prototype.addTrack_.call(this,b),b.addEventListener("modechange",l.bind(this,function(){this.trigger("change")}))},b}(j["default"]);c["default"]=q},{74:74,78:78,83:83,94:94}],71:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function i(a,b){if(b&&(a=b(a)),a&&"none"!==a)return a}function j(a,b){var c=a.options[a.options.selectedIndex].value;return i(c,b)}function k(a,b,c){if(b)for(var d=0;d select",id:"captions-background-color-%s",label:"Color",options:[x,D,C,A,y,E,B,z]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[F,G,H]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[D,x,C,A,y,E,B,z]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],"default":2,parser:function(a){return"1.00"===a?null:Number(a)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[F,G]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[H,G,F]}};I.windowColor.options=I.backgroundColor.options;var J=function(a){function b(c,d){f(this,b);var e=g(this,a.call(this,c,d));return e.setDefaults(),e.hide(),e.updateDisplay=r.bind(e,e.updateDisplay),void 0===d.persistTextTrackSettings&&(e.options_.persistTextTrackSettings=e.options_.playerOptions.persistTextTrackSettings),e.on(e.$(".vjs-done-button"),"click",function(){e.saveSettings(),e.hide()}),e.on(e.$(".vjs-default-button"),"click",function(){e.setDefaults(),e.updateDisplay()}),t.each(I,function(a){e.on(e.$(a.selector),"change",e.updateDisplay)}),e.options_.persistTextTrackSettings&&e.restoreSettings(),e}return h(b,a),b.prototype.createElSelect_=function(a){var b=this,c=I[a],d=c.id.replace("%s",this.id_);return[(0,p.createEl)("label",{className:"vjs-label",textContent:c.label},{"for":d}),(0,p.createEl)("select",{id:d},void 0,c.options.map(function(a){return(0,p.createEl)("option",{textContent:b.localize(a[1]),value:a[0]})}))]},b.prototype.createElFgColor_=function(){var a=(0,p.createEl)("legend",{textContent:this.localize("Text")}),b=this.createElSelect_("color"),c=(0,p.createEl)("span",{className:"vjs-text-opacity vjs-opacity"},void 0,this.createElSelect_("textOpacity"));return(0,p.createEl)("fieldset",{className:"vjs-fg-color vjs-tracksetting"},void 0,[a].concat(b,c))},b.prototype.createElBgColor_=function(){var a=(0,p.createEl)("legend",{textContent:this.localize("Background")}),b=this.createElSelect_("backgroundColor"),c=(0,p.createEl)("span",{className:"vjs-bg-opacity vjs-opacity"},void 0,this.createElSelect_("backgroundOpacity"));return(0,p.createEl)("fieldset",{className:"vjs-bg-color vjs-tracksetting"},void 0,[a].concat(b,c))},b.prototype.createElWinColor_=function(){var a=(0,p.createEl)("legend",{textContent:this.localize("Window")}),b=this.createElSelect_("windowColor"),c=(0,p.createEl)("span",{className:"vjs-window-opacity vjs-opacity"},void 0,this.createElSelect_("windowOpacity"));return(0,p.createEl)("fieldset",{className:"vjs-window-color vjs-tracksetting"},void 0,[a].concat(b,c))},b.prototype.createElColors_=function(){return(0,p.createEl)("div",{className:"vjs-tracksettings-colors"},void 0,[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()])},b.prototype.createElFont_=function(){var a=(0,p.createEl)("div",{className:"vjs-font-percent vjs-tracksetting"},void 0,this.createElSelect_("fontPercent")),b=(0,p.createEl)("div",{className:"vjs-edge-style vjs-tracksetting"},void 0,this.createElSelect_("edgeStyle")),c=(0,p.createEl)("div",{className:"vjs-font-family vjs-tracksetting"},void 0,this.createElSelect_("fontFamily"));return(0,p.createEl)("div",{className:"vjs-tracksettings-font"},void 0,[a,b,c])},b.prototype.createElControls_=function(){var a=(0,p.createEl)("button",{className:"vjs-default-button",textContent:this.localize("Defaults")}),b=(0,p.createEl)("button",{className:"vjs-done-button",textContent:"Done"});return(0,p.createEl)("div",{className:"vjs-tracksettings-controls"},void 0,[a,b])},b.prototype.createEl=function(){var a=(0,p.createEl)("div",{className:"vjs-tracksettings"},void 0,[this.createElColors_(),this.createElFont_(),this.createElControls_()]),b=(0,p.createEl)("div",{className:"vjs-control-text",id:"TTsettingsDialogLabel-"+this.id_,textContent:"Caption Settings Dialog"},{"aria-level":"1",role:"heading"}),c=(0,p.createEl)("div",{className:"vjs-control-text",id:"TTsettingsDialogDescription-"+this.id_,textContent:"Beginning of dialog window. Escape will cancel and close the window."}),d=(0,p.createEl)("div",void 0,{role:"document"},[b,c,a]);return(0,p.createEl)("div",{className:"vjs-caption-settings vjs-modal-overlay",tabIndex:-1},{role:"dialog","aria-labelledby":b.id,"aria-describedby":c.id},d)},b.prototype.getValues=function(){var a=this;return t.reduce(I,function(b,c,d){var e=j(a.$(c.selector),c.parser);return void 0!==e&&(b[d]=e),b},{})},b.prototype.setValues=function(a){var b=this;t.each(I,function(c,d){k(b.$(c.selector),a[d],c.parser)})},b.prototype.setDefaults=function(){var a=this;t.each(I,function(b){var c=b.hasOwnProperty("default")?b["default"]:0;a.$(b.selector).selectedIndex=c})},b.prototype.restoreSettings=function(){var a=void 0;try{a=JSON.parse(m["default"].localStorage.getItem(w))}catch(b){v["default"].warn(b)}a&&this.setValues(a)},b.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var a=this.getValues();try{Object.keys(a).length?m["default"].localStorage.setItem(w,JSON.stringify(a)):m["default"].localStorage.removeItem(w)}catch(b){v["default"].warn(b)}}},b.prototype.updateDisplay=function(){var a=this.player_.getChild("textTrackDisplay");a&&a.updateDisplay()},b}(o["default"]);o["default"].registerComponent("TextTrackSettings",J),c["default"]=J},{5:5,81:81,83:83,86:86,88:88,95:95}],72:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(67),j=e(i),k=a(83),l=d(k),m=a(73),n=a(86),o=e(n),p=a(95),q=e(p),r=a(75),s=e(r),t=a(92),u=a(99),v=e(u),w=a(87),x=e(w),y=a(78),z=d(y),A=function(a,b){var c=new q["default"].WebVTT.Parser(q["default"],q["default"].vttjs,q["default"].WebVTT.StringDecoder()),d=[];c.oncue=function(a){b.addCue(a)},c.onparsingerror=function(a){d.push(a)},c.onflush=function(){b.trigger({type:"loadeddata",target:b})},c.parse(a),d.length>0&&(q["default"].console&&q["default"].console.groupCollapsed&&q["default"].console.groupCollapsed("Text Track parsing errors for "+b.src),d.forEach(function(a){return o["default"].error(a)}),q["default"].console&&q["default"].console.groupEnd&&q["default"].console.groupEnd()),c.flush()},B=function(a,b){var c={uri:a},d=(0,t.isCrossOrigin)(a);d&&(c.cors=d),(0,v["default"])(c,l.bind(this,function(a,c,d){if(a)return o["default"].error(a,c);if(b.loaded_=!0,"function"!=typeof q["default"].WebVTT){if(b.tech_){var e=function(){return A(d,b)};b.tech_.on("vttjsloaded",e),b.tech_.on("vttjserror",function(){o["default"].error("vttjs failed to load, stopping trying to process "+b.src),b.tech_.off("vttjsloaded",e)})}}else A(d,b)}))},C=function(a){function b(){var c,d,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(f(this,b),!e.tech)throw new Error("A tech was not provided.");var h=(0,x["default"])(e,{kind:m.TextTrackKind[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=m.TextTrackMode[h.mode]||"disabled",k=h["default"];"metadata"!==h.kind&&"chapters"!==h.kind||(i="hidden");var n=c=g(this,a.call(this,h));if(n.tech_=h.tech,z.IS_IE8)for(var o in b.prototype)"constructor"!==o&&(n[o]=b.prototype[o]);n.cues_=[],n.activeCues_=[];var p=new j["default"](n.cues_),q=new j["default"](n.activeCues_),r=!1,s=l.bind(n,function(){this.activeCues,r&&(this.trigger("cuechange"),r=!1)});return"disabled"!==i&&n.tech_.ready(function(){n.tech_.on("timeupdate",s)},!0),Object.defineProperty(n,"default",{get:function(){return k},set:function(){}}),Object.defineProperty(n,"mode",{get:function(){return i},set:function(a){var b=this;m.TextTrackMode[a]&&(i=a,"showing"===i&&this.tech_.ready(function(){b.tech_.on("timeupdate",s)},!0),this.trigger("modechange"))}}),Object.defineProperty(n,"cues",{get:function(){return this.loaded_?p:null},set:function(){}}),Object.defineProperty(n,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return q;for(var a=this.tech_.currentTime(),b=[],c=0,d=this.cues.length;c=a?b.push(e):e.startTime===e.endTime&&e.startTime<=a&&e.startTime+.5>=a&&b.push(e)}if(r=!1,b.length!==this.activeCues_.length)r=!0;else for(var f=0;f0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;f(this,b);var h=g(this,a.call(this));if(!e&&(e=h,l.IS_IE8)){e=n["default"].createElement("custom");for(var i in b.prototype)"constructor"!==i&&(e[i]=b.prototype[i])}e.tracks_=[],Object.defineProperty(e,"length",{get:function(){return this.tracks_.length}});for(var j=0;j0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var e=g(this,a.call(this)),h=e;if(j.IS_IE8){h=l["default"].createElement("custom");for(var i in b.prototype)"constructor"!==i&&(h[i]=b.prototype[i])}var k={id:d.id||"vjs_track_"+n.newGUID(),kind:d.kind||"",label:d.label||"",language:d.language||""},m=function(a){Object.defineProperty(h,a,{get:function(){return k[a]},set:function(){}})};for(var o in k)m(o);return c=h,g(e,c)}return h(b,a),b}(p["default"]);c["default"]=q},{42:42,78:78,85:85,94:94}],76:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}c.__esModule=!0;var i=a(74),j=e(i),k=a(78),l=d(k),m=a(94),n=e(m),o=function(a,b){for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:[];f(this,b);for(var h=void 0,i=e.length-1;i>=0;i--)if(e[i].selected){o(e,e[i]);break}if(l.IS_IE8){h=n["default"].createElement("custom");for(var k in j["default"].prototype)"constructor"!==k&&(h[k]=j["default"].prototype[k]);for(var m in b.prototype)"constructor"!==m&&(h[m]=b.prototype[m])}return h=c=g(this,a.call(this,e,h)),h.changing_=!1,Object.defineProperty(h,"selectedIndex",{get:function(){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};f(this,b);var h=(0,m["default"])(e,{kind:i.VideoTrackKind[e.kind]||""}),j=c=g(this,a.call(this,h)),k=!1;if(o.IS_IE8)for(var l in b.prototype)"constructor"!==l&&(j[l]=b.prototype[l]);return Object.defineProperty(j,"selected",{get:function(){return k},set:function(a){"boolean"==typeof a&&a!==k&&(k=a,this.trigger("selectedchange"))}}),h.selected&&(j.selected=h.selected),d=j,g(c,d)}return h(b,a),b}(k["default"]);c["default"]=p},{73:73,75:75,78:78,87:87}],78:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}c.__esModule=!0,c.BACKGROUND_SIZE_SUPPORTED=c.TOUCH_ENABLED=c.IS_ANY_SAFARI=c.IS_SAFARI=c.IE_VERSION=c.IS_IE8=c.IS_CHROME=c.IS_EDGE=c.IS_FIREFOX=c.IS_NATIVE_ANDROID=c.IS_OLD_ANDROID=c.ANDROID_VERSION=c.IS_ANDROID=c.IOS_VERSION=c.IS_IOS=c.IS_IPOD=c.IS_IPHONE=c.IS_IPAD=void 0;var f=a(81),g=e(f),h=a(95),i=d(h),j=i["default"].navigator&&i["default"].navigator.userAgent||"",k=/AppleWebKit\/([\d.]+)/i.exec(j),l=k?parseFloat(k.pop()):null,m=c.IS_IPAD=/iPad/i.test(j),n=c.IS_IPHONE=/iPhone/i.test(j)&&!m,o=c.IS_IPOD=/iPod/i.test(j),p=c.IS_IOS=n||m||o,q=(c.IOS_VERSION=function(){var a=j.match(/OS (\d+)_/i);return a&&a[1]?a[1]:null}(),c.IS_ANDROID=/Android/i.test(j)),r=c.ANDROID_VERSION=function(){var a=j.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!a)return null;var b=a[1]&&parseFloat(a[1]),c=a[2]&&parseFloat(a[2]);return b&&c?parseFloat(a[1]+"."+a[2]):b?b:null}(),s=(c.IS_OLD_ANDROID=q&&/webkit/i.test(j)&&r<2.3,c.IS_NATIVE_ANDROID=q&&r<5&&l<537,c.IS_FIREFOX=/Firefox/i.test(j),c.IS_EDGE=/Edge/i.test(j)),t=c.IS_CHROME=!s&&/Chrome/i.test(j),u=(c.IS_IE8=/MSIE\s8\.0/.test(j),c.IE_VERSION=function(a){return a&&parseFloat(a[1])}(/MSIE\s(\d+)\.\d/.exec(j)),c.IS_SAFARI=/Safari/i.test(j)&&!t&&!q&&!s);c.IS_ANY_SAFARI=u||p,c.TOUCH_ENABLED=g.isReal()&&("ontouchstart"in i["default"]||i["default"].DocumentTouch&&i["default"].document instanceof i["default"].DocumentTouch),c.BACKGROUND_SIZE_SUPPORTED=g.isReal()&&"backgroundSize"in i["default"].document.createElement("video").style},{81:81,95:95}],79:[function(a,b,c){"use strict";function d(a,b){var c=0,d=void 0,f=void 0;if(!b)return 0;a&&a.length||(a=(0,e.createTimeRange)(0,0));for(var g=0;gb&&(f=b),c+=f-d;return c/b}c.__esModule=!0,c.bufferedPercent=d;var e=a(90)},{90:90}],80:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!a||!b)return"";if("function"==typeof g["default"].getComputedStyle){var c=g["default"].getComputedStyle(a);return c?c[b]:""}return a.currentStyle[b]||""}c.__esModule=!0,c["default"]=e;var f=a(95),g=d(f)},{95:95}],81:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){return a.raw=b,a}function g(a){return"string"==typeof a&&/\S/.test(a)}function h(a){if(/\s/.test(a))throw new Error("class has illegal whitespace characters")}function i(a){return new RegExp("(^|\\s)"+a+"($|\\s)")}function j(){return N["default"]===P["default"].document&&"undefined"!=typeof N["default"].createElement}function k(a){return(0,W.isObject)(a)&&1===a.nodeType}function l(a){return function(b,c){if(!g(b))return N["default"][a](null);g(c)&&(c=N["default"].querySelector(c));var d=k(c)?c:N["default"];return d[a]&&d[a](b)}}function m(a){return 0===a.indexOf("#")&&(a=a.slice(1)),N["default"].getElementById(a)}function n(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=arguments[3],e=N["default"].createElement(a);return Object.getOwnPropertyNames(b).forEach(function(a){var c=b[a];a.indexOf("aria-")!==-1||"role"===a||"type"===a?(T["default"].warn((0,V["default"])(L,a,c)),e.setAttribute(a,c)):"textContent"===a?o(e,c):e[a]=c}),Object.getOwnPropertyNames(c).forEach(function(a){e.setAttribute(a,c[a])}),d&&J(e,d),e}function o(a,b){return"undefined"==typeof a.textContent?a.innerText=b:a.textContent=b,a}function p(a,b){b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a)}function q(a){var b=a[Y];return b||(b=a[Y]=R.newGUID()),X[b]||(X[b]={}),X[b]}function r(a){var b=a[Y];return!!b&&!!Object.getOwnPropertyNames(X[b]).length}function s(a){var b=a[Y];if(b){delete X[b];try{delete a[Y]}catch(c){a.removeAttribute?a.removeAttribute(Y):a[Y]=null}}}function t(a,b){return h(b),a.classList?a.classList.contains(b):i(b).test(a.className)}function u(a,b){return a.classList?a.classList.add(b):t(a,b)||(a.className=(a.className+" "+b).trim()),a}function v(a,b){return a.classList?a.classList.remove(b):(h(b),a.className=a.className.split(/\s+/).filter(function(a){return a!==b}).join(" ")),a}function w(a,b,c){var d=t(a,b);if("function"==typeof c&&(c=c(a,b)),"boolean"!=typeof c&&(c=!d),c!==d)return c?u(a,b):v(a,b),a}function x(a,b){Object.getOwnPropertyNames(b).forEach(function(c){var d=b[c];null===d||"undefined"==typeof d||d===!1?a.removeAttribute(c):a.setAttribute(c,d===!0?"":d)})}function y(a){var b={},c=",autoplay,controls,loop,muted,default,";if(a&&a.attributes&&a.attributes.length>0)for(var d=a.attributes,e=d.length-1;e>=0;e--){var f=d[e].name,g=d[e].value;"boolean"!=typeof a[f]&&c.indexOf(","+f+",")===-1||(g=null!==g),b[f]=g}return b}function z(a,b){return a.getAttribute(b)}function A(a,b,c){a.setAttribute(b,c)}function B(a,b){a.removeAttribute(b)}function C(){N["default"].body.focus(),N["default"].onselectstart=function(){return!1}}function D(){N["default"].onselectstart=function(){return!0}}function E(a){var b=void 0;if(a.getBoundingClientRect&&a.parentNode&&(b=a.getBoundingClientRect()),!b)return{left:0,top:0};var c=N["default"].documentElement,d=N["default"].body,e=c.clientLeft||d.clientLeft||0,f=P["default"].pageXOffset||d.scrollLeft,g=b.left+f-e,h=c.clientTop||d.clientTop||0,i=P["default"].pageYOffset||d.scrollTop,j=b.top+i-h;return{left:Math.round(g),top:Math.round(j)}}function F(a,b){var c={},d=E(a),e=a.offsetWidth,f=a.offsetHeight,g=d.top,h=d.left,i=b.pageY,j=b.pageX;return b.changedTouches&&(j=b.changedTouches[0].pageX,i=b.changedTouches[0].pageY),c.y=Math.max(0,Math.min(1,(g-i+f)/f)),c.x=Math.max(0,Math.min(1,(j-h)/e)),c}function G(a){return(0,W.isObject)(a)&&3===a.nodeType}function H(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function I(a){return"function"==typeof a&&(a=a()),(Array.isArray(a)?a:[a]).map(function(a){return"function"==typeof a&&(a=a()),k(a)||G(a)?a:"string"==typeof a&&/\S/.test(a)?N["default"].createTextNode(a):void 0}).filter(function(a){return a})}function J(a,b){return I(b).forEach(function(b){return a.appendChild(b)}),a}function K(a,b){return J(H(a),b)}c.__esModule=!0,c.$$=c.$=void 0;var L=f(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);c.isReal=j,c.isEl=k,c.getEl=m,c.createEl=n,c.textContent=o,c.insertElFirst=p,c.getElData=q,c.hasElData=r,c.removeElData=s,c.hasElClass=t,c.addElClass=u,c.removeElClass=v,c.toggleElClass=w,c.setElAttributes=x,c.getElAttributes=y,c.getAttribute=z,c.setAttribute=A,c.removeAttribute=B,c.blockTextSelection=C,c.unblockTextSelection=D,c.findElPosition=E,c.getPointerPosition=F,c.isTextNode=G,c.emptyEl=H,c.normalizeContent=I,c.appendContent=J,c.insertContent=K;var M=a(94),N=e(M),O=a(95),P=e(O),Q=a(85),R=d(Q),S=a(86),T=e(S),U=a(98),V=e(U),W=a(88),X={},Y="vdata"+(new Date).getTime();c.$=l("querySelector"),c.$$=l("querySelectorAll")},{85:85,86:86,88:88,94:94,95:95,98:98}],82:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){var c=n.getElData(a);0===c.handlers[b].length&&(delete c.handlers[b],a.removeEventListener?a.removeEventListener(b,c.dispatcher,!1):a.detachEvent&&a.detachEvent("on"+b,c.dispatcher)),Object.getOwnPropertyNames(c.handlers).length<=0&&(delete c.handlers,delete c.dispatcher,delete c.disabled),0===Object.getOwnPropertyNames(c).length&&n.removeElData(a)}function g(a,b,c,d){c.forEach(function(c){a(b,c,d)})}function h(a){function b(){return!0}function c(){return!1}if(!a||!a.isPropagationStopped){var d=a||t["default"].event;a={};for(var e in d)"layerX"!==e&&"layerY"!==e&&"keyLocation"!==e&&"webkitMovementX"!==e&&"webkitMovementY"!==e&&("returnValue"===e&&d.preventDefault||(a[e]=d[e]));if(a.target||(a.target=a.srcElement||v["default"]),a.relatedTarget||(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.preventDefault=function(){d.preventDefault&&d.preventDefault(),a.returnValue=!1,d.returnValue=!1,a.defaultPrevented=!0},a.defaultPrevented=!1,a.stopPropagation=function(){d.stopPropagation&&d.stopPropagation(),a.cancelBubble=!0,d.cancelBubble=!0,a.isPropagationStopped=b},a.isPropagationStopped=c,a.stopImmediatePropagation=function(){d.stopImmediatePropagation&&d.stopImmediatePropagation(),a.isImmediatePropagationStopped=b,a.stopPropagation()},a.isImmediatePropagationStopped=c,null!==a.clientX&&void 0!==a.clientX){var f=v["default"].documentElement,g=v["default"].body;a.pageX=a.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=a.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)}a.which=a.charCode||a.keyCode,null!==a.button&&void 0!==a.button&&(a.button=1&a.button?0:4&a.button?1:2&a.button?2:0)}return a}function i(a,b,c){if(Array.isArray(b))return g(i,a,b,c);var d=n.getElData(a);d.handlers||(d.handlers={}),d.handlers[b]||(d.handlers[b]=[]),c.guid||(c.guid=p.newGUID()),d.handlers[b].push(c),d.dispatcher||(d.disabled=!1,d.dispatcher=function(b,c){if(!d.disabled){b=h(b);var e=d.handlers[b.type];if(e)for(var f=e.slice(0),g=0,i=f.length;g=b&&(a.apply(void 0,arguments),c=d)};return d}},{85:85}],84:[function(a,b,c){"use strict";function d(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;a=a<0?0:a;var c=Math.floor(a%60),d=Math.floor(a/60%60),e=Math.floor(a/3600),f=Math.floor(b/60%60),g=Math.floor(b/3600);return(isNaN(a)||a===1/0)&&(e=d=c="-"),e=e>0||g>0?e+":":"",d=((e||f>=10)&&d<10?"0"+d:d)+":",c=c<10?"0"+c:c,e+d+c}c.__esModule=!0,c["default"]=d},{}],85:[function(a,b,c){"use strict";function d(){return e++}c.__esModule=!0,c.newGUID=d;var e=1},{}],86:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0,c.logByType=void 0;var e=a(95),f=d(e),g=a(78),h=a(88),i=void 0,j=c.logByType=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!!g.IE_VERSION&&g.IE_VERSION<11;"log"!==a&&b.unshift(a.toUpperCase()+":"),i.history.push(b),b.unshift("VIDEOJS:");var d=f["default"].console&&f["default"].console[a];d&&(c&&(b=b.map(function(a){if((0,h.isObject)(a)||Array.isArray(a))try{return JSON.stringify(a)}catch(b){return String(a)}return String(a)}).join(" ")),d.apply?d[Array.isArray(b)?"apply":"call"](f["default"].console,b):d(b))};i=function(){for(var a=arguments.length,b=Array(a),c=0;c2&&void 0!==arguments[2]?arguments[2]:0;return k(a).reduce(function(c,d){return b(c,a[d],d)},c)}function f(a){for(var b=arguments.length,c=Array(b>1?b-1:0),e=1;ec)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+b+") is greater than or equal to the maximum bound ("+c+").")}function f(a,b,c,d){return void 0===d&&(j["default"].warn("DEPRECATED: Function '"+a+"' on 'TimeRanges' called without an index argument."),d=0),e(a,d,c.length-1),c[d][b]}function g(a){return void 0===a||0===a.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:a.length,start:f.bind(null,"start",0,a),end:f.bind(null,"end",1,a)}}function h(a,b){return Array.isArray(a)?g(a):void 0===a||void 0===b?g():g([[a,b]])}c.__esModule=!0,c.createTimeRange=void 0,c.createTimeRanges=h;var i=a(86),j=d(i);c.createTimeRange=h},{86:86}],91:[function(a,b,c){"use strict";function d(a){return"string"!=typeof a?a:a.charAt(0).toUpperCase()+a.slice(1)}c.__esModule=!0,c["default"]=d},{}],92:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0,c.isCrossOrigin=c.getFileExtension=c.getAbsoluteURL=c.parseUrl=void 0;var e=a(94),f=d(e),g=a(95),h=d(g),i=c.parseUrl=function(a){var b=["protocol","hostname","port","pathname","search","hash","host"],c=f["default"].createElement("a");c.href=a;var d=""===c.host&&"file:"!==c.protocol,e=void 0;d&&(e=f["default"].createElement("div"),e.innerHTML='',c=e.firstChild,e.setAttribute("style","display:none; position:absolute;"),f["default"].body.appendChild(e));for(var g={},h=0;hx',a=b.firstChild.href}return a},c.getFileExtension=function(a){if("string"==typeof a){var b=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,c=b.exec(a);if(c)return c.pop().toLowerCase()}return""},c.isCrossOrigin=function(a){var b=h["default"].location,c=i(a),d=":"===c.protocol?b.protocol:c.protocol,e=d+c.host!==b.protocol+b.host;return e}},{94:94,95:95}],93:[function(b,c,d){"use strict";function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a){return a&&a.__esModule?a:{"default":a}}function g(a,b,c){var d=void 0;if("string"==typeof a){if(0===a.indexOf("#")&&(a=a.slice(1)),g.getPlayers()[a])return b&&O["default"].warn('Player "'+a+'" is already initialised. Options will not be applied.'),c&&g.getPlayers()[a].ready(c),g.getPlayers()[a];d=Q.getEl(a)}else d=a;if(!d||!d.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");if(d.player||x["default"].players[d.playerId])return d.player||x["default"].players[d.playerId];b=b||{},g.hooks("beforesetup").forEach(function(a){var c=a(d,(0,B["default"])(b));return!(0,V.isObject)(c)||Array.isArray(c)?void O["default"].error("please return an object in beforesetup hooks"):void(b=(0,B["default"])(b,c))});var e=r["default"].getComponent("Player"),f=new e(d,b,c);return g.hooks("setup").forEach(function(a){return a(f)}),f}d.__esModule=!0;var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},i=b(95),j=f(i),k=b(94),l=f(k),m=b(56),n=e(m),o=b(89),p=e(o),q=b(5),r=f(q),s=b(42),t=f(s),u=b(82),v=e(u),w=b(51),x=f(w),y=b(52),z=f(y),A=b(87),B=f(A),C=b(83),D=e(C),E=b(72),F=f(E),G=b(64),H=f(G),I=b(77),J=f(I),K=b(90),L=b(84),M=f(L),N=b(86),O=f(N),P=b(81),Q=e(P),R=b(78),S=e(R),T=b(92),U=e(T),V=b(88),W=b(80),X=f(W),Y=b(43),Z=f(Y),$=b(99),_=f($),aa=b(62),ba=f(aa);if("undefined"==typeof HTMLVideoElement&&Q.isReal()&&(l["default"].createElement("video"),l["default"].createElement("audio"),l["default"].createElement("track")),g.hooks_={},g.hooks=function(a,b){return g.hooks_[a]=g.hooks_[a]||[],b&&(g.hooks_[a]=g.hooks_[a].concat(b)),g.hooks_[a]},g.hook=function(a,b){g.hooks(a,b)},g.removeHook=function(a,b){var c=g.hooks(a).indexOf(b);return!(c<=-1)&&(g.hooks_[a]=g.hooks_[a].slice(),g.hooks_[a].splice(c,1),!0)},j["default"].VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Q.isReal()){var ca=Q.$(".vjs-styles-defaults");if(!ca){ca=p.createStyleElement("vjs-styles-defaults");var da=Q.$("head");da&&da.insertBefore(ca,da.firstChild),p.setTextContent(ca,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}n.autoSetupTimeout(1,g),g.VERSION="5.18.4",g.options=x["default"].prototype.options_,g.getPlayers=function(){return x["default"].players},g.players=x["default"].players,g.getComponent=r["default"].getComponent,g.registerComponent=function(a,b){ba["default"].isTech(b)&&O["default"].warn("The "+a+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),r["default"].registerComponent.call(r["default"],a,b)},g.getTech=ba["default"].getTech,g.registerTech=ba["default"].registerTech,g.browser=S,g.TOUCH_ENABLED=S.TOUCH_ENABLED,g.extend=Z["default"],g.mergeOptions=B["default"],g.bind=D.bind,g.plugin=z["default"],g.addLanguage=function(a,b){var c;return a=(""+a).toLowerCase(),g.options.languages=(0,B["default"])(g.options.languages,(c={},c[a]=b,c)),g.options.languages[a]},g.log=O["default"],g.createTimeRange=g.createTimeRanges=K.createTimeRanges,g.formatTime=M["default"],g.parseUrl=U.parseUrl,g.isCrossOrigin=U.isCrossOrigin,g.EventTarget=t["default"],g.on=v.on,g.one=v.one,g.off=v.off,g.trigger=v.trigger,g.xhr=_["default"],g.TextTrack=F["default"],g.AudioTrack=H["default"],g.VideoTrack=J["default"],g.isEl=Q.isEl,g.isTextNode=Q.isTextNode,g.createEl=Q.createEl,g.hasClass=Q.hasElClass,g.addClass=Q.addElClass,g.removeClass=Q.removeElClass,g.toggleClass=Q.toggleElClass,g.setAttributes=Q.setElAttributes,g.getAttributes=Q.getElAttributes,g.emptyEl=Q.emptyEl,g.appendContent=Q.appendContent,g.insertContent=Q.insertContent,g.computedStyle=X["default"],"function"==typeof a&&a.amd?a("videojs",[],function(){return g}):"object"===("undefined"==typeof d?"undefined":h(d))&&"object"===("undefined"==typeof c?"undefined":h(c))&&(c.exports=g),d["default"]=g},{42:42,43:43,5:5,51:51,52:52,56:56,62:62,64:64,72:72,77:77,78:78,80:80,81:81,82:82,83:83,84:84,86:86,87:87,88:88,89:89,90:90,92:92,94:94,95:95,99:99}],94:[function(a,b,c){(function(c){var d="undefined"!=typeof c?c:"undefined"!=typeof window?window:{},e=a(96);if("undefined"!=typeof document)b.exports=document;else{var f=d["__GLOBAL_DOCUMENT_CACHE@4"];f||(f=d["__GLOBAL_DOCUMENT_CACHE@4"]=e),b.exports=f}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{96:96}],95:[function(a,b,c){(function(a){"undefined"!=typeof window?b.exports=window:"undefined"!=typeof a?b.exports=a:"undefined"!=typeof self?b.exports=self:b.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],96:[function(a,b,c){},{}],97:[function(a,b,c){function d(a,b){var c,d=null;try{c=JSON.parse(a,b)}catch(e){d=e}return[d,c]}b.exports=d},{}],98:[function(a,b,c){function d(a){return a.replace(/\n\r?\s*/g,"")}b.exports=function(a){for(var b="",c=0;c0&&(o=setTimeout(function(){if(!n){n=!0,k.abort("timeout");var a=new Error("XMLHttpRequest timeout");a.code="ETIMEDOUT",d(a)}},a.timeout)),k.setRequestHeader)for(l in s)s.hasOwnProperty(l)&&k.setRequestHeader(l,s[l]);else if(a.headers&&!e(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(k.responseType=a.responseType),"beforeSend"in a&&"function"==typeof a.beforeSend&&a.beforeSend(k),k.send(r||null),k}function i(a){if("document"===a.responseType)return a.responseXML;var b=a.responseXML&&"parsererror"===a.responseXML.documentElement.nodeName;return""!==a.responseType||b?null:a.responseXML}function j(){}var k=a(95),l=a(100),m=a(103),n=a(104);b.exports=g,g.XMLHttpRequest=k.XMLHttpRequest||j,g.XDomainRequest="withCredentials"in new g.XMLHttpRequest?g.XMLHttpRequest:k.XDomainRequest,d(["get","put","post","patch","head","delete"],function(a){g["delete"===a?"del":a]=function(b,c,d){return c=f(b,c,d),c.method=a.toUpperCase(),h(c)}})},{100:100,103:103,104:104,95:95}],100:[function(a,b,c){function d(a){var b=e.call(a);return"[object Function]"===b||"function"==typeof a&&"[object RegExp]"!==b||"undefined"!=typeof window&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}b.exports=d;var e=Object.prototype.toString},{}],101:[function(a,b,c){function d(a,b,c){if(!h(b))throw new TypeError("iterator must be a function");arguments.length<3&&(c=this),"[object Array]"===i.call(a)?e(a,b,c):"string"==typeof a?f(a,b,c):g(a,b,c)}function e(a,b,c){for(var d=0,e=a.length;d59?b(c[1],c[2],0,c[4]):b(0,c[1],c[2],c[4]):null}function d(){this.values=p(null)}function e(a,b,c,d){var e=d?a.split(d):[a];for(var f in e)if("string"==typeof e[f]){var g=e[f].split(c);if(2===g.length){var h=g[0],i=g[1];b(h,i)}}}function f(a,f,g){function h(){var d=c(a);if(null===d)throw new b(b.Errors.BadTimeStamp,"Malformed timestamp: "+k);return a=a.replace(/^[^\sa-zA-Z-]+/,""),d}function i(a,b){var c=new d;e(a,function(a,b){switch(a){case"region":for(var d=g.length-1;d>=0;d--)if(g[d].id===b){c.set(a,g[d].region);break}break;case"vertical":c.alt(a,b,["rl","lr"]);break;case"line":var e=b.split(","),f=e[0];c.integer(a,f),c.percent(a,f)?c.set("snapToLines",!1):null,c.alt(a,f,["auto"]),2===e.length&&c.alt("lineAlign",e[1],["start","middle","end"]);break;case"position":e=b.split(","),c.percent(a,e[0]),2===e.length&&c.alt("positionAlign",e[1],["start","middle","end"]);break;case"size":c.percent(a,b);break;case"align":c.alt(a,b,["start","middle","end","left","right"])}},/:/,/\s/),b.region=c.get("region",null),b.vertical=c.get("vertical",""),b.line=c.get("line","auto"),b.lineAlign=c.get("lineAlign","start"),b.snapToLines=c.get("snapToLines",!0),b.size=c.get("size",100),b.align=c.get("align","middle"),b.position=c.get("position",{start:0,left:0,middle:50,end:100,right:100},b.align),b.positionAlign=c.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},b.align)}function j(){a=a.replace(/^\s+/,"")}var k=a;if(j(),f.startTime=h(),j(),"-->"!==a.substr(0,3))throw new b(b.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+k);a=a.substr(3),j(),f.endTime=h(),j(),i(a,f)}function g(a,b){function d(){function a(a){return b=b.substr(a.length),a}if(!b)return null;var c=b.match(/^([^<]*)(<[^>]+>?)?/);return a(c[1]?c[1]:c[2])}function e(a){return q[a]}function f(a){for(;o=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(o[0],e);return a}function g(a,b){return!t[b.localName]||t[b.localName]===a.localName}function h(b,c){var d=r[b];if(!d)return null;var e=a.document.createElement(d);e.localName=d;var f=s[b];return f&&c&&(e[f]=c.trim()),e}for(var i,j=a.document.createElement("div"),k=j,l=[];null!==(i=d());)if("<"!==i[0])k.appendChild(a.document.createTextNode(f(i)));else{if("/"===i[1]){l.length&&l[l.length-1]===i.substr(2).replace(">","")&&(l.pop(),k=k.parentNode);continue}var m,n=c(i.substr(1,i.length-2));if(n){m=a.document.createProcessingInstruction("timestamp",n),k.appendChild(m);continue}var o=i.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!o)continue;if(m=h(o[1],o[3]),!m)continue;if(!g(k,m))continue;o[2]&&(m.className=o[2].substr(1).replace("."," ")),l.push(o[1]),k.appendChild(m),k=m}return j}function h(a){for(var b=0;b=c[0]&&a<=c[1])return!0}return!1}function i(a){function b(a,b){for(var c=b.childNodes.length-1;c>=0;c--)a.push(b.childNodes[c])}function c(a){if(!a||!a.length)return null;var d=a.pop(),e=d.textContent||d.innerText;if(e){var f=e.match(/^.*(\n|\r)/);return f?(a.length=0,f[0]):e}return"ruby"===d.tagName?c(a):d.childNodes?(b(a,d),c(a)):void 0}var d,e=[],f="";if(!a||!a.childNodes)return"ltr";for(b(e,a);f=c(e);)for(var g=0;g=0&&a.line<=100))return a.line;if(!a.track||!a.track.textTrackList||!a.track.textTrackList.mediaElement)return-1;for(var b=a.track,c=b.textTrackList,d=0,e=0;ei&&(e=new m(a),g=i),a=new m(f)}return e||f}var f=new m(b),g=b.cue,h=j(g),i=[];if(g.snapToLines){var k;switch(g.vertical){case"":i=["+y","-y"],k="height";break;case"rl":i=["+x","-x"],k="width";break;case"lr":i=["-x","+x"],k="width"}var l=f.lineHeight,n=l*Math.round(h),o=c[k]+l,p=i[0];Math.abs(n)>o&&(n=n<0?-1:1,n*=Math.ceil(o/l)*l),h<0&&(n+=""===g.vertical?c.height:c.width,i=i.reverse()),f.move(p,n)}else{var q=f.lineHeight/c.height*100;switch(g.lineAlign){case"middle":h-=q/2;break;case"end":h-=q}switch(g.vertical){case"":b.applyStyles({top:b.formatStyle(h,"%")});break;case"rl":b.applyStyles({left:b.formatStyle(h,"%")});break;case"lr":b.applyStyles({right:b.formatStyle(h,"%")})}i=["+y","-x","+x","-y"],f=new m(b)}var r=e(f,i);b.move(r.toCSSCompatValues(c))}function o(){}var p=Object.create||function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return a.prototype=b,new a}}();b.prototype=p(Error.prototype),b.prototype.constructor=b,b.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},d.prototype={set:function(a,b){this.get(a)||""===b||(this.values[a]=b)},get:function(a,b,c){return c?this.has(a)?this.values[a]:b[c]:this.has(a)?this.values[a]:b},has:function(a){return a in this.values},alt:function(a,b,c){for(var d=0;d=0&&b<=100))&&(this.set(a,b),!0)}};var q={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},r={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},s={v:"title",lang:"lang"},t={rt:"ruby"},u=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];k.prototype.applyStyles=function(a,b){b=b||this.div;for(var c in a)a.hasOwnProperty(c)&&(b.style[c]=a[c])},k.prototype.formatStyle=function(a,b){return 0===a?0:a+b},l.prototype=p(k.prototype),l.prototype.constructor=l,m.prototype.move=function(a,b){switch(b=void 0!==b?b:this.lineHeight,a){case"+x":this.left+=b,this.right+=b;break;case"-x":this.left-=b,this.right-=b;break;case"+y":this.top+=b,this.bottom+=b;break;case"-y":this.top-=b,this.bottom-=b}},m.prototype.overlaps=function(a){return this.lefta.left&&this.topa.top},m.prototype.overlapsAny=function(a){for(var b=0;b=a.top&&this.bottom<=a.bottom&&this.left>=a.left&&this.right<=a.right},m.prototype.overlapsOppositeAxis=function(a,b){switch(b){case"+x":return this.lefta.right;case"+y":return this.topa.bottom}},m.prototype.intersectPercentage=function(a){var b=Math.max(0,Math.min(this.right,a.right)-Math.max(this.left,a.left)),c=Math.max(0,Math.min(this.bottom,a.bottom)-Math.max(this.top,a.top)),d=b*c;return d/(this.height*this.width)},m.prototype.toCSSCompatValues=function(a){return{top:this.top-a.top,bottom:a.bottom-this.bottom,left:this.left-a.left,right:a.right-this.right,height:this.height,width:this.width}},m.getSimpleBoxPosition=function(a){var b=a.div?a.div.offsetHeight:a.tagName?a.offsetHeight:0,c=a.div?a.div.offsetWidth:a.tagName?a.offsetWidth:0,d=a.div?a.div.offsetTop:a.tagName?a.offsetTop:0;a=a.div?a.div.getBoundingClientRect():a.tagName?a.getBoundingClientRect():a;var e={left:a.left,right:a.right,top:a.top||d,height:a.height||b,bottom:a.bottom||d+(a.height||b),width:a.width||c};return e},o.StringDecoder=function(){return{decode:function(a){if(!a)return"";if("string"!=typeof a)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}},o.convertCueToDOMTree=function(a,b){return a&&b?g(a,b):null};var v=.05,w="sans-serif",x="1.5%";o.processCues=function(a,b,c){function d(a){for(var b=0;b")===-1){i.cue.id=j;continue}case"CUE":try{f(j,i.cue,i.regionList)}catch(m){i.reportOrThrowError(m),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var n=j.indexOf("-->")!==-1;if(!j||n&&(l=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=j;continue;case"BADCUE":j||(i.state="ID");continue}}}catch(m){i.reportOrThrowError(m),"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||"HEADER"===a.state)&&(a.buffer+="\n\n",a.parse()),"INITIAL"===a.state)throw new b(b.Errors.BadSignature)}catch(c){a.reportOrThrowError(c)}return a.onflush&&a.onflush(),this}},a.WebVTT=o}(this,this.vttjs||{})},{}],107:[function(a,b,c){"undefined"!=typeof b&&b.exports&&(this.VTTCue=this.VTTCue||a(108).VTTCue),function(a){a.VTTCue.prototype.toJSON=function(){var a={},b=this;return Object.keys(this).forEach(function(c){"getCueAsHTML"!==c&&"hasBeenReset"!==c&&"displayState"!==c&&(a[c]=b[c])}),a},a.VTTCue.create=function(b){if(!b.hasOwnProperty("startTime")||!b.hasOwnProperty("endTime")||!b.hasOwnProperty("text"))throw new Error("You must at least have start time, end time, and text.");var c=new a.VTTCue(b.startTime,b.endTime,b.text);for(var d in b)c.hasOwnProperty(d)&&(c[d]=b[d]);return c},a.VTTCue.fromJSON=function(a){return this.create(JSON.parse(a))}}(this)},{108:108}],108:[function(a,b,c){!function(a,b){function c(a){if("string"!=typeof a)return!1;var b=h[a.toLowerCase()];return!!b&&a.toLowerCase()}function d(a){if("string"!=typeof a)return!1;var b=i[a.toLowerCase()];return!!b&&a.toLowerCase()}function e(a){for(var b=1;b100)throw new Error("Position must be between 0 and 100.");u=a,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",e({},j,{get:function(){return v},set:function(a){var b=d(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",e({},j,{get:function(){return w},set:function(a){if(a<0||a>100)throw new Error("Size must be between 0 and 100.");w=a,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",e({},j,{get:function(){return x},set:function(a){var b=d(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");x=b,this.hasBeenReset=!0}})),h.displayState=void 0,i)return h}var g="auto",h={"":!0,lr:!0,rl:!0},i={start:!0,middle:!0,end:!0,left:!0,right:!0};f.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},a.VTTCue=a.VTTCue||f,b.VTTCue=f}(this,this.vttjs||{})},{}],109:[function(a,b,c){"undefined"!=typeof b&&b.exports&&(this.VTTRegion=a(110).VTTRegion),function(a){a.VTTRegion.create=function(b){var c=new a.VTTRegion;for(var d in b)c.hasOwnProperty(d)&&(c[d]=b[d]);return c},a.VTTRegion.fromJSON=function(a){return this.create(JSON.parse(a))}}(this)},{110:110}],110:[function(a,b,c){!function(a,b){function c(a){if("string"!=typeof a)return!1;var b=f[a.toLowerCase()];return!!b&&a.toLowerCase()}function d(a){return"number"==typeof a&&a>=0&&a<=100}function e(){var a=100,b=3,e=0,f=100,g=0,h=100,i="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(b){if(!d(b))throw new Error("Width must be between 0 and 100.");a=b}},lines:{enumerable:!0,get:function(){return b},set:function(a){if("number"!=typeof a)throw new TypeError("Lines must be set to a number.");b=a}},regionAnchorY:{enumerable:!0,get:function(){return f},set:function(a){if(!d(a))throw new Error("RegionAnchorX must be between 0 and 100.");f=a}},regionAnchorX:{enumerable:!0,get:function(){return e},set:function(a){if(!d(a))throw new Error("RegionAnchorY must be between 0 and 100.");e=a}},viewportAnchorY:{enumerable:!0,get:function(){return h},set:function(a){if(!d(a))throw new Error("ViewportAnchorY must be between 0 and 100.");h=a}},viewportAnchorX:{enumerable:!0,get:function(){return g},set:function(a){if(!d(a))throw new Error("ViewportAnchorX must be between 0 and 100.");g=a}},scroll:{enumerable:!0,get:function(){return i},set:function(a){var b=c(a);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");i=b}}})}var f={"":!0,up:!0};a.VTTRegion=a.VTTRegion||e,b.VTTRegion=e}(this,this.vttjs||{})},{}]},{},[93])(93)}); \ No newline at end of file diff --git a/media/player/videojs/amd/src/Youtube-lazy.js b/media/player/videojs/amd/src/Youtube-lazy.js index 571c6021bb5..37f2e552792 100644 --- a/media/player/videojs/amd/src/Youtube-lazy.js +++ b/media/player/videojs/amd/src/Youtube-lazy.js @@ -33,7 +33,8 @@ THE SOFTWARE. */ }(this, function(videojs) { 'use strict'; - var Tech = videojs.getComponent('Tech'); + var _isOnMobile = videojs.browser.IS_IOS || videojs.browser.IS_ANDROID; + var Tech = videojs.getTech('Tech'); var Youtube = videojs.extend(Tech, { @@ -77,7 +78,7 @@ THE SOFTWARE. */ this.el_.parentNode.className = this.el_.parentNode.className .replace(' vjs-youtube', '') .replace(' vjs-youtube-mobile', ''); - this.el_.remove(); + this.el_.parentNode.removeChild(this.el_); //Needs to be called after the YouTube player is destroyed, otherwise there will be a null reference exception Tech.prototype.dispose.call(this); @@ -206,6 +207,14 @@ THE SOFTWARE. */ playerVars.theme = this.options_.theme; } + // Allow undocumented options to be passed along via customVars + if (typeof this.options_.customVars !== 'undefined') { + var customVars = this.options_.customVars; + Object.keys(customVars).forEach(function(key) { + playerVars[key] = customVars[key]; + }); + } + this.activeVideoId = this.url ? this.url.videoId : null; this.activeList = playerVars.list; @@ -215,6 +224,7 @@ THE SOFTWARE. */ events: { onReady: this.onPlayerReady.bind(this), onPlaybackQualityChange: this.onPlayerPlaybackQualityChange.bind(this), + onPlaybackRateChange: this.onPlayerPlaybackRateChange.bind(this), onStateChange: this.onPlayerStateChange.bind(this), onError: this.onPlayerError.bind(this) } @@ -222,13 +232,22 @@ THE SOFTWARE. */ }, onPlayerReady: function() { + if (this.options_.muted) { + this.ytPlayer.mute(); + } + + var playbackRates = this.ytPlayer.getAvailablePlaybackRates(); + if (playbackRates.length > 1) { + this.featuresPlaybackRate = true; + } + this.playerReady_ = true; this.triggerReady(); if (this.playOnReady) { this.play(); } else if (this.cueOnReady) { - this.ytPlayer.cueVideoById(this.url.videoId); + this.cueVideoById_(this.url.videoId); this.activeVideoId = this.url.videoId; } }, @@ -237,6 +256,10 @@ THE SOFTWARE. */ }, + onPlayerPlaybackRateChange: function() { + this.trigger('ratechange'); + }, + onPlayerStateChange: function(e) { var state = e.data; @@ -251,6 +274,7 @@ THE SOFTWARE. */ this.trigger('loadstart'); this.trigger('loadedmetadata'); this.trigger('durationchange'); + this.trigger('ratechange'); break; case YT.PlayerState.ENDED: @@ -286,26 +310,55 @@ THE SOFTWARE. */ onPlayerError: function(e) { this.errorNumber = e.data; + this.trigger('pause'); this.trigger('error'); - - this.ytPlayer.stopVideo(); }, error: function() { + var code = 1000 + this.errorNumber; // as smaller codes are reserved switch (this.errorNumber) { case 5: - return { code: 'Error while trying to play the video' }; + return { code: code, message: 'Error while trying to play the video' }; case 2: case 100: - return { code: 'Unable to find the video' }; + return { code: code, message: 'Unable to find the video' }; case 101: case 150: - return { code: 'Playback on other Websites has been disabled by the video owner.' }; + return { + code: code, + message: 'Playback on other Websites has been disabled by the video owner.' + }; } - return { code: 'YouTube unknown error (' + this.errorNumber + ')' }; + return { code: code, message: 'YouTube unknown error (' + this.errorNumber + ')' }; + }, + + loadVideoById_: function(id) { + var options = { + videoId: id + }; + if (this.options_.start) { + options.startSeconds = this.options_.start; + } + if (this.options_.end) { + options.endEnd = this.options_.end; + } + this.ytPlayer.loadVideoById(options); + }, + + cueVideoById_: function(id) { + var options = { + videoId: id + }; + if (this.options_.start) { + options.startSeconds = this.options_.start; + } + if (this.options_.end) { + options.endEnd = this.options_.end; + } + this.ytPlayer.cueVideoById(options); }, src: function(src) { @@ -358,7 +411,7 @@ THE SOFTWARE. */ } } else if (this.activeVideoId !== this.url.videoId) { if (this.isReady_) { - this.ytPlayer.cueVideoById(this.url.videoId); + this.cueVideoById_(this.url.videoId); this.activeVideoId = this.url.videoId; } else { this.cueOnReady = true; @@ -402,7 +455,7 @@ THE SOFTWARE. */ if (this.activeVideoId === this.url.videoId) { this.ytPlayer.playVideo(); } else { - this.ytPlayer.loadVideoById(this.url.videoId); + this.loadVideoById_(this.url.videoId); this.activeVideoId = this.url.videoId; } } else { @@ -463,24 +516,11 @@ THE SOFTWARE. */ }, seekable: function () { - if(!this.ytPlayer || !this.ytPlayer.getVideoLoadedFraction) { - return { - length: 0, - start: function() { - throw new Error('This TimeRanges object is empty'); - }, - end: function() { - throw new Error('This TimeRanges object is empty'); - } - }; + if(!this.ytPlayer) { + return videojs.createTimeRange(); } - var end = this.ytPlayer.getDuration(); - return { - length: this.ytPlayer.getDuration(), - start: function() { return 0; }, - end: function() { return end; } - }; + return videojs.createTimeRange(0, this.ytPlayer.getDuration()); }, onSeeked: function() { @@ -504,7 +544,6 @@ THE SOFTWARE. */ } this.ytPlayer.setPlaybackRate(suggestedRate); - this.trigger('ratechange'); }, duration: function() { @@ -559,24 +598,12 @@ THE SOFTWARE. */ buffered: function() { if(!this.ytPlayer || !this.ytPlayer.getVideoLoadedFraction) { - return { - length: 0, - start: function() { - throw new Error('This TimeRanges object is empty'); - }, - end: function() { - throw new Error('This TimeRanges object is empty'); - } - }; + return videojs.createTimeRange(); } - var end = this.ytPlayer.getVideoLoadedFraction() * this.ytPlayer.getDuration(); + var bufferedEnd = this.ytPlayer.getVideoLoadedFraction() * this.ytPlayer.getDuration(); - return { - length: this.ytPlayer.getDuration(), - start: function() { return 0; }, - end: function() { return end; } - }; + return videojs.createTimeRange(0, bufferedEnd); }, // TODO: Can we really do something with this on YouTUbe? @@ -626,8 +653,6 @@ THE SOFTWARE. */ return (e === 'video/youtube'); }; - var _isOnMobile = videojs.browser.IS_IOS || useNativeControlsOnAndroid(); - Youtube.parseUrl = function(url) { var result = { videoId: null @@ -701,14 +726,6 @@ THE SOFTWARE. */ head.appendChild(style); } - function useNativeControlsOnAndroid() { - var stockRegex = window.navigator.userAgent.match(/applewebkit\/(\d*).*Version\/(\d*.\d*)/i); - //True only Android Stock Browser on OS versions 4.X and below - //where a Webkit version and a "Version/X.X" String can be found in - //user agent. - return videojs.browser.IS_ANDROID && videojs.browser.ANDROID_VERSION < 5 && stockRegex && stockRegex[2] > 0; - } - Youtube.apiReadyQueue = []; loadScript('https://www.youtube.com/iframe_api', apiLoaded); diff --git a/media/player/videojs/amd/src/video-lazy.js b/media/player/videojs/amd/src/video-lazy.js index 258cd062d7d..95394bc1a72 100644 --- a/media/player/videojs/amd/src/video-lazy.js +++ b/media/player/videojs/amd/src/video-lazy.js @@ -1,6 +1,6 @@ /** * @license - * Video.js 5.12.6 + * Video.js 5.18.4 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * @@ -35,49 +35,70 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * Initial play button. Shows before the video has played. The hiding of the - * big play button is done via CSS and player states. + * The initial play button that shows before the video has played. The hiding of the + * `BigPlayButton` get done via CSS and `Player` states. * - * @param {Object} player Main Player - * @param {Object=} options Object of option names and values * @extends Button - * @class BigPlayButton */ var BigPlayButton = function (_Button) { _inherits(BigPlayButton, _Button); - function BigPlayButton(player, options) { + function BigPlayButton() { _classCallCheck(this, BigPlayButton); - return _possibleConstructorReturn(this, _Button.call(this, player, options)); + return _possibleConstructorReturn(this, _Button.apply(this, arguments)); } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. Always returns 'vjs-big-play-button'. */ - - BigPlayButton.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-big-play-button'; }; /** - * Handles click for play + * This gets called when a `BigPlayButton` "clicked". See {@link ClickableComponent} + * for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - BigPlayButton.prototype.handleClick = function handleClick() { + BigPlayButton.prototype.handleClick = function handleClick(event) { this.player_.play(); + + var cb = this.player_.getChild('controlBar'); + var playToggle = cb && cb.getChild('playToggle'); + + if (!playToggle) { + this.player_.focus(); + return; + } + + this.setTimeout(function () { + playToggle.focus(); + }, 1); }; return BigPlayButton; }(_button2['default']); +/** + * The text that should display over the `BigPlayButton`s controls. Added to for localization. + * + * @type {string} + * @private + */ + + BigPlayButton.prototype.controlText_ = 'Play Video'; _component2['default'].registerComponent('BigPlayButton', BigPlayButton); @@ -96,13 +117,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _log = _dereq_(85); +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); -var _object = _dereq_(136); - -var _object2 = _interopRequireDefault(_object); +var _obj = _dereq_(88); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } @@ -116,39 +135,40 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * Base class for all buttons + * Base class for all buttons. * - * @param {Object} player Main Player - * @param {Object=} options Object of option names and values * @extends ClickableComponent - * @class Button */ var Button = function (_ClickableComponent) { _inherits(Button, _ClickableComponent); - function Button(player, options) { + function Button() { _classCallCheck(this, Button); - return _possibleConstructorReturn(this, _ClickableComponent.call(this, player, options)); + return _possibleConstructorReturn(this, _ClickableComponent.apply(this, arguments)); } /** - * Create the component's DOM element + * Create the `Button`s DOM element. + * + * @param {string} [tag=button] + * Element's node type. e.g. 'button' + * + * @param {Object} [props={}] + * An object of properties that should be set on the element. + * + * @param {Object} [attributes={}] + * An object of attributes that should be set on the element. * - * @param {String=} type Element's node type. e.g. 'div' - * @param {Object=} props An object of properties that should be set on the element - * @param {Object=} attributes An object of attributes that should be set on the element * @return {Element} - * @method createEl + * The element that gets created. */ - - Button.prototype.createEl = function createEl() { var tag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'button'; var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - props = (0, _object2['default'])({ + props = (0, _obj.assign)({ className: this.buildCSSClass() }, props); @@ -156,18 +176,18 @@ var Button = function (_ClickableComponent) { _log2['default'].warn('Creating a Button with an HTML element of ' + tag + ' is deprecated; use ClickableComponent instead.'); // Add properties for clickable element which is not a native HTML button - props = (0, _object2['default'])({ + props = (0, _obj.assign)({ tabIndex: 0 }, props); // Add ARIA attributes for clickable element which is not a native HTML button - attributes = (0, _object2['default'])({ + attributes = (0, _obj.assign)({ role: 'button' }, attributes); } // Add attributes for button element - attributes = (0, _object2['default'])({ + attributes = (0, _obj.assign)({ // Necessary since the default button type is "submit" 'type': 'button', @@ -184,13 +204,20 @@ var Button = function (_ClickableComponent) { }; /** - * Adds a child component inside this button + * Add a child `Component` inside of this `Button`. * - * @param {String|Component} child The class name or instance of a child to add - * @param {Object=} options Options, including options to be passed to children of the child. - * @return {Component} The child component (created by this process if a string was used) - * @deprecated - * @method addChild + * @param {string|Component} child + * The name or instance of a child to add. + * + * @param {Object} [options={}] + * The key/value store of options that will get passed to children of + * the child. + * + * @return {Component} + * The `Component` that gets added as a child. When using a string the + * `Component` will get created by this process. + * + * @deprecated since version 5 */ @@ -206,9 +233,35 @@ var Button = function (_ClickableComponent) { }; /** - * Handle KeyPress (document level) - Extend with specific functionality for button + * Enable the `Button` element so that it can be activated or clicked. Use this with + * {@link Button#disable}. + */ + + + Button.prototype.enable = function enable() { + _ClickableComponent.prototype.enable.call(this); + this.el_.removeAttribute('disabled'); + }; + + /** + * Enable the `Button` element so that it cannot be activated or clicked. Use this with + * {@link Button#enable}. + */ + + + Button.prototype.disable = function disable() { + _ClickableComponent.prototype.disable.call(this); + this.el_.setAttribute('disabled', 'disabled'); + }; + + /** + * This gets called when a `Button` has focus and `keydown` is triggered via a key + * press. * - * @method handleKeyPress + * @param {EventTarget~Event} event + * The event that caused this function to get called. + * + * @listens keydown */ @@ -229,7 +282,7 @@ var Button = function (_ClickableComponent) { _component2['default'].registerComponent('Button', Button); exports['default'] = Button; -},{"136":136,"3":3,"5":5,"85":85}],3:[function(_dereq_,module,exports){ +},{"3":3,"5":5,"86":86,"88":88}],3:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -238,29 +291,27 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _events = _dereq_(81); +var _events = _dereq_(82); var Events = _interopRequireWildcard(_events); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _log = _dereq_(85); +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); -var _object = _dereq_(136); - -var _object2 = _interopRequireDefault(_object); +var _obj = _dereq_(88); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } @@ -276,16 +327,23 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * Clickable Component which is clickable or keyboard actionable, but is not a native HTML button + * Clickable Component which is clickable or keyboard actionable, + * but is not a native HTML button. * - * @param {Object} player Main Player - * @param {Object=} options Object of option names and values * @extends Component - * @class ClickableComponent */ var ClickableComponent = function (_Component) { _inherits(ClickableComponent, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function ClickableComponent(player, options) { _classCallCheck(this, ClickableComponent); @@ -293,21 +351,24 @@ var ClickableComponent = function (_Component) { _this.emitTapEvents(); - _this.on('tap', _this.handleClick); - _this.on('click', _this.handleClick); - _this.on('focus', _this.handleFocus); - _this.on('blur', _this.handleBlur); + _this.enable(); return _this; } /** - * Create the component's DOM element + * Create the `Component`s DOM element. + * + * @param {string} [tag=div] + * The element's node type. + * + * @param {Object} [props={}] + * An object of properties that should be set on the element. + * + * @param {Object} [attributes={}] + * An object of attributes that should be set on the element. * - * @param {String=} type Element's node type. e.g. 'div' - * @param {Object=} props An object of properties that should be set on the element - * @param {Object=} attributes An object of attributes that should be set on the element * @return {Element} - * @method createEl + * The element that gets created. */ @@ -316,7 +377,7 @@ var ClickableComponent = function (_Component) { var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - props = (0, _object2['default'])({ + props = (0, _obj.assign)({ className: this.buildCSSClass(), tabIndex: 0 }, props); @@ -326,13 +387,15 @@ var ClickableComponent = function (_Component) { } // Add ARIA attributes for clickable element which is not a native HTML button - attributes = (0, _object2['default'])({ + attributes = (0, _obj.assign)({ 'role': 'button', // let the screen reader user know that the text of the element may change 'aria-live': 'polite' }, attributes); + this.tabIndex_ = props.tabIndex; + var el = _Component.prototype.createEl.call(this, tag, props, attributes); this.createControlTextEl(el); @@ -341,11 +404,13 @@ var ClickableComponent = function (_Component) { }; /** - * create control text + * Create a control text element on this `Component` + * + * @param {Element} [el] + * Parent element for the control text. * - * @param {Element} el Parent element for the control text * @return {Element} - * @method controlText + * The control text element that gets created. */ @@ -364,12 +429,17 @@ var ClickableComponent = function (_Component) { }; /** - * Controls text - both request and localize + * Get or set the localize text to use for the controls on the `Component`. * - * @param {String} text Text for element - * @param {Element=} el Element to set the title on - * @return {String} - * @method controlText + * @param {string} [text] + * Control text for element. + * + * @param {Element} [el=this.el()] + * Element to set the title on. + * + * @return {string|ClickableComponent} + * - The control text when getting + * - Returns itself when setting; method can be chained. */ @@ -384,16 +454,20 @@ var ClickableComponent = function (_Component) { this.controlText_ = text; this.controlTextEl_.innerHTML = localizedText; - el.setAttribute('title', localizedText); + + if (!this.nonIconControl) { + // Set title attribute if only an icon is shown + el.setAttribute('title', localizedText); + } return this; }; /** - * Allows sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -402,81 +476,97 @@ var ClickableComponent = function (_Component) { }; /** - * Adds a child component inside this clickable-component + * Enable this `Component`s element. * - * @param {String|Component} child The class name or instance of a child to add - * @param {Object=} options Options, including options to be passed to children of the child. - * @return {Component} The child component (created by this process if a string was used) - * @method addChild - */ - - - ClickableComponent.prototype.addChild = function addChild(child) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - // TODO: Fix adding an actionable child to a ClickableComponent; currently - // it will cause issues with assistive technology (e.g. screen readers) - // which support ARIA, since an element with role="button" cannot have - // actionable child elements. - - // let className = this.constructor.name; - // log.warn(`Adding a child to a ClickableComponent (${className}) can cause issues with assistive technology which supports ARIA, since an element with role="button" cannot have actionable child elements.`); - - return _Component.prototype.addChild.call(this, child, options); - }; - - /** - * Enable the component element - * - * @return {Component} - * @method enable + * @return {ClickableComponent} + * Returns itself; method can be chained. */ ClickableComponent.prototype.enable = function enable() { this.removeClass('vjs-disabled'); this.el_.setAttribute('aria-disabled', 'false'); + if (typeof this.tabIndex_ !== 'undefined') { + this.el_.setAttribute('tabIndex', this.tabIndex_); + } + this.on('tap', this.handleClick); + this.on('click', this.handleClick); + this.on('focus', this.handleFocus); + this.on('blur', this.handleBlur); return this; }; /** - * Disable the component element + * Disable this `Component`s element. * - * @return {Component} - * @method disable + * @return {ClickableComponent} + * Returns itself; method can be chained. */ ClickableComponent.prototype.disable = function disable() { this.addClass('vjs-disabled'); this.el_.setAttribute('aria-disabled', 'true'); + if (typeof this.tabIndex_ !== 'undefined') { + this.el_.removeAttribute('tabIndex'); + } + this.off('tap', this.handleClick); + this.off('click', this.handleClick); + this.off('focus', this.handleFocus); + this.off('blur', this.handleBlur); return this; }; /** - * Handle Click - Override with specific functionality for component + * This gets called when a `ClickableComponent` gets: + * - Clicked (via the `click` event, listening starts in the constructor) + * - Tapped (via the `tap` event, listening starts in the constructor) + * - The following things happen in order: + * 1. {@link ClickableComponent#handleFocus} is called via a `focus` event on the + * `ClickableComponent`. + * 2. {@link ClickableComponent#handleFocus} adds a listener for `keydown` on using + * {@link ClickableComponent#handleKeyPress}. + * 3. `ClickableComponent` has not had a `blur` event (`blur` means that focus was lost). The user presses + * the space or enter key. + * 4. {@link ClickableComponent#handleKeyPress} calls this function with the `keydown` + * event as a parameter. * - * @method handleClick + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + * @abstract */ - ClickableComponent.prototype.handleClick = function handleClick() {}; + ClickableComponent.prototype.handleClick = function handleClick(event) {}; /** - * Handle Focus - Add keyboard functionality to element + * This gets called when a `ClickableComponent` gains focus via a `focus` event. + * Turns on listening for `keydown` events. When they happen it + * calls `this.handleKeyPress`. * - * @method handleFocus + * @param {EventTarget~Event} event + * The `focus` event that caused this function to be called. + * + * @listens focus */ - ClickableComponent.prototype.handleFocus = function handleFocus() { + ClickableComponent.prototype.handleFocus = function handleFocus(event) { Events.on(_document2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); }; /** - * Handle KeyPress (document level) - Trigger click when Space or Enter key is pressed + * Called when this ClickableComponent has focus and a key gets pressed down. By + * default it will call `this.handleClick` when the key is space or enter. * - * @method handleKeyPress + * @param {EventTarget~Event} event + * The `keydown` event that caused this function to be called. + * + * @listens keydown */ @@ -494,13 +584,17 @@ var ClickableComponent = function (_Component) { }; /** - * Handle Blur - Remove keyboard triggers + * Called when a `ClickableComponent` loses focus. Turns off the listener for + * `keydown` events. Which Stops `this.handleKeyPress` from getting called. * - * @method handleBlur + * @param {EventTarget~Event} event + * The `blur` event that caused this function to be called. + * + * @listens blur */ - ClickableComponent.prototype.handleBlur = function handleBlur() { + ClickableComponent.prototype.handleBlur = function handleBlur(event) { Events.off(_document2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); }; @@ -510,7 +604,7 @@ var ClickableComponent = function (_Component) { _component2['default'].registerComponent('ClickableComponent', ClickableComponent); exports['default'] = ClickableComponent; -},{"136":136,"5":5,"80":80,"81":81,"82":82,"85":85,"92":92}],4:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"82":82,"83":83,"86":86,"88":88,"94":94}],4:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -529,18 +623,29 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file close-button.js + */ + /** - * The `CloseButton` component is a button which fires a "close" event - * when it is activated. + * The `CloseButton` is a `{@link Button}` that fires a `close` event when + * it gets clicked. * * @extends Button - * @class CloseButton */ var CloseButton = function (_Button) { _inherits(CloseButton, _Button); + /** + * Creates an instance of the this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function CloseButton(player, options) { _classCallCheck(this, CloseButton); @@ -550,11 +655,45 @@ var CloseButton = function (_Button) { return _this; } + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + CloseButton.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-close-button ' + _Button.prototype.buildCSSClass.call(this); }; - CloseButton.prototype.handleClick = function handleClick() { + /** + * This gets called when a `CloseButton` gets clicked. See + * {@link ClickableComponent#handleClick} for more information on when this will be + * triggered + * + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + * @fires CloseButton#close + */ + + + CloseButton.prototype.handleClick = function handleClick(event) { + + /** + * Triggered when the a `CloseButton` is clicked. + * + * @event CloseButton#close + * @type {EventTarget~Event} + * + * @property {boolean} [bubbles=false] + * set to false so that the close event does not + * bubble up to parents if there is no listener + */ this.trigger({ type: 'close', bubbles: false }); }; @@ -569,35 +708,35 @@ exports['default'] = CloseButton; exports.__esModule = true; -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _guid = _dereq_(84); +var _guid = _dereq_(85); var Guid = _interopRequireWildcard(_guid); -var _events = _dereq_(81); +var _events = _dereq_(82); var Events = _interopRequireWildcard(_events); -var _log = _dereq_(85); +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); -var _toTitleCase = _dereq_(89); +var _toTitleCase = _dereq_(91); var _toTitleCase2 = _interopRequireDefault(_toTitleCase); -var _mergeOptions = _dereq_(86); +var _mergeOptions = _dereq_(87); var _mergeOptions2 = _interopRequireDefault(_mergeOptions); @@ -606,41 +745,47 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * @file component.js - * * Player Component - Base class for all UI objects + * + * @file component.js */ /** - * Base UI Component class - * Components are embeddable UI objects that are represented by both a - * javascript object and an element in the DOM. They can be children of other - * components, and can have many children themselves. - * ```js - * // adding a button to the player - * var button = player.addChild('button'); - * button.el(); // -> button element - * ``` - * ```html - *
- *
Button
- *
- * ``` - * Components are also event targets. - * ```js - * button.on('click', function() { - * console.log('Button Clicked!'); - * }); - * button.trigger('customevent'); - * ``` + * Base class for all UI Components. + * Components are UI objects which represent both a javascript object and an element + * in the DOM. They can be children of other components, and can have + * children themselves. * - * @param {Object} player Main Player - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function - * @class Component + * Components can also use methods from {@link EventTarget} */ var Component = function () { + + /** + * A callback that is called when a component is ready. Does not have any + * paramters and any callback value will be ignored. + * + * @callback Component~ReadyCallback + * @this Component + */ + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + # + * @param {Object[]} [options.children] + * An array of children objects to intialize this component with. Children objects have + * a name property that will be used if more than one component of the same type needs to be + * added. + * + * @param {Component~ReadyCallback} [ready] + * Function that gets called when the `Component` is ready. + */ function Component(player, options, ready) { _classCallCheck(this, Component); @@ -696,13 +841,24 @@ var Component = function () { } /** - * Dispose of the component and all child components + * Dispose of the `Component` and all child components. * - * @method dispose + * @fires Component#dispose */ Component.prototype.dispose = function dispose() { + + /** + * Triggered when a `Component` is disposed. + * + * @event Component#dispose + * @type {EventTarget~Event} + * + * @property {boolean} [bubbles=false] + * set to false so that the close event does not + * bubble up + */ this.trigger({ type: 'dispose', bubbles: false }); // Dispose all children. @@ -732,10 +888,10 @@ var Component = function () { }; /** - * Return the component's player + * Return the {@link Player} that the `Component` has attached to. * * @return {Player} - * @method player + * The player that this `Component` has attached to. */ @@ -744,43 +900,17 @@ var Component = function () { }; /** - * Deep merge of options objects - * Whenever a property is an object on both options objects - * the two properties will be merged using mergeOptions. + * Deep merge of options objects with new options. + * > Note: When both `obj` and `options` contain properties whose values are objects. + * The two properties get merged using {@link module:mergeOptions} * - * ```js - * Parent.prototype.options_ = { - * optionSet: { - * 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, - * 'childTwo': {}, - * 'childThree': {} - * } - * } - * newOptions = { - * optionSet: { - * 'childOne': { 'foo': 'baz', 'abc': '123' } - * 'childTwo': null, - * 'childFour': {} - * } - * } + * @param {Object} obj + * The object that contains new options. * - * this.options(newOptions); - * ``` - * RESULT - * ```js - * { - * optionSet: { - * 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, - * 'childTwo': null, // Disabled. Won't be initialized. - * 'childThree': {}, - * 'childFour': {} - * } - * } - * ``` + * @return {Object} + * A new object of `this.options_` and `obj` merged together. * - * @param {Object} obj Object of new option values - * @return {Object} A NEW object of this.options_ and obj merged - * @method options + * @deprecated since version 5 */ @@ -796,13 +926,10 @@ var Component = function () { }; /** - * Get the component's DOM element - * ```js - * var domEl = myComponent.el(); - * ``` + * Get the `Component`s DOM element * * @return {Element} - * @method el + * The DOM element for this `Component`. */ @@ -811,13 +938,19 @@ var Component = function () { }; /** - * Create the component's DOM element + * Create the `Component`s DOM element. + * + * @param {string} [tagName] + * Element's DOM node type. e.g. 'div' + * + * @param {Object} [properties] + * An object of properties that should be set. + * + * @param {Object} [attributes] + * An object of attributes that should be set. * - * @param {String=} tagName Element's node type. e.g. 'div' - * @param {Object=} properties An object of properties that should be set - * @param {Object=} attributes An object of attributes that should be set * @return {Element} - * @method createEl + * The element that gets created. */ @@ -825,6 +958,17 @@ var Component = function () { return Dom.createEl(tagName, properties, attributes); }; + /** + * Localize a string given the string in english. + * + * @param {string} string + * The string to localize. + * + * @return {string} + * The localized string or if no localization exists the english string. + */ + + Component.prototype.localize = function localize(string) { var code = this.player_.language && this.player_.language(); var languages = this.player_.languages && this.player_.languages(); @@ -850,11 +994,11 @@ var Component = function () { }; /** - * Return the component's DOM element where children are inserted. - * Will either be the same as el() or a new element defined in createEl(). + * Return the `Component`s DOM element. This is where children get inserted. + * This will usually be the the same as the element returned in {@link Component#el}. * * @return {Element} - * @method contentEl + * The content element for this `Component`. */ @@ -863,13 +1007,10 @@ var Component = function () { }; /** - * Get the component's ID - * ```js - * var id = myComponent.id(); - * ``` + * Get this `Component`s ID * - * @return {String} - * @method id + * @return {string} + * The id of this `Component` */ @@ -878,13 +1019,11 @@ var Component = function () { }; /** - * Get the component's name. The name is often used to reference the component. - * ```js - * var name = myComponent.name(); - * ``` + * Get the `Component`s name. The name gets used to reference the `Component` + * and is set during registration. * - * @return {String} - * @method name + * @return {string} + * The name of this `Component`. */ @@ -894,12 +1033,9 @@ var Component = function () { /** * Get an array of all child components - * ```js - * var kids = myComponent.children(); - * ``` * - * @return {Array} The children - * @method children + * @return {Array} + * The children */ @@ -908,10 +1044,13 @@ var Component = function () { }; /** - * Returns a child component with the provided ID + * Returns the child `Component` with the given `id`. * - * @return {Component} - * @method getChildById + * @param {string} id + * The id of the child `Component` to get. + * + * @return {Component|undefined} + * The child `Component` with the given `id` or undefined. */ @@ -920,44 +1059,43 @@ var Component = function () { }; /** - * Returns a child component with the provided name + * Returns the child `Component` with the given `name`. * - * @return {Component} - * @method getChild + * @param {string} name + * The name of the child `Component` to get. + * + * @return {Component|undefined} + * The child `Component` with the given `name` or undefined. */ Component.prototype.getChild = function getChild(name) { + if (!name) { + return; + } + + name = (0, _toTitleCase2['default'])(name); + return this.childNameIndex_[name]; }; /** - * Adds a child component inside this component - * ```js - * myComponent.el(); - * // ->
- * myComponent.children(); - * // [empty array] + * Add a child `Component` inside the current `Component`. * - * var myButton = myComponent.addChild('MyButton'); - * // ->
myButton
- * // -> myButton === myComponent.children()[0]; - * ``` - * Pass in options for child constructors and options for children of the child - * ```js - * var myButton = myComponent.addChild('MyButton', { - * text: 'Press Me', - * buttonChildExample: { - * buttonChildOption: true - * } - * }); - * ``` * - * @param {String|Component} child The class name or instance of a child to add - * @param {Object=} options Options, including options to be passed to children of the child. - * @param {Number} index into our children array to attempt to add the child - * @return {Component} The child component (created by this process if a string was used) - * @method addChild + * @param {string|Component} child + * The name or instance of a child to add. + * + * @param {Object} [options={}] + * The key/value store of options that will get passed to children of + * the child. + * + * @param {number} [index=this.children_.length] + * The index to attempt to add a child into. + * + * @return {Component} + * The `Component` that gets added as a child. When using a string the + * `Component` will get created by this process. */ @@ -968,24 +1106,23 @@ var Component = function () { var component = void 0; var componentName = void 0; - // If child is a string, create nt with options + // If child is a string, create component with options if (typeof child === 'string') { - componentName = child; + componentName = (0, _toTitleCase2['default'])(child); - // Options can also be specified as a boolean, so convert to an empty object if false. + // Options can also be specified as a boolean, + // so convert to an empty object if false. if (!options) { options = {}; } // Same as above, but true is deprecated so show a warning. if (options === true) { - _log2['default'].warn('Initializing a child component with `true` is deprecated. Children should be defined in an array when possible, but if necessary use an object instead of `true`.'); + _log2['default'].warn('Initializing a child component with `true` is deprecated.' + 'Children should be defined in an array when possible, ' + 'but if necessary use an object instead of `true`.'); options = {}; } - // If no componentClass in options, assume componentClass is the name lowercased - // (e.g. playButton) - var componentClassName = options.componentClass || (0, _toTitleCase2['default'])(componentName); + var componentClassName = options.componentClass || componentName; // Set name through options options.name = componentName; @@ -1021,7 +1158,7 @@ var Component = function () { // If a name wasn't used to create the component, check if we can use the // name function of the component - componentName = componentName || component.name && component.name(); + componentName = componentName || component.name && (0, _toTitleCase2['default'])(component.name()); if (componentName) { this.childNameIndex_[componentName] = component; @@ -1041,11 +1178,11 @@ var Component = function () { }; /** - * Remove a child component from this component's list of children, and the - * child component's element from this component's element + * Remove a child `Component` from this `Component`s list of children. Also removes + * the child `Component`s element from this `Component`s element. * - * @param {Component} component Component to remove - * @method removeChild + * @param {Component} component + * The child `Component` to remove. */ @@ -1083,50 +1220,7 @@ var Component = function () { }; /** - * Add and initialize default child components from options - * ```js - * // when an instance of MyComponent is created, all children in options - * // will be added to the instance by their name strings and options - * MyComponent.prototype.options_ = { - * children: [ - * 'myChildComponent' - * ], - * myChildComponent: { - * myChildOption: true - * } - * }; - * - * // Or when creating the component - * var myComp = new MyComponent(player, { - * children: [ - * 'myChildComponent' - * ], - * myChildComponent: { - * myChildOption: true - * } - * }); - * ``` - * The children option can also be an array of - * child options objects (that also include a 'name' key). - * This can be used if you have two child components of the - * same type that need different options. - * ```js - * var myComp = new MyComponent(player, { - * children: [ - * 'button', - * { - * name: 'button', - * someOtherOption: true - * }, - * { - * name: 'button', - * someOtherOption: false - * } - * ] - * }); - * ``` - * - * @method initChildren + * Add and initialize default child `Component`s based upon options. */ @@ -1136,98 +1230,99 @@ var Component = function () { var children = this.options_.children; if (children) { - (function () { - // `this` is `parent` - var parentOptions = _this.options_; + // `this` is `parent` + var parentOptions = this.options_; - var handleAdd = function handleAdd(child) { - var name = child.name; - var opts = child.opts; + var handleAdd = function handleAdd(child) { + var name = child.name; + var opts = child.opts; - // Allow options for children to be set at the parent options - // e.g. videojs(id, { controlBar: false }); - // instead of videojs(id, { children: { controlBar: false }); - if (parentOptions[name] !== undefined) { - opts = parentOptions[name]; - } - - // Allow for disabling default components - // e.g. options['children']['posterImage'] = false - if (opts === false) { - return; - } - - // Allow options to be passed as a simple boolean if no configuration - // is necessary. - if (opts === true) { - opts = {}; - } - - // We also want to pass the original player options to each component as well so they don't need to - // reach back into the player for options later. - opts.playerOptions = _this.options_.playerOptions; - - // Create and add the child component. - // Add a direct reference to the child by name on the parent instance. - // If two of the same component are used, different names should be supplied - // for each - var newChild = _this.addChild(name, opts); - - if (newChild) { - _this[name] = newChild; - } - }; - - // Allow for an array of children details to passed in the options - var workingChildren = void 0; - var Tech = Component.getComponent('Tech'); - - if (Array.isArray(children)) { - workingChildren = children; - } else { - workingChildren = Object.keys(children); + // Allow options for children to be set at the parent options + // e.g. videojs(id, { controlBar: false }); + // instead of videojs(id, { children: { controlBar: false }); + if (parentOptions[name] !== undefined) { + opts = parentOptions[name]; } - workingChildren - // children that are in this.options_ but also in workingChildren would - // give us extra children we do not want. So, we want to filter them out. - .concat(Object.keys(_this.options_).filter(function (child) { - return !workingChildren.some(function (wchild) { - if (typeof wchild === 'string') { - return child === wchild; - } - return child === wchild.name; - }); - })).map(function (child) { - var name = void 0; - var opts = void 0; + // Allow for disabling default components + // e.g. options['children']['posterImage'] = false + if (opts === false) { + return; + } - if (typeof child === 'string') { - name = child; - opts = children[name] || _this.options_[name] || {}; - } else { - name = child.name; - opts = child; + // Allow options to be passed as a simple boolean if no configuration + // is necessary. + if (opts === true) { + opts = {}; + } + + // We also want to pass the original player options + // to each component as well so they don't need to + // reach back into the player for options later. + opts.playerOptions = _this.options_.playerOptions; + + // Create and add the child component. + // Add a direct reference to the child by name on the parent instance. + // If two of the same component are used, different names should be supplied + // for each + var newChild = _this.addChild(name, opts); + + if (newChild) { + _this[name] = newChild; + } + }; + + // Allow for an array of children details to passed in the options + var workingChildren = void 0; + var Tech = Component.getComponent('Tech'); + + if (Array.isArray(children)) { + workingChildren = children; + } else { + workingChildren = Object.keys(children); + } + + workingChildren + // children that are in this.options_ but also in workingChildren would + // give us extra children we do not want. So, we want to filter them out. + .concat(Object.keys(this.options_).filter(function (child) { + return !workingChildren.some(function (wchild) { + if (typeof wchild === 'string') { + return child === wchild; } + return child === wchild.name; + }); + })).map(function (child) { + var name = void 0; + var opts = void 0; - return { name: name, opts: opts }; - }).filter(function (child) { - // we have to make sure that child.name isn't in the techOrder since - // techs are registerd as Components but can't aren't compatible - // See https://github.com/videojs/video.js/issues/2772 - var c = Component.getComponent(child.opts.componentClass || (0, _toTitleCase2['default'])(child.name)); + if (typeof child === 'string') { + name = child; + opts = children[name] || _this.options_[name] || {}; + } else { + name = child.name; + opts = child; + } - return c && !Tech.isTech(c); - }).forEach(handleAdd); - })(); + return { name: name, opts: opts }; + }).filter(function (child) { + // we have to make sure that child.name isn't in the techOrder since + // techs are registerd as Components but can't aren't compatible + // See https://github.com/videojs/video.js/issues/2772 + var c = Component.getComponent(child.opts.componentClass || (0, _toTitleCase2['default'])(child.name)); + + return c && !Tech.isTech(c); + }).forEach(handleAdd); } }; /** - * Allows sub components to stack CSS class names + * Builds the default DOM class name. Should be overriden by sub-components. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM class name for this object. + * + * @abstract */ @@ -1238,35 +1333,34 @@ var Component = function () { }; /** - * Add an event listener to this component's element - * ```js - * var myFunc = function() { - * var myComponent = this; - * // Do something when the event is fired - * }; + * Add an `event listener` to this `Component`s element. * - * myComponent.on('eventType', myFunc); - * ``` - * The context of myFunc will be myComponent unless previously bound. - * Alternatively, you can add a listener to another element or component. - * ```js - * myComponent.on(otherElement, 'eventName', myFunc); - * myComponent.on(otherComponent, 'eventName', myFunc); - * ``` - * The benefit of using this over `VjsEvents.on(otherElement, 'eventName', myFunc)` - * and `otherComponent.on('eventName', myFunc)` is that this way the listeners - * will be automatically cleaned up when either component is disposed. - * It will also bind myComponent as the context of myFunc. - * **NOTE**: When using this on elements in the page other than window - * and document (both permanent), if you remove the element from the DOM - * you need to call `myComponent.trigger(el, 'dispose')` on it to clean up - * references to it and allow the browser to garbage collect it. + * The benefit of using this over the following: + * - `VjsEvents.on(otherElement, 'eventName', myFunc)` + * - `otherComponent.on('eventName', myFunc)` + * + * 1. Is that the listeners will get cleaned up when either component gets disposed. + * 1. It will also bind `myComponent` as the context of `myFunc`. + * > NOTE: If you remove the element from the DOM that has used `on` you need to + * clean up references using: `myComponent.trigger(el, 'dispose')` + * This will also allow the browser to garbage collect it. In special + * cases such as with `window` and `document`, which are both permanent, + * this is not necessary. + * + * @param {string|Component|string[]} [first] + * The event name, and array of event names, or another `Component`. + * + * @param {EventTarget~EventListener|string|string[]} [second] + * The listener function, an event name, or an Array of events names. + * + * @param {EventTarget~EventListener} [third] + * The event handler if `first` is a `Component` and `second` is an event name + * or an Array of event names. * - * @param {String|Component} first The event type or other component - * @param {Function|String} second The event handler or event type - * @param {Function} third The event handler * @return {Component} - * @method on + * Returns itself; method can be chained. + * + * @listens Component#dispose */ @@ -1278,70 +1372,64 @@ var Component = function () { // Targeting another component or element } else { - (function () { - var target = first; - var type = second; - var fn = Fn.bind(_this2, third); + var target = first; + var type = second; + var fn = Fn.bind(this, third); - // When this component is disposed, remove the listener from the other component - var removeOnDispose = function removeOnDispose() { - return _this2.off(target, type, fn); - }; + // When this component is disposed, remove the listener from the other component + var removeOnDispose = function removeOnDispose() { + return _this2.off(target, type, fn); + }; - // Use the same function ID so we can remove it later it using the ID - // of the original listener - removeOnDispose.guid = fn.guid; - _this2.on('dispose', removeOnDispose); + // Use the same function ID so we can remove it later it using the ID + // of the original listener + removeOnDispose.guid = fn.guid; + this.on('dispose', removeOnDispose); - // If the other component is disposed first we need to clean the reference - // to the other component in this component's removeOnDispose listener - // Otherwise we create a memory leak. - var cleanRemover = function cleanRemover() { - return _this2.off('dispose', removeOnDispose); - }; + // If the other component is disposed first we need to clean the reference + // to the other component in this component's removeOnDispose listener + // Otherwise we create a memory leak. + var cleanRemover = function cleanRemover() { + return _this2.off('dispose', removeOnDispose); + }; - // Add the same function ID so we can easily remove it later - cleanRemover.guid = fn.guid; + // Add the same function ID so we can easily remove it later + cleanRemover.guid = fn.guid; - // Check if this is a DOM node - if (first.nodeName) { - // Add the listener to the other element - Events.on(target, type, fn); - Events.on(target, 'dispose', cleanRemover); + // Check if this is a DOM node + if (first.nodeName) { + // Add the listener to the other element + Events.on(target, type, fn); + Events.on(target, 'dispose', cleanRemover); - // Should be a component - // Not using `instanceof Component` because it makes mock players difficult - } else if (typeof first.on === 'function') { - // Add the listener to the other component - target.on(type, fn); - target.on('dispose', cleanRemover); - } - })(); + // Should be a component + // Not using `instanceof Component` because it makes mock players difficult + } else if (typeof first.on === 'function') { + // Add the listener to the other component + target.on(type, fn); + target.on('dispose', cleanRemover); + } } return this; }; /** - * Remove an event listener from this component's element - * ```js - * myComponent.off('eventType', myFunc); - * ``` - * If myFunc is excluded, ALL listeners for the event type will be removed. - * If eventType is excluded, ALL listeners will be removed from the component. - * Alternatively you can use `off` to remove listeners that were added to other - * elements or components using `myComponent.on(otherComponent...`. - * In this case both the event type and listener function are REQUIRED. - * ```js - * myComponent.off(otherElement, 'eventType', myFunc); - * myComponent.off(otherComponent, 'eventType', myFunc); - * ``` + * Remove an event listener from this `Component`s element. If the second argument is + * exluded all listeners for the type passed in as the first argument will be removed. + * + * @param {string|Component|string[]} [first] + * The event name, and array of event names, or another `Component`. + * + * @param {EventTarget~EventListener|string|string[]} [second] + * The listener function, an event name, or an Array of events names. + * + * @param {EventTarget~EventListener} [third] + * The event handler if `first` is a `Component` and `second` is an event name + * or an Array of event names. * - * @param {String=|Component} first The event type or other component - * @param {Function=|String} second The listener function or event type - * @param {Function=} third The listener for other component * @return {Component} - * @method off + * Returns itself; method can be chained. */ @@ -1373,22 +1461,20 @@ var Component = function () { }; /** - * Add an event listener to be triggered only once and then removed - * ```js - * myComponent.one('eventName', myFunc); - * ``` - * Alternatively you can add a listener to another element or component - * that will be triggered only once. - * ```js - * myComponent.one(otherElement, 'eventName', myFunc); - * myComponent.one(otherComponent, 'eventName', myFunc); - * ``` + * Add an event listener that gets triggered only once and then gets removed. + * + * @param {string|Component|string[]} [first] + * The event name, and array of event names, or another `Component`. + * + * @param {EventTarget~EventListener|string|string[]} [second] + * The listener function, an event name, or an Array of events names. + * + * @param {EventTarget~EventListener} [third] + * The event handler if `first` is a `Component` and `second` is an event name + * or an Array of event names. * - * @param {String|Component} first The event type or other component - * @param {Function|String} second The listener function or event type - * @param {Function=} third The listener function for other component * @return {Component} - * @method one + * Returns itself; method can be chained. */ @@ -1399,39 +1485,36 @@ var Component = function () { if (typeof first === 'string' || Array.isArray(first)) { Events.one(this.el_, first, Fn.bind(this, second)); } else { - (function () { - var target = first; - var type = second; - var fn = Fn.bind(_this3, third); + var target = first; + var type = second; + var fn = Fn.bind(this, third); - var newFunc = function newFunc() { - _this3.off(target, type, newFunc); - fn.apply(null, _arguments); - }; + var newFunc = function newFunc() { + _this3.off(target, type, newFunc); + fn.apply(null, _arguments); + }; - // Keep the same function ID so we can remove it later - newFunc.guid = fn.guid; + // Keep the same function ID so we can remove it later + newFunc.guid = fn.guid; - _this3.on(target, type, newFunc); - })(); + this.on(target, type, newFunc); } return this; }; /** - * Trigger an event on an element - * ```js - * myComponent.trigger('eventName'); - * myComponent.trigger({'type':'eventName'}); - * myComponent.trigger('eventName', {data: 'some data'}); - * myComponent.trigger({'type':'eventName'}, {data: 'some data'}); - * ``` + * Trigger an event on an element. * - * @param {Event|Object|String} event A string (the type) or an event object with a type attribute - * @param {Object} [hash] data hash to pass along with the event - * @return {Component} self - * @method trigger + * @param {EventTarget~Event|Object|string} event + * The event name, and Event, or an event-like object with a type attribute + * set to the event name. + * + * @param {Object} [hash] + * Data hash to pass along with the event + * + * @return {Component} + * Returns itself; method can be chained. */ @@ -1441,14 +1524,17 @@ var Component = function () { }; /** - * Bind a listener to the component's ready state. - * Different from event listeners in that if the ready event has already happened - * it will trigger the function immediately. + * Bind a listener to the component's ready state. If the ready event has already + * happened it will trigger the function immediately. + * + * @param {Component~ReadyCallback} fn + * A function to call when ready is triggered. + * + * @param {boolean} [sync=false] + * Execute the listener synchronously if `Component` is ready. * - * @param {Function} fn Ready listener - * @param {Boolean} sync Exec the listener synchronously if component is ready * @return {Component} - * @method ready + * Returns itself; method can be chained. */ @@ -1472,10 +1558,9 @@ var Component = function () { }; /** - * Trigger the ready listeners + * Trigger all the ready listeners for this `Component`. * - * @return {Component} - * @method triggerReady + * @fires Component#ready */ @@ -1496,25 +1581,33 @@ var Component = function () { } // Allow for using event listeners also + /** + * Triggered when a `Component` is ready. + * + * @event Component#ready + * @type {EventTarget~Event} + */ this.trigger('ready'); }, 1); }; /** - * Finds a single DOM element matching `selector` within the component's - * `contentEl` or another custom context. + * Find a single DOM element matching a `selector`. This can be within the `Component`s + * `contentEl()` or another custom context. * - * @method $ - * @param {String} selector - * A valid CSS selector, which will be passed to `querySelector`. + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelector`. * - * @param {Element|String} [context=document] - * A DOM element within which to query. Can also be a selector - * string in which case the first matching element will be used - * as context. If missing (or no element matches selector), falls - * back to `document`. + * @param {Element|string} [context=this.contentEl()] + * A DOM element within which to query. Can also be a selector string in + * which case the first matching element will get used as context. If + * missing `this.contentEl()` gets used. If `this.contentEl()` returns + * nothing it falls back to `document`. * * @return {Element|null} + * the dom element that was found, or null + * + * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors) */ @@ -1523,20 +1616,22 @@ var Component = function () { }; /** - * Finds a all DOM elements matching `selector` within the component's - * `contentEl` or another custom context. + * Finds all DOM element matching a `selector`. This can be within the `Component`s + * `contentEl()` or another custom context. * - * @method $$ - * @param {String} selector - * A valid CSS selector, which will be passed to `querySelectorAll`. + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelectorAll`. * - * @param {Element|String} [context=document] - * A DOM element within which to query. Can also be a selector - * string in which case the first matching element will be used - * as context. If missing (or no element matches selector), falls - * back to `document`. + * @param {Element|string} [context=this.contentEl()] + * A DOM element within which to query. Can also be a selector string in + * which case the first matching element will get used as context. If + * missing `this.contentEl()` gets used. If `this.contentEl()` returns + * nothing it falls back to `document`. * * @return {NodeList} + * a list of dom elements that were found + * + * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors) */ @@ -1545,11 +1640,14 @@ var Component = function () { }; /** - * Check if a component's element has a CSS class name + * Check if a component's element has a CSS class name. * - * @param {String} classToCheck Classname to check - * @return {Component} - * @method hasClass + * @param {string} classToCheck + * CSS class name to check. + * + * @return {boolean} + * - True if the `Component` has the class. + * - False if the `Component` does not have the class` */ @@ -1558,11 +1656,13 @@ var Component = function () { }; /** - * Add a CSS class name to the component's element + * Add a CSS class name to the `Component`s element. + * + * @param {string} classToAdd + * CSS class name to add * - * @param {String} classToAdd Classname to add * @return {Component} - * @method addClass + * Returns itself; method can be chained. */ @@ -1572,11 +1672,13 @@ var Component = function () { }; /** - * Remove a CSS class name from the component's element + * Remove a CSS class name from the `Component`s element. + * + * @param {string} classToRemove + * CSS class name to remove * - * @param {String} classToRemove Classname to remove * @return {Component} - * @method removeClass + * Returns itself; method can be chained. */ @@ -1586,16 +1688,18 @@ var Component = function () { }; /** - * Add or remove a CSS class name from the component's element + * Add or remove a CSS class name from the component's element. + * - `classToToggle` gets added when {@link Component#hasClass} would return false. + * - `classToToggle` gets removed when {@link Component#hasClass} would return true. * - * @param {String} classToToggle - * @param {Boolean|Function} [predicate] - * Can be a function that returns a Boolean. If `true`, the class - * will be added; if `false`, the class will be removed. If not - * given, the class will be added if not present and vice versa. + * @param {string} classToToggle + * The class to add or remove based on (@link Component#hasClass} + * + * @param {boolean|Dom~predicate} [predicate] + * An {@link Dom~predicate} function or a boolean * * @return {Component} - * @method toggleClass + * Returns itself; method can be chained. */ @@ -1605,10 +1709,11 @@ var Component = function () { }; /** - * Show the component element if hidden + * Show the `Component`s element if it is hidden by removing the + * 'vjs-hidden' class name from it. * * @return {Component} - * @method show + * Returns itself; method can be chained. */ @@ -1618,10 +1723,11 @@ var Component = function () { }; /** - * Hide the component element if currently showing + * Hide the `Component`s element if it is currently showing by adding the + * 'vjs-hidden` class name to it. * * @return {Component} - * @method hide + * Returns itself; method can be chained. */ @@ -1631,12 +1737,13 @@ var Component = function () { }; /** - * Lock an item in its visible state - * To be used with fadeIn/fadeOut. + * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing' + * class name to it. Used during fadeIn/fadeOut. * * @return {Component} + * Returns itself; method can be chained. + * * @private - * @method lockShowing */ @@ -1646,12 +1753,13 @@ var Component = function () { }; /** - * Unlock an item to be hidden - * To be used with fadeIn/fadeOut. + * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing' + * class name from it. Used during fadeIn/fadeOut. * * @return {Component} + * Returns itself; method can be chained. + * * @private - * @method unlockShowing */ @@ -1661,17 +1769,79 @@ var Component = function () { }; /** - * Set or get the width of the component (CSS values) - * Setting the video tag dimension values only works with values in pixels. - * Percent values will not work. - * Some percents can be used, but width()/height() will return the number + %, - * not the actual computed width/height. + * Get the value of an attribute on the `Component`s element. * - * @param {Number|String=} num Optional width number - * @param {Boolean} skipListeners Skip the 'resize' event trigger - * @return {Component} This component, when setting the width - * @return {Number|String} The width, when getting - * @method width + * @param {string} attribute + * Name of the attribute to get the value from. + * + * @return {string|null} + * - The value of the attribute that was asked for. + * - Can be an empty string on some browsers if the attribute does not exist + * or has no value + * - Most browsers will return null if the attibute does not exist or has + * no value. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute} + */ + + + Component.prototype.getAttribute = function getAttribute(attribute) { + return Dom.getAttribute(this.el_, attribute); + }; + + /** + * Set the value of an attribute on the `Component`'s element + * + * @param {string} attribute + * Name of the attribute to set. + * + * @param {string} value + * Value to set the attribute to. + * + * @return {Component} + * Returns itself; method can be chained. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute} + */ + + + Component.prototype.setAttribute = function setAttribute(attribute, value) { + Dom.setAttribute(this.el_, attribute, value); + return this; + }; + + /** + * Remove an attribute from the `Component`s element. + * + * @param {string} attribute + * Name of the attribute to remove. + * + * @return {Component} + * Returns itself; method can be chained. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute} + */ + + + Component.prototype.removeAttribute = function removeAttribute(attribute) { + Dom.removeAttribute(this.el_, attribute); + return this; + }; + + /** + * Get or set the width of the component based upon the CSS styles. + * See {@link Component#dimension} for more detailed information. + * + * @param {number|string} [num] + * The width that you want to set postfixed with '%', 'px' or nothing. + * + * @param {boolean} [skipListeners] + * Skip the resize event trigger + * + * @return {Component|number|string} + * - The width when getting, zero if there is no width. Can be a string + * postpixed with '%' or 'px'. + * - Returns itself when setting; method can be chained. */ @@ -1680,17 +1850,19 @@ var Component = function () { }; /** - * Get or set the height of the component (CSS values) - * Setting the video tag dimension values only works with values in pixels. - * Percent values will not work. - * Some percents can be used, but width()/height() will return the number + %, - * not the actual computed width/height. + * Get or set the height of the component based upon the CSS styles. + * See {@link Component#dimension} for more detailed information. * - * @param {Number|String=} num New component height - * @param {Boolean=} skipListeners Skip the resize event trigger - * @return {Component} This component, when setting the height - * @return {Number|String} The height, when getting - * @method height + * @param {number|string} [num] + * The height that you want to set postfixed with '%', 'px' or nothing. + * + * @param {boolean} [skipListeners] + * Skip the resize event trigger + * + * @return {Component|number|string} + * - The width when getting, zero if there is no width. Can be a string + * postpixed with '%' or 'px'. + * - Returns itself when setting; method can be chained. */ @@ -1699,12 +1871,16 @@ var Component = function () { }; /** - * Set both width and height at the same time + * Set both the width and height of the `Component` element at the same time. * - * @param {Number|String} width Width of player - * @param {Number|String} height Height of player - * @return {Component} The component - * @method dimensions + * @param {number|string} width + * Width to set the `Component`s element to. + * + * @param {number|string} height + * Height to set the `Component`s element to. + * + * @return {Component} + * Returns itself; method can be chained. */ @@ -1714,21 +1890,33 @@ var Component = function () { }; /** - * Get or set width or height - * This is the shared code for the width() and height() methods. - * All for an integer, integer + 'px' or integer + '%'; - * Known issue: Hidden elements officially have a width of 0. We're defaulting - * to the style.width value and falling back to computedStyle which has the - * hidden element issue. Info, but probably not an efficient fix: - * http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/ + * Get or set width or height of the `Component` element. This is the shared code + * for the {@link Component#width} and {@link Component#height}. * - * @param {String} widthOrHeight 'width' or 'height' - * @param {Number|String=} num New dimension - * @param {Boolean=} skipListeners Skip resize event trigger - * @return {Component} The component if a dimension was set - * @return {Number|String} The dimension if nothing was set - * @private - * @method dimension + * Things to know: + * - If the width or height in an number this will return the number postfixed with 'px'. + * - If the width/height is a percent this will return the percent postfixed with '%' + * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function + * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`. + * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/} + * for more information + * - If you want the computed style of the component, use {@link Component#currentWidth} + * and {@link {Component#currentHeight} + * + * @fires Component#resize + * + * @param {string} widthOrHeight + 8 'width' or 'height' + * + * @param {number|string} [num] + 8 New dimension + * + * @param {boolean} [skipListeners] + * Skip resize event trigger + * + * @return {Component} + * - the dimension when getting or 0 if unset + * - Returns itself when setting; method can be chained. */ @@ -1750,6 +1938,12 @@ var Component = function () { // skipListeners allows us to avoid triggering the resize event when setting both width and height if (!skipListeners) { + /** + * Triggered when a component is resized. + * + * @event Component#resize + * @type {EventTarget~Event} + */ this.trigger('resize'); } @@ -1779,10 +1973,15 @@ var Component = function () { }; /** - * Get width or height of computed style - * @param {String} widthOrHeight 'width' or 'height' - * @return {Number|Boolean} The bolean false if nothing was set - * @method currentDimension + * Get the width or the height of the `Component` elements computed style. Uses + * `window.getComputedStyle`. + * + * @param {string} widthOrHeight + * A string containing 'width' or 'height'. Whichever one you want to get. + * + * @return {number} + * The dimension that gets asked for or 0 if nothing was set + * for that dimension. */ @@ -1797,23 +1996,42 @@ var Component = function () { var computedStyle = _window2['default'].getComputedStyle(this.el_); computedWidthOrHeight = computedStyle.getPropertyValue(widthOrHeight) || computedStyle[widthOrHeight]; - } else if (this.el_.currentStyle) { - // ie 8 doesn't support computed style, shim it - // return clientWidth or clientHeight instead for better accuracy + } + + // remove 'px' from variable and parse as integer + computedWidthOrHeight = parseFloat(computedWidthOrHeight); + + // if the computed value is still 0, it's possible that the browser is lying + // and we want to check the offset values. + // This code also runs on IE8 and wherever getComputedStyle doesn't exist. + if (computedWidthOrHeight === 0) { var rule = 'offset' + (0, _toTitleCase2['default'])(widthOrHeight); computedWidthOrHeight = this.el_[rule]; } - // remove 'px' from variable and parse as integer - computedWidthOrHeight = parseFloat(computedWidthOrHeight); return computedWidthOrHeight; }; /** - * Get an object which contains width and height values of computed style - * @return {Object} The dimensions of element - * @method currentDimensions + * An object that contains width and height values of the `Component`s + * computed style. Uses `window.getComputedStyle`. + * + * @typedef {Object} Component~DimensionObject + * + * @property {number} width + * The width of the `Component`s computed style. + * + * @property {number} height + * The height of the `Component`s computed style. + */ + + /** + * Get an object that contains width and height values of the `Component`s + * computed style. + * + * @return {Component~DimensionObject} + * The dimensions of the components element */ @@ -1825,9 +2043,10 @@ var Component = function () { }; /** - * Get width of computed style - * @return {Integer} - * @method currentWidth + * Get the width of the `Component`s computed style. Uses `window.getComputedStyle`. + * + * @return {number} width + * The width of the `Component`s computed style. */ @@ -1836,9 +2055,10 @@ var Component = function () { }; /** - * Get height of computed style - * @return {Integer} - * @method currentHeight + * Get the height of the `Component`s computed style. Uses `window.getComputedStyle`. + * + * @return {number} height + * The height of the `Component`s computed style. */ @@ -1847,15 +2067,36 @@ var Component = function () { }; /** - * Emit 'tap' events when touch events are supported - * This is used to support toggling the controls through a tap on the video. - * We're requiring them to be enabled because otherwise every component would - * have this extra overhead unnecessarily, on mobile devices where extra - * overhead is especially bad. + * Set the focus to this component + */ + + + Component.prototype.focus = function focus() { + this.el_.focus(); + }; + + /** + * Remove the focus from this component + */ + + + Component.prototype.blur = function blur() { + this.el_.blur(); + }; + + /** + * Emit a 'tap' events when touch event support gets detected. This gets used to + * support toggling the controls through a tap on the video. They get enabled + * because every sub-component would have extra overhead otherwise. * * @private - * @method emitTapEvents - */ + * @fires Component#tap + * @listens Component#touchstart + * @listens Component#touchmove + * @listens Component#touchleave + * @listens Component#touchcancel + * @listens Component#touchend + */ Component.prototype.emitTapEvents = function emitTapEvents() { @@ -1864,7 +2105,8 @@ var Component = function () { var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap - // Other popular libs use anywhere from 2 (hammer.js) to 15, so 10 seems like a nice, round number. + // Other popular libs use anywhere from 2 (hammer.js) to 15, + // so 10 seems like a nice, round number. var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap @@ -1925,6 +2167,12 @@ var Component = function () { if (touchTime < touchTimeThreshold) { // Don't let browser turn this into a click event.preventDefault(); + /** + * Triggered when a `Component` is tapped. + * + * @event Component#tap + * @type {EventTarget~Event} + */ this.trigger('tap'); // It may be good to copy the touchend event object and change the // type to tap, if the other event properties aren't exact after @@ -1935,25 +2183,27 @@ var Component = function () { }; /** - * Report user touch activity when touch events occur - * User activity is used to determine when controls should show/hide. It's - * relatively simple when it comes to mouse events, because any mouse event - * should show the controls. So we capture mouse events that bubble up to the - * player and report activity when that happens. - * With touch events it isn't as easy. We can't rely on touch events at the - * player level, because a tap (touchstart + touchend) on the video itself on - * mobile devices is meant to turn controls off (and on). User activity is - * checked asynchronously, so what could happen is a tap event on the video - * turns the controls off, then the touchend event bubbles up to the player, - * which if it reported user activity, would turn the controls right back on. - * (We also don't want to completely block touch events from bubbling up) - * Also a touchmove, touch+hold, and anything other than a tap is not supposed - * to turn the controls back on on a mobile device. - * Here we're setting the default component behavior to report user activity - * whenever touch events happen, and this can be turned off by components that - * want touch events to act differently. + * This function reports user activity whenever touch events happen. This can get + * turned off by any sub-components that wants touch events to act another way. * - * @method enableTouchActivity + * Report user touch activity when touch events occur. User activity gets used to + * determine when controls should show/hide. It is simple when it comes to mouse + * events, because any mouse event should show the controls. So we capture mouse + * events that bubble up to the player and report activity when that happens. + * With touch events it isn't as easy as `touchstart` and `touchend` toggle player + * controls. So touch events can't help us at the player level either. + * + * User activity gets checked asynchronously. So what could happen is a tap event + * on the video turns the controls off. Then the `touchend` event bubbles up to + * the player. Which, if it reported user activity, would turn the controls right + * back on. We also don't want to completely block touch events from bubbling up. + * Furthermore a `touchmove` event and anything other than a tap, should not turn + * controls back on. + * + * @listens Component#touchstart + * @listens Component#touchmove + * @listens Component#touchend + * @listens Component#touchcancel */ @@ -1990,21 +2240,44 @@ var Component = function () { }; /** - * Creates timeout and sets up disposal automatically. + * A callback that has no parameters and is bound into `Component`s context. * - * @param {Function} fn The function to run after the timeout. - * @param {Number} timeout Number of ms to delay before executing specified function. - * @return {Number} Returns the timeout ID - * @method setTimeout + * @callback Component~GenericCallback + * @this Component + */ + + /** + * Creates a function that runs after an `x` millisecond timeout. This function is a + * wrapper around `window.setTimeout`. There are a few reasons to use this one + * instead though: + * 1. It gets cleared via {@link Component#clearTimeout} when + * {@link Component#dispose} gets called. + * 2. The function callback will gets turned into a {@link Component~GenericCallback} + * + * > Note: You can use `window.clearTimeout` on the id returned by this function. This + * will cause its dispose listener not to get cleaned up! Please use + * {@link Component#clearTimeout} or {@link Component#dispose}. + * + * @param {Component~GenericCallback} fn + * The function that will be run after `timeout`. + * + * @param {number} timeout + * Timeout in milliseconds to delay before executing the specified function. + * + * @return {number} + * Returns a timeout ID that gets used to identify the timeout. It can also + * get used in {@link Component#clearTimeout} to clear the timeout that + * was set. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout} */ Component.prototype.setTimeout = function setTimeout(fn, timeout) { fn = Fn.bind(this, fn); - // window.setTimeout would be preferable here, but due to some bizarre issue with Sinon and/or Phantomjs, we can't. var timeoutId = _window2['default'].setTimeout(fn, timeout); - var disposeFn = function disposeFn() { this.clearTimeout(timeoutId); }; @@ -2017,11 +2290,19 @@ var Component = function () { }; /** - * Clears a timeout and removes the associated dispose listener + * Clears a timeout that gets created via `window.setTimeout` or + * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout} + * use this function instead of `window.clearTimout`. If you don't your dispose + * listener will not get cleaned up until {@link Component#dispose}! * - * @param {Number} timeoutId The id of the timeout to clear - * @return {Number} Returns the timeout ID - * @method clearTimeout + * @param {number} timeoutId + * The id of the timeout to clear. The return value of + * {@link Component#setTimeout} or `window.setTimeout`. + * + * @return {number} + * Returns the timeout id that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout} */ @@ -2038,12 +2319,24 @@ var Component = function () { }; /** - * Creates an interval and sets up disposal automatically. + * Creates a function that gets run every `x` milliseconds. This function is a wrapper + * around `window.setInterval`. There are a few reasons to use this one instead though. + * 1. It gets cleared via {@link Component#clearInterval} when + * {@link Component#dispose} gets called. + * 2. The function callback will be a {@link Component~GenericCallback} * - * @param {Function} fn The function to run every N seconds. - * @param {Number} interval Number of ms to delay before executing specified function. - * @return {Number} Returns the interval ID - * @method setInterval + * @param {Component~GenericCallback} fn + * The function to run every `x` seconds. + * + * @param {number} interval + * Execute the specified function every `x` milliseconds. + * + * @return {number} + * Returns an id that can be used to identify the interval. It can also be be used in + * {@link Component#clearInterval} to clear the interval. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval} */ @@ -2064,11 +2357,19 @@ var Component = function () { }; /** - * Clears an interval and removes the associated dispose listener + * Clears an interval that gets created via `window.setInterval` or + * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval} + * use this function instead of `window.clearInterval`. If you don't your dispose + * listener will not get cleaned up until {@link Component#dispose}! * - * @param {Number} intervalId The id of the interval to clear - * @return {Number} Returns the interval ID - * @method clearInterval + * @param {number} intervalId + * The id of the interval to clear. The return value of + * {@link Component#setInterval} or `window.setInterval`. + * + * @return {number} + * Returns the interval id that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval} */ @@ -2085,60 +2386,108 @@ var Component = function () { }; /** - * Registers a component + * Register a `Component` with `videojs` given the name and the component. * - * @param {String} name Name of the component to register - * @param {Object} comp The component to register - * @static - * @method registerComponent + * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s + * should be registered using {@link Tech.registerTech} or + * {@link videojs:videojs.registerTech}. + * + * > NOTE: This function can also be seen on videojs as + * {@link videojs:videojs.registerComponent}. + * + * @param {string} name + * The name of the `Component` to register. + * + * @param {Component} comp + * The `Component` class to register. + * + * @return {Component} + * The `Component` that was registered. */ Component.registerComponent = function registerComponent(name, comp) { + if (!name) { + return; + } + + name = (0, _toTitleCase2['default'])(name); + if (!Component.components_) { Component.components_ = {}; } + if (name === 'Player' && Component.components_[name]) { + var Player = Component.components_[name]; + + // If we have players that were disposed, then their name will still be + // in Players.players. So, we must loop through and verify that the value + // for each item is not null. This allows registration of the Player component + // after all players have been disposed or before any were created. + if (Player.players && Object.keys(Player.players).length > 0 && Object.keys(Player.players).map(function (playerName) { + return Player.players[playerName]; + }).every(Boolean)) { + throw new Error('Can not register Player component after player has been created'); + } + } + Component.components_[name] = comp; + return comp; }; /** - * Gets a component by name + * Get a `Component` based on the name it was registered with. + * + * @param {string} name + * The Name of the component to get. * - * @param {String} name Name of the component to get * @return {Component} - * @static - * @method getComponent + * The `Component` that got registered under the given name. + * + * @deprecated In `videojs` 6 this will not return `Component`s that were not + * registered using {@link Component.registerComponent}. Currently we + * check the global `videojs` object for a `Component` name and + * return that if it exists. */ Component.getComponent = function getComponent(name) { + if (!name) { + return; + } + + name = (0, _toTitleCase2['default'])(name); + if (Component.components_ && Component.components_[name]) { return Component.components_[name]; } if (_window2['default'] && _window2['default'].videojs && _window2['default'].videojs[name]) { _log2['default'].warn('The ' + name + ' component was added to the videojs object when it should be registered using videojs.registerComponent(name, component)'); + return _window2['default'].videojs[name]; } }; /** - * Sets up the constructor using the supplied init method - * or uses the init of the parent object + * Sets up the constructor using the supplied init method or uses the init of the + * parent object. * - * @param {Object} props An object of properties - * @static - * @deprecated - * @method extend + * @param {Object} [props={}] + * An object of properties. + * + * @return {Object} + * the extended object. + * + * @deprecated since version 5 */ Component.extend = function extend(props) { props = props || {}; - _log2['default'].warn('Component.extend({}) has been deprecated, use videojs.extend(Component, {}) instead'); + _log2['default'].warn('Component.extend({}) has been deprecated, ' + ' use videojs.extend(Component, {}) instead'); // Set up the constructor using the supplied init method // or using the init of the parent object @@ -2182,7 +2531,7 @@ var Component = function () { Component.registerComponent('Component', Component); exports['default'] = Component; -},{"80":80,"81":81,"82":82,"84":84,"85":85,"86":86,"89":89,"93":93}],6:[function(_dereq_,module,exports){ +},{"81":81,"82":82,"83":83,"85":85,"86":86,"87":87,"91":91,"95":95}],6:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -2211,16 +2560,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The base class for buttons that toggle specific text track types (e.g. subtitles) + * The base class for buttons that toggle specific {@link AudioTrack} types. * - * @param {Player|Object} player - * @param {Object=} options * @extends TrackButton - * @class AudioTrackButton */ var AudioTrackButton = function (_TrackButton) { _inherits(AudioTrackButton, _TrackButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ function AudioTrackButton(player) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -2235,10 +2590,10 @@ var AudioTrackButton = function (_TrackButton) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -2249,8 +2604,11 @@ var AudioTrackButton = function (_TrackButton) { /** * Create a menu item for each audio track * - * @return {Array} Array of menu items - * @method createItems + * @param {AudioTrackMenuItem[]} [items=[]] + * An array of existing menu items to use. + * + * @return {AudioTrackMenuItem[]} + * An array of menu items */ @@ -2279,6 +2637,14 @@ var AudioTrackButton = function (_TrackButton) { return AudioTrackButton; }(_trackButton2['default']); +/** + * The text that should display over the `AudioTrackButton`s controls. Added for localization. + * + * @type {string} + * @private + */ + + AudioTrackButton.prototype.controlText_ = 'Audio Track'; _component2['default'].registerComponent('AudioTrackButton', AudioTrackButton); exports['default'] = AudioTrackButton; @@ -2296,7 +2662,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -2314,16 +2680,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The audio track menu item + * An {@link AudioTrack} {@link MenuItem} * - * @param {Player|Object} player - * @param {Object=} options * @extends MenuItem - * @class AudioTrackMenuItem */ var AudioTrackMenuItem = function (_MenuItem) { _inherits(AudioTrackMenuItem, _MenuItem); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function AudioTrackMenuItem(player, options) { _classCallCheck(this, AudioTrackMenuItem); @@ -2339,22 +2711,26 @@ var AudioTrackMenuItem = function (_MenuItem) { _this.track = track; if (tracks) { - (function () { - var changeHandler = Fn.bind(_this, _this.handleTracksChange); + var changeHandler = Fn.bind(_this, _this.handleTracksChange); - tracks.addEventListener('change', changeHandler); - _this.on('dispose', function () { - tracks.removeEventListener('change', changeHandler); - }); - })(); + tracks.addEventListener('change', changeHandler); + _this.on('dispose', function () { + tracks.removeEventListener('change', changeHandler); + }); } return _this; } /** - * Handle click on audio track + * This gets called when an `AudioTrackMenuItem is "clicked". See {@link ClickableComponent} + * for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ @@ -2375,9 +2751,12 @@ var AudioTrackMenuItem = function (_MenuItem) { }; /** - * Handle audio track change + * Handle any {@link AudioTrack} change. * - * @method handleTracksChange + * @param {EventTarget~Event} [event] + * The {@link AudioTrackList#change} event that caused this to run. + * + * @listens AudioTrackList#change */ @@ -2391,7 +2770,7 @@ var AudioTrackMenuItem = function (_MenuItem) { _component2['default'].registerComponent('AudioTrackMenuItem', AudioTrackMenuItem); exports['default'] = AudioTrackMenuItem; -},{"48":48,"5":5,"82":82}],8:[function(_dereq_,module,exports){ +},{"48":48,"5":5,"83":83}],8:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -2451,10 +2830,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * Container of main controls + * Container of main controls. * * @extends Component - * @class ControlBar */ var ControlBar = function (_Component) { _inherits(ControlBar, _Component); @@ -2466,10 +2844,10 @@ var ControlBar = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ ControlBar.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { @@ -2484,6 +2862,14 @@ var ControlBar = function (_Component) { return ControlBar; }(_component2['default']); +/** + * Default options for `ControlBar` + * + * @type {Object} + * @private + */ + + ControlBar.prototype.options_ = { children: ['playToggle', 'volumeMenuButton', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'subtitlesButton', 'captionsButton', 'audioTrackButton', 'fullscreenToggle'] }; @@ -2519,11 +2905,19 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Toggle fullscreen video * * @extends Button - * @class FullscreenToggle */ var FullscreenToggle = function (_Button) { _inherits(FullscreenToggle, _Button); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function FullscreenToggle(player, options) { _classCallCheck(this, FullscreenToggle); @@ -2534,38 +2928,50 @@ var FullscreenToggle = function (_Button) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ FullscreenToggle.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-fullscreen-control ' + _Button.prototype.buildCSSClass.call(this); }; + /** - * Handles Fullscreenchange on the component and change control text accordingly + * Handles fullscreenchange on the player and change control text accordingly. * - * @method handleFullscreenChange + * @param {EventTarget~Event} [event] + * The {@link Player#fullscreenchange} event that caused this function to be + * called. + * + * @listens Player#fullscreenchange */ - FullscreenToggle.prototype.handleFullscreenChange = function handleFullscreenChange() { + FullscreenToggle.prototype.handleFullscreenChange = function handleFullscreenChange(event) { if (this.player_.isFullscreen()) { this.controlText('Non-Fullscreen'); } else { this.controlText('Fullscreen'); } }; + /** - * Handles click for full screen + * This gets called when an `FullscreenToggle` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - FullscreenToggle.prototype.handleClick = function handleClick() { + FullscreenToggle.prototype.handleClick = function handleClick(event) { if (!this.player_.isFullscreen()) { this.player_.requestFullscreen(); } else { @@ -2576,6 +2982,14 @@ var FullscreenToggle = function (_Button) { return FullscreenToggle; }(_button2['default']); +/** + * The text that should display over the `FullscreenToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + FullscreenToggle.prototype.controlText_ = 'Fullscreen'; _component2['default'].registerComponent('FullscreenToggle', FullscreenToggle); @@ -2590,7 +3004,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); @@ -2607,16 +3021,25 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" */ +// TODO - Future make it click to snap to live + /** - * Displays the live indicator - * TODO - Future make it click to snap to live + * Displays the live indicator when duration is Infinity. * * @extends Component - * @class LiveDisplay */ var LiveDisplay = function (_Component) { _inherits(LiveDisplay, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function LiveDisplay(player, options) { _classCallCheck(this, LiveDisplay); @@ -2628,10 +3051,10 @@ var LiveDisplay = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -2651,7 +3074,18 @@ var LiveDisplay = function (_Component) { return el; }; - LiveDisplay.prototype.updateShowing = function updateShowing() { + /** + * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide + * it accordingly + * + * @param {EventTarget~Event} [event] + * The {@link Player#durationchange} event that caused this function to run. + * + * @listens Player#durationchange + */ + + + LiveDisplay.prototype.updateShowing = function updateShowing(event) { if (this.player().duration() === Infinity) { this.show(); } else { @@ -2665,7 +3099,7 @@ var LiveDisplay = function (_Component) { _component2['default'].registerComponent('LiveDisplay', LiveDisplay); exports['default'] = LiveDisplay; -},{"5":5,"80":80}],11:[function(_dereq_,module,exports){ +},{"5":5,"81":81}],11:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -2678,7 +3112,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); @@ -2696,16 +3130,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * A button component for muting the audio + * A button component for muting the audio. * - * @param {Player|Object} player - * @param {Object=} options * @extends Button - * @class MuteToggle */ var MuteToggle = function (_Button) { _inherits(MuteToggle, _Button); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function MuteToggle(player, options) { _classCallCheck(this, MuteToggle); @@ -2732,10 +3172,10 @@ var MuteToggle = function (_Button) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -2744,24 +3184,34 @@ var MuteToggle = function (_Button) { }; /** - * Handle click on mute + * This gets called when an `MuteToggle` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - MuteToggle.prototype.handleClick = function handleClick() { + MuteToggle.prototype.handleClick = function handleClick(event) { this.player_.muted(this.player_.muted() ? false : true); }; /** - * Update volume + * Update the state of volume. * - * @method update + * @param {EventTarget~Event} [event] + * The {@link Player#loadstart} event if this function was called through an + * event. + * + * @listens Player#loadstart */ - MuteToggle.prototype.update = function update() { + MuteToggle.prototype.update = function update(event) { var vol = this.player_.volume(); var level = 3; @@ -2792,12 +3242,20 @@ var MuteToggle = function (_Button) { return MuteToggle; }(_button2['default']); +/** + * The text that should display over the `MuteToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + MuteToggle.prototype.controlText_ = 'Mute'; _component2['default'].registerComponent('MuteToggle', MuteToggle); exports['default'] = MuteToggle; -},{"2":2,"5":5,"80":80}],12:[function(_dereq_,module,exports){ +},{"2":2,"5":5,"81":81}],12:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -2822,16 +3280,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * Button to toggle between play and pause + * Button to toggle between play and pause. * - * @param {Player|Object} player - * @param {Object=} options * @extends Button - * @class PlayToggle */ var PlayToggle = function (_Button) { _inherits(PlayToggle, _Button); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function PlayToggle(player, options) { _classCallCheck(this, PlayToggle); @@ -2843,10 +3307,10 @@ var PlayToggle = function (_Button) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -2855,13 +3319,19 @@ var PlayToggle = function (_Button) { }; /** - * Handle click to toggle between play and pause + * This gets called when an `PlayToggle` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - PlayToggle.prototype.handleClick = function handleClick() { + PlayToggle.prototype.handleClick = function handleClick(event) { if (this.player_.paused()) { this.player_.play(); } else { @@ -2870,13 +3340,16 @@ var PlayToggle = function (_Button) { }; /** - * Add the vjs-playing class to the element so it can change appearance + * Add the vjs-playing class to the element so it can change appearance. * - * @method handlePlay + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#play */ - PlayToggle.prototype.handlePlay = function handlePlay() { + PlayToggle.prototype.handlePlay = function handlePlay(event) { this.removeClass('vjs-paused'); this.addClass('vjs-playing'); // change the button text to "Pause" @@ -2884,13 +3357,16 @@ var PlayToggle = function (_Button) { }; /** - * Add the vjs-paused class to the element so it can change appearance + * Add the vjs-paused class to the element so it can change appearance. * - * @method handlePause + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#pause */ - PlayToggle.prototype.handlePause = function handlePause() { + PlayToggle.prototype.handlePause = function handlePause(event) { this.removeClass('vjs-playing'); this.addClass('vjs-paused'); // change the button text to "Play" @@ -2900,6 +3376,14 @@ var PlayToggle = function (_Button) { return PlayToggle; }(_button2['default']); +/** + * The text that should display over the `PlayToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + PlayToggle.prototype.controlText_ = 'Play'; _component2['default'].registerComponent('PlayToggle', PlayToggle); @@ -2926,7 +3410,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); @@ -2944,16 +3428,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The component for controlling the playback rate + * The component for controlling the playback rate. * - * @param {Player|Object} player - * @param {Object=} options * @extends MenuButton - * @class PlaybackRateMenuButton */ var PlaybackRateMenuButton = function (_MenuButton) { _inherits(PlaybackRateMenuButton, _MenuButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function PlaybackRateMenuButton(player, options) { _classCallCheck(this, PlaybackRateMenuButton); @@ -2968,10 +3458,10 @@ var PlaybackRateMenuButton = function (_MenuButton) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -2989,10 +3479,10 @@ var PlaybackRateMenuButton = function (_MenuButton) { }; /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -3003,8 +3493,8 @@ var PlaybackRateMenuButton = function (_MenuButton) { /** * Create the playback rate menu * - * @return {Menu} Menu object populated with items - * @method createMenu + * @return {Menu} + * Menu object populated with {@link PlaybackRateMenuItem}s */ @@ -3023,8 +3513,6 @@ var PlaybackRateMenuButton = function (_MenuButton) { /** * Updates ARIA accessibility attributes - * - * @method updateARIAAttributes */ @@ -3034,13 +3522,19 @@ var PlaybackRateMenuButton = function (_MenuButton) { }; /** - * Handle menu item click + * This gets called when an `PlaybackRateMenuButton` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - PlaybackRateMenuButton.prototype.handleClick = function handleClick() { + PlaybackRateMenuButton.prototype.handleClick = function handleClick(event) { // select next rate option var currentRate = this.player().playbackRate(); var rates = this.playbackRates(); @@ -3060,8 +3554,8 @@ var PlaybackRateMenuButton = function (_MenuButton) { /** * Get possible playback rates * - * @return {Array} Possible playback rates - * @method playbackRates + * @return {Array} + * All possible playback rates */ @@ -3073,8 +3567,8 @@ var PlaybackRateMenuButton = function (_MenuButton) { * Get whether playback rates is supported by the tech * and an array of playback rates exists * - * @return {Boolean} Whether changing playback rate is supported - * @method playbackRateSupported + * @return {boolean} + * Whether changing playback rate is supported */ @@ -3085,11 +3579,14 @@ var PlaybackRateMenuButton = function (_MenuButton) { /** * Hide playback rate controls when they're no playback rate options to select * - * @method updateVisibility + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#loadstart */ - PlaybackRateMenuButton.prototype.updateVisibility = function updateVisibility() { + PlaybackRateMenuButton.prototype.updateVisibility = function updateVisibility(event) { if (this.playbackRateSupported()) { this.removeClass('vjs-hidden'); } else { @@ -3100,11 +3597,14 @@ var PlaybackRateMenuButton = function (_MenuButton) { /** * Update button label when rate changed * - * @method updateLabel + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#ratechange */ - PlaybackRateMenuButton.prototype.updateLabel = function updateLabel() { + PlaybackRateMenuButton.prototype.updateLabel = function updateLabel(event) { if (this.playbackRateSupported()) { this.labelEl_.innerHTML = this.player().playbackRate() + 'x'; } @@ -3113,12 +3613,20 @@ var PlaybackRateMenuButton = function (_MenuButton) { return PlaybackRateMenuButton; }(_menuButton2['default']); +/** + * The text that should display over the `FullscreenToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + PlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate'; _component2['default'].registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton); exports['default'] = PlaybackRateMenuButton; -},{"14":14,"47":47,"49":49,"5":5,"80":80}],14:[function(_dereq_,module,exports){ +},{"14":14,"47":47,"49":49,"5":5,"81":81}],14:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -3143,16 +3651,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The specific menu item type for selecting a playback rate + * The specific menu item type for selecting a playback rate. * - * @param {Player|Object} player - * @param {Object=} options * @extends MenuItem - * @class PlaybackRateMenuItem */ var PlaybackRateMenuItem = function (_MenuItem) { _inherits(PlaybackRateMenuItem, _MenuItem); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function PlaybackRateMenuItem(player, options) { _classCallCheck(this, PlaybackRateMenuItem); @@ -3162,6 +3676,7 @@ var PlaybackRateMenuItem = function (_MenuItem) { // Modify options for parent MenuItem class's init. options.label = label; options.selected = rate === 1; + options.selectable = true; var _this = _possibleConstructorReturn(this, _MenuItem.call(this, player, options)); @@ -3173,31 +3688,48 @@ var PlaybackRateMenuItem = function (_MenuItem) { } /** - * Handle click on menu item + * This gets called when an `PlaybackRateMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - PlaybackRateMenuItem.prototype.handleClick = function handleClick() { + PlaybackRateMenuItem.prototype.handleClick = function handleClick(event) { _MenuItem.prototype.handleClick.call(this); this.player().playbackRate(this.rate); }; /** - * Update playback rate with selected rate + * Update the PlaybackRateMenuItem when the playbackrate changes. * - * @method update + * @param {EventTarget~Event} [event] + * The `ratechange` event that caused this function to run. + * + * @listens Player#ratechange */ - PlaybackRateMenuItem.prototype.update = function update() { + PlaybackRateMenuItem.prototype.update = function update(event) { this.selected(this.player().playbackRate() === this.rate); }; return PlaybackRateMenuItem; }(_menuItem2['default']); +/** + * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization. + * + * @type {string} + * @private + */ + + PlaybackRateMenuItem.prototype.contentElType = 'button'; _component2['default'].registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem); @@ -3212,7 +3744,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); @@ -3230,16 +3762,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * Shows load progress + * Shows loading progress * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class LoadProgressBar */ var LoadProgressBar = function (_Component) { _inherits(LoadProgressBar, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function LoadProgressBar(player, options) { _classCallCheck(this, LoadProgressBar); @@ -3251,10 +3789,10 @@ var LoadProgressBar = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -3268,11 +3806,14 @@ var LoadProgressBar = function (_Component) { /** * Update progress bar * - * @method update + * @param {EventTarget~Event} [event] + * The `progress` event that caused this function to run. + * + * @listens Player#progress */ - LoadProgressBar.prototype.update = function update() { + LoadProgressBar.prototype.update = function update(event) { var buffered = this.player_.buffered(); var duration = this.player_.duration(); var bufferedEnd = this.player_.bufferedEnd(); @@ -3318,34 +3859,30 @@ var LoadProgressBar = function (_Component) { _component2['default'].registerComponent('LoadProgressBar', LoadProgressBar); exports['default'] = LoadProgressBar; -},{"5":5,"80":80}],16:[function(_dereq_,module,exports){ +},{"5":5,"81":81}],16:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; -var _window = _dereq_(93); - -var _window2 = _interopRequireDefault(_window); - var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _formatTime = _dereq_(83); +var _formatTime = _dereq_(84); var _formatTime2 = _interopRequireDefault(_formatTime); -var _throttle = _dereq_(98); +var _computedStyle = _dereq_(80); -var _throttle2 = _interopRequireDefault(_throttle); +var _computedStyle2 = _interopRequireDefault(_computedStyle); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } @@ -3364,14 +3901,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * The Mouse Time Display component shows the time you will seek to * when hovering over the progress bar * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class MouseTimeDisplay */ var MouseTimeDisplay = function (_Component) { _inherits(MouseTimeDisplay, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function MouseTimeDisplay(player, options) { _classCallCheck(this, MouseTimeDisplay); @@ -3390,16 +3933,16 @@ var MouseTimeDisplay = function (_Component) { _this.update(0, 0); player.on('ready', function () { - _this.on(player.controlBar.progressControl.el(), 'mousemove', (0, _throttle2['default'])(Fn.bind(_this, _this.handleMouseMove), 25)); + _this.on(player.controlBar.progressControl.el(), 'mousemove', Fn.throttle(Fn.bind(_this, _this.handleMouseMove), 25)); }); return _this; } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -3409,6 +3952,16 @@ var MouseTimeDisplay = function (_Component) { }); }; + /** + * Handle the mouse move event on the `MouseTimeDisplay`. + * + * @param {EventTarget~Event} event + * The `mousemove` event that caused this to event to run. + * + * @listen mousemove + */ + + MouseTimeDisplay.prototype.handleMouseMove = function handleMouseMove(event) { var duration = this.player_.duration(); var newTime = this.calculateDistance(event) * duration; @@ -3417,6 +3970,17 @@ var MouseTimeDisplay = function (_Component) { this.update(newTime, position); }; + /** + * Update the time and posistion of the `MouseTimeDisplay`. + * + * @param {number} newTime + * Time to change the `MouseTimeDisplay` to. + * + * @param {nubmer} position + * Postion from the left of the in pixels. + */ + + MouseTimeDisplay.prototype.update = function update(newTime, position) { var time = (0, _formatTime2['default'])(newTime, this.player_.duration()); @@ -3426,7 +3990,7 @@ var MouseTimeDisplay = function (_Component) { if (this.keepTooltipsInside) { var clampedPosition = this.clampPosition_(position); var difference = position - clampedPosition + 1; - var tooltipWidth = parseFloat(_window2['default'].getComputedStyle(this.tooltip).width); + var tooltipWidth = parseFloat((0, _computedStyle2['default'])(this.tooltip, 'width')); var tooltipWidthHalf = tooltipWidth / 2; this.tooltip.innerHTML = time; @@ -3434,6 +3998,18 @@ var MouseTimeDisplay = function (_Component) { } }; + /** + * Get the mouse pointers x coordinate in pixels. + * + * @param {EventTarget~Event} [event] + * The `mousemove` event that was passed to this function by + * {@link MouseTimeDisplay#handleMouseMove} + * + * @return {number} + * THe x position in pixels of the mouse pointer. + */ + + MouseTimeDisplay.prototype.calculateDistance = function calculateDistance(event) { return Dom.getPointerPosition(this.el().parentNode, event).x; }; @@ -3444,9 +4020,13 @@ var MouseTimeDisplay = function (_Component) { * of the tooltip and smaller than the player width minus half the width o the tooltip. * It will only clamp the position if `keepTooltipsInside` option is set. * - * @param {Number} position the position the bar wants to be - * @return {Number} newPosition the (potentially) clamped position - * @method clampPosition_ + * @param {number} position + * The position the bar wants to be + * + * @return {number} + * The (potentially) new clamped position. + * + * @private */ @@ -3455,8 +4035,8 @@ var MouseTimeDisplay = function (_Component) { return position; } - var playerWidth = parseFloat(_window2['default'].getComputedStyle(this.player().el()).width); - var tooltipWidth = parseFloat(_window2['default'].getComputedStyle(this.tooltip).width); + var playerWidth = parseFloat((0, _computedStyle2['default'])(this.player().el(), 'width')); + var tooltipWidth = parseFloat((0, _computedStyle2['default'])(this.tooltip, 'width')); var tooltipWidthHalf = tooltipWidth / 2; var actualPosition = position; @@ -3475,7 +4055,7 @@ var MouseTimeDisplay = function (_Component) { _component2['default'].registerComponent('MouseTimeDisplay', MouseTimeDisplay); exports['default'] = MouseTimeDisplay; -},{"5":5,"80":80,"82":82,"83":83,"93":93,"98":98}],17:[function(_dereq_,module,exports){ +},{"5":5,"80":80,"81":81,"83":83,"84":84}],17:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -3484,11 +4064,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _formatTime = _dereq_(83); +var _formatTime = _dereq_(84); var _formatTime2 = _interopRequireDefault(_formatTime); @@ -3508,14 +4088,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Shows play progress * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class PlayProgressBar */ var PlayProgressBar = function (_Component) { _inherits(PlayProgressBar, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function PlayProgressBar(player, options) { _classCallCheck(this, PlayProgressBar); @@ -3536,10 +4122,10 @@ var PlayProgressBar = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -3550,7 +4136,17 @@ var PlayProgressBar = function (_Component) { }); }; - PlayProgressBar.prototype.updateDataAttr = function updateDataAttr() { + /** + * Update the data-current-time attribute on the `PlayProgressBar`. + * + * @param {EventTarget~Event} [event] + * The `timeupdate` event that caused this to run. + * + * @listens Player#timeupdate + */ + + + PlayProgressBar.prototype.updateDataAttr = function updateDataAttr(event) { var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); this.el_.setAttribute('data-current-time', (0, _formatTime2['default'])(time, this.player_.duration())); @@ -3562,7 +4158,7 @@ var PlayProgressBar = function (_Component) { _component2['default'].registerComponent('PlayProgressBar', PlayProgressBar); exports['default'] = PlayProgressBar; -},{"5":5,"82":82,"83":83}],18:[function(_dereq_,module,exports){ +},{"5":5,"83":83,"84":84}],18:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -3588,12 +4184,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The Progress Control component contains the seek bar, load progress, - * and play progress + * and play progress. * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class ProgressControl */ var ProgressControl = function (_Component) { _inherits(ProgressControl, _Component); @@ -3605,10 +4198,10 @@ var ProgressControl = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ ProgressControl.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { @@ -3619,6 +4212,14 @@ var ProgressControl = function (_Component) { return ProgressControl; }(_component2['default']); +/** + * Default options for `ProgressControl` + * + * @type {Object} + * @private + */ + + ProgressControl.prototype.options_ = { children: ['seekBar'] }; @@ -3631,10 +4232,6 @@ exports['default'] = ProgressControl; exports.__esModule = true; -var _window = _dereq_(93); - -var _window2 = _interopRequireDefault(_window); - var _slider = _dereq_(57); var _slider2 = _interopRequireDefault(_slider); @@ -3643,14 +4240,18 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _formatTime = _dereq_(83); +var _formatTime = _dereq_(84); var _formatTime2 = _interopRequireDefault(_formatTime); +var _computedStyle = _dereq_(80); + +var _computedStyle2 = _interopRequireDefault(_computedStyle); + _dereq_(15); _dereq_(17); @@ -3673,14 +4274,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Seek Bar and holder for the progress bars * - * @param {Player|Object} player - * @param {Object=} options * @extends Slider - * @class SeekBar */ var SeekBar = function (_Slider) { _inherits(SeekBar, _Slider); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function SeekBar(player, options) { _classCallCheck(this, SeekBar); @@ -3701,10 +4308,10 @@ var SeekBar = function (_Slider) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -3717,21 +4324,25 @@ var SeekBar = function (_Slider) { }; /** - * Update ARIA accessibility attributes + * Update the seek bars tooltip and width. * - * @method updateARIAAttributes + * @param {EventTarget~Event} [event] + * The `timeupdate` or `ended` event that caused this to run. + * + * @listens Player#timeupdate + * @listens Player#ended */ - SeekBar.prototype.updateProgress = function updateProgress() { + SeekBar.prototype.updateProgress = function updateProgress(event) { this.updateAriaAttributes(this.el_); if (this.keepTooltipsInside) { this.updateAriaAttributes(this.tooltipProgressBar.el_); this.tooltipProgressBar.el_.style.width = this.bar.el_.style.width; - var playerWidth = parseFloat(_window2['default'].getComputedStyle(this.player().el()).width); - var tooltipWidth = parseFloat(_window2['default'].getComputedStyle(this.tooltipProgressBar.tooltip).width); + var playerWidth = parseFloat((0, _computedStyle2['default'])(this.player().el(), 'width')); + var tooltipWidth = parseFloat((0, _computedStyle2['default'])(this.tooltipProgressBar.tooltip, 'width')); var tooltipStyle = this.tooltipProgressBar.el().style; tooltipStyle.maxWidth = Math.floor(playerWidth - tooltipWidth / 2) + 'px'; @@ -3740,6 +4351,14 @@ var SeekBar = function (_Slider) { } }; + /** + * Update ARIA accessibility attributes + * + * @param {Element} el + * The element to update with aria accessibility attributes. + */ + + SeekBar.prototype.updateAriaAttributes = function updateAriaAttributes(el) { // Allows for smooth scrubbing, when player can't keep up. var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); @@ -3753,8 +4372,8 @@ var SeekBar = function (_Slider) { /** * Get percentage of video played * - * @return {Number} Percentage played - * @method getPercent + * @return {number} + * The percentage played */ @@ -3767,23 +4386,29 @@ var SeekBar = function (_Slider) { /** * Handle mouse down on seek bar * - * @method handleMouseDown + * @param {EventTarget~Event} event + * The `mousedown` event that caused this to run. + * + * @listens mousedown */ SeekBar.prototype.handleMouseDown = function handleMouseDown(event) { - _Slider.prototype.handleMouseDown.call(this, event); - this.player_.scrubbing(true); this.videoWasPlaying = !this.player_.paused(); this.player_.pause(); + + _Slider.prototype.handleMouseDown.call(this, event); }; /** * Handle mouse move on seek bar * - * @method handleMouseMove + * @param {EventTarget~Event} event + * The `mousemove` event that caused this to run. + * + * @listens mousemove */ @@ -3802,7 +4427,10 @@ var SeekBar = function (_Slider) { /** * Handle mouse up on seek bar * - * @method handleMouseUp + * @param {EventTarget~Event} event + * The `mouseup` event that caused this to run. + * + * @listens mouseup */ @@ -3817,8 +4445,6 @@ var SeekBar = function (_Slider) { /** * Move more quickly fast forward for keyboard-only users - * - * @method stepForward */ @@ -3829,8 +4455,6 @@ var SeekBar = function (_Slider) { /** * Move more quickly rewind for keyboard-only users - * - * @method stepBack */ @@ -3842,17 +4466,30 @@ var SeekBar = function (_Slider) { return SeekBar; }(_slider2['default']); +/** + * Default options for the `SeekBar` + * + * @type {Object} + * @private + */ + + SeekBar.prototype.options_ = { children: ['loadProgressBar', 'mouseTimeDisplay', 'playProgressBar'], barName: 'playProgressBar' }; +/** + * Call the update event for this Slider when this event happens on the player. + * + * @type {string} + */ SeekBar.prototype.playerEvent = 'timeupdate'; _component2['default'].registerComponent('SeekBar', SeekBar); exports['default'] = SeekBar; -},{"15":15,"17":17,"20":20,"5":5,"57":57,"82":82,"83":83,"93":93}],20:[function(_dereq_,module,exports){ +},{"15":15,"17":17,"20":20,"5":5,"57":57,"80":80,"83":83,"84":84}],20:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -3861,11 +4498,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _formatTime = _dereq_(83); +var _formatTime = _dereq_(84); var _formatTime2 = _interopRequireDefault(_formatTime); @@ -3885,14 +4522,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Shows play progress * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class PlayProgressBar */ var TooltipProgressBar = function (_Component) { _inherits(TooltipProgressBar, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function TooltipProgressBar(player, options) { _classCallCheck(this, TooltipProgressBar); @@ -3905,10 +4548,10 @@ var TooltipProgressBar = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -3923,7 +4566,17 @@ var TooltipProgressBar = function (_Component) { return el; }; - TooltipProgressBar.prototype.updateDataAttr = function updateDataAttr() { + /** + * Updatet the data-current-time attribute for TooltipProgressBar + * + * @param {EventTarget~Event} [event] + * The `timeupdate` event that caused this function to run. + * + * @listens Player#timeupdate + */ + + + TooltipProgressBar.prototype.updateDataAttr = function updateDataAttr(event) { var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); var formattedTime = (0, _formatTime2['default'])(time, this.player_.duration()); @@ -3937,7 +4590,7 @@ var TooltipProgressBar = function (_Component) { _component2['default'].registerComponent('TooltipProgressBar', TooltipProgressBar); exports['default'] = TooltipProgressBar; -},{"5":5,"82":82,"83":83}],21:[function(_dereq_,module,exports){ +},{"5":5,"83":83,"84":84}],21:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -3965,7 +4618,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Spacer specifically meant to be used as an insertion point for new plugins, etc. * * @extends Spacer - * @class CustomControlSpacer */ var CustomControlSpacer = function (_Spacer) { _inherits(CustomControlSpacer, _Spacer); @@ -3977,20 +4629,20 @@ var CustomControlSpacer = function (_Spacer) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ CustomControlSpacer.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-custom-control-spacer ' + _Spacer.prototype.buildCSSClass.call(this); }; /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -4036,7 +4688,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Also can be used to create space between elements when necessary. * * @extends Component - * @class Spacer */ var Spacer = function (_Component) { _inherits(Spacer, _Component); @@ -4048,20 +4699,20 @@ var Spacer = function (_Component) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ Spacer.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-spacer ' + _Component.prototype.buildCSSClass.call(this); }; /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -4105,14 +4756,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The menu item for caption track settings menu * - * @param {Player|Object} player - * @param {Object=} options * @extends TextTrackMenuItem - * @class CaptionSettingsMenuItem */ var CaptionSettingsMenuItem = function (_TextTrackMenuItem) { _inherits(CaptionSettingsMenuItem, _TextTrackMenuItem); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function CaptionSettingsMenuItem(player, options) { _classCallCheck(this, CaptionSettingsMenuItem); @@ -4136,13 +4793,19 @@ var CaptionSettingsMenuItem = function (_TextTrackMenuItem) { } /** - * Handle click on menu item + * This gets called when an `CaptionSettingsMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - CaptionSettingsMenuItem.prototype.handleClick = function handleClick() { + CaptionSettingsMenuItem.prototype.handleClick = function handleClick(event) { this.player().getChild('textTrackSettings').show(); this.player().getChild('textTrackSettings').el_.focus(); }; @@ -4184,15 +4847,23 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The button component for toggling and selecting captions * - * @param {Object} player Player object - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function * @extends TextTrackButton - * @class CaptionsButton */ var CaptionsButton = function (_TextTrackButton) { _inherits(CaptionsButton, _TextTrackButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this component is ready. + */ function CaptionsButton(player, options, ready) { _classCallCheck(this, CaptionsButton); @@ -4203,10 +4874,10 @@ var CaptionsButton = function (_TextTrackButton) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -4214,35 +4885,11 @@ var CaptionsButton = function (_TextTrackButton) { return 'vjs-captions-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); }; - /** - * Update caption menu items - * - * @method update - */ - - - CaptionsButton.prototype.update = function update() { - var threshold = 2; - - _TextTrackButton.prototype.update.call(this); - - // if native, then threshold is 1 because no settings button - if (this.player().tech_ && this.player().tech_.featuresNativeTextTracks) { - threshold = 1; - } - - if (this.items && this.items.length > threshold) { - this.show(); - } else { - this.hide(); - } - }; - /** * Create caption menu items * - * @return {Array} Array of menu items - * @method createItems + * @return {CaptionSettingsMenuItem[]} + * The array of current menu items. */ @@ -4251,6 +4898,8 @@ var CaptionsButton = function (_TextTrackButton) { if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks)) { items.push(new _captionSettingsMenuItem2['default'](this.player_, { kind: this.kind_ })); + + this.hideThreshold_ += 1; } return _TextTrackButton.prototype.createItems.call(this, items); @@ -4259,7 +4908,22 @@ var CaptionsButton = function (_TextTrackButton) { return CaptionsButton; }(_textTrackButton2['default']); +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + CaptionsButton.prototype.kind_ = 'captions'; + +/** + * The text that should display over the `CaptionsButton`s controls. Added for localization. + * + * @type {string} + * @private + */ CaptionsButton.prototype.controlText_ = 'Captions'; _component2['default'].registerComponent('CaptionsButton', CaptionsButton); @@ -4278,28 +4942,14 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _textTrackMenuItem = _dereq_(31); - -var _textTrackMenuItem2 = _interopRequireDefault(_textTrackMenuItem); - var _chaptersTrackMenuItem = _dereq_(26); var _chaptersTrackMenuItem2 = _interopRequireDefault(_chaptersTrackMenuItem); -var _menu = _dereq_(49); - -var _menu2 = _interopRequireDefault(_menu); - -var _dom = _dereq_(80); - -var Dom = _interopRequireWildcard(_dom); - -var _toTitleCase = _dereq_(89); +var _toTitleCase = _dereq_(91); var _toTitleCase2 = _interopRequireDefault(_toTitleCase); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -4316,15 +4966,23 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Chapters act much differently than other text tracks * Cues are navigation vs. other tracks of alternative languages * - * @param {Object} player Player object - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function * @extends TextTrackButton - * @class ChaptersButton */ var ChaptersButton = function (_TextTrackButton) { _inherits(ChaptersButton, _TextTrackButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this function is ready. + */ function ChaptersButton(player, options, ready) { _classCallCheck(this, ChaptersButton); @@ -4335,10 +4993,10 @@ var ChaptersButton = function (_TextTrackButton) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -4346,130 +5004,174 @@ var ChaptersButton = function (_TextTrackButton) { return 'vjs-chapters-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); }; + /** + * Update the menu based on the current state of its items. + * + * @param {EventTarget~Event} [event] + * An event that triggered this function to run. + * + * @listens TextTrackList#addtrack + * @listens TextTrackList#removetrack + * @listens TextTrackList#change + */ + + + ChaptersButton.prototype.update = function update(event) { + if (!this.track_ || event && (event.type === 'addtrack' || event.type === 'removetrack')) { + this.setTrack(this.findChaptersTrack()); + } + _TextTrackButton.prototype.update.call(this); + }; + + /** + * Set the currently selected track for the chapters button. + * + * @param {TextTrack} track + * The new track to select. Nothing will change if this is the currently selected + * track. + */ + + + ChaptersButton.prototype.setTrack = function setTrack(track) { + if (this.track_ === track) { + return; + } + + if (!this.updateHandler_) { + this.updateHandler_ = this.update.bind(this); + } + + // here this.track_ refers to the old track instance + if (this.track_) { + var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); + + if (remoteTextTrackEl) { + remoteTextTrackEl.removeEventListener('load', this.updateHandler_); + } + + this.track_ = null; + } + + this.track_ = track; + + // here this.track_ refers to the new track instance + if (this.track_) { + this.track_.mode = 'hidden'; + + var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); + + if (_remoteTextTrackEl) { + _remoteTextTrackEl.addEventListener('load', this.updateHandler_); + } + } + }; + + /** + * Find the track object that is currently in use by this ChaptersButton + * + * @return {TextTrack|undefined} + * The current track or undefined if none was found. + */ + + + ChaptersButton.prototype.findChaptersTrack = function findChaptersTrack() { + var tracks = this.player_.textTracks() || []; + + for (var i = tracks.length - 1; i >= 0; i--) { + // We will always choose the last track as our chaptersTrack + var track = tracks[i]; + + if (track.kind === this.kind_) { + return track; + } + } + }; + + /** + * Get the caption for the ChaptersButton based on the track label. This will also + * use the current tracks localized kind as a fallback if a label does not exist. + * + * @return {string} + * The tracks current label or the localized track kind. + */ + + + ChaptersButton.prototype.getMenuCaption = function getMenuCaption() { + if (this.track_ && this.track_.label) { + return this.track_.label; + } + return this.localize((0, _toTitleCase2['default'])(this.kind_)); + }; + + /** + * Create menu from chapter track + * + * @return {Menu} + * New menu for the chapter buttons + */ + + + ChaptersButton.prototype.createMenu = function createMenu() { + this.options_.title = this.getMenuCaption(); + return _TextTrackButton.prototype.createMenu.call(this); + }; + /** * Create a menu item for each text track * - * @return {Array} Array of menu items - * @method createItems + * @return {TextTrackMenuItem[]} + * Array of menu items */ ChaptersButton.prototype.createItems = function createItems() { var items = []; - var tracks = this.player_.textTracks(); - if (!tracks) { + if (!this.track_) { return items; } - for (var i = 0; i < tracks.length; i++) { - var track = tracks[i]; + var cues = this.track_.cues; - if (track.kind === this.kind_) { - items.push(new _textTrackMenuItem2['default'](this.player_, { track: track })); - } + if (!cues) { + return items; + } + + for (var i = 0, l = cues.length; i < l; i++) { + var cue = cues[i]; + var mi = new _chaptersTrackMenuItem2['default'](this.player_, { track: this.track_, cue: cue }); + + items.push(mi); } return items; }; - /** - * Create menu from chapter buttons - * - * @return {Menu} Menu of chapter buttons - * @method createMenu - */ - - - ChaptersButton.prototype.createMenu = function createMenu() { - var _this2 = this; - - var tracks = this.player_.textTracks() || []; - var chaptersTrack = void 0; - var items = this.items || []; - - for (var i = tracks.length - 1; i >= 0; i--) { - - // We will always choose the last track as our chaptersTrack - var track = tracks[i]; - - if (track.kind === this.kind_) { - chaptersTrack = track; - - break; - } - } - - var menu = this.menu; - - if (menu === undefined) { - menu = new _menu2['default'](this.player_); - - var title = Dom.createEl('li', { - className: 'vjs-menu-title', - innerHTML: (0, _toTitleCase2['default'])(this.kind_), - tabIndex: -1 - }); - - menu.children_.unshift(title); - Dom.insertElFirst(title, menu.contentEl()); - } else { - // We will empty out the menu children each time because we want a - // fresh new menu child list each time - items.forEach(function (item) { - return menu.removeChild(item); - }); - // Empty out the ChaptersButton menu items because we no longer need them - items = []; - } - - if (chaptersTrack && (chaptersTrack.cues === null || chaptersTrack.cues === undefined)) { - chaptersTrack.mode = 'hidden'; - - var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(chaptersTrack); - - if (remoteTextTrackEl) { - remoteTextTrackEl.addEventListener('load', function (event) { - return _this2.update(); - }); - } - } - - if (chaptersTrack && chaptersTrack.cues && chaptersTrack.cues.length > 0) { - var cues = chaptersTrack.cues; - - for (var _i = 0, l = cues.length; _i < l; _i++) { - var cue = cues[_i]; - - var mi = new _chaptersTrackMenuItem2['default'](this.player_, { - cue: cue, - track: chaptersTrack - }); - - items.push(mi); - - menu.addChild(mi); - } - } - - if (items.length > 0) { - this.show(); - } - // Assigning the value of items back to this.items for next iteration - this.items = items; - return menu; - }; - return ChaptersButton; }(_textTrackButton2['default']); +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + ChaptersButton.prototype.kind_ = 'chapters'; + +/** + * The text that should display over the `ChaptersButton`s controls. Added for localization. + * + * @type {string} + * @private + */ ChaptersButton.prototype.controlText_ = 'Chapters'; _component2['default'].registerComponent('ChaptersButton', ChaptersButton); exports['default'] = ChaptersButton; -},{"26":26,"30":30,"31":31,"49":49,"5":5,"80":80,"89":89}],26:[function(_dereq_,module,exports){ +},{"26":26,"30":30,"5":5,"91":91}],26:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4482,7 +5184,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -4502,14 +5204,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The chapter track menu item * - * @param {Player|Object} player - * @param {Object=} options * @extends MenuItem - * @class ChaptersTrackMenuItem */ var ChaptersTrackMenuItem = function (_MenuItem) { _inherits(ChaptersTrackMenuItem, _MenuItem); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function ChaptersTrackMenuItem(player, options) { _classCallCheck(this, ChaptersTrackMenuItem); @@ -4518,6 +5226,7 @@ var ChaptersTrackMenuItem = function (_MenuItem) { var currentTime = player.currentTime(); // Modify options for parent MenuItem class's init. + options.selectable = true; options.label = cue.text; options.selected = cue.startTime <= currentTime && currentTime < cue.endTime; @@ -4530,13 +5239,19 @@ var ChaptersTrackMenuItem = function (_MenuItem) { } /** - * Handle click on menu item + * This gets called when an `ChaptersTrackMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - ChaptersTrackMenuItem.prototype.handleClick = function handleClick() { + ChaptersTrackMenuItem.prototype.handleClick = function handleClick(event) { _MenuItem.prototype.handleClick.call(this); this.player_.currentTime(this.cue.startTime); this.update(this.cue.startTime); @@ -4545,11 +5260,14 @@ var ChaptersTrackMenuItem = function (_MenuItem) { /** * Update chapter menu item * - * @method update + * @param {EventTarget~Event} [event] + * The `cuechange` event that caused this function to run. + * + * @listens TextTrack#cuechange */ - ChaptersTrackMenuItem.prototype.update = function update() { + ChaptersTrackMenuItem.prototype.update = function update(event) { var cue = this.cue; var currentTime = this.player_.currentTime(); @@ -4563,7 +5281,7 @@ var ChaptersTrackMenuItem = function (_MenuItem) { _component2['default'].registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem); exports['default'] = ChaptersTrackMenuItem; -},{"48":48,"5":5,"82":82}],27:[function(_dereq_,module,exports){ +},{"48":48,"5":5,"83":83}],27:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4576,7 +5294,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -4596,15 +5314,23 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The button component for toggling and selecting descriptions * - * @param {Object} player Player object - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function * @extends TextTrackButton - * @class DescriptionsButton */ var DescriptionsButton = function (_TextTrackButton) { _inherits(DescriptionsButton, _TextTrackButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this component is ready. + */ function DescriptionsButton(player, options, ready) { _classCallCheck(this, DescriptionsButton); @@ -4615,14 +5341,12 @@ var DescriptionsButton = function (_TextTrackButton) { var tracks = player.textTracks(); if (tracks) { - (function () { - var changeHandler = Fn.bind(_this, _this.handleTracksChange); + var changeHandler = Fn.bind(_this, _this.handleTracksChange); - tracks.addEventListener('change', changeHandler); - _this.on('dispose', function () { - tracks.removeEventListener('change', changeHandler); - }); - })(); + tracks.addEventListener('change', changeHandler); + _this.on('dispose', function () { + tracks.removeEventListener('change', changeHandler); + }); } return _this; } @@ -4630,7 +5354,10 @@ var DescriptionsButton = function (_TextTrackButton) { /** * Handle text track change * - * @method handleTracksChange + * @param {EventTarget~Event} event + * The event that caused this function to run + * + * @listens TextTrackList#change */ @@ -4657,10 +5384,10 @@ var DescriptionsButton = function (_TextTrackButton) { }; /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -4671,13 +5398,28 @@ var DescriptionsButton = function (_TextTrackButton) { return DescriptionsButton; }(_textTrackButton2['default']); +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + DescriptionsButton.prototype.kind_ = 'descriptions'; + +/** + * The text that should display over the `DescriptionsButton`s controls. Added for localization. + * + * @type {string} + * @private + */ DescriptionsButton.prototype.controlText_ = 'Descriptions'; _component2['default'].registerComponent('DescriptionsButton', DescriptionsButton); exports['default'] = DescriptionsButton; -},{"30":30,"5":5,"82":82}],28:[function(_dereq_,module,exports){ +},{"30":30,"5":5,"83":83}],28:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4704,14 +5446,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * A special menu item for turning of a specific type of text track * - * @param {Player|Object} player - * @param {Object=} options * @extends TextTrackMenuItem - * @class OffTextTrackMenuItem */ var OffTextTrackMenuItem = function (_TextTrackMenuItem) { _inherits(OffTextTrackMenuItem, _TextTrackMenuItem); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function OffTextTrackMenuItem(player, options) { _classCallCheck(this, OffTextTrackMenuItem); @@ -4737,8 +5485,8 @@ var OffTextTrackMenuItem = function (_TextTrackMenuItem) { /** * Handle text track change * - * @param {Object} event Event object - * @method handleTracksChange + * @param {EventTarget~Event} event + * The event that caused this function to run */ @@ -4791,15 +5539,23 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The button component for toggling and selecting subtitles * - * @param {Object} player Player object - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function * @extends TextTrackButton - * @class SubtitlesButton */ var SubtitlesButton = function (_TextTrackButton) { _inherits(SubtitlesButton, _TextTrackButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this component is ready. + */ function SubtitlesButton(player, options, ready) { _classCallCheck(this, SubtitlesButton); @@ -4810,10 +5566,10 @@ var SubtitlesButton = function (_TextTrackButton) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -4824,7 +5580,22 @@ var SubtitlesButton = function (_TextTrackButton) { return SubtitlesButton; }(_textTrackButton2['default']); +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + SubtitlesButton.prototype.kind_ = 'subtitles'; + +/** + * The text that should display over the `SubtitlesButton`s controls. Added for localization. + * + * @type {string} + * @private + */ SubtitlesButton.prototype.controlText_ = 'Subtitles'; _component2['default'].registerComponent('SubtitlesButton', SubtitlesButton); @@ -4865,14 +5636,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The base class for buttons that toggle specific text track types (e.g. subtitles) * - * @param {Player|Object} player - * @param {Object=} options * @extends MenuButton - * @class TextTrackButton */ var TextTrackButton = function (_TrackButton) { _inherits(TextTrackButton, _TrackButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ function TextTrackButton(player) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -4886,8 +5663,11 @@ var TextTrackButton = function (_TrackButton) { /** * Create a menu item for each text track * - * @return {Array} Array of menu items - * @method createItems + * @param {TextTrackMenuItem[]} [items=[]] + * Existing array of items to use during creation + * + * @return {TextTrackMenuItem[]} + * Array of menu items that were created */ @@ -4896,6 +5676,7 @@ var TextTrackButton = function (_TrackButton) { // Add an OFF menu item to turn all tracks off items.push(new _offTextTrackMenuItem2['default'](this.player_, { kind: this.kind_ })); + this.hideThreshold_ += 1; var tracks = this.player_.textTracks(); @@ -4940,15 +5721,15 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); @@ -4968,14 +5749,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The specific menu item type for selecting a language within a text track kind * - * @param {Player|Object} player - * @param {Object=} options * @extends MenuItem - * @class TextTrackMenuItem */ var TextTrackMenuItem = function (_MenuItem) { _inherits(TextTrackMenuItem, _MenuItem); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function TextTrackMenuItem(player, options) { _classCallCheck(this, TextTrackMenuItem); @@ -4991,14 +5778,12 @@ var TextTrackMenuItem = function (_MenuItem) { _this.track = track; if (tracks) { - (function () { - var changeHandler = Fn.bind(_this, _this.handleTracksChange); + var changeHandler = Fn.bind(_this, _this.handleTracksChange); - tracks.addEventListener('change', changeHandler); - _this.on('dispose', function () { - tracks.removeEventListener('change', changeHandler); - }); - })(); + tracks.addEventListener('change', changeHandler); + _this.on('dispose', function () { + tracks.removeEventListener('change', changeHandler); + }); } // iOS7 doesn't dispatch change events to TextTrackLists when an @@ -5008,35 +5793,39 @@ var TextTrackMenuItem = function (_MenuItem) { // the change event. As a poor substitute, we manually dispatch // change events whenever the controls modify the mode. if (tracks && tracks.onchange === undefined) { - (function () { - var event = void 0; + var event = void 0; - _this.on(['tap', 'click'], function () { - if (_typeof(_window2['default'].Event) !== 'object') { - // Android 2.3 throws an Illegal Constructor error for window.Event - try { - event = new _window2['default'].Event('change'); - } catch (err) { - // continue regardless of error - } + _this.on(['tap', 'click'], function () { + if (_typeof(_window2['default'].Event) !== 'object') { + // Android 2.3 throws an Illegal Constructor error for window.Event + try { + event = new _window2['default'].Event('change'); + } catch (err) { + // continue regardless of error } + } - if (!event) { - event = _document2['default'].createEvent('Event'); - event.initEvent('change', true, true); - } + if (!event) { + event = _document2['default'].createEvent('Event'); + event.initEvent('change', true, true); + } - tracks.dispatchEvent(event); - }); - })(); + tracks.dispatchEvent(event); + }); } return _this; } /** - * Handle click on text track + * This gets called when an `TextTrackMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ @@ -5066,9 +5855,12 @@ var TextTrackMenuItem = function (_MenuItem) { }; /** - * Handle text track change + * Handle text track list change * - * @method handleTracksChange + * @param {EventTarget~Event} event + * The `change` event that caused this function to be called. + * + * @listens TextTrackList#change */ @@ -5082,7 +5874,7 @@ var TextTrackMenuItem = function (_MenuItem) { _component2['default'].registerComponent('TextTrackMenuItem', TextTrackMenuItem); exports['default'] = TextTrackMenuItem; -},{"48":48,"5":5,"82":82,"92":92,"93":93}],32:[function(_dereq_,module,exports){ +},{"48":48,"5":5,"83":83,"94":94,"95":95}],32:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -5091,11 +5883,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _formatTime = _dereq_(83); +var _formatTime = _dereq_(84); var _formatTime2 = _interopRequireDefault(_formatTime); @@ -5115,14 +5907,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Displays the current time * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class CurrentTimeDisplay */ var CurrentTimeDisplay = function (_Component) { _inherits(CurrentTimeDisplay, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function CurrentTimeDisplay(player, options) { _classCallCheck(this, CurrentTimeDisplay); @@ -5133,10 +5931,10 @@ var CurrentTimeDisplay = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -5161,11 +5959,14 @@ var CurrentTimeDisplay = function (_Component) { /** * Update current time display * - * @method updateContent + * @param {EventTarget~Event} [event] + * The `timeupdate` event that caused this function to run. + * + * @listens Player#timeupdate */ - CurrentTimeDisplay.prototype.updateContent = function updateContent() { + CurrentTimeDisplay.prototype.updateContent = function updateContent(event) { // Allows for smooth scrubbing, when player can't keep up. var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); var localizedText = this.localize('Current Time'); @@ -5183,7 +5984,7 @@ var CurrentTimeDisplay = function (_Component) { _component2['default'].registerComponent('CurrentTimeDisplay', CurrentTimeDisplay); exports['default'] = CurrentTimeDisplay; -},{"5":5,"80":80,"83":83}],33:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"84":84}],33:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -5192,11 +5993,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _formatTime = _dereq_(83); +var _formatTime = _dereq_(84); var _formatTime2 = _interopRequireDefault(_formatTime); @@ -5216,14 +6017,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Displays the duration * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class DurationDisplay */ var DurationDisplay = function (_Component) { _inherits(DurationDisplay, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function DurationDisplay(player, options) { _classCallCheck(this, DurationDisplay); @@ -5240,10 +6047,10 @@ var DurationDisplay = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -5266,13 +6073,19 @@ var DurationDisplay = function (_Component) { }; /** - * Update duration time display + * Update duration time display. * - * @method updateContent + * @param {EventTarget~Event} [event] + * The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused + * this function to be called. + * + * @listens Player#durationchange + * @listens Player#timeupdate + * @listens Player#loadedmetadata */ - DurationDisplay.prototype.updateContent = function updateContent() { + DurationDisplay.prototype.updateContent = function updateContent(event) { var duration = this.player_.duration(); if (duration && this.duration_ !== duration) { @@ -5291,7 +6104,7 @@ var DurationDisplay = function (_Component) { _component2['default'].registerComponent('DurationDisplay', DurationDisplay); exports['default'] = DurationDisplay; -},{"5":5,"80":80,"83":83}],34:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"84":84}],34:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -5300,11 +6113,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _formatTime = _dereq_(83); +var _formatTime = _dereq_(84); var _formatTime2 = _interopRequireDefault(_formatTime); @@ -5324,14 +6137,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Displays the time left in the video * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class RemainingTimeDisplay */ var RemainingTimeDisplay = function (_Component) { _inherits(RemainingTimeDisplay, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function RemainingTimeDisplay(player, options) { _classCallCheck(this, RemainingTimeDisplay); @@ -5343,10 +6162,10 @@ var RemainingTimeDisplay = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -5369,13 +6188,17 @@ var RemainingTimeDisplay = function (_Component) { }; /** - * Update remaining time display + * Update remaining time display. * - * @method updateContent + * @param {EventTarget~Event} [event] + * The `timeupdate` or `durationchange` event that caused this to run. + * + * @listens Player#timeupdate + * @listens Player#durationchange */ - RemainingTimeDisplay.prototype.updateContent = function updateContent() { + RemainingTimeDisplay.prototype.updateContent = function updateContent(event) { if (this.player_.duration()) { var localizedText = this.localize('Remaining Time'); var formattedTime = (0, _formatTime2['default'])(this.player_.remainingTime()); @@ -5397,7 +6220,7 @@ var RemainingTimeDisplay = function (_Component) { _component2['default'].registerComponent('RemainingTimeDisplay', RemainingTimeDisplay); exports['default'] = RemainingTimeDisplay; -},{"5":5,"80":80,"83":83}],35:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"84":84}],35:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -5421,10 +6244,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * The separator between the current time and duration. * Can be hidden if it's not needed in the design. * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class TimeDivider */ var TimeDivider = function (_Component) { _inherits(TimeDivider, _Component); @@ -5439,7 +6259,7 @@ var TimeDivider = function (_Component) { * Create the component's DOM element * * @return {Element} - * @method createEl + * The element that was created. */ TimeDivider.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { @@ -5467,7 +6287,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -5485,16 +6305,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The base class for buttons that toggle specific text track types (e.g. subtitles) + * The base class for buttons that toggle specific track types (e.g. subtitles). * - * @param {Player|Object} player - * @param {Object=} options * @extends MenuButton - * @class TrackButton */ var TrackButton = function (_MenuButton) { _inherits(TrackButton, _MenuButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function TrackButton(player, options) { _classCallCheck(this, TrackButton); @@ -5528,7 +6354,7 @@ var TrackButton = function (_MenuButton) { _component2['default'].registerComponent('TrackButton', TrackButton); exports['default'] = TrackButton; -},{"47":47,"5":5,"82":82}],37:[function(_dereq_,module,exports){ +},{"47":47,"5":5,"83":83}],37:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -5541,7 +6367,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -5566,14 +6392,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The bar that contains the volume level and can be clicked on to adjust the level * - * @param {Player|Object} player - * @param {Object=} options * @extends Slider - * @class VolumeBar */ var VolumeBar = function (_Slider) { _inherits(VolumeBar, _Slider); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function VolumeBar(player, options) { _classCallCheck(this, VolumeBar); @@ -5585,10 +6417,10 @@ var VolumeBar = function (_Slider) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -5601,9 +6433,12 @@ var VolumeBar = function (_Slider) { }; /** - * Handle mouse move on volume bar + * Handle movement events on the {@link VolumeMenuButton}. * - * @method handleMouseMove + * @param {EventTarget~Event} event + * The event that caused this function to run. + * + * @listens mousemove */ @@ -5612,6 +6447,11 @@ var VolumeBar = function (_Slider) { this.player_.volume(this.calculateDistance(event)); }; + /** + * If the player is muted unmute it. + */ + + VolumeBar.prototype.checkMuted = function checkMuted() { if (this.player_.muted()) { this.player_.muted(false); @@ -5621,8 +6461,8 @@ var VolumeBar = function (_Slider) { /** * Get percent of volume level * - * @retun {Number} Volume level percent - * @method getPercent + * @return {number} + * Volume level percent as a decimal number. */ @@ -5635,8 +6475,6 @@ var VolumeBar = function (_Slider) { /** * Increase volume level for keyboard users - * - * @method stepForward */ @@ -5647,8 +6485,6 @@ var VolumeBar = function (_Slider) { /** * Decrease volume level for keyboard users - * - * @method stepBack */ @@ -5660,11 +6496,14 @@ var VolumeBar = function (_Slider) { /** * Update ARIA accessibility attributes * - * @method updateARIAAttributes + * @param {EventTarget~Event} [event] + * The `volumechange` event that caused this function to run. + * + * @listens Player#volumechange */ - VolumeBar.prototype.updateARIAAttributes = function updateARIAAttributes() { + VolumeBar.prototype.updateARIAAttributes = function updateARIAAttributes(event) { // Current value of volume bar as a percentage var volume = (this.player_.volume() * 100).toFixed(2); @@ -5675,17 +6514,30 @@ var VolumeBar = function (_Slider) { return VolumeBar; }(_slider2['default']); +/** + * Default options for the `VolumeBar` + * + * @type {Object} + * @private + */ + + VolumeBar.prototype.options_ = { children: ['volumeLevel'], barName: 'volumeLevel' }; +/** + * Call the update event for this Slider when this event happens on the player. + * + * @type {string} + */ VolumeBar.prototype.playerEvent = 'volumechange'; _component2['default'].registerComponent('VolumeBar', VolumeBar); exports['default'] = VolumeBar; -},{"39":39,"5":5,"57":57,"82":82}],38:[function(_dereq_,module,exports){ +},{"39":39,"5":5,"57":57,"83":83}],38:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -5713,14 +6565,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The component for controlling the volume level * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class VolumeControl */ var VolumeControl = function (_Component) { _inherits(VolumeControl, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ function VolumeControl(player, options) { _classCallCheck(this, VolumeControl); @@ -5741,10 +6599,10 @@ var VolumeControl = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ @@ -5757,6 +6615,14 @@ var VolumeControl = function (_Component) { return VolumeControl; }(_component2['default']); +/** + * Default options for the `VolumeControl` + * + * @type {Object} + * @private + */ + + VolumeControl.prototype.options_ = { children: ['volumeBar'] }; @@ -5787,10 +6653,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Shows volume level * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class VolumeLevel */ var VolumeLevel = function (_Component) { _inherits(VolumeLevel, _Component); @@ -5802,10 +6665,10 @@ var VolumeLevel = function (_Component) { } /** - * Create the component's DOM element + * Create the `Component`'s DOM element * * @return {Element} - * @method createEl + * The element that was created. */ VolumeLevel.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { @@ -5825,7 +6688,7 @@ exports['default'] = VolumeLevel; exports.__esModule = true; -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -5865,14 +6728,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * Button for volume popup * - * @param {Player|Object} player - * @param {Object=} options * @extends PopupButton - * @class VolumeMenuButton */ var VolumeMenuButton = function (_PopupButton) { _inherits(VolumeMenuButton, _PopupButton); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ function VolumeMenuButton(player) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -5936,10 +6805,10 @@ var VolumeMenuButton = function (_PopupButton) { } /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -5956,10 +6825,10 @@ var VolumeMenuButton = function (_PopupButton) { }; /** - * Allow sub components to stack CSS class names + * Create the VolumeMenuButton popup * - * @return {Popup} The volume popup button - * @method createPopup + * @return {Popup} + * The popup that was created */ @@ -5981,26 +6850,59 @@ var VolumeMenuButton = function (_PopupButton) { }; /** - * Handle click on volume popup and calls super + * This gets called when an `VolumeMenuButton` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. * - * @method handleClick + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - VolumeMenuButton.prototype.handleClick = function handleClick() { + VolumeMenuButton.prototype.handleClick = function handleClick(event) { _muteToggle2['default'].prototype.handleClick.call(this); _PopupButton.prototype.handleClick.call(this); }; + /** + * Add events listeners to the created `VolumeBar`. + */ + + VolumeMenuButton.prototype.attachVolumeBarEvents = function attachVolumeBarEvents() { this.menuContent.on(['mousedown', 'touchdown'], Fn.bind(this, this.handleMouseDown)); }; + /** + * Handle the `mousedown` and `touchdown` events on the `VolumeBar` + * + * @param {EventTarget~Event} [event] + * The `mousedown` or `touchdown` event that caused this to run. + * + * @listens mousedown + * @listens touchdown + */ + + VolumeMenuButton.prototype.handleMouseDown = function handleMouseDown(event) { this.on(['mousemove', 'touchmove'], Fn.bind(this.volumeBar, this.volumeBar.handleMouseMove)); this.on(this.el_.ownerDocument, ['mouseup', 'touchend'], this.handleMouseUp); }; + /** + * Handle the `mouseup` and `touchend` events on the `VolumeBar` + * + * @param {EventTarget~Event} [event] + * The `mouseup` or `touchend` event that caused this to run. + * + * @listens mouseup + * @listens touchend + */ + + VolumeMenuButton.prototype.handleMouseUp = function handleMouseUp(event) { this.off(['mousemove', 'touchmove'], Fn.bind(this.volumeBar, this.volumeBar.handleMouseMove)); }; @@ -6008,13 +6910,25 @@ var VolumeMenuButton = function (_PopupButton) { return VolumeMenuButton; }(_popupButton2['default']); +/** + * @borrows MuteToggle#update as VolumeMenuButton#volumeUpdate + */ + + VolumeMenuButton.prototype.volumeUpdate = _muteToggle2['default'].prototype.update; + +/** + * The text that should display over the `VolumeMenuButton`s controls. Added for localization. + * + * @type {string} + * @private + */ VolumeMenuButton.prototype.controlText_ = 'Mute'; _component2['default'].registerComponent('VolumeMenuButton', VolumeMenuButton); exports['default'] = VolumeMenuButton; -},{"11":11,"37":37,"5":5,"53":53,"54":54,"82":82}],41:[function(_dereq_,module,exports){ +},{"11":11,"37":37,"5":5,"53":53,"54":54,"83":83}],41:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -6027,7 +6941,7 @@ var _modalDialog = _dereq_(50); var _modalDialog2 = _interopRequireDefault(_modalDialog); -var _mergeOptions = _dereq_(86); +var _mergeOptions = _dereq_(87); var _mergeOptions2 = _interopRequireDefault(_mergeOptions); @@ -6043,19 +6957,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * Display that an error has occurred making the video unplayable. + * A display that indicates an error has occurred. This means that the video + * is unplayable. * * @extends ModalDialog - * @class ErrorDisplay */ var ErrorDisplay = function (_ModalDialog) { _inherits(ErrorDisplay, _ModalDialog); /** - * Constructor for error display modal. + * Creates an instance of this class. * * @param {Player} player + * The `Player` that this class should be attached to. + * * @param {Object} [options] + * The key/value store of player options. */ function ErrorDisplay(player, options) { _classCallCheck(this, ErrorDisplay); @@ -6067,13 +6984,12 @@ var ErrorDisplay = function (_ModalDialog) { } /** - * Include the old class for backward-compatibility. + * Builds the default DOM `className`. * - * This can be removed in 6.0. + * @return {string} + * The DOM `className` for this object. * - * @method buildCSSClass - * @deprecated - * @return {String} + * @deprecated Since version 5. */ @@ -6082,9 +6998,10 @@ var ErrorDisplay = function (_ModalDialog) { }; /** - * Generates the modal content based on the player error. + * Gets the localized error message based on the `Player`s error. * - * @return {String|Null} + * @return {string} + * The `Player`s error message localized or an empty string. */ @@ -6097,6 +7014,13 @@ var ErrorDisplay = function (_ModalDialog) { return ErrorDisplay; }(_modalDialog2['default']); +/** + * The default options for an `ErrorDisplay`. + * + * @private + */ + + ErrorDisplay.prototype.options_ = (0, _mergeOptions2['default'])(_modalDialog2['default'].prototype.options_, { fillAlways: true, temporary: false, @@ -6106,24 +7030,71 @@ ErrorDisplay.prototype.options_ = (0, _mergeOptions2['default'])(_modalDialog2[' _component2['default'].registerComponent('ErrorDisplay', ErrorDisplay); exports['default'] = ErrorDisplay; -},{"5":5,"50":50,"86":86}],42:[function(_dereq_,module,exports){ +},{"5":5,"50":50,"87":87}],42:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; -var _events = _dereq_(81); +var _events = _dereq_(82); var Events = _interopRequireWildcard(_events); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } -var EventTarget = function EventTarget() {}; /** - * @file event-target.js - */ +/** + * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It + * adds shorthand functions that wrap around lengthy functions. For example: + * the `on` function is a wrapper around `addEventListener`. + * + * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget} + * @class EventTarget + */ +var EventTarget = function EventTarget() {}; +/** + * A Custom DOM event. + * + * @typedef {Object} EventTarget~Event + * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent} + */ +/** + * All event listeners should follow the following format. + * + * @callback EventTarget~EventListener + * @this {EventTarget} + * + * @param {EventTarget~Event} event + * the event that triggered this function + * + * @param {Object} [hash] + * hash of data sent during the event + */ + +/** + * An object containing event names as keys and booleans as values. + * + * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger} + * will have extra functionality. See that function for more information. + * + * @property EventTarget.prototype.allowedEvents_ + * @private + */ +/** + * @file src/js/event-target.js + */ EventTarget.prototype.allowedEvents_ = {}; +/** + * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a + * function that will get called when an event with a certain name gets triggered. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to call with `EventTarget`s + */ EventTarget.prototype.on = function (type, fn) { // Remove the addEventListener alias before calling Events.on // so we don't get into an infinite type loop @@ -6134,16 +7105,52 @@ EventTarget.prototype.on = function (type, fn) { this.addEventListener = ael; }; +/** + * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#on} + */ EventTarget.prototype.addEventListener = EventTarget.prototype.on; +/** + * Removes an `event listener` for a specific event from an instance of `EventTarget`. + * This makes it so that the `event listener` will no longer get called when the + * named event happens. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to remove. + */ EventTarget.prototype.off = function (type, fn) { Events.off(this, type, fn); }; +/** + * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#off} + */ EventTarget.prototype.removeEventListener = EventTarget.prototype.off; +/** + * This function will add an `event listener` that gets triggered only once. After the + * first trigger it will get removed. This is like adding an `event listener` + * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to be called once for each event name. + */ EventTarget.prototype.one = function (type, fn) { - // Remove the addEventListener alias before calling Events.on + // Remove the addEventListener alialing Events.on // so we don't get into an infinite type loop var ael = this.addEventListener; @@ -6152,6 +7159,22 @@ EventTarget.prototype.one = function (type, fn) { this.addEventListener = ael; }; +/** + * This function causes an event to happen. This will then cause any `event listeners` + * that are waiting for that event, to get called. If there are no `event listeners` + * for an event then nothing will happen. + * + * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`. + * Trigger will also call the `on` + `uppercaseEventName` function. + * + * Example: + * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call + * `onClick` if it exists. + * + * @param {string|EventTarget~Event|Object} event + * The name of the event, an `Event`, or an object with a key of type set to + * an event name. + */ EventTarget.prototype.trigger = function (event) { var type = event.type || event; @@ -6167,30 +7190,49 @@ EventTarget.prototype.trigger = function (event) { Events.trigger(this, event); }; -// The standard DOM EventTarget.dispatchEvent() is aliased to trigger() +/** + * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#trigger} + */ EventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger; exports['default'] = EventTarget; -},{"81":81}],43:[function(_dereq_,module,exports){ +},{"82":82}],43:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -var _log = _dereq_(85); +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); +var _obj = _dereq_(88); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -/* +/** * @file extend.js - * + * @module extend + */ + +/** * A combination of node inherits and babel's inherits (after transpile). * Both work the same but node adds `super_` to the subClass * and Bable adds the superClass as __proto__. Both seem useful. + * + * @param {Object} subClass + * The class to inherit to + * + * @param {Object} superClass + * The class to inherit from + * + * @private */ var _inherits = function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { @@ -6212,22 +7254,18 @@ var _inherits = function _inherits(subClass, superClass) { } }; -/* +/** * Function for subclassing using the same inheritance that * videojs uses internally - * ```js - * var Button = videojs.getComponent('Button'); - * ``` - * ```js - * var MyButton = videojs.extend(Button, { - * constructor: function(player, options) { - * Button.call(this, player, options); - * }, - * onClick: function() { - * // doSomething - * } - * }); - * ``` + * + * @param {Object} superClass + * The class to inherit from + * + * @param {Object} [subClassMethods={}] + * The class to inherit to + * + * @return {Object} + * The new object with subClassMethods that inherited superClass. */ var extendFn = function extendFn(superClass) { var subClassMethods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -6238,7 +7276,7 @@ var extendFn = function extendFn(superClass) { var methods = {}; - if ((typeof subClassMethods === 'undefined' ? 'undefined' : _typeof(subClassMethods)) === 'object') { + if ((0, _obj.isObject)(subClassMethods)) { if (typeof subClassMethods.init === 'function') { _log2['default'].warn('Constructor logic via init() is deprecated; please use constructor() instead.'); subClassMethods.constructor = subClassMethods.init; @@ -6265,32 +7303,33 @@ var extendFn = function extendFn(superClass) { exports['default'] = extendFn; -},{"85":85}],44:[function(_dereq_,module,exports){ +},{"86":86,"88":88}],44:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -/* - * Store the browser-specific methods for the fullscreen API - * @type {Object|undefined} - * @private +/** + * Store the browser-specific methods for the fullscreen API. + * + * @type {Object} + * @see [Specification]{@link https://fullscreen.spec.whatwg.org} + * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js} */ var FullscreenApi = {}; // browser API methods -// map approach from Screenful.js - https://github.com/sindresorhus/screenfull.js /** * @file fullscreen-api.js + * @module fullscreen-api + * @private */ -var apiMap = [ -// Spec: https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html -['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], +var apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], // WebKit ['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Old WebKit (Safari 5.1) @@ -6321,7 +7360,7 @@ if (browserApi) { exports['default'] = FullscreenApi; -},{"92":92}],45:[function(_dereq_,module,exports){ +},{"94":94}],45:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -6341,13 +7380,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" */ -/* Loading Spinner -================================================================================ */ /** - * Loading spinner for waiting events + * A loading spinner for use during waiting/loading events. * * @extends Component - * @class LoadingSpinner */ var LoadingSpinner = function (_Component) { _inherits(LoadingSpinner, _Component); @@ -6359,9 +7395,10 @@ var LoadingSpinner = function (_Component) { } /** - * Create the component's DOM element + * Create the `LoadingSpinner`s DOM element. * - * @method createEl + * @return {Element} + * The dom element that gets created. */ LoadingSpinner.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { @@ -6381,28 +7418,24 @@ exports['default'] = LoadingSpinner; exports.__esModule = true; -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** - * @file media-error.js - */ +var _obj = _dereq_(88); - -var _object = _dereq_(136); - -var _object2 = _interopRequireDefault(_object); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -/* - * Custom MediaError class which mimics the standard HTML5 MediaError class. +/** + * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class. * - * @param {Number|String|Object|MediaError} value + * @param {number|string|Object|MediaError} value * This can be of multiple types: - * - Number: should be a standard error code - * - String: an error message (the code will be 0) + * - number: should be a standard error code + * - string: an error message (the code will be 0) * - Object: arbitrary properties - * - MediaError (native): used to populate a video.js MediaError object - * - MediaError (video.js): will return itself if it's already a - * video.js MediaError object. + * - `MediaError` (native): used to populate a video.js `MediaError` object + * - `MediaError` (video.js): will return itself if it's already a + * video.js `MediaError` object. + * + * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror} + * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes} + * + * @class MediaError */ function MediaError(value) { @@ -6417,15 +7450,15 @@ function MediaError(value) { } else if (typeof value === 'string') { // default code is zero, so this is a custom error this.message = value; - } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { + } else if ((0, _obj.isObject)(value)) { - // We assign the `code` property manually because native MediaError objects + // We assign the `code` property manually because native `MediaError` objects // do not expose it as an own/enumerable property of the object. if (typeof value.code === 'number') { this.code = value.code; } - (0, _object2['default'])(this, value); + (0, _obj.assign)(this, value); } if (!this.message) { @@ -6433,39 +7466,56 @@ function MediaError(value) { } } -/* - * The error code that refers two one of the defined - * MediaError types +/** + * The error code that refers two one of the defined `MediaError` types * * @type {Number} */ +/** + * @file media-error.js + */ MediaError.prototype.code = 0; -/* - * An optional message to be shown with the error. - * Message is not part of the HTML5 video spec - * but allows for more informative custom errors. +/** + * An optional message that to show with the error. Message is not part of the HTML5 + * video spec but allows for more informative custom errors. * * @type {String} */ MediaError.prototype.message = ''; -/* - * An optional status code that can be set by plugins - * to allow even more detail about the error. - * For example the HLS plugin might provide the specific - * HTTP status code that was returned when the error - * occurred, then allowing a custom error overlay - * to display more information. +/** + * An optional status code that can be set by plugins to allow even more detail about + * the error. For example a plugin might provide a specific HTTP status code and an + * error message for that code. Then when the plugin gets that error this class will + * know how to display an error message for it. This allows a custom message to show + * up on the `Player` error overlay. * * @type {Array} */ MediaError.prototype.status = null; -// These errors are indexed by the W3C standard numeric value. The order -// should not be changed! +/** + * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the + * specification listed under {@link MediaError} for more information. + * + * @enum {array} + * @readonly + * @property {string} 0 - MEDIA_ERR_CUSTOM + * @property {string} 1 - MEDIA_ERR_CUSTOM + * @property {string} 2 - MEDIA_ERR_ABORTED + * @property {string} 3 - MEDIA_ERR_NETWORK + * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED + * @property {string} 5 - MEDIA_ERR_ENCRYPTED + */ MediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED']; +/** + * The default `MediaError` messages based on the {@link MediaError.errorTypes}. + * + * @type {Array} + * @constant + */ MediaError.defaultMessages = { 1: 'You aborted the media playback', 2: 'A network error caused the media download to fail part-way.', @@ -6482,9 +7532,101 @@ for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) { MediaError.prototype[MediaError.errorTypes[errNum]] = errNum; } +// jsdocs for instance/static members added above +// instance methods use `#` and static methods use `.` +/** + * W3C error code for any custom error. + * + * @member MediaError#MEDIA_ERR_CUSTOM + * @constant {number} + * @default 0 + */ +/** + * W3C error code for any custom error. + * + * @member MediaError.MEDIA_ERR_CUSTOM + * @constant {number} + * @default 0 + */ + +/** + * W3C error code for media error aborted. + * + * @member MediaError#MEDIA_ERR_ABORTED + * @constant {number} + * @default 1 + */ +/** + * W3C error code for media error aborted. + * + * @member MediaError.MEDIA_ERR_ABORTED + * @constant {number} + * @default 1 + */ + +/** + * W3C error code for any network error. + * + * @member MediaError#MEDIA_ERR_NETWORK + * @constant {number} + * @default 2 + */ +/** + * W3C error code for any network error. + * + * @member MediaError.MEDIA_ERR_NETWORK + * @constant {number} + * @default 2 + */ + +/** + * W3C error code for any decoding error. + * + * @member MediaError#MEDIA_ERR_DECODE + * @constant {number} + * @default 3 + */ +/** + * W3C error code for any decoding error. + * + * @member MediaError.MEDIA_ERR_DECODE + * @constant {number} + * @default 3 + */ + +/** + * W3C error code for any time that a source is not supported. + * + * @member MediaError#MEDIA_ERR_SRC_NOT_SUPPORTED + * @constant {number} + * @default 4 + */ +/** + * W3C error code for any time that a source is not supported. + * + * @member MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED + * @constant {number} + * @default 4 + */ + +/** + * W3C error code for any time that a source is encrypted. + * + * @member MediaError#MEDIA_ERR_ENCRYPTED + * @constant {number} + * @default 5 + */ +/** + * W3C error code for any time that a source is encrypted. + * + * @member MediaError.MEDIA_ERR_ENCRYPTED + * @constant {number} + * @default 5 + */ + exports['default'] = MediaError; -},{"136":136}],47:[function(_dereq_,module,exports){ +},{"88":88}],47:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -6501,15 +7643,15 @@ var _menu = _dereq_(49); var _menu2 = _interopRequireDefault(_menu); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _toTitleCase = _dereq_(89); +var _toTitleCase = _dereq_(91); var _toTitleCase2 = _interopRequireDefault(_toTitleCase); @@ -6527,16 +7669,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * A button class with a popup menu + * A `MenuButton` class for any popup {@link Menu}. * - * @param {Player|Object} player - * @param {Object=} options - * @extends Button - * @class MenuButton + * @extends ClickableComponent */ var MenuButton = function (_ClickableComponent) { _inherits(MenuButton, _ClickableComponent); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ function MenuButton(player) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -6555,9 +7703,7 @@ var MenuButton = function (_ClickableComponent) { } /** - * Update menu - * - * @method update + * Update the menu based on the current state of its items. */ @@ -6580,24 +7726,34 @@ var MenuButton = function (_ClickableComponent) { this.buttonPressed_ = false; this.el_.setAttribute('aria-expanded', 'false'); - if (this.items && this.items.length === 0) { + if (this.items && this.items.length <= this.hideThreshold_) { this.hide(); - } else if (this.items && this.items.length > 1) { + } else { this.show(); } }; /** - * Create menu + * Create the menu and add all items to it. * - * @return {Menu} The constructed menu - * @method createMenu + * @return {Menu} + * The constructed menu */ MenuButton.prototype.createMenu = function createMenu() { var menu = new _menu2['default'](this.player_); + /** + * Hide the menu if the number of items is less than or equal to this threshold. This defaults + * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list + * it here because every time we run `createMenu` we need to reset the value. + * + * @protected + * @type {Number} + */ + this.hideThreshold_ = 0; + // Add a title list item to the top if (this.options_.title) { var title = Dom.createEl('li', { @@ -6606,6 +7762,8 @@ var MenuButton = function (_ClickableComponent) { tabIndex: -1 }); + this.hideThreshold_ += 1; + menu.children_.unshift(title); Dom.insertElFirst(title, menu.contentEl()); } @@ -6625,17 +7783,17 @@ var MenuButton = function (_ClickableComponent) { /** * Create the list of menu items. Specific to each subclass. * - * @method createItems + * @abstract */ MenuButton.prototype.createItems = function createItems() {}; /** - * Create the component's DOM element + * Create the `MenuButtons`s DOM element. * * @return {Element} - * @method createEl + * The element that gets created. */ @@ -6646,10 +7804,10 @@ var MenuButton = function (_ClickableComponent) { }; /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -6667,17 +7825,23 @@ var MenuButton = function (_ClickableComponent) { }; /** - * When you click the button it adds focus, which - * will show the menu indefinitely. - * So we'll remove focus when the mouse leaves the button. - * Focus is needed for tab navigation. - * Allow sub components to stack CSS class names + * Handle a click on a `MenuButton`. + * See {@link ClickableComponent#handleClick} for instances where this is called. * - * @method handleClick + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - MenuButton.prototype.handleClick = function handleClick() { + MenuButton.prototype.handleClick = function handleClick(event) { + // When you click the button it adds focus, which will show the menu. + // So we'll remove focus when the mouse leaves the button. Focus is needed + // for tab navigation. + this.one(this.menu.contentEl(), 'mouseleave', Fn.bind(this, function (e) { this.unpressButton(); this.el_.blur(); @@ -6690,10 +7854,13 @@ var MenuButton = function (_ClickableComponent) { }; /** - * Handle key press on menu + * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See + * {@link ClickableComponent#handleKeyPress} for instances where this is called. * - * @param {Object} event Key press event - * @method handleKeyPress + * @param {EventTarget~Event} event + * The `keydown` event that caused this function to be called. + * + * @listens keydown */ @@ -6720,10 +7887,13 @@ var MenuButton = function (_ClickableComponent) { }; /** - * Handle key press on submenu + * Handle a `keydown` event on a sub-menu. The listener for this is added in + * the constructor. * - * @param {Object} event Key press event - * @method handleSubmenuKeyPress + * @param {EventTarget~Event} event + * Key press event + * + * @listens keydown */ @@ -6742,9 +7912,7 @@ var MenuButton = function (_ClickableComponent) { }; /** - * Makes changes based on button pressed - * - * @method pressButton + * Put the current `MenuButton` into a pressed state. */ @@ -6759,9 +7927,7 @@ var MenuButton = function (_ClickableComponent) { }; /** - * Makes changes based on button unpressed - * - * @method unpressButton + * Take the current `MenuButton` out of a pressed state. */ @@ -6776,10 +7942,10 @@ var MenuButton = function (_ClickableComponent) { }; /** - * Disable the menu button + * Disable the `MenuButton`. Don't allow it to be clicked. * - * @return {Component} - * @method disable + * @return {MenuButton} + * Returns itself; method can be chained. */ @@ -6795,10 +7961,10 @@ var MenuButton = function (_ClickableComponent) { }; /** - * Enable the menu button + * Enable the `MenuButton`. Allow it to be clicked. * - * @return {Component} - * @method disable + * @return {MenuButton} + * Returns itself; method can be chained. */ @@ -6814,7 +7980,7 @@ var MenuButton = function (_ClickableComponent) { _component2['default'].registerComponent('MenuButton', MenuButton); exports['default'] = MenuButton; -},{"3":3,"49":49,"5":5,"80":80,"82":82,"89":89}],48:[function(_dereq_,module,exports){ +},{"3":3,"49":49,"5":5,"81":81,"83":83,"91":91}],48:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -6827,9 +7993,7 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _object = _dereq_(136); - -var _object2 = _interopRequireDefault(_object); +var _obj = _dereq_(88); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } @@ -6845,14 +8009,21 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * The component for a menu item. `
  • ` * - * @param {Player|Object} player - * @param {Object=} options - * @extends Button - * @class MenuItem + * @extends ClickableComponent */ var MenuItem = function (_ClickableComponent) { _inherits(MenuItem, _ClickableComponent); + /** + * Creates an instance of the this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + * + */ function MenuItem(player, options) { _classCallCheck(this, MenuItem); @@ -6873,17 +8044,27 @@ var MenuItem = function (_ClickableComponent) { } /** - * Create the component's DOM element + * Create the `MenuItem's DOM element + * + * @param {string} [type=li] + * Element's node type, not actually used, always set to `li`. + * + * @param {Object} [props={}] + * An object of properties that should be set on the element + * + * @param {Object} [attrs={}] + * An object of attributes that should be set on the element * - * @param {String=} type Desc - * @param {Object=} props Desc * @return {Element} - * @method createEl + * The element that gets created. */ MenuItem.prototype.createEl = function createEl(type, props, attrs) { - return _ClickableComponent.prototype.createEl.call(this, 'li', (0, _object2['default'])({ + // The control is textual, not just an icon + this.nonIconControl = true; + + return _ClickableComponent.prototype.createEl.call(this, 'li', (0, _obj.assign)({ className: 'vjs-menu-item', innerHTML: this.localize(this.options_.label), tabIndex: -1 @@ -6891,21 +8072,27 @@ var MenuItem = function (_ClickableComponent) { }; /** - * Handle a click on the menu item, and set it to selected + * Any click on a `MenuItem` puts int into the selected state. + * See {@link ClickableComponent#handleClick} for instances where this is called. * - * @method handleClick + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click */ - MenuItem.prototype.handleClick = function handleClick() { + MenuItem.prototype.handleClick = function handleClick(event) { this.selected(true); }; /** - * Set this menu item as selected or not + * Set the state for this menu item as selected or not. * - * @param {Boolean} selected - * @method selected + * @param {boolean} selected + * if the menu item is selected or not */ @@ -6933,7 +8120,7 @@ var MenuItem = function (_ClickableComponent) { _component2['default'].registerComponent('MenuItem', MenuItem); exports['default'] = MenuItem; -},{"136":136,"3":3,"5":5}],49:[function(_dereq_,module,exports){ +},{"3":3,"5":5,"88":88}],49:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -6942,15 +8129,15 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _events = _dereq_(81); +var _events = _dereq_(82); var Events = _interopRequireWildcard(_events); @@ -6968,15 +8155,24 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The Menu component is used to build pop up menus, including subtitle and + * The Menu component is used to build popup menus, including subtitle and * captions selection menus. * * @extends Component - * @class Menu */ var Menu = function (_Component) { _inherits(Menu, _Component); + /** + * Create an instance of this class. + * + * @param {Player} player + * the player that this component should attach to + * + * @param {Object} [options] + * Object of option names and values + * + */ function Menu(player, options) { _classCallCheck(this, Menu); @@ -6989,26 +8185,27 @@ var Menu = function (_Component) { } /** - * Add a menu item to the menu + * Add a {@link MenuItem} to the menu. + * + * @param {Object|string} component + * The name or instance of the `MenuItem` to add. * - * @param {Object|String} component Component or component type to add - * @method addItem */ Menu.prototype.addItem = function addItem(component) { this.addChild(component); - component.on('click', Fn.bind(this, function () { + component.on('click', Fn.bind(this, function (event) { this.unlockShowing(); // TODO: Need to set keyboard focus back to the menuButton })); }; /** - * Create the component's DOM element + * Create the `Menu`s DOM element. * * @return {Element} - * @method createEl + * the element that was created */ @@ -7040,10 +8237,12 @@ var Menu = function (_Component) { }; /** - * Handle key press for menu + * Handle a `keydown` event on this menu. This listener is added in the constructor. * - * @param {Object} event Event object - * @method handleKeyPress + * @param {EventTarget~Event} event + * A `keydown` event that happened on the menu. + * + * @listens keydown */ @@ -7061,9 +8260,7 @@ var Menu = function (_Component) { }; /** - * Move to next (lower) menu item for keyboard users - * - * @method stepForward + * Move to next (lower) menu item for keyboard users. */ @@ -7077,9 +8274,7 @@ var Menu = function (_Component) { }; /** - * Move to previous (higher) menu item for keyboard users - * - * @method stepBack + * Move to previous (higher) menu item for keyboard users. */ @@ -7093,10 +8288,10 @@ var Menu = function (_Component) { }; /** - * Set focus on a menu item in the menu + * Set focus on a {@link MenuItem} in the `Menu`. * - * @param {Object|String} item Index of child item set focus on - * @method focus + * @param {Object|string} [item=0] + * Index of child item set focus on. */ @@ -7129,16 +8324,16 @@ var Menu = function (_Component) { _component2['default'].registerComponent('Menu', Menu); exports['default'] = Menu; -},{"5":5,"80":80,"81":81,"82":82}],50:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"82":82,"83":83}],50:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -7170,40 +8365,42 @@ var ESC = 27; * is activated - or when ESC is pressed anywhere. * * @extends Component - * @class ModalDialog */ var ModalDialog = function (_Component) { _inherits(ModalDialog, _Component); /** - * Constructor for modals. + * Create an instance of this class. * - * @param {Player} player - * @param {Object} [options] - * @param {Mixed} [options.content=undefined] - * Provide customized content for this modal. + * @param {Player} player + * The `Player` that this class should be attached to. * - * @param {String} [options.description] - * A text description for the modal, primarily for accessibility. + * @param {Object} [options] + * The key/value store of player options. * - * @param {Boolean} [options.fillAlways=false] - * Normally, modals are automatically filled only the first time - * they open. This tells the modal to refresh its content - * every time it opens. + * @param {Mixed} [options.content=undefined] + * Provide customized content for this modal. * - * @param {String} [options.label] - * A text label for the modal, primarily for accessibility. + * @param {string} [options.description] + * A text description for the modal, primarily for accessibility. * - * @param {Boolean} [options.temporary=true] - * If `true`, the modal can only be opened once; it will be - * disposed as soon as it's closed. + * @param {boolean} [options.fillAlways=false] + * Normally, modals are automatically filled only the first time + * they open. This tells the modal to refresh its content + * every time it opens. * - * @param {Boolean} [options.uncloseable=false] - * If `true`, the user will not be able to close the modal - * through the UI in the normal ways. Programmatic closing is - * still possible. + * @param {string} [options.label] + * A text label for the modal, primarily for accessibility. * + * @param {boolean} [options.temporary=true] + * If `true`, the modal can only be opened once; it will be + * disposed as soon as it's closed. + * + * @param {boolean} [options.uncloseable=false] + * If `true`, the user will not be able to close the modal + * through the UI in the normal ways. Programmatic closing is + * still possible. */ function ModalDialog(player, options) { _classCallCheck(this, ModalDialog); @@ -7236,10 +8433,10 @@ var ModalDialog = function (_Component) { } /** - * Create the modal's DOM element + * Create the `ModalDialog`'s DOM element * - * @method createEl * @return {Element} + * The DOM element that gets created. */ @@ -7256,10 +8453,10 @@ var ModalDialog = function (_Component) { }; /** - * Build the modal's CSS class. + * Builds the default DOM `className`. * - * @method buildCSSClass - * @return {String} + * @return {string} + * The DOM `className` for this object. */ @@ -7268,11 +8465,13 @@ var ModalDialog = function (_Component) { }; /** - * Handles key presses on the document, looking for ESC, which closes + * Handles `keydown` events on the document, looking for ESC, which closes * the modal. * - * @method handleKeyPress - * @param {Event} e + * @param {EventTarget~Event} e + * The keypress that triggered this event. + * + * @listens keydown */ @@ -7285,7 +8484,8 @@ var ModalDialog = function (_Component) { /** * Returns the label string for this modal. Primarily used for accessibility. * - * @return {String} + * @return {string} + * the localized or raw label of this modal. */ @@ -7297,7 +8497,8 @@ var ModalDialog = function (_Component) { * Returns the description string for this modal. Primarily used for * accessibility. * - * @return {String} + * @return {string} + * The localized or raw description of this modal. */ @@ -7315,8 +8516,11 @@ var ModalDialog = function (_Component) { /** * Opens the modal. * - * @method open + * @fires ModalDialog#beforemodalopen + * @fires ModalDialog#modalopen + * * @return {ModalDialog} + * Returns itself; method can be chained. */ @@ -7324,6 +8528,12 @@ var ModalDialog = function (_Component) { if (!this.opened_) { var player = this.player(); + /** + * Fired just before a `ModalDialog` is opened. + * + * @event ModalDialog#beforemodalopen + * @type {EventTarget~Event} + */ this.trigger('beforemodalopen'); this.opened_ = true; @@ -7348,6 +8558,13 @@ var ModalDialog = function (_Component) { player.controls(false); this.show(); this.el().setAttribute('aria-hidden', 'false'); + + /** + * Fired just after a `ModalDialog` is opened. + * + * @event ModalDialog#modalopen + * @type {EventTarget~Event} + */ this.trigger('modalopen'); this.hasBeenOpened_ = true; } @@ -7355,13 +8572,13 @@ var ModalDialog = function (_Component) { }; /** - * Whether or not the modal is opened currently. + * If the `ModalDialog` is currently open or closed. * - * @method opened - * @param {Boolean} [value] + * @param {boolean} [value] * If given, it will open (`true`) or close (`false`) the modal. * - * @return {Boolean} + * @return {boolean} + * the current open state of the modaldialog */ @@ -7373,10 +8590,14 @@ var ModalDialog = function (_Component) { }; /** - * Closes the modal. + * Closes the modal, does nothing if the `ModalDialog` is + * not open. + * + * @fires ModalDialog#beforemodalclose + * @fires ModalDialog#modalclose * - * @method close * @return {ModalDialog} + * Returns itself; method can be chained. */ @@ -7384,6 +8605,12 @@ var ModalDialog = function (_Component) { if (this.opened_) { var player = this.player(); + /** + * Fired just before a `ModalDialog` is closed. + * + * @event ModalDialog#beforemodalclose + * @type {EventTarget~Event} + */ this.trigger('beforemodalclose'); this.opened_ = false; @@ -7398,6 +8625,13 @@ var ModalDialog = function (_Component) { player.controls(true); this.hide(); this.el().setAttribute('aria-hidden', 'true'); + + /** + * Fired just after a `ModalDialog` is closed. + * + * @event ModalDialog#modalclose + * @type {EventTarget~Event} + */ this.trigger('modalclose'); if (this.options_.temporary) { @@ -7408,13 +8642,13 @@ var ModalDialog = function (_Component) { }; /** - * Whether or not the modal is closeable via the UI. + * Check to see if the `ModalDialog` is closeable via the UI. * - * @method closeable - * @param {Boolean} [value] - * If given as a Boolean, it will set the `closeable` option. + * @param {boolean} [value] + * If given as a boolean, it will set the `closeable` option. * - * @return {Boolean} + * @return {boolean} + * Returns the final value of the closable option. */ @@ -7448,11 +8682,10 @@ var ModalDialog = function (_Component) { /** * Fill the modal's content element with the modal's "content" option. - * * The content element will be emptied before this change takes place. * - * @method fill * @return {ModalDialog} + * Returns itself; method can be chained. */ @@ -7462,14 +8695,16 @@ var ModalDialog = function (_Component) { /** * Fill the modal's content element with arbitrary content. - * * The content element will be emptied before this change takes place. * - * @method fillWith + * @fires ModalDialog#beforemodalfill + * @fires ModalDialog#modalfill + * * @param {Mixed} [content] * The same rules apply to this as apply to the `content` option. * * @return {ModalDialog} + * Returns itself; method can be chained. */ @@ -7478,6 +8713,12 @@ var ModalDialog = function (_Component) { var parentEl = contentEl.parentNode; var nextSiblingEl = contentEl.nextSibling; + /** + * Fired just before a `ModalDialog` is filled with content. + * + * @event ModalDialog#beforemodalfill + * @type {EventTarget~Event} + */ this.trigger('beforemodalfill'); this.hasBeenFilled_ = true; @@ -7486,6 +8727,12 @@ var ModalDialog = function (_Component) { parentEl.removeChild(contentEl); this.empty(); Dom.insertContent(contentEl, content); + /** + * Fired just after a `ModalDialog` is filled with content. + * + * @event ModalDialog#modalfill + * @type {EventTarget~Event} + */ this.trigger('modalfill'); // Re-inject the re-filled content element. @@ -7499,18 +8746,32 @@ var ModalDialog = function (_Component) { }; /** - * Empties the content element. + * Empties the content element. This happens anytime the modal is filled. * - * This happens automatically anytime the modal is filled. + * @fires ModalDialog#beforemodalempty + * @fires ModalDialog#modalempty * - * @method empty * @return {ModalDialog} + * Returns itself; method can be chained. */ ModalDialog.prototype.empty = function empty() { + /** + * Fired just before a `ModalDialog` is emptied. + * + * @event ModalDialog#beforemodalempty + * @type {EventTarget~Event} + */ this.trigger('beforemodalempty'); Dom.emptyEl(this.contentEl()); + + /** + * Fired just after a `ModalDialog` is emptied. + * + * @event ModalDialog#modalempty + * @type {EventTarget~Event} + */ this.trigger('modalempty'); return this; }; @@ -7522,13 +8783,13 @@ var ModalDialog = function (_Component) { * This does not update the DOM or fill the modal, but it is called during * that process. * - * @method content * @param {Mixed} [value] * If defined, sets the internal content value to be used on the * next call(s) to `fill`. This value is normalized before being * inserted. To "clear" the internal content value, pass `null`. * * @return {Mixed} + * The current content of the modal dialog */ @@ -7542,8 +8803,8 @@ var ModalDialog = function (_Component) { return ModalDialog; }(_component2['default']); -/* - * Modal dialog default options. +/** + * Default options for `ModalDialog` default options. * * @type {Object} * @private @@ -7557,7 +8818,7 @@ ModalDialog.prototype.options_ = { _component2['default'].registerComponent('ModalDialog', ModalDialog); exports['default'] = ModalDialog; -},{"5":5,"80":80,"82":82}],51:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"83":83}],51:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -7566,27 +8827,27 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); -var _events = _dereq_(81); +var _events = _dereq_(82); var Events = _interopRequireWildcard(_events); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _guid = _dereq_(84); +var _guid = _dereq_(85); var Guid = _interopRequireWildcard(_guid); @@ -7594,19 +8855,19 @@ var _browser = _dereq_(78); var browser = _interopRequireWildcard(_browser); -var _log = _dereq_(85); +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); -var _toTitleCase = _dereq_(89); +var _toTitleCase = _dereq_(91); var _toTitleCase2 = _interopRequireDefault(_toTitleCase); -var _timeRanges = _dereq_(88); +var _timeRanges = _dereq_(90); var _buffer = _dereq_(79); -var _stylesheet = _dereq_(87); +var _stylesheet = _dereq_(89); var stylesheet = _interopRequireWildcard(_stylesheet); @@ -7618,15 +8879,13 @@ var _mediaError = _dereq_(46); var _mediaError2 = _interopRequireDefault(_mediaError); -var _tuple = _dereq_(145); +var _tuple = _dereq_(97); var _tuple2 = _interopRequireDefault(_tuple); -var _object = _dereq_(136); +var _obj = _dereq_(88); -var _object2 = _interopRequireDefault(_object); - -var _mergeOptions = _dereq_(86); +var _mergeOptions = _dereq_(87); var _mergeOptions2 = _interopRequireDefault(_mergeOptions); @@ -7694,107 +8953,210 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" // Import Html5 tech, at least for disposing the original video tag. +// The following tech events are simply re-triggered +// on the player when they happen var TECH_EVENTS_RETRIGGER = [ /** - * Fired while the user agent is downloading media data + * Fired while the user agent is downloading media data. + * + * @event Player#progress + * @type {EventTarget~Event} + */ +/** + * Retrigger the `progress` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechProgress_ + * @method Player#handleTechProgress_ + * @fires Player#progress + * @listens Tech#progress */ 'progress', + /** - * Fires when the loading of an audio/video is aborted + * Fires when the loading of an audio/video is aborted. + * + * @event Player#abort + * @type {EventTarget~Event} + */ +/** + * Retrigger the `abort` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechAbort_ + * @method Player#handleTechAbort_ + * @fires Player#abort + * @listens Tech#abort */ 'abort', + /** - * Fires when the browser is intentionally not getting media data + * Fires when the browser is intentionally not getting media data. + * + * @event Player#suspend + * @type {EventTarget~Event} + */ +/** + * Retrigger the `suspend` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechSuspend_ + * @method Player#handleTechSuspend_ + * @fires Player#suspend + * @listens Tech#suspend */ 'suspend', + /** - * Fires when the current playlist is empty + * Fires when the current playlist is empty. + * + * @event Player#emptied + * @type {EventTarget~Event} + */ +/** + * Retrigger the `emptied` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechEmptied_ + * @method Player#handleTechEmptied_ + * @fires Player#emptied + * @listens Tech#emptied */ 'emptied', /** - * Fires when the browser is trying to get media data, but data is not available + * Fires when the browser is trying to get media data, but data is not available. + * + * @event Player#stalled + * @type {EventTarget~Event} + */ +/** + * Retrigger the `stalled` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechStalled_ + * @method Player#handleTechStalled_ + * @fires Player#stalled + * @listens Tech#stalled */ 'stalled', + /** - * Fires when the browser has loaded meta data for the audio/video + * Fires when the browser has loaded meta data for the audio/video. + * + * @event Player#loadedmetadata + * @type {EventTarget~Event} + */ +/** + * Retrigger the `stalled` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechLoadedmetadata_ + * @method Player#handleTechLoadedmetadata_ + * @fires Player#loadedmetadata + * @listens Tech#loadedmetadata */ 'loadedmetadata', + /** - * Fires when the browser has loaded the current frame of the audio/video + * Fires when the browser has loaded the current frame of the audio/video. + * + * @event player#loadeddata + * @type {event} + */ +/** + * Retrigger the `loadeddata` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechLoaddeddata_ + * @method Player#handleTechLoaddeddata_ + * @fires Player#loadeddata + * @listens Tech#loadeddata */ 'loadeddata', + /** - * Fires when the current playback position has changed + * Fires when the current playback position has changed. + * + * @event player#timeupdate + * @type {event} + */ +/** + * Retrigger the `timeupdate` event that was triggered by the {@link Tech}. * * @private - * @method Player.prototype.handleTechTimeUpdate_ + * @method Player#handleTechTimeUpdate_ + * @fires Player#timeupdate + * @listens Tech#timeupdate */ 'timeupdate', + /** * Fires when the playing speed of the audio/video is changed * + * @event player#ratechange + * @type {event} + */ +/** + * Retrigger the `ratechange` event that was triggered by the {@link Tech}. + * * @private - * @method Player.prototype.handleTechRatechange_ + * @method Player#handleTechRatechange_ + * @fires Player#ratechange + * @listens Tech#ratechange */ 'ratechange', + /** * Fires when the volume has been changed * + * @event player#volumechange + * @type {event} + */ +/** + * Retrigger the `volumechange` event that was triggered by the {@link Tech}. + * * @private - * @method Player.prototype.handleTechVolumechange_ + * @method Player#handleTechVolumechange_ + * @fires Player#volumechange + * @listens Tech#volumechange */ 'volumechange', + /** * Fires when the text track has been changed * + * @event player#texttrackchange + * @type {event} + */ +/** + * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}. + * * @private - * @method Player.prototype.handleTechTexttrackchange_ + * @method Player#handleTechTexttrackchange_ + * @fires Player#texttrackchange + * @listens Tech#texttrackchange */ 'texttrackchange']; /** - * An instance of the `Player` class is created when any of the Video.js setup methods are used to initialize a video. - * ```js - * var myPlayer = videojs('example_video_1'); - * ``` - * In the following example, the `data-setup` attribute tells the Video.js library to create a player instance when the library is ready. - * ```html - * - * ``` - * After an instance has been created it can be accessed globally using `Video('example_video_1')`. + * An instance of the `Player` class is created when any of the Video.js setup methods + * are used to initialize a video. * - * @param {Element} tag The original video tag used for configuring options - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function - * @class Player + * After an instance has been created it can be accessed globally in two ways: + * 1. By calling `videojs('example_video_1');` + * 2. By using it directly via `videojs.players.example_video_1;` + * + * @extends Component */ var Player = function (_Component) { _inherits(Player, _Component); + /** + * Create an instance of this class. + * + * @param {Element} tag + * The original video DOM element used for configuring options. + * + * @param {Object} [options] + * Object of option names and values. + * + * @param {Component~ReadyCallback} [ready] + * Ready callback function. + */ function Player(tag, options, ready) { _classCallCheck(this, Player); @@ -7806,7 +9168,7 @@ var Player = function (_Component) { // which overrides globally set options. // This latter part coincides with the load order // (tag must exist before Player) - options = (0, _object2['default'])(Player.getTagSettings(tag), options); + options = (0, _obj.assign)(Player.getTagSettings(tag), options); // Delay the initialization of children because we need to set up // player properties first, and can't use `this` before `super()` @@ -7861,15 +9223,13 @@ var Player = function (_Component) { // Update Supported Languages if (options.languages) { - (function () { - // Normalise player option languages to lowercase - var languagesToLower = {}; + // Normalise player option languages to lowercase + var languagesToLower = {}; - Object.getOwnPropertyNames(options.languages).forEach(function (name) { - languagesToLower[name.toLowerCase()] = options.languages[name]; - }); - _this.languages_ = languagesToLower; - })(); + Object.getOwnPropertyNames(options.languages).forEach(function (name) { + languagesToLower[name.toLowerCase()] = options.languages[name]; + }); + _this.languages_ = languagesToLower; } else { _this.languages_ = Player.prototype.options_.languages; } @@ -7906,17 +9266,15 @@ var Player = function (_Component) { // Load plugins if (options.plugins) { - (function () { - var plugins = options.plugins; + var plugins = options.plugins; - Object.getOwnPropertyNames(plugins).forEach(function (name) { - if (typeof this[name] === 'function') { - this[name](plugins[name]); - } else { - _log2['default'].error('Unable to find plugin:', name); - } - }, _this); - })(); + Object.getOwnPropertyNames(plugins).forEach(function (name) { + if (typeof this[name] === 'function') { + this[name](plugins[name]); + } else { + _log2['default'].error('Unable to find plugin:', name); + } + }, _this); } _this.options_.playerOptions = playerOptionsCopy; @@ -7976,16 +9334,22 @@ var Player = function (_Component) { } /** - * Destroys the video player and does any necessary cleanup - * ```js - * myPlayer.dispose(); - * ``` + * Destroys the video player and does any necessary cleanup. + * * This is especially helpful if you are dynamically adding and removing videos * to/from the DOM. + * + * @fires Player#dispose */ Player.prototype.dispose = function dispose() { + /** + * Called when the player is being disposed of. + * + * @event Player#dispose + * @type {EventTarget~Event} + */ this.trigger('dispose'); // prevent dispose from being called twice this.off('dispose'); @@ -8013,15 +9377,26 @@ var Player = function (_Component) { }; /** - * Create the component's DOM element + * Create the `Player`'s DOM element. * * @return {Element} + * The DOM element that gets created. */ Player.prototype.createEl = function createEl() { - var el = this.el_ = _Component.prototype.createEl.call(this, 'div'); var tag = this.tag; + var el = void 0; + var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player'); + + if (playerElIngest) { + el = this.el_ = tag.parentNode; + } else { + el = this.el_ = _Component.prototype.createEl.call(this, 'div'); + } + + // set tabindex to -1 so we could focus on the player element + tag.setAttribute('tabindex', '-1'); // Remove width/height attrs from tag so CSS can make it 100% width/height tag.removeAttribute('width'); @@ -8035,7 +9410,7 @@ var Player = function (_Component) { // workaround so we don't totally break IE7 // http://stackoverflow.com/questions/3653444/css-styles-not-applied-on-dynamic-elements-in-internet-explorer-7 if (attr === 'class') { - el.className = attrs[attr]; + el.className += ' ' + attrs[attr]; } else { el.setAttribute(attr, attrs[attr]); } @@ -8085,7 +9460,7 @@ var Player = function (_Component) { tag.initNetworkState_ = tag.networkState; // Wrap video tag in div (el/box) container - if (tag.parentNode) { + if (tag.parentNode && !playerElIngest) { tag.parentNode.insertBefore(el, tag); } @@ -8103,10 +9478,13 @@ var Player = function (_Component) { }; /** - * Get/set player width + * A getter/setter for the `Player`'s width. * - * @param {Number=} value Value for width - * @return {Number} Width when getting + * @param {number} [value] + * The value to set the `Player's width to. + * + * @return {number} + * The current width of the `Player`. */ @@ -8115,10 +9493,13 @@ var Player = function (_Component) { }; /** - * Get/set player height + * A getter/setter for the `Player`'s height. * - * @param {Number=} value Value for height - * @return {Number} Height when getting + * @param {number} [value] + * The value to set the `Player's heigth to. + * + * @return {number} + * The current heigth of the `Player`. */ @@ -8127,11 +9508,19 @@ var Player = function (_Component) { }; /** - * Get/set dimension for player + * A getter/setter for the `Player`'s width & height. * - * @param {String} dimension Either width or height - * @param {Number=} value Value for dimension - * @return {Component} + * @param {string} dimension + * This string can be: + * - 'width' + * - 'height' + * + * @param {number} [value] + * Value for dimension specified in the first argument. + * + * @return {Player|number} + * - Returns itself when setting; method can be chained. + * - The dimension arguments value when getting (width/height). */ @@ -8161,9 +9550,16 @@ var Player = function (_Component) { }; /** - * Add/remove the vjs-fluid class + * A getter/setter/toggler for the vjs-fluid `className` on the `Player`. * - * @param {Boolean} bool Value of true adds the class, value of false removes the class + * @param {boolean} [bool] + * - A value of true adds the class. + * - A value of false removes the class. + * - No value will toggle the fluid class. + * + * @return {boolean|undefined} + * - The value of fluid when getting. + * - `undefined` when setting. */ @@ -8179,13 +9575,29 @@ var Player = function (_Component) { } else { this.removeClass('vjs-fluid'); } + + this.updateStyleEl_(); }; /** * Get/Set the aspect ratio * - * @param {String=} ratio Aspect ratio for player - * @return aspectRatio + * @param {string} [ratio] + * Aspect ratio for player + * + * @return {string|undefined} + * returns the current aspect ratio when getting + */ + + /** + * A getter/setter for the `Player`'s aspect ratio. + * + * @param {string} [ratio] + * The value to set the `Player's aspect ratio to. + * + * @return {string|undefined} + * - The current aspect ratio of the `Player` when getting. + * - undefined when setting */ @@ -8208,7 +9620,10 @@ var Player = function (_Component) { }; /** - * Update styles of the player element (height, width and aspect ratio) + * Update styles of the `Player` element (height, width and aspect ratio). + * + * @private + * @listens Tech#loadedmetadata */ @@ -8239,7 +9654,7 @@ var Player = function (_Component) { if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') { // Use any aspectRatio that's been specifically set aspectRatio = this.aspectRatio_; - } else if (this.videoWidth()) { + } else if (this.videoWidth() > 0) { // Otherwise try to get the aspect ratio from the video metadata aspectRatio = this.videoWidth() + ':' + this.videoHeight(); } else { @@ -8284,12 +9699,15 @@ var Player = function (_Component) { }; /** - * Load the Media Playback Technology (tech) - * Load/Create an instance of playback technology including element and API methods - * And append playback element in player div. + * Load/Create an instance of playback {@link Tech} including element + * and API methods. Then append the `Tech` element in `Player` as a child. + * + * @param {string} techName + * name of the playback technology + * + * @param {string} source + * video source * - * @param {String} techName Name of the playback technology - * @param {String} source Video source * @private */ @@ -8315,7 +9733,7 @@ var Player = function (_Component) { this.isReady_ = false; // Grab tech-specific options from player options and add source and parent element to use. - var techOptions = (0, _object2['default'])({ + var techOptions = (0, _obj.assign)({ source: source, 'nativeControlsForTouch': this.options_.nativeControlsForTouch, 'playerId': this.id(), @@ -8329,6 +9747,7 @@ var Player = function (_Component) { 'muted': this.options_.muted, 'poster': this.poster(), 'language': this.language(), + 'playerElIngest': this.playerElIngest_ || false, 'vtt.js': this.options_['vtt.js'] }, this.options_[techName.toLowerCase()]); @@ -8338,10 +9757,13 @@ var Player = function (_Component) { if (source) { this.currentType_ = source.type; + if (source.src === this.cache_.src && this.cache_.currentTime > 0) { techOptions.startTime = this.cache_.currentTime; } + this.cache_.sources = null; + this.cache_.source = source; this.cache_.src = source.src; } @@ -8402,7 +9824,7 @@ var Player = function (_Component) { }; /** - * Unload playback technology + * Unload and dispose of the current playback {@link Tech}. * * @private */ @@ -8423,13 +9845,18 @@ var Player = function (_Component) { }; /** - * Return a reference to the current tech. - * It will only return a reference to the tech if given an object with the - * `IWillNotUseThisInPlugins` property on it. This is try and prevent misuse + * Return a reference to the current {@link Tech}, but only if given an object with the + * `IWillNotUseThisInPlugins` property having a true value. This is try and prevent misuse * of techs by plugins. * - * @param {Object} - * @return {Object} The Tech + * @param {Object} safety + * An object that must contain `{IWillNotUseThisInPlugins: true}` + * + * @param {boolean} safety.IWillNotUseThisInPlugins + * Must be set to true or else this function will throw an error. + * + * @return {Tech} + * The Tech */ @@ -8446,17 +9873,18 @@ var Player = function (_Component) { /** * Set up click and touch listeners for the playback element * - * On desktops, a click on the video itself will toggle playback, - * on a mobile device a click on the video toggles controls. - * (toggling controls is done by toggling the user state between active and - * inactive) - * A tap can signal that a user has become active, or has become inactive - * e.g. a quick tap on an iPhone movie should reveal the controls. Another - * quick tap should hide them again (signaling the user is in an inactive - * viewing state) - * In addition to this, we still want the user to be considered inactive after - * a few seconds of inactivity. - * Note: the only part of iOS interaction we can't mimic with this setup + * - On desktops: a click on the video itself will toggle playback + * - On mobile devices: a click on the video toggles controls + * which is done by toggling the user state between active and + * inactive + * - A tap can signal that a user has become active or has become inactive + * e.g. a quick tap on an iPhone movie should reveal the controls. Another + * quick tap should hide them again (signaling the user is in an inactive + * viewing state) + * - In addition to this, we still want the user to be considered inactive after + * a few seconds of inactivity. + * + * > Note: the only part of iOS interaction we can't mimic with this setup * is a touch and hold on the video element counting as activity in order to * keep the controls showing, but that shouldn't be an issue. A touch and hold * on any controls will still keep the user active @@ -8542,9 +9970,13 @@ var Player = function (_Component) { }; /** - * Fired when the user agent begins looking for media data + * Retrigger the `loadstart` event that was triggered by the {@link Tech}. This + * function will also trigger {@link Player#firstplay} if it is the first loadstart + * for a video. * - * @event loadstart + * @fires Player#loadstart + * @fires Player#firstplay + * @listens Tech#loadstart * @private */ @@ -8553,6 +9985,7 @@ var Player = function (_Component) { // TODO: Update to use `emptied` event instead. See #1277. this.removeClass('vjs-ended'); + this.removeClass('vjs-seeking'); // reset the error state this.error(null); @@ -8561,6 +9994,12 @@ var Player = function (_Component) { // The firstplay event relies on both the play and loadstart events // which can happen in any order for a new source if (!this.paused()) { + /** + * Fired when the user agent begins looking for media data + * + * @event Player#loadstart + * @type {EventTarget~Event} + */ this.trigger('loadstart'); this.trigger('firstplay'); } else { @@ -8573,9 +10012,14 @@ var Player = function (_Component) { /** * Add/remove the vjs-has-started class * - * @param {Boolean} hasStarted The value of true adds the class the value of false remove the class - * @return {Boolean} Boolean value if has started - * @private + * @fires Player#firstplay + * + * @param {boolean} hasStarted + * - true: adds the class + * - false: remove the class + * + * @return {boolean} + * the boolean value of hasStarted */ @@ -8600,6 +10044,9 @@ var Player = function (_Component) { /** * Fired whenever the media begins or resumes playback * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play} + * @fires Player#play + * @listens Tech#play * @private */ @@ -8610,15 +10057,22 @@ var Player = function (_Component) { this.addClass('vjs-playing'); // hide the poster when the user hits play - // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play this.hasStarted(true); - + /** + * Triggered whenever an {@link Tech#play} event happens. Indicates that + * playback has started or resumed. + * + * @event Player#play + * @type {EventTarget~Event} + */ this.trigger('play'); }; /** - * Fired whenever the media begins waiting + * Retrigger the `waiting` event that was triggered by the {@link Tech}. * + * @fires Player#waiting + * @listens Tech#waiting * @private */ @@ -8627,6 +10081,12 @@ var Player = function (_Component) { var _this3 = this; this.addClass('vjs-waiting'); + /** + * A readyState change on the DOM element has caused playback to stop. + * + * @event Player#waiting + * @type {EventTarget~Event} + */ this.trigger('waiting'); this.one('timeupdate', function () { return _this3.removeClass('vjs-waiting'); @@ -8634,74 +10094,113 @@ var Player = function (_Component) { }; /** - * A handler for events that signal that waiting has ended - * which is not consistent between browsers. See #1351 + * Retrigger the `canplay` event that was triggered by the {@link Tech}. + * > Note: This is not consistent between browsers. See #1351 * + * @fires Player#canplay + * @listens Tech#canplay * @private */ Player.prototype.handleTechCanPlay_ = function handleTechCanPlay_() { this.removeClass('vjs-waiting'); + /** + * The media has a readyState of HAVE_FUTURE_DATA or greater. + * + * @event Player#canplay + * @type {EventTarget~Event} + */ this.trigger('canplay'); }; /** - * A handler for events that signal that waiting has ended - * which is not consistent between browsers. See #1351 + * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}. * + * @fires Player#canplaythrough + * @listens Tech#canplaythrough * @private */ Player.prototype.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() { this.removeClass('vjs-waiting'); + /** + * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the + * entire media file can be played without buffering. + * + * @event Player#canplaythrough + * @type {EventTarget~Event} + */ this.trigger('canplaythrough'); }; /** - * A handler for events that signal that waiting has ended - * which is not consistent between browsers. See #1351 + * Retrigger the `playing` event that was triggered by the {@link Tech}. * + * @fires Player#playing + * @listens Tech#playing * @private */ Player.prototype.handleTechPlaying_ = function handleTechPlaying_() { this.removeClass('vjs-waiting'); + /** + * The media is no longer blocked from playback, and has started playing. + * + * @event Player#playing + * @type {EventTarget~Event} + */ this.trigger('playing'); }; /** - * Fired whenever the player is jumping to a new time + * Retrigger the `seeking` event that was triggered by the {@link Tech}. * + * @fires Player#seeking + * @listens Tech#seeking * @private */ Player.prototype.handleTechSeeking_ = function handleTechSeeking_() { this.addClass('vjs-seeking'); + /** + * Fired whenever the player is jumping to a new time + * + * @event Player#seeking + * @type {EventTarget~Event} + */ this.trigger('seeking'); }; /** - * Fired when the player has finished jumping to a new time + * Retrigger the `seeked` event that was triggered by the {@link Tech}. * + * @fires Player#seeked + * @listens Tech#seeked * @private */ Player.prototype.handleTechSeeked_ = function handleTechSeeked_() { this.removeClass('vjs-seeking'); + /** + * Fired when the player has finished jumping to a new time + * + * @event Player#seeked + * @type {EventTarget~Event} + */ this.trigger('seeked'); }; /** - * Fired the first time a video is played - * Not part of the HLS spec, and we're not sure if this is the best - * implementation yet, so use sparingly. If you don't have a reason to - * prevent playback, use `myPlayer.one('play');` instead. + * Retrigger the `firstplay` event that was triggered by the {@link Tech}. * + * @fires Player#firstplay + * @listens Tech#firstplay + * @deprecated As of 6.0 passing the `starttime` option to the player will be deprecated * @private */ @@ -8710,16 +10209,27 @@ var Player = function (_Component) { // If the first starttime attribute is specified // then we will start at the given offset in seconds if (this.options_.starttime) { + _log2['default'].warn('Passing the `starttime` option to the player will be deprecated in 6.0'); this.currentTime(this.options_.starttime); } this.addClass('vjs-has-started'); + /** + * Fired the first time a video is played. Not part of the HLS spec, and this is + * probably not the best implementation yet, so use sparingly. If you don't have a + * reason to prevent playback, use `myPlayer.one('play');` instead. + * + * @event Player#firstplay + * @type {EventTarget~Event} + */ this.trigger('firstplay'); }; /** - * Fired whenever the media has been paused + * Retrigger the `pause` event that was triggered by the {@link Tech}. * + * @fires Player#pause + * @listens Tech#pause * @private */ @@ -8727,13 +10237,20 @@ var Player = function (_Component) { Player.prototype.handleTechPause_ = function handleTechPause_() { this.removeClass('vjs-playing'); this.addClass('vjs-paused'); + /** + * Fired whenever the media has been paused + * + * @event Player#pause + * @type {EventTarget~Event} + */ this.trigger('pause'); }; /** - * Fired when the end of the media resource is reached (currentTime == duration) + * Retrigger the `ended` event that was triggered by the {@link Tech}. * - * @event ended + * @fires Player#ended + * @listens Tech#ended * @private */ @@ -8747,12 +10264,19 @@ var Player = function (_Component) { this.pause(); } + /** + * Fired when the end of the media resource is reached (currentTime == duration) + * + * @event Player#ended + * @type {EventTarget~Event} + */ this.trigger('ended'); }; /** * Fired when the duration of the media resource is first known or changed * + * @listens Tech#durationchange * @private */ @@ -8764,7 +10288,10 @@ var Player = function (_Component) { /** * Handle a click on the media element to play/pause * - * @param {Object=} event Event object + * @param {EventTarget~Event} event + * the event that caused this function to trigger + * + * @listens Tech#mousedown * @private */ @@ -8791,6 +10318,7 @@ var Player = function (_Component) { * Handle a tap on the media element. It will toggle the user * activity state, which hides and shows the controls. * + * @listens Tech#tap * @private */ @@ -8802,6 +10330,7 @@ var Player = function (_Component) { /** * Handle touch to start * + * @listens Tech#touchstart * @private */ @@ -8813,6 +10342,7 @@ var Player = function (_Component) { /** * Handle touch to move * + * @listens Tech#touchmove * @private */ @@ -8826,6 +10356,11 @@ var Player = function (_Component) { /** * Handle touch to end * + * @param {EventTarget~Event} event + * the touchend event that triggered + * this function + * + * @listens Tech#touchend * @private */ @@ -8839,6 +10374,7 @@ var Player = function (_Component) { * Fired when the player switches in or out of fullscreen mode * * @private + * @listens Player#fullscreenchange */ @@ -8855,6 +10391,7 @@ var Player = function (_Component) { * use stageclick events triggered from inside the SWF instead * * @private + * @listens stageclick */ @@ -8865,7 +10402,15 @@ var Player = function (_Component) { /** * Handle Tech Fullscreen Change * + * @param {EventTarget~Event} event + * the fullscreenchange event that triggered this function + * + * @param {Object} data + * the data that was sent with the event + * * @private + * @listens Tech#fullscreenchange + * @fires Player#fullscreenchange */ @@ -8873,13 +10418,20 @@ var Player = function (_Component) { if (data) { this.isFullscreen(data.isFullscreen); } + /** + * Fired when going in and out of fullscreen. + * + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ this.trigger('fullscreenchange'); }; /** - * Fires when an error occurred during the loading of an audio/video + * Fires when an error occurred during the loading of an audio/video. * * @private + * @listens Tech#error */ @@ -8889,12 +10441,28 @@ var Player = function (_Component) { this.error(error); }; + /** + * Retrigger the `textdata` event that was triggered by the {@link Tech}. + * + * @fires Player#textdata + * @listens Tech#textdata + * @private + */ + + Player.prototype.handleTechTextData_ = function handleTechTextData_() { var data = null; if (arguments.length > 1) { data = arguments[1]; } + + /** + * Fires when we get a textdata event from tech + * + * @event Player#textdata + * @type {EventTarget~Event} + */ this.trigger('textdata', data); }; @@ -8902,6 +10470,7 @@ var Player = function (_Component) { * Get object for cached values. * * @return {Object} + * get the current object cache */ @@ -8912,8 +10481,12 @@ var Player = function (_Component) { /** * Pass values to the playback tech * - * @param {String=} method Method - * @param {Object=} arg Argument + * @param {string} [method] + * the method to call + * + * @param {Object} arg + * the argument to pass + * * @private */ @@ -8941,8 +10514,12 @@ var Player = function (_Component) { /** * Get calls can't wait for the tech, and sometimes don't need to. * - * @param {String} method Tech method - * @return {Method} + * @param {string} method + * Tech method + * + * @return {Function|undefined} + * the method or undefined + * * @private */ @@ -8976,11 +10553,9 @@ var Player = function (_Component) { /** * start media playback - * ```js - * myPlayer.play(); - * ``` * - * @return {Player} self + * @return {Player} + * A reference to the player object this function was called on */ @@ -8999,11 +10574,9 @@ var Player = function (_Component) { /** * Pause the video playback - * ```js - * myPlayer.pause(); - * ``` * - * @return {Player} self + * @return {Player} + * A reference to the player object this function was called on */ @@ -9013,13 +10586,11 @@ var Player = function (_Component) { }; /** - * Check if the player is paused - * ```js - * var isPaused = myPlayer.paused(); - * var isPlaying = !myPlayer.paused(); - * ``` + * Check if the player is paused or has yet to play * - * @return {Boolean} false if the media is currently playing, or true otherwise + * @return {boolean} + * - false: if the media is currently playing + * - true: if media is not currently playing */ @@ -9029,12 +10600,16 @@ var Player = function (_Component) { }; /** - * Returns whether or not the user is "scrubbing". Scrubbing is when the user - * has clicked the progress bar handle and is dragging it along the progress bar. + * Returns whether or not the user is "scrubbing". Scrubbing is + * when the user has clicked the progress bar handle and is + * dragging it along the progress bar. * - * @param {Boolean} isScrubbing True/false the user is scrubbing - * @return {Boolean} The scrubbing status when getting - * @return {Object} The player when setting + * @param {boolean} [isScrubbing] + * wether the user is or is not scrubbing + * + * @return {boolean|Player} + * A instance of the player that called this function when setting, + * and the value of scrubbing when getting */ @@ -9056,16 +10631,13 @@ var Player = function (_Component) { /** * Get or set the current time (in seconds) - * ```js - * // get - * var whereYouAt = myPlayer.currentTime(); - * // set - * myPlayer.currentTime(120); // 2 minutes into the video - * ``` * - * @param {Number|String=} seconds The time to seek to - * @return {Number} The time in seconds, when not setting - * @return {Player} self, when the current time is set + * @param {number|string} [seconds] + * The time to seek to in seconds + * + * @return {Player|number} + * - the current time in seconds when getting + * - a reference to the current player object when setting */ @@ -9090,15 +10662,20 @@ var Player = function (_Component) { /** * Normally gets the length in time of the video in seconds; * in all but the rarest use cases an argument will NOT be passed to the method - * ```js - * var lengthOfVideo = myPlayer.duration(); - * ``` - * **NOTE**: The video must have started loading before the duration can be + * + * > **NOTE**: The video must have started loading before the duration can be * known, and in the case of Flash, may not be known until the video starts * playing. * - * @param {Number} seconds Duration when setting - * @return {Number} The duration of the video in seconds when getting + * @fires Player#durationchange + * + * @param {number} [seconds] + * The duration of the video to set in seconds + * + * @return {number|Player} + * - The duration of the video in seconds when getting + * - A reference to the player that called this function + * when setting */ @@ -9123,7 +10700,10 @@ var Player = function (_Component) { } else { this.removeClass('vjs-live'); } - + /** + * @event Player#durationchange + * @type {EventTarget~Event} + */ this.trigger('durationchange'); } @@ -9131,13 +10711,11 @@ var Player = function (_Component) { }; /** - * Calculates how much time is left. - * ```js - * var timeLeft = myPlayer.remainingTime(); - * ``` - * Not a native video element function, but useful + * Calculates how much time is left in the video. Not part + * of the native video API. * - * @return {Number} The time remaining in seconds + * @return {number} + * The time remaining in seconds */ @@ -9145,26 +10723,18 @@ var Player = function (_Component) { return this.duration() - this.currentTime(); }; - // http://dev.w3.org/html5/spec/video.html#dom-media-buffered - // Buffered returns a timerange object. + // // Kind of like an array of portions of the video that have been downloaded. /** - * Get a TimeRange object with the times of the video that have been downloaded - * If you just want the percent of the video that's been downloaded, - * use bufferedPercent. - * ```js - * // Number of different ranges of time have been buffered. Usually 1. - * numberOfRanges = bufferedTimeRange.length, - * // Time in seconds when the first range starts. Usually 0. - * firstRangeStart = bufferedTimeRange.start(0), - * // Time in seconds when the first range ends - * firstRangeEnd = bufferedTimeRange.end(0), - * // Length in seconds of the first time range - * firstRangeLength = firstRangeEnd - firstRangeStart; - * ``` + * Get a TimeRange object with an array of the times of the video + * that have been downloaded. If you just want the percent of the + * video that's been downloaded, use bufferedPercent. * - * @return {Object} A mock TimeRange object (following HTML spec) + * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered} + * + * @return {TimeRange} + * A mock TimeRange object (following HTML spec) */ @@ -9179,14 +10749,12 @@ var Player = function (_Component) { }; /** - * Get the percent (as a decimal) of the video that's been downloaded - * ```js - * var howMuchIsDownloaded = myPlayer.bufferedPercent(); - * ``` - * 0 means none, 1 means all. - * (This method isn't in the HTML5 spec, but it's very convenient) + * Get the percent (as a decimal) of the video that's been downloaded. + * This method is not a part of the native HTML video API. * - * @return {Number} A decimal between 0 and 1 representing the percent + * @return {number} + * A decimal between 0 and 1 representing the percent + * that is bufferred 0 being 0% and 1 being 100% */ @@ -9198,7 +10766,8 @@ var Player = function (_Component) { * Get the ending time of the last buffered time range * This is used in the progress bar to encapsulate all time ranges. * - * @return {Number} The end of the last buffered time range + * @return {number} + * The end of the last buffered time range */ @@ -9216,17 +10785,16 @@ var Player = function (_Component) { /** * Get or set the current volume of the media - * ```js - * // get - * var howLoudIsIt = myPlayer.volume(); - * // set - * myPlayer.volume(0.5); // Set volume to half - * ``` - * 0 is off (muted), 1.0 is all the way up, 0.5 is half way. * - * @param {Number} percentAsDecimal The new volume as a decimal percent - * @return {Number} The current volume when getting - * @return {Player} self when setting + * @param {number} [percentAsDecimal] + * The new volume as a decimal percent: + * - 0 is muted/0%/off + * - 1.0 is 100%/full + * - 0.5 is half volume or 50% + * + * @return {Player|number} + * a reference to the calling player when setting and the + * current volume as a percent when getting */ @@ -9249,16 +10817,15 @@ var Player = function (_Component) { /** * Get the current muted state, or turn mute on or off - * ```js - * // get - * var isVolumeMuted = myPlayer.muted(); - * // set - * myPlayer.muted(true); // mute the volume - * ``` * - * @param {Boolean=} muted True to mute, false to unmute - * @return {Boolean} True if mute is on, false if not when getting - * @return {Player} self when setting mute + * @param {boolean} [muted] + * - true to mute + * - false to unmute + * + * @return {boolean|Player} + * - true if mute is on and getting + * - false if mute is off and getting + * - A reference to the current player when setting */ @@ -9270,12 +10837,12 @@ var Player = function (_Component) { return this.techGet_('muted') || false; }; - // Check if current tech can support native fullscreen - // (e.g. with built in controls like iOS, so not our flash swf) /** - * Check to see if fullscreen is supported + * Check if current tech can support native fullscreen + * (e.g. with built in controls like iOS, so not our flash swf) * - * @return {Boolean} + * @return {boolean} + * if native fullscreen is supported */ @@ -9284,20 +10851,20 @@ var Player = function (_Component) { }; /** - * Check if the player is in fullscreen mode - * ```js - * // get - * var fullscreenOrNot = myPlayer.isFullscreen(); - * // set - * myPlayer.isFullscreen(true); // tell the player it's in fullscreen - * ``` - * NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official + * Check if the player is in fullscreen mode or tell the player that it + * is or is not in fullscreen mode. + * + * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official * property and instead document.fullscreenElement is used. But isFullscreen is * still a valuable property for internal player workings. * - * @param {Boolean=} isFS Update the player's fullscreen state - * @return {Boolean} true if fullscreen false if not when getting - * @return {Player} self when setting + * @param {boolean} [isFS] + * Set the players current fullscreen state + * + * @return {boolean|Player} + * - true if fullscreen is on and getting + * - false if fullscreen is off and getting + * - A reference to the current player when setting */ @@ -9311,9 +10878,6 @@ var Player = function (_Component) { /** * Increase the size of the video to full screen - * ```js - * myPlayer.requestFullscreen(); - * ``` * In some browsers, full screen is not supported natively, so it enters * "full window mode", where the video fills the browser window. * In browsers and devices that support native full screen, sometimes the @@ -9321,7 +10885,9 @@ var Player = function (_Component) { * This includes most mobile devices (iOS, Android) and older versions of * Safari. * - * @return {Player} self + * @fires Player#fullscreenchange + * @return {Player} + * A reference to the current player */ @@ -9346,7 +10912,10 @@ var Player = function (_Component) { if (this.isFullscreen() === false) { Events.off(_document2['default'], fsApi.fullscreenchange, documentFullscreenChange); } - + /** + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ this.trigger('fullscreenchange'); })); @@ -9359,6 +10928,10 @@ var Player = function (_Component) { // fullscreen isn't supported so we'll just stretch the video element to // fill the viewport this.enterFullWindow(); + /** + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ this.trigger('fullscreenchange'); } @@ -9367,11 +10940,11 @@ var Player = function (_Component) { /** * Return the video to its normal size after having been in full screen mode - * ```js - * myPlayer.exitFullscreen(); - * ``` * - * @return {Player} self + * @fires Player#fullscreenchange + * + * @return {Player} + * A reference to the current player */ @@ -9387,6 +10960,10 @@ var Player = function (_Component) { this.techCall_('exitFullScreen'); } else { this.exitFullWindow(); + /** + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ this.trigger('fullscreenchange'); } @@ -9394,7 +10971,10 @@ var Player = function (_Component) { }; /** - * When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us. + * When fullscreen isn't supported we can stretch the + * video container to as wide as the browser will let us. + * + * @fires Player#enterFullWindow */ @@ -9413,13 +10993,19 @@ var Player = function (_Component) { // Apply fullscreen styles Dom.addElClass(_document2['default'].body, 'vjs-full-window'); + /** + * @event Player#enterFullWindow + * @type {EventTarget~Event} + */ this.trigger('enterFullWindow'); }; /** - * Check for call to either exit full window or full screen on ESC key + * Check for call to either exit full window or + * full screen on ESC key * - * @param {String} event Event to check for key press + * @param {string} event + * Event to check for key press */ @@ -9435,6 +11021,8 @@ var Player = function (_Component) { /** * Exit full window + * + * @fires Player#exitFullWindow */ @@ -9450,14 +11038,23 @@ var Player = function (_Component) { // Resize the box, controller, and poster to original sizes // this.positionAll(); + /** + * @event Player#exitFullWindow + * @type {EventTarget~Event} + */ this.trigger('exitFullWindow'); }; /** * Check whether the player can play a given mimetype * - * @param {String} type The mimetype to check - * @return {String} 'probably', 'maybe', or '' (empty string) + * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype + * + * @param {string} type + * The mimetype to check + * + * @return {string} + * 'probably', 'maybe', or '' (empty string) */ @@ -9499,8 +11096,11 @@ var Player = function (_Component) { * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise, * defaults to tech-order selection * - * @param {Array} sources The sources for a media asset - * @return {Object|Boolean} Object of source and tech order, otherwise false + * @param {Array} sources + * The sources for a media asset + * + * @return {Object|boolean} + * Object of source and tech order or false */ @@ -9578,33 +11178,16 @@ var Player = function (_Component) { /** * The source function updates the video source * There are three types of variables you can pass as the argument. - * **URL String**: A URL to the the video file. Use this method if you are sure + * **URL string**: A URL to the the video file. Use this method if you are sure * the current playback technology (HTML5/Flash) can support the source you * provide. Currently only MP4 files can be used in both HTML5 and Flash. - * ```js - * myPlayer.src("http://www.example.com/path/to/video.mp4"); - * ``` - * **Source Object (or element):* * A javascript object containing information - * about the source file. Use this method if you want the player to determine if - * it can support the file using the type information. - * ```js - * myPlayer.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }); - * ``` - * **Array of Source Objects:* * To provide multiple versions of the source so - * that it can be played using HTML5 across browsers you can use an array of - * source objects. Video.js will detect which version is supported and load that - * file. - * ```js - * myPlayer.src([ - * { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, - * { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, - * { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } - * ]); - * ``` * - * @param {String|Object|Array=} source The source URL, object, or array of sources - * @return {String} The current video source when getting - * @return {String} The player when setting + * @param {Tech~SourceObject|Tech~SourceObject[]} [source] + * One SourceObject or an array of SourceObjects + * + * @return {string|Player} + * - The current video source when getting + * - The player when setting */ @@ -9639,7 +11222,10 @@ var Player = function (_Component) { // the tech loop to check for a compatible technology this.sourceList_([source]); } else { + this.cache_.sources = null; + this.cache_.source = source; this.cache_.src = source.src; + this.currentType_ = source.type || ''; // wait until the tech is ready to set the source @@ -9674,7 +11260,9 @@ var Player = function (_Component) { /** * Handle an array of source objects * - * @param {Array} sources Array of source objects + * @param {Tech~SourceObject[]} sources + * Array of source objects + * * @private */ @@ -9690,6 +11278,8 @@ var Player = function (_Component) { // load this technology with the chosen source this.loadTech_(sourceTech.tech, sourceTech.source); } + + this.cache_.sources = sources; } else { // We need to wrap this in a timeout to give folks a chance to add error event handlers this.setTimeout(function () { @@ -9705,7 +11295,8 @@ var Player = function (_Component) { /** * Begin loading the src data. * - * @return {Player} Returns the player + * @return {Player} + * A reference to the player */ @@ -9718,7 +11309,8 @@ var Player = function (_Component) { * Reset the player. Loads the first tech in the techOrder, * and calls `reset` on the tech`. * - * @return {Player} Returns the player + * @return {Player} + * A reference to the player */ @@ -9728,11 +11320,51 @@ var Player = function (_Component) { return this; }; + /** + * Returns all of the current source objects. + * + * @return {Tech~SourceObject[]} + * The current source objects + */ + + + Player.prototype.currentSources = function currentSources() { + var source = this.currentSource(); + var sources = []; + + // assume `{}` or `{ src }` + if (Object.keys(source).length !== 0) { + sources.push(source); + } + + return this.cache_.sources || sources; + }; + + /** + * Returns the current source object. + * + * @return {Tech~SourceObject} + * The current source object + */ + + + Player.prototype.currentSource = function currentSource() { + var source = {}; + var src = this.currentSrc(); + + if (src) { + source.src = src; + } + + return this.cache_.source || source; + }; + /** * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4 * Can be used in conjuction with `currentType` to assist in rebuilding the current source object. * - * @return {String} The current source + * @return {string} + * The current source */ @@ -9745,7 +11377,8 @@ var Player = function (_Component) { * This can allow you rebuild the current source object so that you could load the same * source and tech later * - * @return {String} The source MIME type + * @return {string} + * The source MIME type */ @@ -9756,9 +11389,13 @@ var Player = function (_Component) { /** * Get or set the preload attribute * - * @param {Boolean} value Boolean to determine if preload should be used - * @return {String} The preload attribute value when getting - * @return {Player} Returns the player when setting + * @param {boolean} [value] + * - true means that we should preload + * - false maens that we should not preload + * + * @return {string|Player} + * - the preload attribute value when getting + * - the player when setting */ @@ -9774,9 +11411,13 @@ var Player = function (_Component) { /** * Get or set the autoplay attribute. * - * @param {Boolean} value Boolean to determine if video should autoplay - * @return {String} The autoplay attribute value when getting - * @return {Player} Returns the player when setting + * @param {boolean} [value] + * - true means that we should autoplay + * - false maens that we should not autoplay + * + * @return {string|Player} + * - the current value of autoplay + * - the player when setting */ @@ -9792,9 +11433,13 @@ var Player = function (_Component) { /** * Get or set the loop attribute on the video element. * - * @param {Boolean} value Boolean to determine if video should loop - * @return {String} The loop attribute value when getting - * @return {Player} Returns the player when setting + * @param {boolean} [value] + * - true means that we should loop the video + * - false means that we should not loop the video + * + * @return {string|Player} + * - the current value of loop when getting + * - the player when setting */ @@ -9810,17 +11455,14 @@ var Player = function (_Component) { /** * Get or set the poster image source url * - * ##### EXAMPLE: - * ```js - * // get - * var currentPoster = myPlayer.poster(); - * // set - * myPlayer.poster('http://example.com/myImage.jpg'); - * ``` + * @fires Player#posterchange * - * @param {String=} src Poster image source URL - * @return {String} poster URL when getting - * @return {Player} self when setting + * @param {string} [src] + * Poster image source URL + * + * @return {string|Player} + * - the current value of poster when getting + * - the player when setting */ @@ -9842,6 +11484,12 @@ var Player = function (_Component) { this.techCall_('setPoster', src); // alert components that the poster has been set + /** + * This event fires when the poster image is changed on the player. + * + * @event Player#posterchange + * @type {EventTarget~Event} + */ this.trigger('posterchange'); return this; @@ -9855,6 +11503,8 @@ var Player = function (_Component) { * soruce if the player user hasn't set a poster through * the normal APIs. * + * @fires Player#posterchange + * @listens Tech#posterchange * @private */ @@ -9871,8 +11521,15 @@ var Player = function (_Component) { /** * Get or set whether or not the controls are showing. * - * @param {Boolean} bool Set controls to showing or not - * @return {Boolean} Controls are showing + * @fires Player#controlsenabled + * + * @param {boolean} [bool] + * - true to turn controls on + * - false to turn controls off + * + * @return {boolean|Player} + * - the current value of controls when getting + * - the player when setting */ @@ -9891,6 +11548,10 @@ var Player = function (_Component) { if (bool) { this.removeClass('vjs-controls-disabled'); this.addClass('vjs-controls-enabled'); + /** + * @event Player#controlsenabled + * @type {EventTarget~Event} + */ this.trigger('controlsenabled'); if (!this.usingNativeControls()) { @@ -9899,6 +11560,10 @@ var Player = function (_Component) { } else { this.removeClass('vjs-controls-enabled'); this.addClass('vjs-controls-disabled'); + /** + * @event Player#controlsdisabled + * @type {EventTarget~Event} + */ this.trigger('controlsdisabled'); if (!this.usingNativeControls()) { @@ -9918,9 +11583,16 @@ var Player = function (_Component) { * **This should only be set by the current tech, because only the tech knows * if it can support native controls** * - * @param {Boolean} bool True signals that native controls are on - * @return {Player} Returns the player - * @private + * @fires Player#usingnativecontrols + * @fires Player#usingcustomcontrols + * + * @param {boolean} [bool] + * - true to turn native controls on + * - false to turn native controls off + * + * @return {boolean|Player} + * - the current value of native controls when getting + * - the player when setting */ @@ -9935,25 +11607,21 @@ var Player = function (_Component) { this.addClass('vjs-using-native-controls'); /** - * player is using the native device controls + * player is using the native device controls * - * @event usingnativecontrols - * @memberof Player - * @instance - * @private - */ + * @event Player#usingnativecontrols + * @type {EventTarget~Event} + */ this.trigger('usingnativecontrols'); } else { this.removeClass('vjs-using-native-controls'); /** - * player is using the custom HTML controls + * player is using the custom HTML controls * - * @event usingcustomcontrols - * @memberof Player - * @instance - * @private - */ + * @event Player#usingcustomcontrols + * @type {EventTarget~Event} + */ this.trigger('usingcustomcontrols'); } } @@ -9965,9 +11633,15 @@ var Player = function (_Component) { /** * Set or get the current MediaError * - * @param {*} err A MediaError or a String/Number to be turned into a MediaError - * @return {MediaError|null} when getting - * @return {Player} when setting + * @fires Player#error + * + * @param {MediaError|string|number} [err] + * A MediaError or a string/number to be turned + * into a MediaError + * + * @return {MediaError|null|Player} + * - The current MediaError when getting (or null) + * - The player when setting */ @@ -9995,7 +11669,10 @@ var Player = function (_Component) { // ie8 just logs "[object object]" if you just log the error object _log2['default'].error('(CODE:' + this.error_.code + ' ' + _mediaError2['default'].errorTypes[this.error_.code] + ')', this.error_.message, this.error_); - // fire an error event on the player + /** + * @event Player#error + * @type {EventTarget~Event} + */ this.trigger('error'); return this; @@ -10004,7 +11681,8 @@ var Player = function (_Component) { /** * Report user activity * - * @param {Object} event Event object + * @param {Object} event + * Event object */ @@ -10015,8 +11693,15 @@ var Player = function (_Component) { /** * Get/set if user is active * - * @param {Boolean} bool Value when setting - * @return {Boolean} Value if user is active user when getting + * @fires Player#useractive + * @fires Player#userinactive + * + * @param {boolean} [bool] + * - true if the user is active + * - false if the user is inactive + * @return {boolean|Player} + * - the current value of userActive when getting + * - the player when setting */ @@ -10031,6 +11716,10 @@ var Player = function (_Component) { this.userActivity_ = true; this.removeClass('vjs-user-inactive'); this.addClass('vjs-user-active'); + /** + * @event Player#useractive + * @type {EventTarget~Event} + */ this.trigger('useractive'); } else { // We're switching the state to inactive manually, so erase any other @@ -10054,6 +11743,10 @@ var Player = function (_Component) { this.removeClass('vjs-user-active'); this.addClass('vjs-user-inactive'); + /** + * @event Player#userinactive + * @type {EventTarget~Event} + */ this.trigger('userinactive'); } } @@ -10151,14 +11844,18 @@ var Player = function (_Component) { }; /** - * Gets or sets the current playback rate. A playback rate of + * Gets or sets the current playback rate. A playback rate of * 1.0 represents normal speed and 0.5 would indicate half-speed * playback, for instance. + * * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate * - * @param {Number} rate New playback rate to set. - * @return {Number} Returns the new playback rate when setting - * @return {Number} Returns the current playback rate when getting + * @param {number} [rate] + * New playback rate to set. + * + * @return {number|Player} + * - The current playback rate when getting or 1.0 + * - the player when setting */ @@ -10177,10 +11874,13 @@ var Player = function (_Component) { /** * Gets or sets the audio flag * - * @param {Boolean} bool True signals that this is an audio player. - * @return {Boolean} Returns true if player is audio, false if not when getting - * @return {Player} Returns the player if setting - * @private + * @param {boolean} bool + * - true signals that this is an audio player + * - false signals that this is not an audio player + * + * @return {Player|boolean} + * - the current value of isAudio when getting + * - the player if setting */ @@ -10194,10 +11894,12 @@ var Player = function (_Component) { }; /** - * Get a video track list - * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist + * Get the {@link VideoTrackList} * - * @return {VideoTrackList} thes current video track list + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist + * + * @return {VideoTrackList} + * the current video track list */ @@ -10213,10 +11915,12 @@ var Player = function (_Component) { }; /** - * Get an audio track list - * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist + * Get the {@link AudioTrackList} * - * @return {AudioTrackList} thes current audio track list + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist + * + * @return {AudioTrackList} + * the current audio track list */ @@ -10232,18 +11936,23 @@ var Player = function (_Component) { }; /** - * Text tracks are tracks of timed text events. - * Captions - text displayed over the video for the hearing impaired - * Subtitles - text displayed over the video for those who don't understand language in the video - * Chapters - text displayed in a menu allowing the user to jump to particular points (chapters) in the video - * Descriptions (not supported yet) - audio descriptions that are read back to the user by a screen reading device - */ - - /** - * Get an array of associated text tracks. captions, subtitles, chapters, descriptions - * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks + * Get the {@link TextTrackList} * - * @return {Array} Array of track objects + * Text tracks are tracks of timed text events. + * - Captions: text displayed over the video + * for the hearing impaired + * - Subtitles: text displayed over the video for + * those who don't understand language in the video + * - Chapters: text displayed in a menu allowing the user to jump + * to particular points (chapters) in the video + * - Descriptions: (not yet implemented) audio descriptions that are read back to + * the user by a screen reading device + * + * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks + * + * @return {TextTrackList|undefined} + * The current TextTrackList or undefined if + * or undefined if we don't have a tech */ @@ -10256,9 +11965,14 @@ var Player = function (_Component) { }; /** - * Get an array of remote text tracks + * Get the "remote" {@link TextTrackList}. Remote Text Tracks + * are tracks that were added to the HTML video element and can + * be removed, whereas normal texttracks cannot be removed. * - * @return {Array} + * + * @return {TextTrackList|undefined} + * The current remote text track list or undefined + * if we don't have a tech */ @@ -10269,9 +11983,13 @@ var Player = function (_Component) { }; /** - * Get an array of remote html track elements + * Get the "remote" {@link HTMLTrackElementList}. + * This gives the user all of the DOM elements that match up + * with the remote {@link TextTrackList}. * - * @return {HTMLTrackElement[]} + * @return {HTMLTrackElementList} + * The current remote text track list elements + * or undefined if we don't have a tech */ @@ -10282,13 +12000,25 @@ var Player = function (_Component) { }; /** - * Add a text track - * In addition to the W3C settings we allow adding additional info through options. - * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack + * A helper method for adding a {@link TextTrack} to our + * {@link TextTrackList}. * - * @param {String} kind Captions, subtitles, chapters, descriptions, or metadata - * @param {String=} label Optional label - * @param {String=} language Optional language + * In addition to the W3C settings we allow adding additional info through options. + * + * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack + * + * @param {string} [kind] + * the kind of TextTrack you are adding + * + * @param {string} [label] + * the label to give the TextTrack label + * + * @param {string} [language] + * the language to set on the TextTrack + * + * @return {TextTrack|undefined} + * the TextTrack that was added or undefined + * if there is no tech */ @@ -10299,25 +12029,42 @@ var Player = function (_Component) { }; /** - * Add a remote text track + * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}. It will + * automatically removed from the video element whenever the source changes, unless + * manualCleanup is set to false. * - * @param {Object} options Options for remote text track + * @param {Object} options + * Options to pass to {@link HTMLTrackElement} during creation. See + * {@link HTMLTrackElement} for object properties that you should use. + * + * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be + * + * @return {HTMLTrackElement} + * the HTMLTrackElement that was created and added + * to the HTMLTrackElementList and the remote + * TextTrackList + * + * @deprecated The default value of the "manualCleanup" parameter will default + * to "false" in upcoming versions of Video.js */ - Player.prototype.addRemoteTextTrack = function addRemoteTextTrack(options) { + Player.prototype.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { if (this.tech_) { - return this.tech_.addRemoteTextTrack(options); + return this.tech_.addRemoteTextTrack(options, manualCleanup); } }; /** - * Remove a remote text track + * Remove a remote {@link TextTrack} from the respective + * {@link TextTrackList} and {@link HTMLTrackElementList}. * - * @param {Object} track Remote text track to remove + * @param {Object} track + * Remote {@link TextTrack} to remove + * + * @return {undefined} + * does not return anything */ - // destructure the input into an object with a track argument, defaulting to arguments[0] - // default the whole argument to an empty object if nothing was passed in Player.prototype.removeRemoteTextTrack = function removeRemoteTextTrack() { @@ -10325,6 +12072,9 @@ var Player = function (_Component) { _ref3$track = _ref3.track, track = _ref3$track === undefined ? arguments[0] : _ref3$track; + // destructure the input into an object with a track argument, defaulting to arguments[0] + // default the whole argument to an empty object if nothing was passed in + if (this.tech_) { return this.tech_.removeRemoteTextTrack(track); } @@ -10333,7 +12083,8 @@ var Player = function (_Component) { /** * Get video width * - * @return {Number} Video width + * @return {number} + * current video width */ @@ -10344,7 +12095,8 @@ var Player = function (_Component) { /** * Get video height * - * @return {Number} Video height + * @return {number} + * current video height */ @@ -10365,9 +12117,12 @@ var Player = function (_Component) { * the controls to be built with a specific language. Changing the lanugage * later will not update controls text. * - * @param {String} code The locale string - * @return {String} The locale string when getting - * @return {Player} self when setting + * @param {string} [code] + * the language code to set the player to + * + * @return {string|Player} + * - The current language code when getting + * - A reference to the player when setting */ @@ -10385,7 +12140,8 @@ var Player = function (_Component) { * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time * Languages specified directly in the player options have precedence * - * @return {Array} Array of languages + * @return {Array} + * An array of of supported languages */ @@ -10394,9 +12150,11 @@ var Player = function (_Component) { }; /** - * Converts track info to JSON + * returns a JavaScript object reperesenting the current track + * information. **DOES not return it as JSON** * - * @return {Object} JSON object of options + * @return {Object} + * Object representing the current of track info */ @@ -10419,20 +12177,20 @@ var Player = function (_Component) { }; /** - * Creates a simple modal dialog (an instance of the `ModalDialog` + * Creates a simple modal dialog (an instance of the {@link ModalDialog} * component) that immediately overlays the player with arbitrary * content and removes itself when closed. * - * @param {String|Function|Element|Array|Null} content - * Same as `ModalDialog#content`'s param of the same name. - * + * @param {string|Function|Element|Array|null} content + * Same as {@link ModalDialog#content}'s param of the same name. * The most straight-forward usage is to provide a string or DOM * element. * * @param {Object} [options] - * Extra options which will be passed on to the `ModalDialog`. + * Extra options which will be passed on to the {@link ModalDialog}. * * @return {ModalDialog} + * the {@link ModalDialog} that was created */ @@ -10455,9 +12213,12 @@ var Player = function (_Component) { /** * Gets tag settings * - * @param {Element} tag The player tag - * @return {Array} An array of sources and track objects - * @static + * @param {Element} tag + * The player tag + * + * @return {Object} + * An object containing all of the settings + * for a player tag */ @@ -10470,6 +12231,10 @@ var Player = function (_Component) { var tagOptions = Dom.getElAttributes(tag); var dataSetup = tagOptions['data-setup']; + if (Dom.hasElClass(tag, 'vjs-fluid')) { + tagOptions.fluid = true; + } + // Check if data-setup attr exists. if (dataSetup !== null) { // Parse options JSON @@ -10481,10 +12246,10 @@ var Player = function (_Component) { if (err) { _log2['default'].error(err); } - (0, _object2['default'])(tagOptions, data); + (0, _obj.assign)(tagOptions, data); } - (0, _object2['default'])(baseOptions, tagOptions); + (0, _obj.assign)(baseOptions, tagOptions); // Get tag children settings if (tag.hasChildNodes()) { @@ -10509,7 +12274,9 @@ var Player = function (_Component) { /** * Determine wether or not flexbox is supported * - * @return {Boolean} wether or not flexbox is supported + * @return {boolean} + * - true if flexbox is supported + * - false if flexbox is not supported */ @@ -10526,7 +12293,7 @@ var Player = function (_Component) { return Player; }(_component2['default']); -/* +/** * Global player list * * @type {Object} @@ -10581,14 +12348,14 @@ Player.prototype.options_ = { * Returns whether or not the player is in the "ended" state. * * @return {Boolean} True if the player is in the ended state, false if not. - * @method Player.prototype.ended + * @method Player#ended */ 'ended', /** * Returns whether or not the player is in the "seeking" state. * * @return {Boolean} True if the player is in the seeking state, false if not. - * @method Player.prototype.seeking + * @method Player#seeking */ 'seeking', /** @@ -10596,7 +12363,7 @@ Player.prototype.options_ = { * for seeking to. * * @return {TimeRanges} the seekable intervals of the media timeline - * @method Player.prototype.seekable + * @method Player#seekable */ 'seekable', /** @@ -10616,8 +12383,8 @@ Player.prototype.options_ = { * not yet found a resource to use. * * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states - * @return {Number} the current network activity state - * @method Player.prototype.networkState + * @return {number} the current network activity state + * @method Player#networkState */ 'networkState', /** @@ -10640,8 +12407,8 @@ Player.prototype.options_ = { * playback to proceed uninterrupted. * * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate - * @return {Number} the current playback rendering state - * @method Player.prototype.readyState + * @return {number} the current playback rendering state + * @method Player#readyState */ 'readyState'].forEach(function (fn) { Player.prototype[fn] = function () { @@ -10655,45 +12422,18 @@ TECH_EVENTS_RETRIGGER.forEach(function (event) { }; }); -/* document methods */ /** * Fired when the player has initial duration and dimension information * - * @event loadedmetadata - * @private - * @method Player.prototype.handleLoadedMetaData_ - */ - -/** - * Fired when the player receives text data - * - * @event textdata - * @private - * @method Player.prototype.handleTextData_ + * @event Player#loadedmetadata + * @type {EventTarget~Event} */ /** * Fired when the player has downloaded data at the current playback position * - * @event loadeddata - * @private - * @method Player.prototype.handleLoadedData_ - */ - -/** - * Fired when the user is active, e.g. moves the mouse over the player - * - * @event useractive - * @private - * @method Player.prototype.handleUserActive_ - */ - -/** - * Fired when the user is inactive, e.g. a short delay after the last mouse move or control interaction - * - * @event userinactive - * @private - * @method Player.prototype.handleUserInactive_ + * @event Player#loadeddata + * @type {EventTarget~Event} */ /** @@ -10701,31 +12441,21 @@ TECH_EVENTS_RETRIGGER.forEach(function (event) { * During playback this is fired every 15-250 milliseconds, depending on the * playback technology in use. * - * @event timeupdate - * @private - * @method Player.prototype.handleTimeUpdate_ + * @event Player#timeupdate + * @type {EventTarget~Event} */ /** * Fired when the volume changes * - * @event volumechange - * @private - * @method Player.prototype.handleVolumeChange_ - */ - -/** - * Fired when an error occurs - * - * @event error - * @private - * @method Player.prototype.handleError_ + * @event Player#volumechange + * @type {EventTarget~Event} */ _component2['default'].registerComponent('Player', Player); exports['default'] = Player; -},{"1":1,"136":136,"145":145,"4":4,"41":41,"44":44,"45":45,"46":46,"5":5,"50":50,"55":55,"59":59,"60":60,"61":61,"62":62,"63":63,"68":68,"69":69,"71":71,"76":76,"78":78,"79":79,"8":8,"80":80,"81":81,"82":82,"84":84,"85":85,"86":86,"87":87,"88":88,"89":89,"92":92,"93":93}],52:[function(_dereq_,module,exports){ +},{"1":1,"4":4,"41":41,"44":44,"45":45,"46":46,"5":5,"50":50,"55":55,"59":59,"60":60,"61":61,"62":62,"63":63,"68":68,"69":69,"71":71,"76":76,"78":78,"79":79,"8":8,"81":81,"82":82,"83":83,"85":85,"86":86,"87":87,"88":88,"89":89,"90":90,"91":91,"94":94,"95":95,"97":97}],52:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -10737,16 +12467,19 @@ var _player2 = _interopRequireDefault(_player); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /** - * The method for registering a video.js plugin + * The method for registering a video.js plugin. {@link videojs:videojs.registerPlugin]. * - * @param {String} name The name of the plugin - * @param {Function} init The function that is run when the player inits - * @method plugin + * @param {string} name + * The name of the plugin that is being registered + * + * @param {plugins:PluginFn} init + * The function that gets run when a `Player` initializes. */ var plugin = function plugin(name, init) { _player2['default'].prototype[name] = init; }; /** * @file plugins.js + * @module plugins */ exports['default'] = plugin; @@ -10775,16 +12508,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * A button class with a popup control + * A button class for use with {@link Popup} controls * - * @param {Player|Object} player - * @param {Object=} options * @extends ClickableComponent - * @class PopupButton */ var PopupButton = function (_ClickableComponent) { _inherits(PopupButton, _ClickableComponent); + /** + * Create an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function PopupButton(player) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; @@ -10797,9 +12536,7 @@ var PopupButton = function (_ClickableComponent) { } /** - * Update popup - * - * @method update + * Update the `Popup` that this button is attached to. */ @@ -10821,20 +12558,19 @@ var PopupButton = function (_ClickableComponent) { }; /** - * Create popup - Override with specific functionality for component + * Create a `Popup`. - Override with specific functionality for component * - * @return {Popup} The constructed popup - * @method createPopup + * @abstract */ PopupButton.prototype.createPopup = function createPopup() {}; /** - * Create the component's DOM element + * Create the `PopupButton`s DOM element. * * @return {Element} - * @method createEl + * The element that gets created. */ @@ -10845,10 +12581,10 @@ var PopupButton = function (_ClickableComponent) { }; /** - * Allow sub components to stack CSS class names + * Builds the default DOM `className`. * - * @return {String} The constructed class name - * @method buildCSSClass + * @return {string} + * The DOM `className` for this object. */ @@ -10880,15 +12616,15 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _events = _dereq_(81); +var _events = _dereq_(82); var Events = _interopRequireWildcard(_events); @@ -10909,7 +12645,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * The Popup component is used to build pop up controls. * * @extends Component - * @class Popup */ var Popup = function (_Component) { _inherits(Popup, _Component); @@ -10923,8 +12658,9 @@ var Popup = function (_Component) { /** * Add a popup item to the popup * - * @param {Object|String} component Component or component type to add - * @method addItem + * @param {Object|string} component + * Component or component type to add + * */ Popup.prototype.addItem = function addItem(component) { this.addChild(component); @@ -10934,10 +12670,10 @@ var Popup = function (_Component) { }; /** - * Create the component's DOM element + * Create the `PopupButton`s DOM element. * * @return {Element} - * @method createEl + * The element that gets created. */ @@ -10971,7 +12707,7 @@ var Popup = function (_Component) { _component2['default'].registerComponent('Popup', Popup); exports['default'] = Popup; -},{"5":5,"80":80,"81":81,"82":82}],55:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"82":82,"83":83}],55:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -10984,11 +12720,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); @@ -11010,16 +12746,22 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The component that handles showing the poster image. + * A `ClickableComponent` that handles showing the poster image for the player. * - * @param {Player|Object} player - * @param {Object=} options - * @extends Button - * @class PosterImage + * @extends ClickableComponent */ var PosterImage = function (_ClickableComponent) { _inherits(PosterImage, _ClickableComponent); + /** + * Create an instance of this class. + * + * @param {Player} player + * The `Player` that this class should attach to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function PosterImage(player, options) { _classCallCheck(this, PosterImage); @@ -11031,9 +12773,7 @@ var PosterImage = function (_ClickableComponent) { } /** - * Clean up the poster image - * - * @method dispose + * Clean up and dispose of the `PosterImage`. */ @@ -11043,10 +12783,10 @@ var PosterImage = function (_ClickableComponent) { }; /** - * Create the poster's image element + * Create the `PosterImage`s DOM element. * * @return {Element} - * @method createEl + * The element that gets created. */ @@ -11071,13 +12811,16 @@ var PosterImage = function (_ClickableComponent) { }; /** - * Event handler for updates to the player's poster source + * An {@link EventTarget~EventListener} for {@link Player#posterchange} events. * - * @method update + * @listens Player#posterchange + * + * @param {EventTarget~Event} [event] + * The `Player#posterchange` event that triggered this function. */ - PosterImage.prototype.update = function update() { + PosterImage.prototype.update = function update(event) { var url = this.player().poster(); this.setSrc(url); @@ -11092,10 +12835,10 @@ var PosterImage = function (_ClickableComponent) { }; /** - * Set the poster source depending on the display method + * Set the source of the `PosterImage` depending on the display method. * - * @param {String} url The URL to the poster source - * @method setSrc + * @param {string} url + * The URL to the source for the `PosterImage`. */ @@ -11116,15 +12859,24 @@ var PosterImage = function (_ClickableComponent) { }; /** - * Event handler for clicks on the poster image + * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See + * {@link ClickableComponent#handleClick} for instances where this will be triggered. * - * @method handleClick + * @listens tap + * @listens click + * @listens keydown + * + * @param {EventTarget~Event} event + + The `click`, `tap` or `keydown` event that caused this function to be called. */ - PosterImage.prototype.handleClick = function handleClick() { + PosterImage.prototype.handleClick = function handleClick(event) { // We don't want a click to trigger playback when controls are disabled - // but CSS should be hiding the poster to prevent that from happening + if (!this.player_.controls()) { + return; + } + if (this.player_.paused()) { this.player_.play(); } else { @@ -11138,21 +12890,25 @@ var PosterImage = function (_ClickableComponent) { _component2['default'].registerComponent('PosterImage', PosterImage); exports['default'] = PosterImage; -},{"3":3,"5":5,"78":78,"80":80,"82":82}],56:[function(_dereq_,module,exports){ +},{"3":3,"5":5,"78":78,"81":81,"83":83}],56:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; exports.hasLoaded = exports.autoSetupTimeout = exports.autoSetup = undefined; -var _events = _dereq_(81); +var _dom = _dereq_(81); + +var Dom = _interopRequireWildcard(_dom); + +var _events = _dereq_(82); var Events = _interopRequireWildcard(_events); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); @@ -11160,17 +12916,25 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } -var _windowLoaded = false; /** - * @file setup.js - * - * Functions for automatically setting up a player - * based on the data-setup attribute of the video tag - */ - +/** + * @file setup.js - Functions for setting up a player without + * user interaction based on the data-setup `attribute` of the video tag. + * + * @module setup + */ +var _windowLoaded = false; var videojs = void 0; -// Automatically set up any tags that have a data-setup attribute +/** + * Set up any tags that have a data-setup `attribute` when the player is started. + */ var autoSetup = function autoSetup() { + + // Protect against breakage in non-browser environments. + if (!Dom.isReal()) { + return; + } + // One day, when we stop supporting IE8, go back to this, but in the meantime...*hack hack hack* // var vids = Array.prototype.slice.call(document.getElementsByTagName('video')); // var audios = Array.prototype.slice.call(document.getElementsByTagName('audio')); @@ -11230,23 +12994,40 @@ var autoSetup = function autoSetup() { } }; -// Pause to let the DOM keep processing +/** + * Wait until the page is loaded before running autoSetup. This will be called in + * autoSetup if `hasLoaded` returns false. + * + * @param {number} wait + * How long to wait in ms + * + * @param {videojs} [vjs] + * The videojs library function + */ function autoSetupTimeout(wait, vjs) { if (vjs) { videojs = vjs; } - setTimeout(autoSetup, wait); + _window2['default'].setTimeout(autoSetup, wait); } -if (_document2['default'].readyState === 'complete') { +if (Dom.isReal() && _document2['default'].readyState === 'complete') { _windowLoaded = true; } else { + /** + * Listen for the load event on window, and set _windowLoaded to true. + * + * @listens load + */ Events.one(_window2['default'], 'load', function () { _windowLoaded = true; }); } +/** + * check if the document has been loaded + */ var hasLoaded = function hasLoaded() { return _windowLoaded; }; @@ -11255,7 +13036,7 @@ exports.autoSetup = autoSetup; exports.autoSetupTimeout = autoSetupTimeout; exports.hasLoaded = hasLoaded; -},{"81":81,"92":92,"93":93}],57:[function(_dereq_,module,exports){ +},{"81":81,"82":82,"94":94,"95":95}],57:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -11264,13 +13045,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _object = _dereq_(136); - -var _object2 = _interopRequireDefault(_object); +var _obj = _dereq_(88); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } @@ -11286,16 +13065,23 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The base functionality for sliders like the volume bar and seek bar + * The base functionality for a slider. Can be vertical or horizontal. + * For instance the volume bar or the seek bar on a video is a slider. * - * @param {Player|Object} player - * @param {Object=} options * @extends Component - * @class Slider */ var Slider = function (_Component) { _inherits(Slider, _Component); + /** + * Create an instance of this class + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ function Slider(player, options) { _classCallCheck(this, Slider); @@ -11319,12 +13105,19 @@ var Slider = function (_Component) { } /** - * Create the component's DOM element + * Create the `Button`s DOM element. + * + * @param {string} type + * Type of element to create. + * + * @param {Object} [props={}] + * List of properties in Object form. + * + * @param {Object} [attributes={}] + * list of attributes in Object form. * - * @param {String} type Type of element to create - * @param {Object=} props List of properties in Object form * @return {Element} - * @method createEl + * The element that gets created. */ @@ -11334,11 +13127,11 @@ var Slider = function (_Component) { // Add the slider element class to all sub classes props.className = props.className + ' vjs-slider'; - props = (0, _object2['default'])({ + props = (0, _obj.assign)({ tabIndex: 0 }, props); - attributes = (0, _object2['default'])({ + attributes = (0, _obj.assign)({ 'role': 'slider', 'aria-valuenow': 0, 'aria-valuemin': 0, @@ -11350,10 +13143,14 @@ var Slider = function (_Component) { }; /** - * Handle mouse down on slider + * Handle `mousedown` or `touchstart` events on the `Slider`. * - * @param {Object} event Mouse down event object - * @method handleMouseDown + * @param {EventTarget~Event} event + * `mousedown` or `touchstart` event that triggered this function + * + * @listens mousedown + * @listens touchstart + * @fires Slider#slideractive */ @@ -11364,6 +13161,12 @@ var Slider = function (_Component) { Dom.blockTextSelection(); this.addClass('vjs-sliding'); + /** + * Triggered when the slider is in an active state + * + * @event Slider#slideractive + * @type {EventTarget~Event} + */ this.trigger('slideractive'); this.on(doc, 'mousemove', this.handleMouseMove); @@ -11375,18 +13178,31 @@ var Slider = function (_Component) { }; /** - * To be overridden by a subclass + * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`. + * The `mousemove` and `touchmove` events will only only trigger this function during + * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and + * {@link Slider#handleMouseUp}. * - * @method handleMouseMove + * @param {EventTarget~Event} event + * `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered + * this function + * + * @listens mousemove + * @listens touchmove */ - Slider.prototype.handleMouseMove = function handleMouseMove() {}; + Slider.prototype.handleMouseMove = function handleMouseMove(event) {}; /** - * Handle mouse up on Slider + * Handle `mouseup` or `touchend` events on the `Slider`. * - * @method handleMouseUp + * @param {EventTarget~Event} event + * `mouseup` or `touchend` event that triggered this function. + * + * @listens touchend + * @listens mouseup + * @fires Slider#sliderinactive */ @@ -11396,6 +13212,12 @@ var Slider = function (_Component) { Dom.unblockTextSelection(); this.removeClass('vjs-sliding'); + /** + * Triggered when the slider is no longer in an active state. + * + * @event Slider#sliderinactive + * @type {EventTarget~Event} + */ this.trigger('sliderinactive'); this.off(doc, 'mousemove', this.handleMouseMove); @@ -11407,9 +13229,7 @@ var Slider = function (_Component) { }; /** - * Update slider - * - * @method update + * Update the progress bar of the `Slider`. */ @@ -11450,8 +13270,13 @@ var Slider = function (_Component) { /** * Calculate distance for slider * - * @param {Object} event Event object - * @method calculateDistance + * @param {EventTarget~Event} event + * The event that caused this function to run. + * + * @return {number} + * The current position of the Slider. + * - postition.x for vertical `Slider`s + * - postition.y for horizontal `Slider`s */ @@ -11465,9 +13290,12 @@ var Slider = function (_Component) { }; /** - * Handle on focus for slider + * Handle a `focus` event on this `Slider`. * - * @method handleFocus + * @param {EventTarget~Event} event + * The `focus` event that caused this function to run. + * + * @listens focus */ @@ -11476,10 +13304,14 @@ var Slider = function (_Component) { }; /** - * Handle key press for slider + * Handle a `keydown` event on the `Slider`. Watches for left, rigth, up, and down + * arrow keys. This function will only be called when the slider has focus. See + * {@link Slider#handleFocus} and {@link Slider#handleBlur}. * - * @param {Object} event Event object - * @method handleKeyPress + * @param {EventTarget~Event} event + * the `keydown` event that caused this function to run. + * + * @listens keydown */ @@ -11497,12 +13329,14 @@ var Slider = function (_Component) { }; /** - * Handle on blur for slider + * Handle a `blur` event on this `Slider`. * - * @method handleBlur + * @param {EventTarget~Event} event + * The `blur` event that caused this function to run. + * + * @listens blur */ - Slider.prototype.handleBlur = function handleBlur() { this.off(this.bar.el_.ownerDocument, 'keydown', this.handleKeyPress); }; @@ -11511,8 +13345,8 @@ var Slider = function (_Component) { * Listener for click events on slider, used to prevent clicks * from bubbling up to parent elements like button menus. * - * @param {Object} event Event object - * @method handleClick + * @param {Object} event + * Event that caused this object to run */ @@ -11524,9 +13358,14 @@ var Slider = function (_Component) { /** * Get/set if slider is horizontal for vertical * - * @param {Boolean} bool True if slider is vertical, false is horizontal - * @return {Boolean} True if slider is vertical, false is horizontal - * @method vertical + * @param {boolean} [bool] + * - true if slider is vertical, + * - false is horizontal + * + * @return {boolean|Slider} + * - true if slider is vertical, and getting + * - false is horizontal, and getting + * - a reference to this object when setting */ @@ -11552,12 +13391,22 @@ var Slider = function (_Component) { _component2['default'].registerComponent('Slider', Slider); exports['default'] = Slider; -},{"136":136,"5":5,"80":80}],58:[function(_dereq_,module,exports){ +},{"5":5,"81":81,"88":88}],58:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; /** * @file flash-rtmp.js + * @module flash-rtmp + */ + +/** + * Add RTMP properties to the {@link Flash} Tech. + * + * @param {Flash} Flash + * The flash tech class. + * + * @mixin FlashRtmpDecorator */ function FlashRtmpDecorator(Flash) { Flash.streamingFormats = { @@ -11565,10 +13414,40 @@ function FlashRtmpDecorator(Flash) { 'rtmp/flv': 'FLV' }; + /** + * Join connection and stream with an ampersand. + * + * @param {string} connection + * The connection string. + * + * @param {string} stream + * The stream string. + */ Flash.streamFromParts = function (connection, stream) { return connection + '&' + stream; }; + /** + * The flash parts object that contains connection and stream info. + * + * @typedef {Object} Flash~PartsObject + * + * @property {string} connection + * The connection string of a source, defaults to an empty string. + * + * @property {string} stream + * The stream string of the source, defaults to an empty string. + */ + + /** + * Convert a source url into a stream and connection parts. + * + * @param {string} src + * the source url + * + * @return {Flash~PartsObject} + * The parts object that contains a connection and a stream + */ Flash.streamToParts = function (src) { var parts = { connection: '', @@ -11602,14 +13481,40 @@ function FlashRtmpDecorator(Flash) { return parts; }; + /** + * Check if the source type is a streaming type. + * + * @param {string} srcType + * The mime type to check. + * + * @return {boolean} + * - True if the source type is a streaming type. + * - False if the source type is not a streaming type. + */ Flash.isStreamingType = function (srcType) { return srcType in Flash.streamingFormats; }; // RTMP has four variations, any string starting // with one of these protocols should be valid + + /** + * Regular expression used to check if the source is an rtmp source. + * + * @property {RegExp} Flash.RTMP_RE + */ Flash.RTMP_RE = /^rtmp[set]?:\/\//i; + /** + * Check if the source itself is a streaming type. + * + * @param {string} src + * The url to the source. + * + * @return {boolean} + * - True if the source url indicates that the source is streaming. + * - False if the shource url indicates that the source url is not streaming. + */ Flash.isStreamingSrc = function (src) { return Flash.RTMP_RE.test(src); }; @@ -11621,9 +13526,13 @@ function FlashRtmpDecorator(Flash) { Flash.rtmpSourceHandler = {}; /** - * Check if Flash can play the given videotype - * @param {String} type The mimetype to check - * @return {String} 'probably', 'maybe', or '' (empty string) + * Check if Flash can play the given mime type. + * + * @param {string} type + * The mime type to check + * + * @return {string} + * 'maybe', or '' (empty string) */ Flash.rtmpSourceHandler.canPlayType = function (type) { if (Flash.isStreamingType(type)) { @@ -11635,9 +13544,15 @@ function FlashRtmpDecorator(Flash) { /** * Check if Flash can handle the source natively - * @param {Object} source The source object - * @param {Object} options The options passed to the tech - * @return {String} 'probably', 'maybe', or '' (empty string) + * + * @param {Object} source + * The source object + * + * @param {Object} [options] + * The options passed to the tech + * + * @return {string} + * 'maybe', or '' (empty string) */ Flash.rtmpSourceHandler.canHandleSource = function (source, options) { var can = Flash.rtmpSourceHandler.canPlayType(source.type); @@ -11654,12 +13569,16 @@ function FlashRtmpDecorator(Flash) { }; /** - * Pass the source to the flash object - * Adaptive source handlers will have more complicated workflows before passing - * video data to the video element - * @param {Object} source The source object - * @param {Flash} tech The instance of the Flash tech - * @param {Object} options The options to pass to the source + * Pass the source to the flash object. + * + * @param {Object} source + * The source object + * + * @param {Flash} tech + * The instance of the Flash tech + * + * @param {Object} [options] + * The options to pass to the source */ Flash.rtmpSourceHandler.handleSource = function (source, tech, options) { var srcParts = Flash.streamToParts(source.src); @@ -11685,15 +13604,15 @@ var _tech = _dereq_(62); var _tech2 = _interopRequireDefault(_tech); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _url = _dereq_(90); +var _url = _dereq_(92); var Url = _interopRequireWildcard(_url); -var _timeRanges = _dereq_(88); +var _timeRanges = _dereq_(90); var _flashRtmp = _dereq_(58); @@ -11703,13 +13622,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); -var _object = _dereq_(136); - -var _object2 = _interopRequireDefault(_object); +var _obj = _dereq_(88); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } @@ -11729,17 +13646,25 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" var navigator = _window2['default'].navigator; /** - * Flash Media Controller - Wrapper for fallback SWF API + * Flash Media Controller - Wrapper for Flash Media API * - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function + * @mixes FlashRtmpDecorator + * @mixes Tech~SouceHandlerAdditions * @extends Tech - * @class Flash */ var Flash = function (_Tech) { _inherits(Flash, _Tech); + /** + * Create an instance of this Tech. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} ready + * Callback function to call when the `Flash` Tech is ready. + */ function Flash(options, ready) { _classCallCheck(this, Flash); @@ -11775,14 +13700,15 @@ var Flash = function (_Tech) { _this.on('seeked', function () { this.lastSeekTarget_ = undefined; }); + return _this; } /** - * Create the component's DOM element + * Create the `Flash` Tech's DOM element. * * @return {Element} - * @method createEl + * The element that gets created. */ @@ -11794,7 +13720,7 @@ var Flash = function (_Tech) { // Otherwise this adds a CDN url. // The CDN also auto-adds a swf URL for that specific version. if (!options.swf) { - var ver = '5.1.0'; + var ver = '5.3.0'; options.swf = '//vjs.zencdn.net/swf/' + ver + '/video-js.swf'; } @@ -11803,7 +13729,7 @@ var Flash = function (_Tech) { var objId = options.techId; // Merge default flashvars with ones passed in to init - var flashVars = (0, _object2['default'])({ + var flashVars = (0, _obj.assign)({ // SWF Callback Functions readyFunction: 'videojs.Flash.onReady', @@ -11819,7 +13745,7 @@ var Flash = function (_Tech) { }, options.flashVars); // Merge default parames with ones passed in - var params = (0, _object2['default'])({ + var params = (0, _obj.assign)({ // Opaque is needed to overlay controls, but can affect playback performance wmode: 'opaque', // Using bgcolor prevents a white flash when the object is loading @@ -11827,7 +13753,7 @@ var Flash = function (_Tech) { }, options.params); // Merge default attributes with ones passed in - var attributes = (0, _object2['default'])({ + var attributes = (0, _obj.assign)({ // Both ID and Name needed or swf to identify itself id: objId, name: objId, @@ -11841,9 +13767,7 @@ var Flash = function (_Tech) { }; /** - * Play for flash tech - * - * @method play + * Called by {@link Player#play} to play using the `Flash` `Tech`. */ @@ -11855,9 +13779,7 @@ var Flash = function (_Tech) { }; /** - * Pause for flash tech - * - * @method pause + * Called by {@link Player#pause} to pause using the `Flash` `Tech`. */ @@ -11866,11 +13788,17 @@ var Flash = function (_Tech) { }; /** - * Get/set video + * A getter/setter for the `Flash` Tech's source object. + * > Note: Please use {@link Flash#setSource} * - * @param {Object=} src Source object - * @return {Object} - * @method src + * @param {Tech~SourceObject} [src] + * The source object you want to set on the `Flash` techs. + * + * @return {Tech~SourceObject|undefined} + * - The current source object when a source is not passed in. + * - undefined when setting + * + * @deprecated Since version 5. */ @@ -11884,11 +13812,14 @@ var Flash = function (_Tech) { }; /** - * Set video + * A getter/setter for the `Flash` Tech's source object. * - * @param {Object=} src Source object - * @deprecated - * @method setSrc + * @param {Tech~SourceObject} [src] + * The source object you want to set on the `Flash` techs. + * + * @return {Tech~SourceObject|undefined} + * - The current source object when a source is not passed in. + * - undefined when setting */ @@ -11909,8 +13840,11 @@ var Flash = function (_Tech) { }; /** - * Returns true if the tech is currently seeking. - * @return {boolean} true if seeking + * Indicates whether the media is currently seeking to a new position or not. + * + * @return {boolean} + * - True if seeking to a new position + * - False otherwise */ @@ -11919,10 +13853,10 @@ var Flash = function (_Tech) { }; /** - * Set current time + * Returns the current time in seconds that the media is at in playback. * - * @param {Number} time Current time of video - * @method setCurrentTime + * @param {number} time + * Current playtime of the media in seconds. */ @@ -11942,15 +13876,14 @@ var Flash = function (_Tech) { }; /** - * Get current time + * Get the current playback time in seconds * - * @param {Number=} time Current time of video - * @return {Number} Current time - * @method currentTime + * @return {number} + * The current time of playback in seconds. */ - Flash.prototype.currentTime = function currentTime(time) { + Flash.prototype.currentTime = function currentTime() { // when seeking make the reported time keep up with the requested time // by reading the time we're seeking to if (this.seeking()) { @@ -11960,9 +13893,11 @@ var Flash = function (_Tech) { }; /** - * Get current source + * Get the current source * * @method currentSrc + * @return {Tech~SourceObject} + * The current source */ @@ -11974,9 +13909,10 @@ var Flash = function (_Tech) { }; /** - * Get media duration + * Get the total duration of the current media. * - * @returns {Number} Media duration + * @return {number} + 8 The total duration of the current media. */ @@ -11990,9 +13926,7 @@ var Flash = function (_Tech) { }; /** - * Load media into player - * - * @method load + * Load media into Tech. */ @@ -12001,9 +13935,7 @@ var Flash = function (_Tech) { }; /** - * Get poster - * - * @method poster + * Get the poster image that was set on the tech. */ @@ -12012,19 +13944,17 @@ var Flash = function (_Tech) { }; /** - * Poster images are not handled by the Flash tech so make this a no-op - * - * @method setPoster + * Poster images are not handled by the Flash tech so make this is a no-op. */ Flash.prototype.setPoster = function setPoster() {}; /** - * Determine if can seek in media + * Determine the time ranges that can be seeked to in the media. * - * @return {TimeRangeObject} - * @method seekable + * @return {TimeRange} + * Returns the time ranges that can be seeked to. */ @@ -12038,10 +13968,10 @@ var Flash = function (_Tech) { }; /** - * Get buffered time range + * Get and create a `TimeRange` object for buffering. * - * @return {TimeRangeObject} - * @method buffered + * @return {TimeRange} + * The time range object that was created. */ @@ -12056,11 +13986,12 @@ var Flash = function (_Tech) { /** * Get fullscreen support - - * Flash does not allow fullscreen through javascript - * so always returns false * - * @return {Boolean} false - * @method supportsFullScreen + * Flash does not allow fullscreen through javascript + * so this always returns false. + * + * @return {boolean} + * The Flash tech does not support fullscreen, so it will always return false. */ @@ -12070,12 +14001,11 @@ var Flash = function (_Tech) { }; /** - * Request to enter fullscreen * Flash does not allow fullscreen through javascript - * so always returns false + * so this always returns false. * - * @return {Boolean} false - * @method enterFullScreen + * @return {boolean} + * The Flash tech does not support fullscreen, so it will always return false. */ @@ -12118,8 +14048,392 @@ for (var _i = 0; _i < _readOnly.length; _i++) { _createGetter(_readOnly[_i]); } +/** ------------------------------ Getters ------------------------------ **/ +/** + * Get the value of `rtmpConnection` from the swf. + * + * @method Flash#rtmpConnection + * @return {string} + * The current value of `rtmpConnection` on the swf. + */ + +/** + * Get the value of `rtmpStream` from the swf. + * + * @method Flash#rtmpStream + * @return {string} + * The current value of `rtmpStream` on the swf. + */ + +/** + * Get the value of `preload` from the swf. `preload` indicates + * what should download before the media is interacted with. It can have the following + * values: + * - none: nothing should be downloaded + * - metadata: poster and the first few frames of the media may be downloaded to get + * media dimensions and other metadata + * - auto: allow the media and metadata for the media to be downloaded before + * interaction + * + * @method Flash#preload + * @return {string} + * The value of `preload` from the swf. Will be 'none', 'metadata', + * or 'auto'. + */ + +/** + * Get the value of `defaultPlaybackRate` from the swf. + * + * @method Flash#defaultPlaybackRate + * @return {number} + * The current value of `defaultPlaybackRate` on the swf. + */ + +/** + * Get the value of `playbackRate` from the swf. `playbackRate` indicates + * the rate at which the media is currently playing back. Examples: + * - if playbackRate is set to 2, media will play twice as fast. + * - if playbackRate is set to 0.5, media will play half as fast. + * + * @method Flash#playbackRate + * @return {number} + * The value of `playbackRate` from the swf. A number indicating + * the current playback speed of the media, where 1 is normal speed. + */ + +/** + * Get the value of `autoplay` from the swf. `autoplay` indicates + * that the media should start to play as soon as the page is ready. + * + * @method Flash#autoplay + * @return {boolean} + * - The value of `autoplay` from the swf. + * - True indicates that the media ashould start as soon as the page loads. + * - False indicates that the media should not start as soon as the page loads. + */ + +/** + * Get the value of `loop` from the swf. `loop` indicates + * that the media should return to the start of the media and continue playing once + * it reaches the end. + * + * @method Flash#loop + * @return {boolean} + * - The value of `loop` from the swf. + * - True indicates that playback should seek back to start once + * the end of a media is reached. + * - False indicates that playback should not loop back to the start when the + * end of the media is reached. + */ + +/** + * Get the value of `mediaGroup` from the swf. + * + * @method Flash#mediaGroup + * @return {string} + * The current value of `mediaGroup` on the swf. + */ + +/** + * Get the value of `controller` from the swf. + * + * @method Flash#controller + * @return {string} + * The current value of `controller` on the swf. + */ + +/** + * Get the value of `controls` from the swf. `controls` indicates + * whether the native flash controls should be shown or hidden. + * + * @method Flash#controls + * @return {boolean} + * - The value of `controls` from the swf. + * - True indicates that native controls should be showing. + * - False indicates that native controls should be hidden. + */ + +/** + * Get the value of the `volume` from the swf. `volume` indicates the current + * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and + * so on. + * + * @method Flash#volume + * @return {number} + * The volume percent as a decimal. Value will be between 0-1. + */ + +/** + * Get the value of the `muted` from the swf. `muted` indicates the current + * audio level should be silent. + * + * @method Flash#muted + * @return {boolean} + * - True if the audio should be set to silent + * - False otherwise + */ + +/** + * Get the value of `defaultMuted` from the swf. `defaultMuted` indicates + * whether the media should start muted or not. Only changes the default state of the + * media. `muted` and `defaultMuted` can have different values. `muted` indicates the + * current state. + * + * @method Flash#defaultMuted + * @return {boolean} + * - The value of `defaultMuted` from the swf. + * - True indicates that the media should start muted. + * - False indicates that the media should not start muted. + */ + +/** + * Get the value of `networkState` from the swf. `networkState` indicates + * the current network state. It returns an enumeration from the following list: + * - 0: NETWORK_EMPTY + * - 1: NEWORK_IDLE + * - 2: NETWORK_LOADING + * - 3: NETWORK_NO_SOURCE + * + * @method Flash#networkState + * @return {number} + * The value of `networkState` from the swf. This will be a number + * from the list in the description. + */ + +/** + * Get the value of `readyState` from the swf. `readyState` indicates + * the current state of the media element. It returns an enumeration from the + * following list: + * - 0: HAVE_NOTHING + * - 1: HAVE_METADATA + * - 2: HAVE_CURRENT_DATA + * - 3: HAVE_FUTURE_DATA + * - 4: HAVE_ENOUGH_DATA + * + * @method Flash#readyState + * @return {number} + * The value of `readyState` from the swf. This will be a number + * from the list in the description. + */ + +/** + * Get the value of `readyState` from the swf. `readyState` indicates + * the current state of the media element. It returns an enumeration from the + * following list: + * - 0: HAVE_NOTHING + * - 1: HAVE_METADATA + * - 2: HAVE_CURRENT_DATA + * - 3: HAVE_FUTURE_DATA + * - 4: HAVE_ENOUGH_DATA + * + * @method Flash#readyState + * @return {number} + * The value of `readyState` from the swf. This will be a number + * from the list in the description. + */ + +/** + * Get the value of `initialTime` from the swf. + * + * @method Flash#initialTime + * @return {number} + * The `initialTime` proprety on the swf. + */ + +/** + * Get the value of `startOffsetTime` from the swf. + * + * @method Flash#startOffsetTime + * @return {number} + * The `startOffsetTime` proprety on the swf. + */ + +/** + * Get the value of `paused` from the swf. `paused` indicates whether the swf + * is current paused or not. + * + * @method Flash#paused + * @return {boolean} + * The value of `paused` from the swf. + */ + +/** + * Get the value of `ended` from the swf. `ended` indicates whether + * the media has reached the end or not. + * + * @method Flash#ended + * @return {boolean} + * - True indicates that the media has ended. + * - False indicates that the media has not ended. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended} + */ + +/** + * Get the value of `videoWidth` from the swf. `videoWidth` indicates + * the current width of the media in css pixels. + * + * @method Flash#videoWidth + * @return {number} + * The value of `videoWidth` from the swf. This will be a number + * in css pixels. + */ + +/** + * Get the value of `videoHeight` from the swf. `videoHeigth` indicates + * the current height of the media in css pixels. + * + * @method Flassh.prototype.videoHeight + * @return {number} + * The value of `videoHeight` from the swf. This will be a number + * in css pixels. + */ +/** ------------------------------ Setters ------------------------------ **/ + +/** + * Set the value of `rtmpConnection` on the swf. + * + * @method Flash#setRtmpConnection + * @param {string} rtmpConnection + * New value to set the `rtmpConnection` property to. + */ + +/** + * Set the value of `rtmpStream` on the swf. + * + * @method Flash#setRtmpStream + * @param {string} rtmpStream + * New value to set the `rtmpStream` property to. + */ + +/** + * Set the value of `preload` on the swf. `preload` indicates + * what should download before the media is interacted with. It can have the following + * values: + * - none: nothing should be downloaded + * - metadata: poster and the first few frames of the media may be downloaded to get + * media dimensions and other metadata + * - auto: allow the media and metadata for the media to be downloaded before + * interaction + * + * @method Flash#setPreload + * @param {string} preload + * The value of `preload` to set on the swf. Should be 'none', 'metadata', + * or 'auto'. + */ + +/** + * Set the value of `defaultPlaybackRate` on the swf. + * + * @method Flash#setDefaultPlaybackRate + * @param {number} defaultPlaybackRate + * New value to set the `defaultPlaybackRate` property to. + */ + +/** + * Set the value of `playbackRate` on the swf. `playbackRate` indicates + * the rate at which the media is currently playing back. Examples: + * - if playbackRate is set to 2, media will play twice as fast. + * - if playbackRate is set to 0.5, media will play half as fast. + * + * @method Flash#setPlaybackRate + * @param {number} playbackRate + * New value of `playbackRate` on the swf. A number indicating + * the current playback speed of the media, where 1 is normal speed. + */ + +/** + * Set the value of `autoplay` on the swf. `autoplay` indicates + * that the media should start to play as soon as the page is ready. + * + * @method Flash#setAutoplay + * @param {boolean} autoplay + * - The value of `autoplay` from the swf. + * - True indicates that the media ashould start as soon as the page loads. + * - False indicates that the media should not start as soon as the page loads. + */ + +/** + * Set the value of `loop` on the swf. `loop` indicates + * that the media should return to the start of the media and continue playing once + * it reaches the end. + * + * @method Flash#setLoop + * @param {boolean} loop + * - True indicates that playback should seek back to start once + * the end of a media is reached. + * - False indicates that playback should not loop back to the start when the + * end of the media is reached. + */ + +/** + * Set the value of `mediaGroup` on the swf. + * + * @method Flash#setMediaGroup + * @param {string} mediaGroup + * New value of `mediaGroup` to set on the swf. + */ + +/** + * Set the value of `controller` on the swf. + * + * @method Flash#setController + * @param {string} controller + * New value the current value of `controller` on the swf. + */ + +/** + * Get the value of `controls` from the swf. `controls` indicates + * whether the native flash controls should be shown or hidden. + * + * @method Flash#controls + * @return {boolean} + * - The value of `controls` from the swf. + * - True indicates that native controls should be showing. + * - False indicates that native controls should be hidden. + */ + +/** + * Set the value of the `volume` on the swf. `volume` indicates the current + * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and + * so on. + * + * @method Flash#setVolume + * @param {number} percentAsDecimal + * The volume percent as a decimal. Value will be between 0-1. + */ + +/** + * Set the value of the `muted` on the swf. `muted` indicates that the current + * audio level should be silent. + * + * @method Flash#setMuted + * @param {boolean} muted + * - True if the audio should be set to silent + * - False otherwise + */ + +/** + * Set the value of `defaultMuted` on the swf. `defaultMuted` indicates + * whether the media should start muted or not. Only changes the default state of the + * media. `muted` and `defaultMuted` can have different values. `muted` indicates the + * current state. + * + * @method Flash#setDefaultMuted + * @param {boolean} defaultMuted + * - True indicates that the media should start muted. + * - False indicates that the media should not start muted. + */ + /* Flash Support Testing -------------------------------------------------------- */ +/** + * Check if the Flash tech is currently supported. + * + * @return {boolean} + * - True if the flash tech is supported. + * - False otherwise. + */ Flash.isSupported = function () { return Flash.version()[0] >= 10; // return swfobject.hasFlashPlayerVersion('10'); @@ -12129,18 +14443,24 @@ Flash.isSupported = function () { _tech2['default'].withSourceHandlers(Flash); /* - * The default native source handler. - * This simply passes the source to the video element. Nothing fancy. + * Native source handler for flash, simply passes the source to the swf element. * - * @param {Object} source The source object - * @param {Flash} tech The instance of the Flash tech + * @property {Tech~SourceObject} source + * The source object + * + * @property {Flash} tech + * The instance of the Flash tech */ Flash.nativeSourceHandler = {}; /** - * Check if Flash can play the given videotype - * @param {String} type The mimetype to check - * @return {String} 'probably', 'maybe', or '' (empty string) + * Check if the Flash can play the given mime type. + * + * @param {string} type + * The mimetype to check + * + * @return {string} + * 'maybe', or '' (empty string) */ Flash.nativeSourceHandler.canPlayType = function (type) { if (type in Flash.formats) { @@ -12150,12 +14470,17 @@ Flash.nativeSourceHandler.canPlayType = function (type) { return ''; }; -/* - * Check Flash can handle the source natively +/** + * Check if the media element can handle a source natively. * - * @param {Object} source The source object - * @param {Object} options The options passed to the tech - * @return {String} 'probably', 'maybe', or '' (empty string) + * @param {Tech~SourceObject} source + * The source object + * + * @param {Object} [options] + * Options to be passed to the tech. + * + * @return {string} + * 'maybe', or '' (empty string). */ Flash.nativeSourceHandler.canHandleSource = function (source, options) { var type = void 0; @@ -12179,28 +14504,35 @@ Flash.nativeSourceHandler.canHandleSource = function (source, options) { return Flash.nativeSourceHandler.canPlayType(type); }; -/* - * Pass the source to the flash object - * Adaptive source handlers will have more complicated workflows before passing - * video data to the video element +/** + * Pass the source to the swf. * - * @param {Object} source The source object - * @param {Flash} tech The instance of the Flash tech - * @param {Object} options The options to pass to the source + * @param {Tech~SourceObject} source + * The source object + * + * @param {Flash} tech + * The instance of the Flash tech + * + * @param {Object} [options] + * The options to pass to the source */ Flash.nativeSourceHandler.handleSource = function (source, tech, options) { tech.setSrc(source.src); }; -/* - * Clean up the source handler when disposing the player or switching sources.. - * (no cleanup is needed when supporting the format natively) +/** + * noop for native source handler dispose, as cleanup will happen automatically. */ Flash.nativeSourceHandler.dispose = function () {}; // Register the native source handler Flash.registerSourceHandler(Flash.nativeSourceHandler); +/** + * Flash supported mime types. + * + * @constant {Object} + */ Flash.formats = { 'video/flv': 'FLV', 'video/x-flv': 'FLV', @@ -12208,6 +14540,10 @@ Flash.formats = { 'video/m4v': 'MP4' }; +/** + * Called when the the swf is "ready", and makes sure that the swf is really + * ready using {@link Flash#checkReady} + */ Flash.onReady = function (currSwf) { var el = Dom.getEl(currSwf); var tech = el && el.tech; @@ -12220,8 +14556,14 @@ Flash.onReady = function (currSwf) { } }; -// The SWF isn't always ready when it says it is. Sometimes the API functions still need to be added to the object. -// If it's not ready, we set a timeout to check again shortly. +/** + * The SWF isn't always ready when it says it is. Sometimes the API functions still + * need to be added to the object. If it's not ready, we set a timeout to check again + * shortly. + * + * @param {Flash} tech + * The instance of the flash tech to check. + */ Flash.checkReady = function (tech) { // stop worrying if the tech has been disposed if (!tech.el()) { @@ -12240,14 +14582,42 @@ Flash.checkReady = function (tech) { } }; -// Trigger events from the swf on the player +/** + * Trigger events from the swf on the Flash Tech. + * + * @param {number} swfID + * The id of the swf that had the event + * + * @param {string} eventName + * The name of the event to trigger + */ Flash.onEvent = function (swfID, eventName) { var tech = Dom.getEl(swfID).tech; + var args = Array.prototype.slice.call(arguments, 2); - tech.trigger(eventName, Array.prototype.slice.call(arguments, 2)); + // dispatch Flash events asynchronously for two reasons: + // - Flash swallows any exceptions generated by javascript it + // invokes + // - Flash is suspended until the javascript returns which may cause + // playback performance issues + tech.setTimeout(function () { + tech.trigger(eventName, args); + }, 1); }; -// Log errors from the swf +/** + * Log errors from the swf on the Flash tech. + * + * @param {number} swfID + * The id of the swf that had an error. + * + * @param {string} The error string + * The error to set on the Flash Tech. + * + * @return {MediaError|undefined} + * - Returns a MediaError when err is 'srcnotfound' + * - Returns undefined otherwise. + */ Flash.onError = function (swfID, err) { var tech = Dom.getEl(swfID).tech; @@ -12260,7 +14630,12 @@ Flash.onError = function (swfID, err) { tech.error('FLASH: ' + err); }; -// Flash Version Check +/** + * Get the current version of Flash that is in use on the page. + * + * @return {Array} + * an array of versions that are available. + */ Flash.version = function () { var version = '0,0,0'; @@ -12281,7 +14656,24 @@ Flash.version = function () { return version.split(','); }; -// Flash embedding method. Only used in non-iframe mode +/** + * Only use for non-iframe embeds. + * + * @param {Object} swf + * The videojs-swf object. + * + * @param {Object} flashVars + * Names and values to use as flash option variables. + * + * @param {Object} params + * Style parameters to set on the object. + * + * @param {Object} attributes + * Attributes to set on the element. + * + * @return {Element} + * The embeded Flash DOM element. + */ Flash.embed = function (swf, flashVars, params, attributes) { var code = Flash.getEmbedCode(swf, flashVars, params, attributes); @@ -12291,6 +14683,24 @@ Flash.embed = function (swf, flashVars, params, attributes) { return obj; }; +/** + * Only use for non-iframe embeds. + * + * @param {Object} swf + * The videojs-swf object. + * + * @param {Object} flashVars + * Names and values to use as flash option variables. + * + * @param {Object} params + * Style parameters to set on the object. + * + * @param {Object} attributes + * Attributes to set on the element. + * + * @return {Element} + * The embeded Flash DOM element. + */ Flash.getEmbedCode = function (swf, flashVars, params, attributes) { var objTag = ''; }); - attributes = (0, _object2['default'])({ + attributes = (0, _obj.assign)({ // Add swf to attributes (need both for IE and Others to work) data: swf, @@ -12344,13 +14754,11 @@ _component2['default'].registerComponent('Flash', Flash); _tech2['default'].registerTech('Flash', Flash); exports['default'] = Flash; -},{"136":136,"5":5,"58":58,"62":62,"80":80,"88":88,"90":90,"93":93}],60:[function(_dereq_,module,exports){ +},{"5":5,"58":58,"62":62,"81":81,"88":88,"90":90,"92":92,"95":95}],60:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - var _templateObject = _taggedTemplateLiteralLoose(['Text Tracks are being loaded from another origin but the crossorigin attribute isn\'t used.\n This may prevent text tracks from loading.'], ['Text Tracks are being loaded from another origin but the crossorigin attribute isn\'t used.\n This may prevent text tracks from loading.']); var _tech = _dereq_(62); @@ -12361,23 +14769,23 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _dom = _dereq_(80); +var _dom = _dereq_(81); var Dom = _interopRequireWildcard(_dom); -var _url = _dereq_(90); +var _url = _dereq_(92); var Url = _interopRequireWildcard(_url); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _log = _dereq_(85); +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); -var _tsml = _dereq_(146); +var _tsml = _dereq_(98); var _tsml2 = _interopRequireDefault(_tsml); @@ -12385,23 +14793,21 @@ var _browser = _dereq_(78); var browser = _interopRequireWildcard(_browser); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); -var _object = _dereq_(136); +var _obj = _dereq_(88); -var _object2 = _interopRequireDefault(_object); - -var _mergeOptions = _dereq_(86); +var _mergeOptions = _dereq_(87); var _mergeOptions2 = _interopRequireDefault(_mergeOptions); -var _toTitleCase = _dereq_(89); +var _toTitleCase = _dereq_(91); var _toTitleCase2 = _interopRequireDefault(_toTitleCase); @@ -12417,19 +14823,27 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * @file html5.js - * HTML5 Media Controller - Wrapper for HTML5 Media API */ + /** * HTML5 Media Controller - Wrapper for HTML5 Media API * - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function - * @class Html5 + * @mixes Tech~SouceHandlerAdditions + * @extends Tech */ var Html5 = function (_Tech) { _inherits(Html5, _Tech); + /** + * Create an instance of this Tech. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} ready + * Callback function to call when the `HTML5` Tech is ready. + */ function Html5(options, ready) { _classCallCheck(this, Html5); @@ -12502,6 +14916,7 @@ var Html5 = function (_Tech) { srcElement: techTracks }); }; + _this['handle' + capitalType + 'TrackAdd_'] = function (e) { return techTracks.addTrack(e.track); }; @@ -12548,7 +14963,7 @@ var Html5 = function (_Tech) { } /** - * Dispose of html5 media element + * Dispose of `HTML5` media element and remove all tracks. */ @@ -12578,9 +14993,10 @@ var Html5 = function (_Tech) { }; /** - * Create the component's DOM element + * Create the `Html5` Tech's DOM element. * * @return {Element} + * The element that gets created. */ @@ -12590,13 +15006,16 @@ var Html5 = function (_Tech) { // Check if this browser supports moving the element into the box. // On the iPhone video will break if you move the element, // So we have to create a brand new element. - if (!el || this.movingMediaElementInDOM === false) { + // If we ingested the player div, we do not need to move the media element. + if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) { // If the original tag is still there, clone and remove it. if (el) { var clone = el.cloneNode(true); - el.parentNode.insertBefore(clone, el); + if (el.parentNode) { + el.parentNode.insertBefore(clone, el); + } Html5.disposeMediaElement(el); el = clone; } else { @@ -12610,7 +15029,7 @@ var Html5 = function (_Tech) { delete attributes.controls; } - Dom.setElAttributes(el, (0, _object2['default'])(attributes, { + Dom.setElAttributes(el, (0, _obj.assign)(attributes, { id: this.options_.techId, 'class': 'vjs-tech' })); @@ -12633,18 +15052,24 @@ var Html5 = function (_Tech) { } return el; - // jenniisawesome = true; }; - // If we're loading the playback object after it has started loading - // or playing the video (often with autoplay on) then the loadstart event - // has already fired and we need to fire it manually because many things - // rely on it. + /** + * This will be triggered if the loadstart event has already fired, before videojs was + * ready. Two known examples of when this can happen are: + * 1. If we're loading the playback object after it has started loading + * 2. The media is already playing the (often with autoplay on) then + * + * This function will fire another loadstart so that videojs can catchup. + * + * @fires Tech#loadstart + * + * @return {undefined} + * returns nothing. + */ Html5.prototype.handleLateInit_ = function handleLateInit_(el) { - var _this3 = this; - if (el.networkState === 0 || el.networkState === 3) { // The video element hasn't started loading the source yet // or didn't find a source @@ -12652,50 +15077,44 @@ var Html5 = function (_Tech) { } if (el.readyState === 0) { - var _ret = function () { - // NetworkState is set synchronously BUT loadstart is fired at the - // end of the current stack, usually before setInterval(fn, 0). - // So at this point we know loadstart may have already fired or is - // about to fire, and either way the player hasn't seen it yet. - // We don't want to fire loadstart prematurely here and cause a - // double loadstart so we'll wait and see if it happens between now - // and the next loop, and fire it if not. - // HOWEVER, we also want to make sure it fires before loadedmetadata - // which could also happen between now and the next loop, so we'll - // watch for that also. - var loadstartFired = false; - var setLoadstartFired = function setLoadstartFired() { - loadstartFired = true; - }; + // NetworkState is set synchronously BUT loadstart is fired at the + // end of the current stack, usually before setInterval(fn, 0). + // So at this point we know loadstart may have already fired or is + // about to fire, and either way the player hasn't seen it yet. + // We don't want to fire loadstart prematurely here and cause a + // double loadstart so we'll wait and see if it happens between now + // and the next loop, and fire it if not. + // HOWEVER, we also want to make sure it fires before loadedmetadata + // which could also happen between now and the next loop, so we'll + // watch for that also. + var loadstartFired = false; + var setLoadstartFired = function setLoadstartFired() { + loadstartFired = true; + }; - _this3.on('loadstart', setLoadstartFired); + this.on('loadstart', setLoadstartFired); - var triggerLoadstart = function triggerLoadstart() { - // We did miss the original loadstart. Make sure the player - // sees loadstart before loadedmetadata - if (!loadstartFired) { - this.trigger('loadstart'); - } - }; + var triggerLoadstart = function triggerLoadstart() { + // We did miss the original loadstart. Make sure the player + // sees loadstart before loadedmetadata + if (!loadstartFired) { + this.trigger('loadstart'); + } + }; - _this3.on('loadedmetadata', triggerLoadstart); + this.on('loadedmetadata', triggerLoadstart); - _this3.ready(function () { - this.off('loadstart', setLoadstartFired); - this.off('loadedmetadata', triggerLoadstart); + this.ready(function () { + this.off('loadstart', setLoadstartFired); + this.off('loadedmetadata', triggerLoadstart); - if (!loadstartFired) { - // We did miss the original native loadstart. Fire it now. - this.trigger('loadstart'); - } - }); + if (!loadstartFired) { + // We did miss the original native loadstart. Fire it now. + this.trigger('loadstart'); + } + }); - return { - v: void 0 - }; - }(); - - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; + return; } // From here on we know that loadstart already fired and we missed it. @@ -12730,6 +15149,12 @@ var Html5 = function (_Tech) { }); }; + /** + * Add event listeners to native text track events. This adds the native text tracks + * to our emulated {@link TextTrackList}. + */ + + Html5.prototype.proxyNativeTextTracks_ = function proxyNativeTextTracks_() { var tt = this.el().textTracks; @@ -12751,6 +15176,16 @@ var Html5 = function (_Tech) { } }; + /** + * Handle any {@link TextTrackList} `change` event. + * + * @param {EventTarget~Event} e + * The `change` event that caused this to run. + * + * @listens TextTrackList#change + */ + + Html5.prototype.handleTextTrackChange = function handleTextTrackChange(e) { var tt = this.textTracks(); @@ -12762,25 +15197,50 @@ var Html5 = function (_Tech) { }); }; + /** + * Handle any {@link TextTrackList} `addtrack` event. + * + * @param {EventTarget~Event} e + * The `addtrack` event that caused this to run. + * + * @listens TextTrackList#addtrack + */ + + Html5.prototype.handleTextTrackAdd = function handleTextTrackAdd(e) { this.textTracks().addTrack_(e.track); }; + /** + * Handle any {@link TextTrackList} `removetrack` event. + * + * @param {EventTarget~Event} e + * The `removetrack` event that caused this to run. + * + * @listens TextTrackList#removetrack + */ + + Html5.prototype.handleTextTrackRemove = function handleTextTrackRemove(e) { this.textTracks().removeTrack_(e.track); }; /** - * This is a helper function that is used in removeOldTextTracks_, removeOldAudioTracks_ and - * removeOldVideoTracks_ - * @param {Track[]} techTracks Tracks for this tech - * @param {Track[]} elTracks Tracks for the HTML5 video element + * This function removes any {@link AudioTrack}s, {@link VideoTrack}s, or + * {@link TextTrack}s that are not in the media elements TrackList. + * + * @param {TrackList} techTracks + * HTML5 Tech's TrackList to search through + * + * @param {TrackList} elTracks + * HTML5 media elements TrackList to search trough. + * * @private */ Html5.prototype.removeOldTracks_ = function removeOldTracks_(techTracks, elTracks) { - // This will loop over the techTracks and check if they are still used by the HTML5 video element + // This will loop over the techTracks and check if they are still used by the HTML5 media element // If not, they will be removed from the emulated list var removeTracks = []; @@ -12805,13 +15265,21 @@ var Html5 = function (_Tech) { } for (var _i = 0; _i < removeTracks.length; _i++) { - var _track = removeTracks[_i]; + var track = removeTracks[_i]; - techTracks.removeTrack_(_track); + techTracks.removeTrack_(track); } }; - Html5.prototype.removeOldTextTracks_ = function removeOldTextTracks_() { + /** + * Remove {@link TextTrack}s that dont exist in the native track list from our + * emulated {@link TextTrackList}. + * + * @listens Tech#loadstart + */ + + + Html5.prototype.removeOldTextTracks_ = function removeOldTextTracks_(e) { var techTracks = this.textTracks(); var elTracks = this.el().textTracks; @@ -12819,7 +15287,7 @@ var Html5 = function (_Tech) { }; /** - * Play for html5 tech + * Called by {@link Player#play} to play using the `Html5` `Tech`. */ @@ -12834,9 +15302,10 @@ var Html5 = function (_Tech) { }; /** - * Set current time + * Set current time for the `HTML5` tech. * - * @param {Number} seconds Current time of video + * @param {number} seconds + * Set the current time of the media to this. */ @@ -12850,20 +15319,46 @@ var Html5 = function (_Tech) { }; /** - * Get duration + * Get the current duration of the HTML5 media element. * - * @return {Number} + * @return {number} + * The duration of the media or 0 if there is no duration. */ Html5.prototype.duration = function duration() { - return this.el_.duration || 0; + var _this3 = this; + + // Android Chrome will report duration as Infinity for VOD HLS until after + // playback has started, which triggers the live display erroneously. + // Return NaN if playback has not started and trigger a durationupdate once + // the duration can be reliably known. + if (this.el_.duration === Infinity && browser.IS_ANDROID && browser.IS_CHROME) { + if (this.el_.currentTime === 0) { + // Wait for the first `timeupdate` with currentTime > 0 - there may be + // several with 0 + var checkProgress = function checkProgress() { + if (_this3.el_.currentTime > 0) { + // Trigger durationchange for genuinely live video + if (_this3.el_.duration === Infinity) { + _this3.trigger('durationchange'); + } + _this3.off('timeupdate', checkProgress); + } + }; + + this.on('timeupdate', checkProgress); + return NaN; + } + } + return this.el_.duration || NaN; }; /** - * Get player width + * Get the current width of the HTML5 media element. * - * @return {Number} + * @return {number} + * The width of the HTML5 media element. */ @@ -12872,9 +15367,10 @@ var Html5 = function (_Tech) { }; /** - * Get player height + * Get the current height of the HTML5 media element. * - * @return {Number} + * @return {number} + * The heigth of the HTML5 media element. */ @@ -12884,10 +15380,13 @@ var Html5 = function (_Tech) { /** * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into - * `fullscreenchange` event + * `fullscreenchange` event. * * @private - * @method proxyWebkitFullscreen_ + * @fires fullscreenchange + * @listens webkitendfullscreen + * @listens webkitbeginfullscreen + * @listens webkitbeginfullscreen */ @@ -12916,9 +15415,11 @@ var Html5 = function (_Tech) { }; /** - * Get if there is fullscreen support + * Check if fullscreen is supported on the current playback device. * - * @return {Boolean} + * @return {boolean} + * - True if fullscreen is supported. + * - False if fullscreen is not supported. */ @@ -12935,7 +15436,7 @@ var Html5 = function (_Tech) { }; /** - * Request to enter fullscreen + * Request that the `HTML5` Tech enter fullscreen. */ @@ -12959,7 +15460,7 @@ var Html5 = function (_Tech) { }; /** - * Request to exit fullscreen + * Request that the `HTML5` Tech exit fullscreen. */ @@ -12968,10 +15469,17 @@ var Html5 = function (_Tech) { }; /** - * Get/set video + * A getter/setter for the `Html5` Tech's source object. + * > Note: Please use {@link Html5#setSource} * - * @param {Object=} src Source object - * @return {Object} + * @param {Tech~SourceObject} [src] + * The source object you want to set on the `HTML5` techs element. + * + * @return {Tech~SourceObject|undefined} + * - The current source object when a source is not passed in. + * - undefined when setting + * + * @deprecated Since version 5. */ @@ -12985,7 +15493,8 @@ var Html5 = function (_Tech) { }; /** - * Reset the tech. Removes all sources and calls `load`. + * Reset the tech by removing all sources and then calling + * {@link Html5.resetMediaElement}. */ @@ -12994,9 +15503,12 @@ var Html5 = function (_Tech) { }; /** - * Get current source + * Get the current source on the `HTML5` Tech. Falls back to returning the source from + * the HTML5 media element. * - * @return {Object} + * @return {Tech~SourceObject} + * The current source object from the HTML5 tech. With a fallback to the + * elements source. */ @@ -13008,9 +15520,10 @@ var Html5 = function (_Tech) { }; /** - * Set controls attribute + * Set controls attribute for the HTML5 media Element. * - * @param {String} val Value for controls attribute + * @param {string} val + * Value to set the controls attribute to */ @@ -13019,13 +15532,19 @@ var Html5 = function (_Tech) { }; /** - * Creates and returns a text track object + * Create and returns a remote {@link TextTrack} object. * - * @param {String} kind Text track kind (subtitles, captions, descriptions - * chapters and metadata) - * @param {String=} label Label to identify the text track - * @param {String=} language Two letter language abbreviation - * @return {TextTrackObject} + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @return {TextTrack} + * The TextTrack that gets created. */ @@ -13038,21 +15557,39 @@ var Html5 = function (_Tech) { }; /** - * Creates a remote text track object and returns a html track element + * Creates either native TextTrack or an emulated TextTrack depending + * on the value of `featuresNativeTextTracks` + * + * @param {Object} options + * The object should contain the options to intialize the TextTrack with. + * + * @param {string} [options.kind] + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata). + * + * @param {string} [options.label]. + * Label to identify the text track + * + * @param {string} [options.language] + * Two letter language abbreviation. + * + * @param {boolean} [options.default] + * Default this track to on. + * + * @param {string} [options.id] + * The internal id to assign this track. + * + * @param {string} [options.src] + * A source url for the track. * - * @param {Object} options The object should contain values for - * kind, language, label and src (location of the WebVTT file) * @return {HTMLTrackElement} + * The track element that gets created. */ - Html5.prototype.addRemoteTextTrack = function addRemoteTextTrack() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - + Html5.prototype.createRemoteTextTrack = function createRemoteTextTrack(options) { if (!this.featuresNativeTextTracks) { - return _Tech.prototype.addRemoteTextTrack.call(this, options); + return _Tech.prototype.createRemoteTextTrack.call(this, options); } - var htmlTrackElement = _document2['default'].createElement('track'); if (options.kind) { @@ -13074,40 +15611,53 @@ var Html5 = function (_Tech) { htmlTrackElement.src = options.src; } - this.el().appendChild(htmlTrackElement); + return htmlTrackElement; + }; - // store HTMLTrackElement and TextTrack to remote list - this.remoteTextTrackEls().addTrackElement_(htmlTrackElement); - this.remoteTextTracks().addTrack_(htmlTrackElement.track); + /** + * Creates a remote text track object and returns an html track element. + * + * @param {Object} options The object should contain values for + * kind, language, label, and src (location of the WebVTT file) + * @param {Boolean} [manualCleanup=true] if set to false, the TextTrack will be + * automatically removed from the video element whenever the source changes + * @return {HTMLTrackElement} An Html Track Element. + * This can be an emulated {@link HTMLTrackElement} or a native one. + * @deprecated The default value of the "manualCleanup" parameter will default + * to "false" in upcoming versions of Video.js + */ + + + Html5.prototype.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { + var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options, manualCleanup); + + if (this.featuresNativeTextTracks) { + this.el().appendChild(htmlTrackElement); + } return htmlTrackElement; }; /** - * Remove remote text track from TextTrackList object + * Remove remote `TextTrack` from `TextTrackList` object * - * @param {TextTrackObject} track Texttrack object to remove + * @param {TextTrack} track + * `TextTrack` object to remove */ Html5.prototype.removeRemoteTextTrack = function removeRemoteTextTrack(track) { - if (!this.featuresNativeTextTracks) { - return _Tech.prototype.removeRemoteTextTrack.call(this, track); - } + _Tech.prototype.removeRemoteTextTrack.call(this, track); - var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); + if (this.featuresNativeTextTracks) { + var tracks = this.$$('track'); - // remove HTMLTrackElement and TextTrack from remote list - this.remoteTextTrackEls().removeTrackElement_(trackElement); - this.remoteTextTracks().removeTrack_(track); + var i = tracks.length; - var tracks = this.$$('track'); - - var i = tracks.length; - - while (i--) { - if (track === tracks[i] || track === tracks[i].track) { - this.el().removeChild(tracks[i]); + while (i--) { + if (track === tracks[i] || track === tracks[i].track) { + this.el().removeChild(tracks[i]); + } } } }; @@ -13117,27 +15667,30 @@ var Html5 = function (_Tech) { /* HTML5 Support Testing ---------------------------------------------------- */ -/** - * Element for testing browser HTML5 video capabilities - * - * @type {Element} - * @constant - * @private - */ +if (Dom.isReal()) { + /** + * Element for testing browser HTML5 media capabilities + * + * @type {Element} + * @constant + * @private + */ + Html5.TEST_VID = _document2['default'].createElement('video'); + var track = _document2['default'].createElement('track'); -Html5.TEST_VID = _document2['default'].createElement('video'); -var track = _document2['default'].createElement('track'); - -track.kind = 'captions'; -track.srclang = 'en'; -track.label = 'English'; -Html5.TEST_VID.appendChild(track); + track.kind = 'captions'; + track.srclang = 'en'; + track.label = 'English'; + Html5.TEST_VID.appendChild(track); +} /** - * Check if HTML5 video is supported by this browser/device + * Check if HTML5 media is supported by this browser/device. * - * @return {Boolean} + * @return {boolean} + * - True if HTML5 media is supported. + * - False if HTML5 media is not supported. */ Html5.isSupported = function () { // IE9 with no Media Player is a LIAR! (#984) @@ -13147,7 +15700,7 @@ Html5.isSupported = function () { return false; } - return !!Html5.TEST_VID.canPlayType; + return !!(Html5.TEST_VID && Html5.TEST_VID.canPlayType); }; /** @@ -13155,7 +15708,9 @@ Html5.isSupported = function () { * Volume cannot be changed in a lot of mobile devices. * Specifically, it can't be changed from 1 on iOS. * - * @return {Boolean} + * @return {boolean} + * - True if volume can be controlled + * - False otherwise */ Html5.canControlVolume = function () { // IE will error if Windows Media Player not installed #3315 @@ -13170,9 +15725,11 @@ Html5.canControlVolume = function () { }; /** - * Check if playbackRate is supported in this browser/device. + * Check if the playback rate can be changed in this browser/device. * - * @return {Boolean} + * @return {boolean} + * - True if playback rate can be controlled + * - False otherwise */ Html5.canControlPlaybackRate = function () { // Playback rate API is implemented in Android Chrome, but doesn't do anything @@ -13192,52 +15749,36 @@ Html5.canControlPlaybackRate = function () { }; /** - * Check to see if native text tracks are supported by this browser/device + * Check to see if native `TextTrack`s are supported by this browser/device. * - * @return {Boolean} + * @return {boolean} + * - True if native `TextTrack`s are supported. + * - False otherwise */ Html5.supportsNativeTextTracks = function () { - var supportsTextTracks = void 0; - - // Figure out native text track support - // If mode is a number, we cannot change it because it'll disappear from view. - // Browsers with numeric modes include IE10 and older (<=2013) samsung android models. - // Firefox isn't playing nice either with modifying the mode - // TODO: Investigate firefox: https://github.com/videojs/video.js/issues/1862 - supportsTextTracks = !!Html5.TEST_VID.textTracks; - if (supportsTextTracks && Html5.TEST_VID.textTracks.length > 0) { - supportsTextTracks = typeof Html5.TEST_VID.textTracks[0].mode !== 'number'; - } - if (supportsTextTracks && browser.IS_FIREFOX) { - supportsTextTracks = false; - } - if (supportsTextTracks && !('onremovetrack' in Html5.TEST_VID.textTracks)) { - supportsTextTracks = false; - } - - return supportsTextTracks; + return browser.IS_ANY_SAFARI; }; /** - * Check to see if native video tracks are supported by this browser/device + * Check to see if native `VideoTrack`s are supported by this browser/device * - * @return {Boolean} + * @return {boolean} + * - True if native `VideoTrack`s are supported. + * - False otherwise */ Html5.supportsNativeVideoTracks = function () { - var supportsVideoTracks = !!Html5.TEST_VID.videoTracks; - - return supportsVideoTracks; + return !!(Html5.TEST_VID && Html5.TEST_VID.videoTracks); }; /** - * Check to see if native audio tracks are supported by this browser/device + * Check to see if native `AudioTrack`s are supported by this browser/device * - * @return {Boolean} + * @return {boolean} + * - True if native `AudioTrack`s are supported. + * - False otherwise */ Html5.supportsNativeAudioTracks = function () { - var supportsAudioTracks = !!Html5.TEST_VID.audioTracks; - - return supportsAudioTracks; + return !!(Html5.TEST_VID && Html5.TEST_VID.audioTracks); }; /** @@ -13249,93 +15790,104 @@ Html5.supportsNativeAudioTracks = function () { Html5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'volumechange']; /** - * Set the tech's volume control support status + * Boolean indicating whether the `Tech` supports volume control. * - * @type {Boolean} + * @type {boolean} + * @default {@link Html5.canControlVolume} */ Html5.prototype.featuresVolumeControl = Html5.canControlVolume(); /** - * Set the tech's playbackRate support status + * Boolean indicating whether the `Tech` supports changing the speed at which the media + * plays. Examples: + * - Set player to play 2x (twice) as fast + * - Set player to play 0.5x (half) as fast * - * @type {Boolean} + * @type {boolean} + * @default {@link Html5.canControlPlaybackRate} */ Html5.prototype.featuresPlaybackRate = Html5.canControlPlaybackRate(); /** - * Set the tech's status on moving the video element. - * In iOS, if you move a video element in the DOM, it breaks video playback. + * Boolean indicating whether the `HTML5` tech currently supports the media element + * moving in the DOM. iOS breaks if you move the media element, so this is set this to + * false there. Everywhere else this should be true. * - * @type {Boolean} + * @type {boolean} + * @default */ Html5.prototype.movingMediaElementInDOM = !browser.IS_IOS; +// TODO: Previous comment: No longer appears to be used. Can probably be removed. +// Is this true? /** - * Set the the tech's fullscreen resize support status. - * HTML video is able to automatically resize when going to fullscreen. - * (No longer appears to be used. Can probably be removed.) + * Boolean indicating whether the `HTML5` tech currently supports automatic media resize + * when going into fullscreen. + * + * @type {boolean} + * @default */ Html5.prototype.featuresFullscreenResize = true; /** - * Set the tech's progress event support status - * (this disables the manual progress events of the Tech) + * Boolean indicating whether the `HTML5` tech currently supports the progress event. + * If this is false, manual `progress` events will be triggred instead. + * + * @type {boolean} + * @default */ Html5.prototype.featuresProgressEvents = true; /** - * Set the tech's timeupdate event support status - * (this disables the manual timeupdate events of the Tech) + * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event. + * If this is false, manual `timeupdate` events will be triggred instead. + * + * @default */ Html5.prototype.featuresTimeupdateEvents = true; /** - * Sets the tech's status on native text track support + * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s. * - * @type {Boolean} + * @type {boolean} + * @default {@link Html5.supportsNativeTextTracks} */ Html5.prototype.featuresNativeTextTracks = Html5.supportsNativeTextTracks(); /** - * Sets the tech's status on native text track support + * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s. * - * @type {Boolean} + * @type {boolean} + * @default {@link Html5.supportsNativeVideoTracks} */ Html5.prototype.featuresNativeVideoTracks = Html5.supportsNativeVideoTracks(); /** - * Sets the tech's status on native audio track support + * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s. * - * @type {Boolean} + * @type {boolean} + * @default {@link Html5.supportsNativeAudioTracks} */ Html5.prototype.featuresNativeAudioTracks = Html5.supportsNativeAudioTracks(); // HTML5 Feature detection and Device Fixes --------------------------------- // -var canPlayType = void 0; +var canPlayType = Html5.TEST_VID && Html5.TEST_VID.constructor.prototype.canPlayType; var mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i; var mp4RE = /^video\/mp4/i; Html5.patchCanPlayType = function () { + // Android 4.0 and above can play HLS to some extent but it reports being unable to do so if (browser.ANDROID_VERSION >= 4.0 && !browser.IS_FIREFOX) { - if (!canPlayType) { - canPlayType = Html5.TEST_VID.constructor.prototype.canPlayType; - } - Html5.TEST_VID.constructor.prototype.canPlayType = function (type) { if (type && mpegurlRE.test(type)) { return 'maybe'; } return canPlayType.call(this, type); }; - } - - // Override Android 2.2 and less canPlayType method which is broken - if (browser.IS_OLD_ANDROID) { - if (!canPlayType) { - canPlayType = Html5.TEST_VID.constructor.prototype.canPlayType; - } + // Override Android 2.2 and less canPlayType method which is broken + } else if (browser.IS_OLD_ANDROID) { Html5.TEST_VID.constructor.prototype.canPlayType = function (type) { if (type && mp4RE.test(type)) { return 'maybe'; @@ -13349,11 +15901,10 @@ Html5.unpatchCanPlayType = function () { var r = Html5.TEST_VID.constructor.prototype.canPlayType; Html5.TEST_VID.constructor.prototype.canPlayType = canPlayType; - canPlayType = null; return r; }; -// by default, patch the video element +// by default, patch the media element Html5.patchCanPlayType(); Html5.disposeMediaElement = function (el) { @@ -13420,172 +15971,304 @@ Html5.resetMediaElement = function (el) { // Wrap native properties with a getter [ /** - * Paused for html5 tech + * Get the value of `paused` from the media element. `paused` indicates whether the media element + * is currently paused or not. * - * @method Html5.prototype.paused - * @return {Boolean} + * @method Html5#paused + * @return {boolean} + * The value of `paused` from the media element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused} */ 'paused', + /** - * Get current time + * Get the value of `currentTime` from the media element. `currentTime` indicates + * the current second that the media is at in playback. * - * @method Html5.prototype.currentTime - * @return {Number} + * @method Html5#currentTime + * @return {number} + * The value of `currentTime` from the media element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime} */ 'currentTime', + /** - * Get a TimeRange object that represents the intersection - * of the time ranges for which the user agent has all - * relevant media + * Get the value of `buffered` from the media element. `buffered` is a `TimeRange` + * object that represents the parts of the media that are already downloaded and + * available for playback. * - * @return {TimeRangeObject} - * @method Html5.prototype.buffered + * @method Html5#buffered + * @return {TimeRange} + * The value of `buffered` from the media element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered} */ 'buffered', + /** - * Get volume level + * Get the value of `volume` from the media element. `volume` indicates + * the current playback volume of audio for a media. `volume` will be a value from 0 + * (silent) to 1 (loudest and default). * - * @return {Number} - * @method Html5.prototype.volume + * @method Html5#volume + * @return {number} + * The value of `volume` from the media element. Value will be between 0-1. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume} */ 'volume', + /** - * Get if muted + * Get the value of `muted` from the media element. `muted` indicates + * that the volume for the media should be set to silent. This does not actually change + * the `volume` attribute. * - * @return {Boolean} - * @method Html5.prototype.muted + * @method Html5#muted + * @return {boolean} + * - True if the value of `volume` should be ignored and the audio set to silent. + * - False if the value of `volume` should be used. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted} */ 'muted', + /** - * Get poster + * Get the value of `poster` from the media element. `poster` indicates + * that the url of an image file that can/will be shown when no media data is available. * - * @return {String} - * @method Html5.prototype.poster + * @method Html5#poster + * @return {string} + * The value of `poster` from the media element. Value will be a url to an + * image. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster} */ 'poster', + /** - * Get preload attribute + * Get the value of `preload` from the media element. `preload` indicates + * what should download before the media is interacted with. It can have the following + * values: + * - none: nothing should be downloaded + * - metadata: poster and the first few frames of the media may be downloaded to get + * media dimensions and other metadata + * - auto: allow the media and metadata for the media to be downloaded before + * interaction * - * @return {String} - * @method Html5.prototype.preload + * @method Html5#preload + * @return {string} + * The value of `preload` from the media element. Will be 'none', 'metadata', + * or 'auto'. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload} */ 'preload', + /** - * Get autoplay attribute + * Get the value of `autoplay` from the media element. `autoplay` indicates + * that the media should start to play as soon as the page is ready. * - * @return {String} - * @method Html5.prototype.autoplay + * @method Html5#autoplay + * @return {boolean} + * - The value of `autoplay` from the media element. + * - True indicates that the media should start as soon as the page loads. + * - False indicates that the media should not start as soon as the page loads. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay} */ 'autoplay', + /** - * Get controls attribute + * Get the value of `controls` from the media element. `controls` indicates + * whether the native media controls should be shown or hidden. * - * @return {String} - * @method Html5.prototype.controls + * @method Html5#controls + * @return {boolean} + * - The value of `controls` from the media element. + * - True indicates that native controls should be showing. + * - False indicates that native controls should be hidden. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls} */ 'controls', + /** - * Get loop attribute + * Get the value of `loop` from the media element. `loop` indicates + * that the media should return to the start of the media and continue playing once + * it reaches the end. * - * @return {String} - * @method Html5.prototype.loop + * @method Html5#loop + * @return {boolean} + * - The value of `loop` from the media element. + * - True indicates that playback should seek back to start once + * the end of a media is reached. + * - False indicates that playback should not loop back to the start when the + * end of the media is reached. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop} */ 'loop', + /** - * Get error value + * Get the value of the `error` from the media element. `error` indicates any + * MediaError that may have occured during playback. If error returns null there is no + * current error. * - * @return {String} - * @method Html5.prototype.error + * @method Html5#error + * @return {MediaError|null} + * The value of `error` from the media element. Will be `MediaError` if there + * is a current error and null otherwise. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error} */ 'error', + /** - * Get whether or not the player is in the "seeking" state + * Get the value of `seeking` from the media element. `seeking` indicates whether the + * media is currently seeking to a new position or not. * - * @return {Boolean} - * @method Html5.prototype.seeking + * @method Html5#seeking + * @return {boolean} + * - The value of `seeking` from the media element. + * - True indicates that the media is currently seeking to a new position. + * - Flase indicates that the media is not seeking to a new position at this time. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking} */ 'seeking', + /** - * Get a TimeRanges object that represents the - * ranges of the media resource to which it is possible - * for the user agent to seek. + * Get the value of `seekable` from the media element. `seekable` returns a + * `TimeRange` object indicating ranges of time that can currently be `seeked` to. * - * @return {TimeRangeObject} - * @method Html5.prototype.seekable + * @method Html5#seekable + * @return {TimeRange} + * The value of `seekable` from the media element. A `TimeRange` object + * indicating the current ranges of time that can be seeked to. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable} */ 'seekable', + /** - * Get if video ended + * Get the value of `ended` from the media element. `ended` indicates whether + * the media has reached the end or not. * - * @return {Boolean} - * @method Html5.prototype.ended + * @method Html5#ended + * @return {boolean} + * - The value of `ended` from the media element. + * - True indicates that the media has ended. + * - False indicates that the media has not ended. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended} */ 'ended', + /** - * Get the value of the muted content attribute - * This attribute has no dynamic effect, it only - * controls the default state of the element + * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates + * whether the media should start muted or not. Only changes the default state of the + * media. `muted` and `defaultMuted` can have different values. `muted` indicates the + * current state. * - * @return {Boolean} - * @method Html5.prototype.defaultMuted + * @method Html5#defaultMuted + * @return {boolean} + * - The value of `defaultMuted` from the media element. + * - True indicates that the media should start muted. + * - False indicates that the media should not start muted + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted} */ 'defaultMuted', + /** - * Get desired speed at which the media resource is to play + * Get the value of `playbackRate` from the media element. `playbackRate` indicates + * the rate at which the media is currently playing back. Examples: + * - if playbackRate is set to 2, media will play twice as fast. + * - if playbackRate is set to 0.5, media will play half as fast. * - * @return {Number} - * @method Html5.prototype.playbackRate + * @method Html5#playbackRate + * @return {number} + * The value of `playbackRate` from the media element. A number indicating + * the current playback speed of the media, where 1 is normal speed. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate} */ 'playbackRate', + /** - * Returns a TimeRanges object that represents the ranges of the - * media resource that the user agent has played. - * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-played + * Get the value of `played` from the media element. `played` returns a `TimeRange` + * object representing points in the media timeline that have been played. * - * @return {TimeRangeObject} the range of points on the media - * timeline that has been reached through - * normal playback - * @method Html5.prototype.played + * @method Html5#played + * @return {TimeRange} + * The value of `played` from the media element. A `TimeRange` object indicating + * the ranges of time that have been played. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played} */ 'played', + /** - * Get the current state of network activity for the element, from - * the list below - * - NETWORK_EMPTY (numeric value 0) - * - NETWORK_IDLE (numeric value 1) - * - NETWORK_LOADING (numeric value 2) - * - NETWORK_NO_SOURCE (numeric value 3) + * Get the value of `networkState` from the media element. `networkState` indicates + * the current network state. It returns an enumeration from the following list: + * - 0: NETWORK_EMPTY + * - 1: NEWORK_IDLE + * - 2: NETWORK_LOADING + * - 3: NETWORK_NO_SOURCE * - * @return {Number} - * @method Html5.prototype.networkState + * @method Html5#networkState + * @return {number} + * The value of `networkState` from the media element. This will be a number + * from the list in the description. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate} */ 'networkState', + /** - * Get a value that expresses the current state of the element - * with respect to rendering the current playback position, from - * the codes in the list below - * - HAVE_NOTHING (numeric value 0) - * - HAVE_METADATA (numeric value 1) - * - HAVE_CURRENT_DATA (numeric value 2) - * - HAVE_FUTURE_DATA (numeric value 3) - * - HAVE_ENOUGH_DATA (numeric value 4) + * Get the value of `readyState` from the media element. `readyState` indicates + * the current state of the media element. It returns an enumeration from the + * following list: + * - 0: HAVE_NOTHING + * - 1: HAVE_METADATA + * - 2: HAVE_CURRENT_DATA + * - 3: HAVE_FUTURE_DATA + * - 4: HAVE_ENOUGH_DATA * - * @return {Number} - * @method Html5.prototype.readyState + * @method Html5#readyState + * @return {number} + * The value of `readyState` from the media element. This will be a number + * from the list in the description. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states} */ 'readyState', + /** - * Get width of video + * Get the value of `videoWidth` from the video element. `videoWidth` indicates + * the current width of the video in css pixels. * - * @return {Number} - * @method Html5.prototype.videoWidth + * @method Html5#videoWidth + * @return {number} + * The value of `videoWidth` from the video element. This will be a number + * in css pixels. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth} */ 'videoWidth', + /** - * Get height of video + * Get the value of `videoHeight` from the video element. `videoHeigth` indicates + * the current height of the video in css pixels. * - * @return {Number} - * @method Html5.prototype.videoHeight + * @method Html5#videoHeight + * @return {number} + * The value of `videoHeight` from the video element. This will be a number + * in css pixels. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth} */ 'videoHeight'].forEach(function (prop) { Html5.prototype[prop] = function () { @@ -13597,60 +16280,116 @@ Html5.resetMediaElement = function (el) { // set + toTitleCase(name) [ /** - * Set volume level + * Set the value of `volume` on the media element. `volume` indicates the current + * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and + * so on. * - * @param {Number} percentAsDecimal Volume percent as a decimal - * @method Html5.prototype.setVolume + * @method Html5#setVolume + * @param {number} percentAsDecimal + * The volume percent as a decimal. Valid range is from 0-1. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume} */ 'volume', + /** - * Set muted + * Set the value of `muted` on the media element. `muted` indicates the current + * audio level should be silent. * - * @param {Boolean} muted If player is to be muted or note - * @method Html5.prototype.setMuted + * @method Html5#setMuted + * @param {boolean} muted + * - True if the audio should be set to silent + * - False otherwise + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted} */ 'muted', + /** - * Set video source + * Set the value of `src` on the media element. `src` indicates the current + * {@link Tech~SourceObject} for the media. * - * @param {Object} src Source object - * @deprecated since version 5 - * @method Html5.prototype.setSrc + * @method Html5#setSrc + * @param {Tech~SourceObject} src + * The source object to set as the current source. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src} */ 'src', + /** - * Set poster + * Set the value of `poster` on the media element. `poster` is the url to + * an image file that can/will be shown when no media data is available. * - * @param {String} val URL to poster image - * @method Html5.prototype.setPoster + * @method Html5#setPoster + * @param {string} poster + * The url to an image that should be used as the `poster` for the media + * element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster} */ 'poster', + /** - * Set preload attribute + * Set the value of `preload` on the media element. `preload` indicates + * what should download before the media is interacted with. It can have the following + * values: + * - none: nothing should be downloaded + * - metadata: poster and the first few frames of the media may be downloaded to get + * media dimensions and other metadata + * - auto: allow the media and metadata for the media to be downloaded before + * interaction * - * @param {String} val Value for the preload attribute - * @method Htm5.prototype.setPreload + * @method Html5#setPreload + * @param {string} preload + * The value of `preload` to set on the media element. Must be 'none', 'metadata', + * or 'auto'. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload} */ 'preload', + /** - * Set autoplay attribute + * Set the value of `autoplay` on the media element. `autoplay` indicates + * that the media should start to play as soon as the page is ready. * - * @param {Boolean} autoplay Value for the autoplay attribute - * @method setAutoplay + * @method Html5#setAutoplay + * @param {boolean} autoplay + * - True indicates that the media should start as soon as the page loads. + * - False indicates that the media should not start as soon as the page loads. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay} */ 'autoplay', + /** - * Set loop attribute + * Set the value of `loop` on the media element. `loop` indicates + * that the media should return to the start of the media and continue playing once + * it reaches the end. * - * @param {Boolean} loop Value for the loop attribute - * @method Html5.prototype.setLoop + * @method Html5#setLoop + * @param {boolean} loop + * - True indicates that playback should seek back to start once + * the end of a media is reached. + * - False indicates that playback should not loop back to the start when the + * end of the media is reached. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop} */ 'loop', + /** - * Set desired speed at which the media resource is to play + * Set the value of `playbackRate` on the media element. `playbackRate` indicates + * the rate at which the media should play back. Examples: + * - if playbackRate is set to 2, media will play twice as fast. + * - if playbackRate is set to 0.5, media will play half as fast. * - * @param {Number} val Speed at which the media resource is to play - * @method Html5.prototype.setPlaybackRate + * @method Html5#setPlaybackRate + * @return {number} + * The value of `playbackRate` from the media element. A number indicating + * the current playback speed of the media, where 1 is normal speed. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate} */ 'playbackRate'].forEach(function (prop) { Html5.prototype['set' + (0, _toTitleCase2['default'])(prop)] = function (v) { @@ -13661,15 +16400,20 @@ Html5.resetMediaElement = function (el) { // wrap native functions with a function [ /** - * Pause for html5 tech + * A wrapper around the media elements `pause` function. This will call the `HTML5` + * media elements `pause` function. * - * @method Html5.prototype.pause + * @method Html5#pause + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause} */ 'pause', + /** - * Load media into player + * A wrapper around the media elements `load` function. This will call the `HTML5`s + * media element `load` function. * - * @method Html5.prototype.load + * @method Html5#load + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load} */ 'load'].forEach(function (prop) { Html5.prototype[prop] = function () { @@ -13677,23 +16421,27 @@ Html5.resetMediaElement = function (el) { }; }); -// Add Source Handler pattern functions to this tech _tech2['default'].withSourceHandlers(Html5); /** - * The default native source handler. - * This simply passes the source to the video element. Nothing fancy. + * Native source handler for Html5, simply passes the source to the media element. * - * @param {Object} source The source object - * @param {Html5} tech The instance of the HTML5 tech + * @proprety {Tech~SourceObject} source + * The source object + * + * @proprety {Html5} tech + * The instance of the HTML5 tech. */ Html5.nativeSourceHandler = {}; /** - * Check if the video element can play the given videotype + * Check if the media element can play the given mime type. * - * @param {String} type The mimetype to check - * @return {String} 'probably', 'maybe', or '' (empty string) + * @param {string} type + * The mimetype to check + * + * @return {string} + * 'probably', 'maybe', or '' (empty string) */ Html5.nativeSourceHandler.canPlayType = function (type) { // IE9 on Windows 7 without MediaPlayer throws an error here @@ -13706,11 +16454,16 @@ Html5.nativeSourceHandler.canPlayType = function (type) { }; /** - * Check if the video element can handle the source natively + * Check if the media element can handle a source natively. * - * @param {Object} source The source object - * @param {Object} options The options passed to the tech - * @return {String} 'probably', 'maybe', or '' (empty string) + * @param {Tech~SourceObject} source + * The source object + * + * @param {Object} [options] + * Options to be passed to the tech. + * + * @return {string} + * 'probably', 'maybe', or '' (empty string). */ Html5.nativeSourceHandler.canHandleSource = function (source, options) { @@ -13729,21 +16482,23 @@ Html5.nativeSourceHandler.canHandleSource = function (source, options) { }; /** - * Pass the source to the video element - * Adaptive source handlers will have more complicated workflows before passing - * video data to the video element + * Pass the source to the native media element. * - * @param {Object} source The source object - * @param {Html5} tech The instance of the Html5 tech - * @param {Object} options The options to pass to the source + * @param {Tech~SourceObject} source + * The source object + * + * @param {Html5} tech + * The instance of the Html5 tech + * + * @param {Object} [options] + * The options to pass to the source */ Html5.nativeSourceHandler.handleSource = function (source, tech, options) { tech.setSrc(source.src); }; -/* - * Clean up the source handler when disposing the player or switching sources.. - * (no cleanup is needed when supporting the format natively) +/** + * A noop for the native dispose function, as cleanup is not needed. */ Html5.nativeSourceHandler.dispose = function () {}; @@ -13754,7 +16509,7 @@ _component2['default'].registerComponent('Html5', Html5); _tech2['default'].registerTech('Html5', Html5); exports['default'] = Html5; -},{"136":136,"146":146,"5":5,"62":62,"78":78,"80":80,"82":82,"85":85,"86":86,"89":89,"90":90,"92":92,"93":93}],61:[function(_dereq_,module,exports){ +},{"5":5,"62":62,"78":78,"81":81,"83":83,"86":86,"87":87,"88":88,"91":91,"92":92,"94":94,"95":95,"98":98}],61:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -13767,7 +16522,7 @@ var _tech = _dereq_(62); var _tech2 = _interopRequireDefault(_tech); -var _toTitleCase = _dereq_(89); +var _toTitleCase = _dereq_(91); var _toTitleCase2 = _interopRequireDefault(_toTitleCase); @@ -13783,18 +16538,26 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * The Media Loader is the component that decides which playback technology to load - * when the player is initialized. + * The `MediaLoader` is the `Component` that decides which playback technology to load + * when a player is initialized. * - * @param {Object} player Main Player - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function * @extends Component - * @class MediaLoader */ var MediaLoader = function (_Component) { _inherits(MediaLoader, _Component); + /** + * Create an instance of this class. + * + * @param {Player} player + * The `Player` that this class should attach to. + * + * @param {Object} [options] + * The key/value stroe of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function that is run when this component is ready. + */ function MediaLoader(player, options, ready) { _classCallCheck(this, MediaLoader); @@ -13836,7 +16599,7 @@ var MediaLoader = function (_Component) { _component2['default'].registerComponent('MediaLoader', MediaLoader); exports['default'] = MediaLoader; -},{"5":5,"62":62,"89":89}],62:[function(_dereq_,module,exports){ +},{"5":5,"62":62,"91":91}],62:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -13853,7 +16616,7 @@ var _htmlTrackElementList = _dereq_(65); var _htmlTrackElementList2 = _interopRequireDefault(_htmlTrackElementList); -var _mergeOptions = _dereq_(86); +var _mergeOptions = _dereq_(87); var _mergeOptions2 = _interopRequireDefault(_mergeOptions); @@ -13873,15 +16636,15 @@ var _audioTrackList = _dereq_(63); var _audioTrackList2 = _interopRequireDefault(_audioTrackList); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _log = _dereq_(85); +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); -var _timeRanges = _dereq_(88); +var _timeRanges = _dereq_(90); var _buffer = _dereq_(79); @@ -13889,14 +16652,16 @@ var _mediaError = _dereq_(46); var _mediaError2 = _interopRequireDefault(_mediaError); -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); +var _obj = _dereq_(88); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } @@ -13907,10 +16672,44 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * @file tech.js - * Media Technology Controller - Base class for media playback - * technology controllers like Flash and HTML5 */ +/** + * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string + * that just contains the src url alone. + * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};` + * `var SourceString = 'http://example.com/some-video.mp4';` + * + * @typedef {Object|string} Tech~SourceObject + * + * @property {string} src + * The url to the source + * + * @property {string} type + * The mime type of the source + */ + +/** + * A function used by {@link Tech} to create a new {@link TextTrack}. + * + * @param {Tech} self + * An instance of the Tech class. + * + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @param {Object} [options={}] + * An object with additional text track options + * + * @return {TextTrack} + * The text track that was created. + */ function createTrackHelper(self, kind, label, language) { var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; @@ -13934,17 +16733,24 @@ function createTrackHelper(self, kind, label, language) { } /** - * Base class for media (HTML5 Video, Flash) controllers + * This is the base class for media playback technology controllers, such as + * {@link Flash} and {@link HTML5} * - * @param {Object=} options Options object - * @param {Function=} ready Ready callback function * @extends Component - * @class Tech */ var Tech = function (_Component) { _inherits(Tech, _Component); + /** + * Create an instance of this Tech. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} ready + * Callback function to call when the `HTML5` Tech is ready. + */ function Tech() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var ready = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; @@ -13981,30 +16787,43 @@ var Tech = function (_Component) { _this.manualTimeUpdatesOn(); } - if (options.nativeCaptions === false || options.nativeTextTracks === false) { + ['Text', 'Audio', 'Video'].forEach(function (track) { + if (options['native' + track + 'Tracks'] === false) { + _this['featuresNative' + track + 'Tracks'] = false; + } + }); + + if (options.nativeCaptions === false) { _this.featuresNativeTextTracks = false; } if (!_this.featuresNativeTextTracks) { - _this.on('ready', _this.emulateTextTracks); + _this.emulateTextTracks(); } + _this.autoRemoteTextTracks_ = new _textTrackList2['default'](); + _this.initTextTrackListeners(); _this.initTrackListeners(); - // Turn on component tap events - _this.emitTapEvents(); + // Turn on component tap events only if not using native controls + if (!options.nativeControlsForTouch) { + _this.emitTapEvents(); + } + + if (_this.constructor) { + _this.name_ = _this.constructor.name || 'Unknown Tech'; + } return _this; } /* Fallbacks for unsupported event types ================================================================================ */ - // Manually trigger progress events based on changes to the buffered amount - // Many flash players and older HTML5 browsers don't send progress or progress-like events + /** - * Turn on progress events + * Polyfill the `progress` event for browsers that don't support it natively. * - * @method manualProgressOn + * @see {@link Tech#trackProgress} */ @@ -14018,9 +16837,8 @@ var Tech = function (_Component) { }; /** - * Turn off progress events - * - * @method manualProgressOff + * Turn off the polyfill for `progress` events that was created in + * {@link Tech#manualProgressOn} */ @@ -14032,13 +16850,21 @@ var Tech = function (_Component) { }; /** - * Track progress + * This is used to trigger a `progress` event when the buffered percent changes. It + * sets an interval function that will be called every 500 milliseconds to check if the + * buffer end percent has changed. * - * @method trackProgress + * > This function is called by {@link Tech#manualProgressOn} + * + * @param {EventTarget~Event} event + * The `ready` event that caused this to run. + * + * @listens Tech#ready + * @fires Tech#progress */ - Tech.prototype.trackProgress = function trackProgress() { + Tech.prototype.trackProgress = function trackProgress(event) { this.stopTrackingProgress(); this.progressInterval = this.setInterval(Fn.bind(this, function () { // Don't trigger unless buffered amount is greater than last time @@ -14046,6 +16872,12 @@ var Tech = function (_Component) { var numBufferedPercent = this.bufferedPercent(); if (this.bufferedPercent_ !== numBufferedPercent) { + /** + * See {@link Player#progress} + * + * @event Tech#progress + * @type {EventTarget~Event} + */ this.trigger('progress'); } @@ -14058,21 +16890,25 @@ var Tech = function (_Component) { }; /** - * Update duration + * Update our internal duration on a `durationchange` event by calling + * {@link Tech#duration}. * - * @method onDurationChange + * @param {EventTarget~Event} event + * The `durationchange` event that caused this to run. + * + * @listens Tech#durationchange */ - Tech.prototype.onDurationChange = function onDurationChange() { + Tech.prototype.onDurationChange = function onDurationChange(event) { this.duration_ = this.duration(); }; /** - * Create and get TimeRange object for buffering + * Get and create a `TimeRange` object for buffering. * - * @return {TimeRangeObject} - * @method buffered + * @return {TimeRange} + * The time range object that was created. */ @@ -14081,10 +16917,12 @@ var Tech = function (_Component) { }; /** - * Get buffered percent + * Get the percentage of the current video that is currently buffered. + * + * @return {number} + * A number from 0 to 1 that represents the decimal percentage of the + * video that is buffered. * - * @return {Number} - * @method bufferedPercent */ @@ -14093,9 +16931,10 @@ var Tech = function (_Component) { }; /** - * Stops tracking progress by clearing progress interval - * - * @method stopTrackingProgress + * Turn off the polyfill for `progress` events that was created in + * {@link Tech#manualProgressOn} + * Stop manually tracking progress events by clearing the interval that was set in + * {@link Tech#trackProgress}. */ @@ -14104,9 +16943,9 @@ var Tech = function (_Component) { }; /** - * Set event listeners for on play and pause and tracking current time + * Polyfill the `timeupdate` event for browsers that don't support it. * - * @method manualTimeUpdatesOn + * @see {@link Tech#trackCurrentTime} */ @@ -14118,9 +16957,8 @@ var Tech = function (_Component) { }; /** - * Remove event listeners for on play and pause and tracking current time - * - * @method manualTimeUpdatesOff + * Turn off the polyfill for `timeupdate` events that was created in + * {@link Tech#manualTimeUpdatesOn} */ @@ -14132,9 +16970,11 @@ var Tech = function (_Component) { }; /** - * Tracks current time + * Sets up an interval function to track current time and trigger `timeupdate` every + * 250 milliseconds. * - * @method trackCurrentTime + * @listens Tech#play + * @triggers Tech#timeupdate */ @@ -14143,6 +16983,12 @@ var Tech = function (_Component) { this.stopTrackingCurrentTime(); } this.currentTimeInterval = this.setInterval(function () { + /** + * Triggered at an interval of 250ms to indicated that time is passing in the video. + * + * @event Tech#timeupdate + * @type {EventTarget~Event} + */ this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15 @@ -14150,9 +16996,10 @@ var Tech = function (_Component) { }; /** - * Turn off play progress tracking (when paused or dragging) + * Stop the interval function created in {@link Tech#trackCurrentTime} so that the + * `timeupdate` event is no longer triggered. * - * @method stopTrackingCurrentTime + * @listens {Tech#pause} */ @@ -14165,9 +17012,10 @@ var Tech = function (_Component) { }; /** - * Turn off any manual progress or timeupdate tracking + * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList}, + * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech. * - * @method dispose + * @fires Component#dispose */ @@ -14189,15 +17037,14 @@ var Tech = function (_Component) { }; /** - * clear out a track list, or multiple track lists + * Clear out a single `TrackList` or an array of `TrackLists` given their names. * - * Note: Techs without source handlers should call this between - * sources for video & audio tracks, as usually you don't want - * to use them between tracks and we have no automatic way to do - * it for you + * > Note: Techs without source handlers should call this between sources for `video` + * & `audio` tracks. You don't want to use them between tracks! * - * @method clearTracks - * @param {Array|String} types type(s) of track lists to empty + * @param {string[]|string} types + * TrackList names to clear, valid names are `video`, `audio`, and + * `text`. */ @@ -14222,22 +17069,39 @@ var Tech = function (_Component) { }; /** - * Reset the tech. Removes all sources and resets readyState. + * Remove any TextTracks added via addRemoteTextTrack that are + * flagged for automatic garbage collection + */ + + + Tech.prototype.cleanupAutoTextTracks = function cleanupAutoTextTracks() { + var list = this.autoRemoteTextTracks_ || []; + var i = list.length; + + while (i--) { + var track = list[i]; + + this.removeRemoteTextTrack(track); + } + }; + + /** + * Reset the tech, which will removes all sources and reset the internal readyState. * - * @method reset + * @abstract */ Tech.prototype.reset = function reset() {}; /** - * When invoked without an argument, returns a MediaError object - * representing the current error state of the player or null if - * there is no error. When invoked with an argument, set the current - * error state of the player. - * @param {MediaError=} err Optional an error object - * @return {MediaError} the current error object or null - * @method error + * Get or set an error on the Tech. + * + * @param {MediaError} [err] + * Error to set on the Tech + * + * @return {MediaError|null} + * The current error object on the tech, or null if there isn't one. */ @@ -14250,13 +17114,14 @@ var Tech = function (_Component) { }; /** - * Return the time ranges that have been played through for the - * current source. This implementation is incomplete. It does not - * track the played time ranges, only whether the source has played - * at all or not. - * @return {TimeRangeObject} a single time range if this video has - * played or an empty set of ranges if not. - * @method played + * Returns the `TimeRange`s that have been played through for the current source. + * + * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`. + * It only checks wether the source has played at all or not. + * + * @return {TimeRange} + * - A single time range if this video has played + * - An empty set of ranges if not. */ @@ -14268,28 +17133,43 @@ var Tech = function (_Component) { }; /** - * Set current time + * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was + * previously called. * - * @method setCurrentTime + * @fires Tech#timeupdate */ Tech.prototype.setCurrentTime = function setCurrentTime() { // improve the accuracy of manual timeupdates if (this.manualTimeUpdates) { + /** + * A manual `timeupdate` event. + * + * @event Tech#timeupdate + * @type {EventTarget~Event} + */ this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); } }; /** - * Initialize texttrack listeners + * Turn on listeners for {@link TextTrackList} events. This adds + * {@link EventTarget~EventListeners} for `texttrackchange`, `addtrack` and + * `removetrack`. * - * @method initTextTrackListeners + * @fires Tech#texttrackchange */ Tech.prototype.initTextTrackListeners = function initTextTrackListeners() { var textTrackListChanges = Fn.bind(this, function () { + /** + * Triggered when tracks are added or removed on the Tech {@link TextTrackList} + * + * @event Tech#texttrackchange + * @type {EventTarget~Event} + */ this.trigger('texttrackchange'); }); @@ -14309,9 +17189,11 @@ var Tech = function (_Component) { }; /** - * Initialize audio and video track listeners + * Turn on listeners for {@link VideoTrackList} and {@link {AudioTrackList} events. + * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`. * - * @method initTrackListeners + * @fires Tech#audiotrackchange + * @fires Tech#videotrackchange */ @@ -14321,6 +17203,19 @@ var Tech = function (_Component) { var trackTypes = ['video', 'audio']; trackTypes.forEach(function (type) { + /** + * Triggered when tracks are added or removed on the Tech {@link AudioTrackList} + * + * @event Tech#audiotrackchange + * @type {EventTarget~Event} + */ + + /** + * Triggered when tracks are added or removed on the Tech {@link VideoTrackList} + * + * @event Tech#videotrackchange + * @type {EventTarget~Event} + */ var trackListChanges = function trackListChanges() { _this3.trigger(type + 'trackchange'); }; @@ -14337,6 +17232,71 @@ var Tech = function (_Component) { }); }; + /** + * Emulate TextTracks using vtt.js if necessary + * + * @fires Tech#vttjsloaded + * @fires Tech#vttjserror + */ + + + Tech.prototype.addWebVttScript_ = function addWebVttScript_() { + var _this4 = this; + + if (_window2['default'].WebVTT) { + return; + } + + // Initially, Tech.el_ is a child of a dummy-div wait until the Component system + // signals that the Tech is ready at which point Tech.el_ is part of the DOM + // before inserting the WebVTT script + if (_document2['default'].body.contains(this.el())) { + var vtt = _dereq_(105); + + // load via require if available and vtt.js script location was not passed in + // as an option. novtt builds will turn the above require call into an empty object + // which will cause this if check to always fail. + if (!this.options_['vtt.js'] && (0, _obj.isPlain)(vtt) && Object.keys(vtt).length > 0) { + this.trigger('vttjsloaded'); + return; + } + + // load vtt.js via the script location option or the cdn of no location was + // passed in + var script = _document2['default'].createElement('script'); + + script.src = this.options_['vtt.js'] || 'https://cdn.rawgit.com/gkatsev/vtt.js/vjs-v0.12.1/dist/vtt.min.js'; + script.onload = function () { + /** + * Fired when vtt.js is loaded. + * + * @event Tech#vttjsloaded + * @type {EventTarget~Event} + */ + _this4.trigger('vttjsloaded'); + }; + script.onerror = function () { + /** + * Fired when vtt.js was not loaded due to an error + * + * @event Tech#vttjsloaded + * @type {EventTarget~Event} + */ + _this4.trigger('vttjserror'); + }; + this.on('dispose', function () { + script.onload = null; + script.onerror = null; + }); + // but have not loaded yet and we set it to true before the inject so that + // we don't overwrite the injected window.WebVTT if it loads right away + _window2['default'].WebVTT = true; + this.el().parentNode.appendChild(script); + } else { + this.ready(this.addWebVttScript_); + } + }; + /** * Emulate texttracks * @@ -14345,7 +17305,7 @@ var Tech = function (_Component) { Tech.prototype.emulateTextTracks = function emulateTextTracks() { - var _this4 = this; + var _this5 = this; var tracks = this.textTracks(); @@ -14353,31 +17313,23 @@ var Tech = function (_Component) { return; } - if (!_window2['default'].WebVTT && this.el().parentNode !== null && this.el().parentNode !== undefined) { - (function () { - var script = _document2['default'].createElement('script'); + var remoteTracks = this.remoteTextTracks(); + var handleAddTrack = function handleAddTrack(e) { + return tracks.addTrack_(e.track); + }; + var handleRemoveTrack = function handleRemoveTrack(e) { + return tracks.removeTrack_(e.track); + }; - script.src = _this4.options_['vtt.js'] || 'https://cdn.rawgit.com/gkatsev/vtt.js/vjs-v0.12.1/dist/vtt.min.js'; - script.onload = function () { - _this4.trigger('vttjsloaded'); - }; - script.onerror = function () { - _this4.trigger('vttjserror'); - }; - _this4.on('dispose', function () { - script.onload = null; - script.onerror = null; - }); - // but have not loaded yet and we set it to true before the inject so that - // we don't overwrite the injected window.WebVTT if it loads right away - _window2['default'].WebVTT = true; - _this4.el().parentNode.appendChild(script); - })(); - } + remoteTracks.on('addtrack', handleAddTrack); + remoteTracks.on('removetrack', handleRemoveTrack); + + this.addWebVttScript_(); var updateDisplay = function updateDisplay() { - return _this4.trigger('texttrackchange'); + return _this5.trigger('texttrackchange'); }; + var textTracksChanges = function textTracksChanges() { updateDisplay(); @@ -14395,15 +17347,23 @@ var Tech = function (_Component) { tracks.addEventListener('change', textTracksChanges); this.on('dispose', function () { + remoteTracks.off('addtrack', handleAddTrack); + remoteTracks.off('removetrack', handleRemoveTrack); tracks.removeEventListener('change', textTracksChanges); + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + track.removeEventListener('cuechange', updateDisplay); + } }); }; /** - * Get videotracks + * Get the `Tech`s {@link VideoTrackList}. * - * @returns {VideoTrackList} - * @method videoTracks + * @return {VideoTrackList} + * The video track list that the Tech is currently using. */ @@ -14413,10 +17373,10 @@ var Tech = function (_Component) { }; /** - * Get audiotracklist + * Get the `Tech`s {@link AudioTrackList}. * - * @returns {AudioTrackList} - * @method audioTracks + * @return {AudioTrackList} + * The audio track list that the Tech is currently using. */ @@ -14425,17 +17385,11 @@ var Tech = function (_Component) { return this.audioTracks_; }; - /* - * Provide default methods for text tracks. - * - * Html5 tech overrides these. - */ - /** - * Get texttracks + * Get the `Tech`s {@link TextTrackList}. * - * @returns {TextTrackList} - * @method textTracks + * @return {TextTrackList} + * The text track list that the Tech is currently using. */ @@ -14445,10 +17399,11 @@ var Tech = function (_Component) { }; /** - * Get remote texttracks + * Get the `Tech`s remote {@link TextTrackList}, which is created from elements + * that were added to the DOM. * - * @returns {TextTrackList} - * @method remoteTextTracks + * @return {TextTrackList} + * The remote text track list that the Tech is currently using. */ @@ -14458,10 +17413,11 @@ var Tech = function (_Component) { }; /** - * Get remote htmltrackelements + * Get The `Tech`s {HTMLTrackElementList}, which are the elements in the DOM that are + * being used as TextTracks. * - * @returns {HTMLTrackElementList} - * @method remoteTextTrackEls + * @return {HTMLTrackElementList} + * The current HTML track elements that exist for the tech. */ @@ -14471,14 +17427,19 @@ var Tech = function (_Component) { }; /** - * Creates and returns a remote text track object + * Create and returns a remote {@link TextTrack} object. * - * @param {String} kind Text track kind (subtitles, captions, descriptions - * chapters and metadata) - * @param {String=} label Label to identify the text track - * @param {String=} language Two letter language abbreviation - * @return {TextTrackObject} - * @method addTextTrack + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @return {TextTrack} + * The TextTrack that gets created. */ @@ -14491,69 +17452,123 @@ var Tech = function (_Component) { }; /** - * Creates a remote text track object and returns a emulated html track element + * Create an emulated TextTrack for use by addRemoteTextTrack + * + * This is intended to be overridden by classes that inherit from + * Tech in order to create native or custom TextTracks. + * + * @param {Object} options + * The object should contain the options to initialize the TextTrack with. + * + * @param {string} [options.kind] + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata). + * + * @param {string} [options.label]. + * Label to identify the text track + * + * @param {string} [options.language] + * Two letter language abbreviation. * - * @param {Object} options The object should contain values for - * kind, language, label and src (location of the WebVTT file) * @return {HTMLTrackElement} - * @method addRemoteTextTrack + * The track element that gets created. */ - Tech.prototype.addRemoteTextTrack = function addRemoteTextTrack(options) { + Tech.prototype.createRemoteTextTrack = function createRemoteTextTrack(options) { var track = (0, _mergeOptions2['default'])(options, { tech: this }); - var htmlTrackElement = new _htmlTrackElement2['default'](track); + return new _htmlTrackElement2['default'](track); + }; + + /** + * Creates a remote text track object and returns an html track element. + * + * > Note: This can be an emulated {@link HTMLTrackElement} or a native one. + * + * @param {Object} options + * See {@link Tech#createRemoteTextTrack} for more detailed properties. + * + * @param {boolean} [manualCleanup=true] + * - When false: the TextTrack will be automatically removed from the video + * element whenever the source changes + * - When True: The TextTrack will have to be cleaned up manually + * + * @return {HTMLTrackElement} + * An Html Track Element. + * + * @deprecated The default functionality for this function will be equivalent + * to "manualCleanup=false" in the future. The manualCleanup parameter will + * also be removed. + */ + + + Tech.prototype.addRemoteTextTrack = function addRemoteTextTrack() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var manualCleanup = arguments[1]; + + var htmlTrackElement = this.createRemoteTextTrack(options); + + if (manualCleanup !== true && manualCleanup !== false) { + // deprecation warning + _log2['default'].warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'); + manualCleanup = true; + } // store HTMLTrackElement and TextTrack to remote list this.remoteTextTrackEls().addTrackElement_(htmlTrackElement); this.remoteTextTracks().addTrack_(htmlTrackElement.track); - // must come after remoteTextTracks() - this.textTracks().addTrack_(htmlTrackElement.track); + if (manualCleanup !== true) { + // create the TextTrackList if it doesn't exist + this.autoRemoteTextTracks_.addTrack_(htmlTrackElement.track); + } return htmlTrackElement; }; /** - * Remove remote texttrack + * Remove a remote text track from the remote `TextTrackList`. * - * @param {TextTrackObject} track Texttrack to remove - * @method removeRemoteTextTrack + * @param {TextTrack} track + * `TextTrack` to remove from the `TextTrackList` */ Tech.prototype.removeRemoteTextTrack = function removeRemoteTextTrack(track) { - this.textTracks().removeTrack_(track); - var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list this.remoteTextTrackEls().removeTrackElement_(trackElement); this.remoteTextTracks().removeTrack_(track); + this.autoRemoteTextTracks_.removeTrack_(track); }; /** - * Provide a default setPoster method for techs - * Poster support for techs should be optional, so we don't want techs to - * break if they don't have a way to set a poster. + * A method to set a poster from a `Tech`. * - * @method setPoster + * @abstract */ Tech.prototype.setPoster = function setPoster() {}; /* - * Check if the tech can support the given type + * Check if the tech can support the given mime-type. * * The base tech does not support any type, but source handlers might * overwrite this. * - * @param {String} type The mimetype to check - * @return {String} 'probably', 'maybe', or '' (empty string) + * @param {string} type + * The mimetype to check for support + * + * @return {string} + * 'probably', 'maybe', or empty string + * + * @see [Spec]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType} + * + * @abstract */ @@ -14565,8 +17580,13 @@ var Tech = function (_Component) { * Return whether the argument is a Tech or not. * Can be passed either a Class like `Html5` or a instance like `player.tech_` * - * @param {Object} component An item to check - * @return {Boolean} Whether it is a tech or not + * @param {Object} component + * The item to check + * + * @return {boolean} + * Whether it is a tech or not + * - True if it is a tech + * - False if it is not */ @@ -14575,12 +17595,13 @@ var Tech = function (_Component) { }; /** - * Registers a Tech + * Registers a `Tech` into a shared list for videojs. * - * @param {String} name Name of the Tech to register - * @param {Object} tech The tech to register - * @static - * @method registerComponent + * @param {string} name + * Name of the `Tech` to register. + * + * @param {Object} tech + * The `Tech` class to register. */ @@ -14598,12 +17619,13 @@ var Tech = function (_Component) { }; /** - * Gets a component by name + * Get a `Tech` from the shared list by name. * - * @param {String} name Name of the component to get - * @return {Component} - * @static - * @method getComponent + * @param {string} name + * Name of the component to get + * + * @return {Tech|undefined} + * The `Tech` or undefined if there was no tech with the name requsted. */ @@ -14622,7 +17644,7 @@ var Tech = function (_Component) { }(_component2['default']); /** - * List of associated text tracks + * List of associated text tracks. * * @type {TextTrackList} * @private @@ -14632,7 +17654,7 @@ var Tech = function (_Component) { Tech.prototype.textTracks_; // eslint-disable-line /** - * List of associated audio tracks + * List of associated audio tracks. * * @type {AudioTrackList} * @private @@ -14640,43 +17662,92 @@ Tech.prototype.textTracks_; // eslint-disable-line Tech.prototype.audioTracks_; // eslint-disable-line /** - * List of associated video tracks + * List of associated video tracks. * * @type {VideoTrackList} * @private */ Tech.prototype.videoTracks_; // eslint-disable-line +/** + * Boolean indicating wether the `Tech` supports volume control. + * + * @type {boolean} + * @default + */ Tech.prototype.featuresVolumeControl = true; -// Resizing plugins using request fullscreen reloads the plugin +/** + * Boolean indicating wether the `Tech` support fullscreen resize control. + * Resizing plugins using request fullscreen reloads the plugin + * + * @type {boolean} + * @default + */ Tech.prototype.featuresFullscreenResize = false; + +/** + * Boolean indicating wether the `Tech` supports changing the speed at which the video + * plays. Examples: + * - Set player to play 2x (twice) as fast + * - Set player to play 0.5x (half) as fast + * + * @type {boolean} + * @default + */ Tech.prototype.featuresPlaybackRate = false; -// Optional events that we can manually mimic with timers -// currently not triggered by video-js-swf +/** + * Boolean indicating wether the `Tech` supports the `progress` event. This is currently + * not triggered by video-js-swf. This will be used to determine if + * {@link Tech#manualProgressOn} should be called. + * + * @type {boolean} + * @default + */ Tech.prototype.featuresProgressEvents = false; + +/** + * Boolean indicating wether the `Tech` supports the `timeupdate` event. This is currently + * not triggered by video-js-swf. This will be used to determine if + * {@link Tech#manualTimeUpdates} should be called. + * + * @type {boolean} + * @default + */ Tech.prototype.featuresTimeupdateEvents = false; +/** + * Boolean indicating wether the `Tech` supports the native `TextTrack`s. + * This will help us integrate with native `TextTrack`s if the browser supports them. + * + * @type {boolean} + * @default + */ Tech.prototype.featuresNativeTextTracks = false; /** * A functional mixin for techs that want to use the Source Handler pattern. + * Source handlers are scripts for handling specific formats. + * The source handler pattern is used for adaptive formats (HLS, DASH) that + * manually load video data and feed it into a Source Buffer (Media Source Extensions) + * Example: `Tech.withSourceHandlers.call(MyTech);` * - * ##### EXAMPLE: - * - * Tech.withSourceHandlers.call(MyTech); + * @param {Tech} _Tech + * The tech to add source handler functions to. * + * @mixes Tech~SourceHandlerAdditions */ Tech.withSourceHandlers = function (_Tech) { /** * Register a source handler - * Source handlers are scripts for handling specific formats. - * The source handler pattern is used for adaptive formats (HLS, DASH) that - * manually load video data and feed it into a Source Buffer (Media Source Extensions) - * @param {Function} handler The source handler - * @param {Boolean} first Register it before any existing handlers + * + * @param {Function} handler + * The source handler class + * + * @param {number} [index] + * Register it at the following index */ _Tech.registerSourceHandler = function (handler, index) { var handlers = _Tech.sourceHandlers; @@ -14694,9 +17765,14 @@ Tech.withSourceHandlers = function (_Tech) { }; /** - * Check if the tech can support the given type - * @param {String} type The mimetype to check - * @return {String} 'probably', 'maybe', or '' (empty string) + * Check if the tech can support the given type. Also checks the + * Techs sourceHandlers. + * + * @param {string} type + * The mimetype to check. + * + * @return {string} + * 'probably', 'maybe', or '' (empty string) */ _Tech.canPlayType = function (type) { var handlers = _Tech.sourceHandlers || []; @@ -14714,12 +17790,19 @@ Tech.withSourceHandlers = function (_Tech) { }; /** - * Return the first source handler that supports the source + * Returns the first source handler that supports the source. + * * TODO: Answer question: should 'probably' be prioritized over 'maybe' - * @param {Object} source The source object - * @param {Object} options The options passed to the tech - * @returns {Object} The first source handler that supports the source - * @returns {null} Null if no source handler is found + * + * @param {Tech~SourceObject} source + * The source object + * + * @param {Object} options + * The options passed to the tech + * + * @return {SourceHandler|null} + * The first source handler that supports the source or null if + * no SourceHandler supports the source */ _Tech.selectSourceHandler = function (source, options) { var handlers = _Tech.sourceHandlers || []; @@ -14737,10 +17820,16 @@ Tech.withSourceHandlers = function (_Tech) { }; /** - * Check if the tech can support the given source - * @param {Object} srcObj The source object - * @param {Object} options The options passed to the tech - * @return {String} 'probably', 'maybe', or '' (empty string) + * Check if the tech can support the given source. + * + * @param {Tech~SourceObject} srcObj + * The source object + * + * @param {Object} options + * The options passed to the tech + * + * @return {string} + * 'probably', 'maybe', or '' (empty string) */ _Tech.canPlaySource = function (srcObj, options) { var sh = _Tech.selectSourceHandler(srcObj, options); @@ -14758,6 +17847,20 @@ Tech.withSourceHandlers = function (_Tech) { */ var deferrable = ['seekable', 'duration']; + /** + * A wrapper around {@link Tech#seekable} that will call a `SourceHandler`s seekable + * function if it exists, with a fallback to the Techs seekable function. + * + * @method _Tech.seekable + */ + + /** + * A wrapper around {@link Tech#duration} that will call a `SourceHandler`s duration + * function if it exists, otherwise it will fallback to the techs duration function. + * + * @method _Tech.duration + */ + deferrable.forEach(function (fnName) { var originalFn = this[fnName]; @@ -14777,8 +17880,12 @@ Tech.withSourceHandlers = function (_Tech) { * Create a function for setting the source using a source object * and source handlers. * Should never be called unless a source handler was found. - * @param {Object} source A source object with src and type keys - * @return {Tech} self + * + * @param {Tech~SourceObject} source + * A source object with src and type keys + * + * @return {Tech} + * Returns itself; this method is chainable */ _Tech.prototype.setSource = function (source) { var sh = _Tech.selectSourceHandler(source, this.options_); @@ -14797,17 +17904,7 @@ Tech.withSourceHandlers = function (_Tech) { this.disposeSourceHandler(); this.off('dispose', this.disposeSourceHandler); - // if we have a source and get another one - // then we are loading something new - // than clear all of our current tracks - if (this.currentSource_) { - this.clearTracks(['audio', 'video']); - - this.currentSource_ = null; - } - if (sh !== _Tech.nativeSourceHandler) { - this.currentSource_ = source; // Catch if someone replaced the src without calling setSource. @@ -14823,26 +17920,51 @@ Tech.withSourceHandlers = function (_Tech) { return this; }; - // On the first loadstart after setSource + /** + * Called once for the first loadstart of a video. + * + * @listens Tech#loadstart + */ _Tech.prototype.firstLoadStartListener_ = function () { this.one(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); }; // On successive loadstarts when setSource has not been called again + /** + * Called after the first loadstart for a video occurs. + * + * @listens Tech#loadstart + */ _Tech.prototype.successiveLoadStartListener_ = function () { - this.currentSource_ = null; this.disposeSourceHandler(); this.one(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); }; - /* - * Clean up any existing source handler + /** + * Clean up any existing SourceHandlers and listeners when the Tech is disposed. + * + * @listens Tech#dispose */ _Tech.prototype.disposeSourceHandler = function () { - if (this.sourceHandler_ && this.sourceHandler_.dispose) { + // if we have a source and get another one + // then we are loading something new + // than clear all of our current tracks + if (this.currentSource_) { + this.clearTracks(['audio', 'video']); + this.currentSource_ = null; + } + + // always clean up auto-text tracks + this.cleanupAutoTextTracks(); + + if (this.sourceHandler_) { this.off(this.el_, 'loadstart', _Tech.prototype.firstLoadStartListener_); this.off(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); - this.sourceHandler_.dispose(); + + if (this.sourceHandler_.dispose) { + this.sourceHandler_.dispose(); + } + this.sourceHandler_ = null; } }; @@ -14850,11 +17972,12 @@ Tech.withSourceHandlers = function (_Tech) { _component2['default'].registerComponent('Tech', Tech); // Old name for Tech +// @deprecated _component2['default'].registerComponent('MediaTechController', Tech); Tech.registerTech('Tech', Tech); exports['default'] = Tech; -},{"46":46,"5":5,"63":63,"65":65,"66":66,"70":70,"72":72,"76":76,"79":79,"82":82,"85":85,"86":86,"88":88,"92":92,"93":93}],63:[function(_dereq_,module,exports){ +},{"105":105,"46":46,"5":5,"63":63,"65":65,"66":66,"70":70,"72":72,"76":76,"79":79,"83":83,"86":86,"87":87,"88":88,"90":90,"94":94,"95":95}],63:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -14867,7 +17990,7 @@ var _browser = _dereq_(78); var browser = _interopRequireWildcard(_browser); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); @@ -14885,11 +18008,16 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * anywhere we call this function we diverge from the spec + * Anywhere we call this function we diverge from the spec * as we only support one enabled audiotrack at a time * - * @param {Array|AudioTrackList} list list to work on - * @param {AudioTrack} track the track to skip + * @param {AudioTrackList} list + * list to work on + * + * @param {AudioTrack} track + * The track to skip + * + * @private */ var disableOthers = function disableOthers(list, track) { for (var i = 0; i < list.length; i++) { @@ -14902,28 +18030,21 @@ var disableOthers = function disableOthers(list, track) { }; /** - * A list of possible audio tracks. All functionality is in the - * base class Tracklist and the spec for AudioTrackList is located at: - * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist + * The current list of {@link AudioTrack} for a media file. * - * interface AudioTrackList : EventTarget { - * readonly attribute unsigned long length; - * getter AudioTrack (unsigned long index); - * AudioTrack? getTrackById(DOMString id); - * - * attribute EventHandler onchange; - * attribute EventHandler onaddtrack; - * attribute EventHandler onremovetrack; - * }; - * - * @param {AudioTrack[]} tracks a list of audio tracks to instantiate the list with + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist} * @extends TrackList - * @class AudioTrackList */ var AudioTrackList = function (_TrackList) { _inherits(AudioTrackList, _TrackList); + /** + * Create an instance of this class. + * + * @param {AudioTrack[]} [tracks=[]] + * A list of `AudioTrack` to instantiate the list with. + */ function AudioTrackList() { var _this, _ret; @@ -14964,6 +18085,17 @@ var AudioTrackList = function (_TrackList) { return _ret = list, _possibleConstructorReturn(_this, _ret); } + /** + * Add an {@link AudioTrack} to the `AudioTrackList`. + * + * @param {AudioTrack} track + * The AudioTrack to add to the list + * + * @fires Track#addtrack + * @private + */ + + AudioTrackList.prototype.addTrack_ = function addTrack_(track) { var _this2 = this; @@ -14977,6 +18109,10 @@ var AudioTrackList = function (_TrackList) { return; } + /** + * @listens AudioTrack#enabledchange + * @fires TrackList#change + */ track.addEventListener('enabledchange', function () { // when we are disabling other tracks (since we don't support // more than one track at a time) we will set changing_ @@ -14991,10 +18127,30 @@ var AudioTrackList = function (_TrackList) { }); }; + /** + * Add an {@link AudioTrack} to the `AudioTrackList`. + * + * @param {AudioTrack} track + * The AudioTrack to add to the list + * + * @fires Track#addtrack + */ + + AudioTrackList.prototype.addTrack = function addTrack(track) { this.addTrack_(track); }; + /** + * Remove an {@link AudioTrack} from the `AudioTrackList`. + * + * @param {AudioTrack} track + * The AudioTrack to remove from the list + * + * @fires Track#removetrack + */ + + AudioTrackList.prototype.removeTrack = function removeTrack(track) { _TrackList.prototype.removeTrack_.call(this, track); }; @@ -15004,7 +18160,7 @@ var AudioTrackList = function (_TrackList) { exports['default'] = AudioTrackList; -},{"74":74,"78":78,"92":92}],64:[function(_dereq_,module,exports){ +},{"74":74,"78":78,"94":94}],64:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -15015,7 +18171,7 @@ var _track = _dereq_(75); var _track2 = _interopRequireDefault(_track); -var _mergeOptions = _dereq_(86); +var _mergeOptions = _dereq_(87); var _mergeOptions2 = _interopRequireDefault(_mergeOptions); @@ -15034,23 +18190,37 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * A single audio text track as defined in: - * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack + * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList} + * only one `AudioTrack` in the list will be enabled at a time. * - * interface AudioTrack { - * readonly attribute DOMString id; - * readonly attribute DOMString kind; - * readonly attribute DOMString label; - * readonly attribute DOMString language; - * attribute boolean enabled; - * }; - * - * @param {Object=} options Object of option names and values - * @class AudioTrack + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack} + * @extends Track */ var AudioTrack = function (_Track) { _inherits(AudioTrack, _Track); + /** + * Create an instance of this class. + * + * @param {Object} [options={}] + * Object of option names and values + * + * @param {AudioTrack~Kind} [options.kind=''] + * A valid audio track kind + * + * @param {string} [options.id='vjs_track_' + Guid.newGUID()] + * A unique id for this AudioTrack. + * + * @param {string} [options.label=''] + * The menu label for this track. + * + * @param {string} [options.language=''] + * A valid two character language code. + * + * @param {boolean} [options.enabled] + * If this track is the one that is currently playing. If this track is part of + * an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled. + */ function AudioTrack() { var _this, _ret; @@ -15073,7 +18243,13 @@ var AudioTrack = function (_Track) { } } } - + /** + * @member {boolean} enabled + * If this `AudioTrack` is enabled or not. When setting this will + * fire {@link AudioTrack#enabledchange} if the state of enabled is changed. + * + * @fires VideoTrack#selectedchange + */ Object.defineProperty(track, 'enabled', { get: function get() { return enabled; @@ -15084,6 +18260,17 @@ var AudioTrack = function (_Track) { return; } enabled = newEnabled; + + /** + * An event that fires when enabled changes on this track. This allows + * the AudioTrackList that holds this track to act accordingly. + * + * > Note: This is not part of the spec! Native tracks will do + * this internally without an event. + * + * @event AudioTrack#enabledchange + * @type {EventTarget~Event} + */ this.trigger('enabledchange'); } }); @@ -15104,7 +18291,7 @@ var AudioTrack = function (_Track) { exports['default'] = AudioTrack; -},{"73":73,"75":75,"78":78,"86":86}],65:[function(_dereq_,module,exports){ +},{"73":73,"75":75,"78":78,"87":87}],65:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -15113,7 +18300,7 @@ var _browser = _dereq_(78); var browser = _interopRequireWildcard(_browser); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); @@ -15125,7 +18312,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * @file html-track-element-list.js */ +/** + * The current list of {@link HtmlTrackElement}s. + */ var HtmlTrackElementList = function () { + + /** + * Create an instance of this class. + * + * @param {HtmlTrackElement[]} [tracks=[]] + * A list of `HtmlTrackElement` to instantiate the list with. + */ function HtmlTrackElementList() { var trackElements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; @@ -15145,6 +18342,10 @@ var HtmlTrackElementList = function () { list.trackElements_ = []; + /** + * @member {number} length + * The current number of `Track`s in the this Trackist. + */ Object.defineProperty(list, 'length', { get: function get() { return this.trackElements_.length; @@ -15160,10 +18361,47 @@ var HtmlTrackElementList = function () { } } + /** + * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList` + * + * @param {HtmlTrackElement} trackElement + * The track element to add to the list. + * + * @private + */ + + HtmlTrackElementList.prototype.addTrackElement_ = function addTrackElement_(trackElement) { - this.trackElements_.push(trackElement); + var index = this.trackElements_.length; + + if (!('' + index in this)) { + Object.defineProperty(this, index, { + get: function get() { + return this.trackElements_[index]; + } + }); + } + + // Do not add duplicate elements + if (this.trackElements_.indexOf(trackElement) === -1) { + this.trackElements_.push(trackElement); + } }; + /** + * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an + * {@link TextTrack}. + * + * @param {TextTrack} track + * The track associated with a track element. + * + * @return {HtmlTrackElement|undefined} + * The track element that was found or undefined. + * + * @private + */ + + HtmlTrackElementList.prototype.getTrackElementByTrack_ = function getTrackElementByTrack_(track) { var trackElement_ = void 0; @@ -15178,6 +18416,16 @@ var HtmlTrackElementList = function () { return trackElement_; }; + /** + * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList` + * + * @param {HtmlTrackElement} trackElement + * The track element to remove from the list. + * + * @private + */ + + HtmlTrackElementList.prototype.removeTrackElement_ = function removeTrackElement_(trackElement) { for (var i = 0, length = this.trackElements_.length; i < length; i++) { if (trackElement === this.trackElements_[i]) { @@ -15193,7 +18441,7 @@ var HtmlTrackElementList = function () { exports['default'] = HtmlTrackElementList; -},{"78":78,"92":92}],66:[function(_dereq_,module,exports){ +},{"78":78,"94":94}],66:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -15202,7 +18450,7 @@ var _browser = _dereq_(78); var browser = _interopRequireWildcard(_browser); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); @@ -15226,37 +18474,59 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * @file html-track-element.js */ +/** + * @typedef {HTMLTrackElement~ReadyState} + * @enum {number} + */ var NONE = 0; var LOADING = 1; var LOADED = 2; var ERROR = 3; /** - * https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement + * A single track represented in the DOM. * - * interface HTMLTrackElement : HTMLElement { - * attribute DOMString kind; - * attribute DOMString src; - * attribute DOMString srclang; - * attribute DOMString label; - * attribute boolean default; - * - * const unsigned short NONE = 0; - * const unsigned short LOADING = 1; - * const unsigned short LOADED = 2; - * const unsigned short ERROR = 3; - * readonly attribute unsigned short readyState; - * - * readonly attribute TextTrack track; - * }; - * - * @param {Object} options TextTrack configuration - * @class HTMLTrackElement + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement} + * @extends EventTarget */ var HTMLTrackElement = function (_EventTarget) { _inherits(HTMLTrackElement, _EventTarget); + /** + * Create an instance of this class. + * + * @param {Object} options={} + * Object of option names and values + * + * @param {Tech} options.tech + * A reference to the tech that owns this HTMLTrackElement. + * + * @param {TextTrack~Kind} [options.kind='subtitles'] + * A valid text track kind. + * + * @param {TextTrack~Mode} [options.mode='disabled'] + * A valid text track mode. + * + * @param {string} [options.id='vjs_track_' + Guid.newGUID()] + * A unique id for this TextTrack. + * + * @param {string} [options.label=''] + * The menu label for this track. + * + * @param {string} [options.language=''] + * A valid two character language code. + * + * @param {string} [options.srclang=''] + * A valid two character language code. An alternative, but deprioritized + * vesion of `options.language` + * + * @param {string} [options.src] + * A url to TextTrack cues. + * + * @param {boolean} [options.default] + * If this track should default to on or off. + */ function HTMLTrackElement() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -15285,12 +18555,20 @@ var HTMLTrackElement = function (_EventTarget) { trackElement.label = track.label; trackElement['default'] = track['default']; + /** + * @member {HTMLTrackElement~ReadyState} readyState + * The current ready state of the track element. + */ Object.defineProperty(trackElement, 'readyState', { get: function get() { return readyState; } }); + /** + * @member {TextTrack} track + * The underlying TextTrack object. + */ Object.defineProperty(trackElement, 'track', { get: function get() { return track; @@ -15299,6 +18577,10 @@ var HTMLTrackElement = function (_EventTarget) { readyState = NONE; + /** + * @listens TextTrack#loadeddata + * @fires HTMLTrackElement#load + */ track.addEventListener('loadeddata', function () { readyState = LOADED; @@ -15330,7 +18612,7 @@ HTMLTrackElement.ERROR = ERROR; exports['default'] = HTMLTrackElement; -},{"42":42,"72":72,"78":78,"92":92}],67:[function(_dereq_,module,exports){ +},{"42":42,"72":72,"78":78,"94":94}],67:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -15339,7 +18621,7 @@ var _browser = _dereq_(78); var browser = _interopRequireWildcard(_browser); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); @@ -15353,20 +18635,36 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons /** - * A List of text track cues as defined in: - * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist + * @typedef {Object} TextTrackCue * - * interface TextTrackCueList { - * readonly attribute unsigned long length; - * getter TextTrackCue (unsigned long index); - * TextTrackCue? getCueById(DOMString id); - * }; + * @property {string} id + * The unique id for this text track cue * - * @param {Array} cues A list of cues to be initialized with - * @class TextTrackCueList + * @property {number} startTime + * The start time for this text track cue + * + * @property {number} endTime + * The end time for this text track cue + * + * @property {boolean} pauseOnExit + * Pause when the end time is reached if true. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue} */ +/** + * A List of TextTrackCues. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist} + */ var TextTrackCueList = function () { + + /** + * Create an instance of this class.. + * + * @param {Array} cues + * A list of cues to be initialized with + */ function TextTrackCueList(cues) { _classCallCheck(this, TextTrackCueList); @@ -15384,6 +18682,10 @@ var TextTrackCueList = function () { TextTrackCueList.prototype.setCues_.call(list, cues); + /** + * @member {number} length + * The current number of `TextTrackCue`s in the TextTrackCueList. + */ Object.defineProperty(list, 'length', { get: function get() { return this.length_; @@ -15396,10 +18698,12 @@ var TextTrackCueList = function () { } /** - * A setter for cues in this list + * A setter for cues in this list. Creates getters + * an an index for the cues. + * + * @param {Array} cues + * An array of cues to set * - * @param {Array} cues an array of cues - * @method setCues_ * @private */ @@ -15432,11 +18736,13 @@ var TextTrackCueList = function () { }; /** - * Get a cue that is currently in the Cue list by id + * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id. * - * @param {String} id - * @method getCueById - * @return {Object} a single cue + * @param {string} id + * The id of the cue that should be searched for. + * + * @return {TextTrackCue|null} + * A single cue or null if none was found. */ @@ -15460,7 +18766,7 @@ var TextTrackCueList = function () { exports['default'] = TextTrackCueList; -},{"78":78,"92":92}],68:[function(_dereq_,module,exports){ +},{"78":78,"94":94}],68:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -15469,11 +18775,11 @@ var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _window = _dereq_(93); +var _window = _dereq_(95); var _window2 = _interopRequireDefault(_window); @@ -15506,12 +18812,18 @@ var fontMap = { }; /** - * Add cue HTML to display + * Construct an rgba color from a given hex color code. * - * @param {Number} color Hex number for color, like #f0e - * @param {Number} opacity Value for opacity,0.0 - 1.0 - * @return {RGBAColor} In the form 'rgba(255, 0, 0, 0.3)' - * @method constructColor + * @param {number} color + * Hex number for color, like #f0e. + * + * @param {number} opacity + * Value for opacity, 0.0 - 1.0. + * + * @return {string} + * The rgba color that was created, like 'rgba(255, 0, 0, 0.3)'. + * + * @private */ function constructColor(color, opacity) { return 'rgba(' + @@ -15520,13 +18832,17 @@ function constructColor(color, opacity) { } /** - * Try to update style - * Some style changes will throw an error, particularly in IE8. Those should be noops. + * Try to update the style of a DOM element. Some style changes will throw an error, + * particularly in IE8. Those should be noops. * - * @param {Element} el The element to be styles - * @param {CSSProperty} style The CSS property to be styled - * @param {CSSStyle} rule The actual style to be applied to the property - * @method tryUpdateStyle + * @param {Element} el + * The DOM element to be styled. + * + * @param {string} style + * The CSS property on the element that should be styled. + * + * @param {string} rule + * The style rule that should be applied to the property. */ function tryUpdateStyle(el, style, rule) { try { @@ -15539,18 +18855,26 @@ function tryUpdateStyle(el, style, rule) { } /** - * The component for displaying text track cues + * The component for displaying text track cues. * - * @param {Object} player Main Player - * @param {Object=} options Object of option names and values - * @param {Function=} ready Ready callback function * @extends Component - * @class TextTrackDisplay */ var TextTrackDisplay = function (_Component) { _inherits(TextTrackDisplay, _Component); + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when `TextTrackDisplay` is ready. + */ function TextTrackDisplay(player, options, ready) { _classCallCheck(this, TextTrackDisplay); @@ -15574,7 +18898,7 @@ var TextTrackDisplay = function (_Component) { var tracks = this.options_.playerOptions.tracks || []; for (var i = 0; i < tracks.length; i++) { - this.player_.addRemoteTextTrack(tracks[i]); + this.player_.addRemoteTextTrack(tracks[i], true); } var modes = { captions: 1, subtitles: 1 }; @@ -15610,9 +18934,12 @@ var TextTrackDisplay = function (_Component) { } /** - * Toggle display texttracks + * Turn display of {@link TextTrack}'s from the current state into the other state. + * There are only two states: + * - 'shown' + * - 'hidden' * - * @method toggleDisplay + * @listens Player#loadstart */ @@ -15625,10 +18952,10 @@ var TextTrackDisplay = function (_Component) { }; /** - * Create the component's DOM element + * Create the {@link Component}'s DOM element. * * @return {Element} - * @method createEl + * The element that was created. */ @@ -15636,15 +18963,13 @@ var TextTrackDisplay = function (_Component) { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-text-track-display' }, { - 'aria-live': 'assertive', + 'aria-live': 'off', 'aria-atomic': 'true' }); }; /** - * Clear display texttracks - * - * @method clearDisplay + * Clear all displayed {@link TextTrack}s. */ @@ -15655,9 +18980,11 @@ var TextTrackDisplay = function (_Component) { }; /** - * Update display texttracks + * Update the displayed TextTrack when a either a {@link Player#texttrackchange} or + * a {@link Player#fullscreenchange} is fired. * - * @method updateDisplay + * @listens Player#texttrackchange + * @listens Player#fullscreenchange */ @@ -15692,17 +19019,23 @@ var TextTrackDisplay = function (_Component) { } if (captionsSubtitlesTrack) { + if (this.getAttribute('aria-live') !== 'off') { + this.setAttribute('aria-live', 'off'); + } this.updateForTrack(captionsSubtitlesTrack); } else if (descriptionsTrack) { + if (this.getAttribute('aria-live') !== 'assertive') { + this.setAttribute('aria-live', 'assertive'); + } this.updateForTrack(descriptionsTrack); } }; /** - * Add texttrack to texttrack list + * Add an {@link Texttrack} to to the {@link Tech}s {@link TextTrackList}. * - * @param {TextTrackObject} track Texttrack object to be added to list - * @method updateForTrack + * @param {TextTrack} track + * Text track object to be added to the list. */ @@ -15785,22 +19118,26 @@ var TextTrackDisplay = function (_Component) { _component2['default'].registerComponent('TextTrackDisplay', TextTrackDisplay); exports['default'] = TextTrackDisplay; -},{"5":5,"82":82,"93":93}],69:[function(_dereq_,module,exports){ +},{"5":5,"83":83,"95":95}],69:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; /** - * Utilities for capturing text track state and re-creating tracks - * based on a capture. + * @file text-track-list-converter.js Utilities for capturing text track state and + * re-creating tracks based on a capture. * - * @file text-track-list-converter.js + * @module text-track-list-converter */ /** - * Examine a single text track and return a JSON-compatible javascript - * object that represents the text track's state. - * @param track {TextTrackObject} the text track to query - * @return {Object} a serializable javascript representation of the + * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that + * represents the {@link TextTrack}'s state. + * + * @param {TextTrack} track + * The text track to query. + * + * @return {Object} + * A serializable javascript representation of the TextTrack. * @private */ var trackToJson_ = function trackToJson_(track) { @@ -15826,12 +19163,16 @@ var trackToJson_ = function trackToJson_(track) { }; /** - * Examine a tech and return a JSON-compatible javascript array that - * represents the state of all text tracks currently configured. The - * return array is compatible with `jsonToTextTracks`. - * @param tech {tech} the tech object to query - * @return {Array} a serializable javascript representation of the - * @function textTracksToJson + * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the + * state of all {@link TextTrack}s currently configured. The return array is compatible with + * {@link text-track-list-converter:jsonToTextTracks}. + * + * @param {Tech} tech + * The tech object to query + * + * @return {Array} + * A serializable javascript representation of the {@link Tech}s + * {@link TextTrackList}. */ var textTracksToJson = function textTracksToJson(tech) { @@ -15855,12 +19196,15 @@ var textTracksToJson = function textTracksToJson(tech) { }; /** - * Creates a set of remote text tracks on a tech based on an array of - * javascript text track representations. - * @param json {Array} an array of text track representation objects, - * like those that would be produced by `textTracksToJson` - * @param tech {tech} the tech to create text tracks on - * @function jsonToTextTracks + * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript + * object {@link TextTrack} representations. + * + * @param {Array} json + * An array of `TextTrack` representation objects, like those that would be + * produced by `textTracksToJson`. + * + * @param {Tech} tech + * The `Tech` to create the `TextTrack`s on. */ var jsonToTextTracks = function jsonToTextTracks(json, tech) { json.forEach(function (track) { @@ -15887,7 +19231,7 @@ var _trackList = _dereq_(74); var _trackList2 = _interopRequireDefault(_trackList); -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); @@ -15895,7 +19239,7 @@ var _browser = _dereq_(78); var browser = _interopRequireWildcard(_browser); -var _document = _dereq_(92); +var _document = _dereq_(94); var _document2 = _interopRequireDefault(_document); @@ -15913,27 +19257,20 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** - * A list of possible text tracks. All functionality is in the - * base class TrackList. The spec for TextTrackList is located at: - * @link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist + * The current list of {@link TextTrack} for a media file. * - * interface TextTrackList : EventTarget { - * readonly attribute unsigned long length; - * getter TextTrack (unsigned long index); - * TextTrack? getTrackById(DOMString id); - * - * attribute EventHandler onchange; - * attribute EventHandler onaddtrack; - * attribute EventHandler onremovetrack; - * }; - * - * @param {TextTrack[]} tracks A list of tracks to initialize the list with + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist} * @extends TrackList - * @class TextTrackList */ var TextTrackList = function (_TrackList) { _inherits(TextTrackList, _TrackList); + /** + * Create an instance of this class. + * + * @param {TextTrack[]} [tracks=[]] + * A list of `TextTrack` to instantiate the list with. + */ function TextTrackList() { var _this, _ret; @@ -15963,108 +19300,61 @@ var TextTrackList = function (_TrackList) { return _ret = list, _possibleConstructorReturn(_this, _ret); } + /** + * Add a {@link TextTrack} to the `TextTrackList` + * + * @param {TextTrack} track + * The text track to add to the list. + * + * @fires TrackList#addtrack + * @private + */ + + TextTrackList.prototype.addTrack_ = function addTrack_(track) { _TrackList.prototype.addTrack_.call(this, track); + + /** + * @listens TextTrack#modechange + * @fires TrackList#change + */ track.addEventListener('modechange', Fn.bind(this, function () { this.trigger('change'); })); }; - /** - * Remove TextTrack from TextTrackList - * NOTE: Be mindful of what is passed in as it may be a HTMLTrackElement - * - * @param {TextTrack} rtrack - * @method removeTrack_ - * @private - */ - - - TextTrackList.prototype.removeTrack_ = function removeTrack_(rtrack) { - var track = void 0; - - for (var i = 0, l = this.length; i < l; i++) { - if (this[i] === rtrack) { - track = this[i]; - if (track.off) { - track.off(); - } - - this.tracks_.splice(i, 1); - - break; - } - } - - if (!track) { - return; - } - - this.trigger({ - track: track, - type: 'removetrack' - }); - }; - - /** - * Get a TextTrack from TextTrackList by a tracks id - * - * @param {String} id - the id of the track to get - * @method getTrackById - * @return {TextTrack} - * @private - */ - - - TextTrackList.prototype.getTrackById = function getTrackById(id) { - var result = null; - - for (var i = 0, l = this.length; i < l; i++) { - var track = this[i]; - - if (track.id === id) { - result = track; - break; - } - } - - return result; - }; - return TextTrackList; }(_trackList2['default']); exports['default'] = TextTrackList; -},{"74":74,"78":78,"82":82,"92":92}],71:[function(_dereq_,module,exports){ +},{"74":74,"78":78,"83":83,"94":94}],71:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; +var _window = _dereq_(95); + +var _window2 = _interopRequireDefault(_window); + var _component = _dereq_(5); var _component2 = _interopRequireDefault(_component); -var _events = _dereq_(81); +var _dom = _dereq_(81); -var Events = _interopRequireWildcard(_events); - -var _fn = _dereq_(82); +var _fn = _dereq_(83); var Fn = _interopRequireWildcard(_fn); -var _log = _dereq_(85); +var _obj = _dereq_(88); + +var Obj = _interopRequireWildcard(_obj); + +var _log = _dereq_(86); var _log2 = _interopRequireDefault(_log); -var _tuple = _dereq_(145); - -var _tuple2 = _interopRequireDefault(_tuple); - -var _window = _dereq_(93); - -var _window2 = _interopRequireDefault(_window); - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } @@ -16078,94 +19368,226 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" */ -function captionOptionsMenuTemplate(uniqueId, dialogLabelId, dialogDescriptionId) { - var template = '\n
    \n
    Captions Settings Dialog
    \n
    Beginning of dialog window. Escape will cancel and close the window.
    \n
    \n
    \n
    \n Text\n \n \n \n \n \n \n
    \n
    \n Background\n \n \n \n \n \n \n
    \n
    \n Window\n \n \n \n \n \n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n \n
    \n
    \n \n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n '; +var LOCAL_STORAGE_KEY = 'vjs-text-track-settings'; - return template; -} +var COLOR_BLACK = ['#000', 'Black']; +var COLOR_BLUE = ['#00F', 'Blue']; +var COLOR_CYAN = ['#0FF', 'Cyan']; +var COLOR_GREEN = ['#0F0', 'Green']; +var COLOR_MAGENTA = ['#F0F', 'Magenta']; +var COLOR_RED = ['#F00', 'Red']; +var COLOR_WHITE = ['#FFF', 'White']; +var COLOR_YELLOW = ['#FF0', 'Yellow']; -function getSelectedOptionValue(target) { - var selectedOption = void 0; +var OPACITY_OPAQUE = ['1', 'Opaque']; +var OPACITY_SEMI = ['0.5', 'Semi-Transparent']; +var OPACITY_TRANS = ['0', 'Transparent']; - // not all browsers support selectedOptions, so, fallback to options - if (target.selectedOptions) { - selectedOption = target.selectedOptions[0]; - } else if (target.options) { - selectedOption = target.options[target.options.selectedIndex]; +// Configuration for the various element. +var selectConfigs = { + backgroundColor: { + selector: '.vjs-bg-color > select', + id: 'captions-background-color-%s', + label: 'Color', + options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN] + }, + + backgroundOpacity: { + selector: '.vjs-bg-opacity > select', + id: 'captions-background-opacity-%s', + label: 'Transparency', + options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS] + }, + + color: { + selector: '.vjs-fg-color > select', + id: 'captions-foreground-color-%s', + label: 'Color', + options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN] + }, + + edgeStyle: { + selector: '.vjs-edge-style > select', + id: '%s', + label: 'Text Edge Style', + options: [['none', 'None'], ['raised', 'Raised'], ['depressed', 'Depressed'], ['uniform', 'Uniform'], ['dropshadow', 'Dropshadow']] + }, + + fontFamily: { + selector: '.vjs-font-family > select', + id: 'captions-font-family-%s', + label: 'Font Family', + options: [['proportionalSansSerif', 'Proportional Sans-Serif'], ['monospaceSansSerif', 'Monospace Sans-Serif'], ['proportionalSerif', 'Proportional Serif'], ['monospaceSerif', 'Monospace Serif'], ['casual', 'Casual'], ['script', 'Script'], ['small-caps', 'Small Caps']] + }, + + fontPercent: { + selector: '.vjs-font-percent > select', + id: 'captions-font-size-%s', + label: 'Font Size', + options: [['0.50', '50%'], ['0.75', '75%'], ['1.00', '100%'], ['1.25', '125%'], ['1.50', '150%'], ['1.75', '175%'], ['2.00', '200%'], ['3.00', '300%'], ['4.00', '400%']], + 'default': 2, + parser: function parser(v) { + return v === '1.00' ? null : Number(v); + } + }, + + textOpacity: { + selector: '.vjs-text-opacity > select', + id: 'captions-foreground-opacity-%s', + label: 'Transparency', + options: [OPACITY_OPAQUE, OPACITY_SEMI] + }, + + // Options for this object are defined below. + windowColor: { + selector: '.vjs-window-color > select', + id: 'captions-window-color-%s', + label: 'Color' + }, + + // Options for this object are defined below. + windowOpacity: { + selector: '.vjs-window-opacity > select', + id: 'captions-window-opacity-%s', + label: 'Transparency', + options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE] + } +}; + +selectConfigs.windowColor.options = selectConfigs.backgroundColor.options; + +/** + * Get the actual value of an option. + * + * @param {string} value + * The value to get + * + * @param {Function} [parser] + * Optional function to adjust the value. + * + * @return {Mixed} + * - Will be `undefined` if no value exists + * - Will be `undefined` if the given value is "none". + * - Will be the actual value otherwise. + * + * @private + */ +function parseOptionValue(value, parser) { + if (parser) { + value = parser(value); } - return selectedOption.value; + if (value && value !== 'none') { + return value; + } } -function setSelectedOption(target, value) { +/** + * Gets the value of the selected