iotgateway/IoTGateway/wwwroot/layuiadmin/ueditor/third-party/video-js/video.dev.js

4 lines
73 KiB
JavaScript
Raw Normal View History

2021-12-12 06:55:48 +00:00
/** layuiAdmin.pro-v1.2.1 LPPL License By http://www.layui.com/admin/ */
;function createMethod(t){return function(){throw new Error('The "'+t+"\" method is not available on the playback technology's API")}}document.createElement("video"),document.createElement("audio"),document.createElement("track");var vjs=function(t,e,s){var o;if("string"==typeof t){if(0===t.indexOf("#")&&(t=t.slice(1)),vjs.players[t])return vjs.players[t];o=vjs.el(t)}else o=t;if(!o||!o.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return o.player||new vjs.Player(o,e,s)},videojs=vjs;window.videojs=window.vjs=vjs,vjs.CDN_VERSION="4.3",vjs.ACCESS_PROTOCOL="https:"==document.location.protocol?"https://":"http://",vjs.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,children:{mediaLoader:{},posterImage:{},textTrackDisplay:{},loadingSpinner:{},bigPlayButton:{},controlBar:{}},notSupportedMessage:'Sorry, no compatible source and playback technology were found for this video. Try using another browser like <a href="http://bit.ly/ccMUEC">Chrome</a> or download the latest <a href="http://adobe.ly/mwfN1">Adobe Flash Player</a>.'},"GENERATED_CDN_VSN"!==vjs.CDN_VERSION&&(videojs.options.flash.swf=vjs.ACCESS_PROTOCOL+"vjs.zencdn.net/"+vjs.CDN_VERSION+"/video-js.swf"),vjs.players={},vjs.CoreObject=vjs.CoreObject=function(){},vjs.CoreObject.extend=function(t){var e,s;t=t||{},e=t.init||t.init||this.prototype.init||this.prototype.init||function(){},s=function(){e.apply(this,arguments)},s.prototype=vjs.obj.create(this.prototype),s.prototype.constructor=s,s.extend=vjs.CoreObject.extend,s.create=vjs.CoreObject.create;for(var o in t)t.hasOwnProperty(o)&&(s.prototype[o]=t[o]);return s},vjs.CoreObject.create=function(){var t=vjs.obj.create(this.prototype);return this.apply(t,arguments),t},vjs.on=function(t,e,s){var o=vjs.getData(t);o.handlers||(o.handlers={}),o.handlers[e]||(o.handlers[e]=[]),s.guid||(s.guid=vjs.guid++),o.handlers[e].push(s),o.dispatcher||(o.disabled=!1,o.dispatcher=function(e){if(!o.disabled){e=vjs.fixEvent(e);var s=o.handlers[e.type];if(s)for(var n=s.slice(0),i=0,r=n.length;i<r&&!e.isImmediatePropagationStopped();i++)n[i].call(t,e)}}),1==o.handlers[e].length&&(document.addEventListener?t.addEventListener(e,o.dispatcher,!1):document.attachEvent&&t.attachEvent("on"+e,o.dispatcher))},vjs.off=function(t,e,s){if(vjs.hasData(t)){var o=vjs.getData(t);if(o.handlers){var n=function(e){o.handlers[e]=[],vjs.cleanUpEvents(t,e)};if(e){var i=o.handlers[e];if(i){if(!s)return void n(e);if(s.guid)for(var r=0;r<i.length;r++)i[r].guid===s.guid&&i.splice(r--,1);vjs.cleanUpEvents(t,e)}}else for(var a in o.handlers)n(a)}}},vjs.cleanUpEvents=function(t,e){var s=vjs.getData(t);0===s.handlers[e].length&&(delete s.handlers[e],document.removeEventListener?t.removeEventListener(e,s.dispatcher,!1):document.detachEvent&&t.detachEvent("on"+e,s.dispatcher)),vjs.isEmpty(s.handlers)&&(delete s.handlers,delete s.dispatcher,delete s.disabled),vjs.isEmpty(s)&&vjs.removeData(t)},vjs.fixEvent=function(t){function e(){return!0}function s(){return!1}if(!t||!t.isPropagationStopped){var o=t||window.event;t={};for(var n in o)"layerX"!==n&&"layerY"!==n&&(t[n]=o[n]);if(t.target||(t.target=t.srcElement||document),t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement,t.preventDefault=function(){o.preventDefault&&o.preventDefault(),t.returnValue=!1,t.isDefaultPrevented=e},t.isDefaultPrevented=s,t.stopPropagation=function(){o.stopPropagation&&o.stopPropagation(),t.cancelBubble=!0,t.isPropagationStopped=e},t.isPropagationStopped=s,t.stopImmediatePropagation=function(){o.stopImmediatePropagation&&o.stopImmediatePropagation(),t.isImmediatePropagationStopped=e,t.stopPropagation()},t.isImmediatePropagationStopped=s,null!=t.clientX){var i=document.documentElement,r=document.body;t.pageX=t.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),t.pageY=t.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)}t.which=t.charCode||t.keyCode,null!=t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t},vjs.trigger=function(t,
var a=r[i];if(n.canPlaySource(a))return{source:a,tech:o}}}return!1},vjs.Player.prototype.src=function(t){if(t instanceof Array){var e,s=this.selectSource(t);s?(t=s.source,e=s.tech,e==this.techName?this.src(t):this.loadTech(e,t)):this.el_.appendChild(vjs.createEl("p",{innerHTML:this.options().notSupportedMessage}))}else t instanceof Object?window.videojs[this.techName].canPlaySource(t)?this.src(t.src):this.src([t]):(this.cache_.src=t,this.isReady_?(this.techCall("src",t),"auto"==this.options_.preload&&this.load(),this.options_.autoplay&&this.play()):this.ready(function(){this.src(t)}));return this},vjs.Player.prototype.load=function(){return this.techCall("load"),this},vjs.Player.prototype.currentSrc=function(){return this.techGet("currentSrc")||this.cache_.src||""},vjs.Player.prototype.preload=function(t){return void 0!==t?(this.techCall("setPreload",t),this.options_.preload=t,this):this.techGet("preload")},vjs.Player.prototype.autoplay=function(t){return void 0!==t?(this.techCall("setAutoplay",t),this.options_.autoplay=t,this):this.techGet("autoplay",t)},vjs.Player.prototype.loop=function(t){return void 0!==t?(this.techCall("setLoop",t),this.options_.loop=t,this):this.techGet("loop")},vjs.Player.prototype.poster_,vjs.Player.prototype.poster=function(t){return void 0!==t?(this.poster_=t,this):this.poster_},vjs.Player.prototype.controls_,vjs.Player.prototype.controls=function(t){return void 0!==t?(t=!!t,this.controls_!==t&&(this.controls_=t,t?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled")):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"))),this):this.controls_},vjs.Player.prototype.usingNativeControls_,vjs.Player.prototype.usingNativeControls=function(t){return void 0!==t?(t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,t?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols"))),this):this.usingNativeControls_},vjs.Player.prototype.error=function(){return this.techGet("error")},vjs.Player.prototype.ended=function(){return this.techGet("ended")},vjs.Player.prototype.seeking=function(){return this.techGet("seeking")},vjs.Player.prototype.userActivity_=!0,vjs.Player.prototype.reportUserActivity=function(t){this.userActivity_=!0},vjs.Player.prototype.userActive_=!0,vjs.Player.prototype.userActive=function(t){return void 0!==t?(t=!!t,t!==this.userActive_&&(this.userActive_=t,t?(this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive")):(this.userActivity_=!1,this.tech.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive"))),this):this.userActive_},vjs.Player.prototype.listenForUserActivity=function(){var t,e,s,o,n,i;t=this.reportUserActivity,e=function(){t(),clearInterval(s),s=setInterval(vjs.bind(this,t),250)},o=function(e){t(),clearInterval(s)},this.on("mousedown",e),this.on("mousemove",t),this.on("mouseup",o),this.on("keydown",t),this.on("keyup",t),this.on("touchstart",e),this.on("touchmove",t),this.on("touchend",o),this.on("touchcancel",o),n=setInterval(vjs.bind(this,function(){this.userActivity_&&(this.userActivity_=!1,this.userActive(!0),clearTimeout(i),i=setTimeout(vjs.bind(this,function(){this.userActivity_||this.userActive(!1)}),2e3))}),250),this.on("dispose",function(){clearInterval(n),clearTimeout(i)})},function(){var t,e,s;s=document.createElement("div"),e={},void 0!==s.cancelFullscreen?(e.requestFn="requestFullscreen",e.cancelFn="exitFullscreen",e.eventName="fullscreenchange",e.isFullScreen="fullScreen"):(document.mozCancelFullScreen?(t="moz",e.isFullScreen=t+"FullScreen"):(t="webkit",e.isFullScreen=t+"IsFullScreen"),s[t+"RequestFullScreen"]&&(e.requestFn=t+"RequestFullScreen",e.cancelFn=t+"CancelFullScreen"),e.eventName=t+"fullscreenchange"),document[e.cancelFn]&&(vjs.support.requestFull
return this.kind_},vjs.TextTrack.prototype.src_,vjs.TextTrack.prototype.src=function(){return this.src_},vjs.TextTrack.prototype.dflt_,vjs.TextTrack.prototype.dflt=function(){return this.dflt_},vjs.TextTrack.prototype.title_,vjs.TextTrack.prototype.title=function(){return this.title_},vjs.TextTrack.prototype.language_,vjs.TextTrack.prototype.language=function(){return this.language_},vjs.TextTrack.prototype.label_,vjs.TextTrack.prototype.label=function(){return this.label_},vjs.TextTrack.prototype.cues_,vjs.TextTrack.prototype.cues=function(){return this.cues_},vjs.TextTrack.prototype.activeCues_,vjs.TextTrack.prototype.activeCues=function(){return this.activeCues_},vjs.TextTrack.prototype.readyState_,vjs.TextTrack.prototype.readyState=function(){return this.readyState_},vjs.TextTrack.prototype.mode_,vjs.TextTrack.prototype.mode=function(){return this.mode_},vjs.TextTrack.prototype.adjustFontSize=function(){this.player_.isFullScreen?this.el_.style.fontSize=screen.width/this.player_.width()*1.4*100+"%":this.el_.style.fontSize=""},vjs.TextTrack.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-"+this.kind_+" vjs-text-track"})},vjs.TextTrack.prototype.show=function(){this.activate(),this.mode_=2,vjs.Component.prototype.show.call(this)},vjs.TextTrack.prototype.hide=function(){this.activate(),this.mode_=1,vjs.Component.prototype.hide.call(this)},vjs.TextTrack.prototype.disable=function(){2==this.mode_&&this.hide(),this.deactivate(),this.mode_=0},vjs.TextTrack.prototype.activate=function(){0===this.readyState_&&this.load(),0===this.mode_&&(this.player_.on("timeupdate",vjs.bind(this,this.update,this.id_)),this.player_.on("ended",vjs.bind(this,this.reset,this.id_)),"captions"!==this.kind_&&"subtitles"!==this.kind_||this.player_.getChild("textTrackDisplay").addChild(this))},vjs.TextTrack.prototype.deactivate=function(){this.player_.off("timeupdate",vjs.bind(this,this.update,this.id_)),this.player_.off("ended",vjs.bind(this,this.reset,this.id_)),this.reset(),this.player_.getChild("textTrackDisplay").removeChild(this)},vjs.TextTrack.prototype.load=function(){0===this.readyState_&&(this.readyState_=1,vjs.get(this.src_,vjs.bind(this,this.parseCues),vjs.bind(this,this.onError)))},vjs.TextTrack.prototype.onError=function(t){this.error=t,this.readyState_=3,this.trigger("error")},vjs.TextTrack.prototype.parseCues=function(t){for(var e,s,o,n,i=t.split("\n"),r="",a=1,l=i.length;a<l;a++)if(r=vjs.trim(i[a])){for(r.indexOf("-->")==-1?(n=r,r=vjs.trim(i[++a])):n=this.cues_.length,e={id:n,index:this.cues_.length},s=r.split(" --> "),e.startTime=this.parseCueTime(s[0]),e.endTime=this.parseCueTime(s[1]),o=[];i[++a]&&(r=vjs.trim(i[a]));)o.push(r);e.text=o.join("<br/>"),this.cues_.push(e)}this.readyState_=2,this.trigger("loaded")},vjs.TextTrack.prototype.parseCueTime=function(t){var e,s,o,n,i,r=t.split(":"),a=0;return 3==r.length?(e=r[0],s=r[1],o=r[2]):(e=0,s=r[0],o=r[1]),o=o.split(/\s+/),n=o.splice(0,1)[0],n=n.split(/\.|,/),i=parseFloat(n[1]),n=n[0],a+=3600*parseFloat(e),a+=60*parseFloat(s),a+=parseFloat(n),i&&(a+=i/1e3),a},vjs.TextTrack.prototype.update=function(){if(this.cues_.length>0){var t=this.player_.currentTime();if(void 0===this.prevChange||t<this.prevChange||this.nextChange<=t){var e,s,o,n,i=this.cues_,r=this.player_.duration(),a=0,l=!1,c=[];for(t>=this.nextChange||void 0===this.nextChange?n=void 0!==this.firstActiveIndex?this.firstActiveIndex:0:(l=!0,n=void 0!==this.lastActiveIndex?this.lastActiveIndex:i.length-1);;){if(o=i[n],o.endTime<=t)a=Math.max(a,o.endTime),o.active&&(o.active=!1);else if(t<o.startTime){if(r=Math.min(r,o.startTime),o.active&&(o.active=!1),!l)break}else l?(c.splice(0,0,o),void 0===s&&(s=n),e=n):(c.push(o),void 0===e&&(e=n),s=n),r=Math.min(r,o.endTime),a=Math.max(a,o.startTime),o.active=!0;if(l){if(0===n)break;n--}else{if(n===i.length-1)break;n++}}this.activeCues_=c,this.nextChange=r,this.prevChange=a,this.firstActiveIndex=e,this.lastActiveIndex=s,this.updateDisplay(),this.trigger("cuechange")}}},vjs.TextTrack.prototype.updateDisplay=function(){for(var t=this.active