tcplayer.js 5.3.4-beta.26 → 5.3.4-beta.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,5 +18,5 @@ e.keySystems&&e.keySystems["com.widevine.alpha"]&&e.keySystems["com.widevine.alp
18
18
  return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control tcp-dvr-progress-control"})},e.prototype.update=function(t){this.getChild("DvrSeekBar").update(t)},e.prototype.handleMouseMove=function(t){var e=this.getChild("DvrSeekBar"),n=e.calculateDistance(t),i=e.getChild("DvrMouseTimeDisplay");i&&i.update(videojs.dom.getBoundingClientRect(e.el()),n)},e.prototype.handleMouseUp=function(t){this.getChild("DvrSeekBar").handleMouseUp(t)},e}(Component$11);DvrProgressControl.prototype.options_={children:["DvrSeekBar"]},videojs.registerComponent("DvrProgressControl",DvrProgressControl);var Slider$2=videojs.getComponent("Slider"),DvrSeekBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.percent_=1,r.update=throttle_1(videojs.bind(r,r.update),50),r.on(n,"seekToLive",videojs.bind(r,function(t){this.update(t.data)})),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update=function(t){t!=undefined&&(this.percent_=t,this.bar.update(videojs.dom.getBoundingClientRect(this.el_),t),this.updateAriaAttributes(t))},e.prototype.handleMouseDown=function(e){t.prototype.handleMouseDown.call(this,e),this.isMouseDown=!0},e.prototype.handleMouseMove=function(t){var e=this.calculateDistance(t);this.update(e)},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this);var n=this.calculateDistance(e);this.update(n),this.player().Dvr().timeShift(n)},e.prototype.stepBack=function(){},e.prototype.stepForward=function(){},e.prototype.updateAriaAttributes=function(t){this.el().setAttribute("aria-valuenow",(100*t).toFixed(2))},e.prototype.getPercent=function(){return this.percent_},e}(Slider$2);DvrSeekBar.prototype.options_={children:["DvrMouseTimeDisplay","DvrTimeShiftBar"],barName:"DvrTimeShiftBar"},videojs.registerComponent("DvrSeekBar",DvrSeekBar);var DvrTimeShiftBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.el_.style.width="100%",r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar tcp-dvr-time-shift",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 100%</span>"})},e.prototype.update=function(t,e){var n=(100*e).toFixed(2)+"%";this.el_.style.width=n},e}(Component$11);videojs.registerComponent("DvrTimeShiftBar",DvrTimeShiftBar);var MouseTimeDisplay$2=videojs.getComponent("MouseTimeDisplay"),DvrMouseTimeDisplay=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player().Dvr().dvrData.maxTimeShift,r=videojs.formatTime((1-e)*i,i);n.el_.style.left=t.width*e+"px",n.getChild("timeTooltip").update(t,e,r)})},e}(MouseTimeDisplay$2);videojs.registerComponent("DvrMouseTimeDisplay",DvrMouseTimeDisplay);var Button$4=videojs.getComponent("Button"),LiveButton=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){var t=Button$4.prototype.createEl.call(this,"button",{className:"vjs-live-control vjs-control"});return this.contentEl_=videojs.dom.createEl("div",{className:"vjs-live-display",innerHTML:this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},e.prototype.update=function(){},e.prototype.updateControlText=function(t){this.controlText(t?"直播中":"返回直播")},e.prototype.handleClick=function(t){this.player().Dvr().seekToLive()},e}(Button$4);LiveButton.prototype.controlText_="返回直播",videojs.registerComponent("LiveButton",LiveButton);var Plugin$4=videojs.getPlugin("plugin"),Dvr=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));r.isInit=!1,r.options=i;var o=r;return n.ready(function(){var t=n.tech(!0);t&&t.hlsProvider&&n.one("loadedmetadata",function(e){t.el_.setAttribute("poster",""),o.init(),o.options.liveURL&&o.seekToLive()})}),r}return inherits(e,t),e.prototype.init=function(){var t=this.player,e=t.tech(!0).hlsProvider;if(this.parseM3u8(e.manifests[0]),!this.dvrData.startTime&&!this.isInit)return void t.one("loadedmetadata",videojs.bind(this,function(t){this.init()}));this.initControl(),this.delay=getParams("delay",t.tech_.currentSource_.src)||0,this.updateControl(!this.isLive()),t.on("loadedmetadata",videojs.bind(this,function(){this.parseM3u8(e.manifests[0]),this.delay=getParams("delay",t.tech_.currentSource_.src)||0,this.updateControl()})),this.isInit=!0},e.prototype.initControl=function(){var t=this.player;t.addClass("vjs-dvr"),t.controlBar.getChild("ProgressControl").hide(),t.controlBar.getChild("LiveDisplay").hide(),t.controlBar.addChild("DvrProgressControl",{},5),t.controlBar.addChild("liveButton",{},6)},e.prototype.updateControl=function(t){var e=this.player,n=e.controlBar.getChild("ProgressControl"),i=e.controlBar.getChild("LiveDisplay"),r=e.controlBar.getChild("DvrProgressControl"),o=e.controlBar.getChild("LiveButton");e.toggleClass("vjs-dvr-live",this.isLive()),o.updateControlText(this.isLive()),t&&r.update(1-this.delay/this.dvrData.maxTimeShift),this.dvrData.startTime?(r.show(),o.show(),n.hide(),i.hide()):(r.hide(),o.hide(),n.show(),i.show())},e.prototype.seekToLive=function(){this.isLive()||(this.timeShift(1),this.player.trigger({type:"seekToLive",data:1}))},e.prototype.isLive=function(){return!(this.delay>0)},e.prototype.timeShift=function(t){var e=this.player,n=(e.getChild("ControlBar").getChild("LiveButton"),e.tech_.currentSource_),i=Math.floor(this.dvrData.maxTimeShift*(1-t));this.delay=i,0==i&&this.options.liveURL?e.src(this.options.liveURL):(n.src=(this.options.shiftURL||n.src).replace(/delay=*(\d+)/,"delay="+i),e.src(e.tech_.currentSource_.src)),e.bigPlayButton.hide(),e.posterImage.hide(),e.tech_.one("hlsManifestParsed",videojs.bind(this,function(){e.play()}))},e.prototype.parseM3u8=function(t){this.dvrData={};for(var e=new RegExp([/#EXT-TX-TS-START-TIME:*(.+)/.source,/|#EXT-TX-TS-DURATION:*(.+)/.source].join(""),"g"),n=void 0;null!==(n=e.exec(t));)n[1]?this.dvrData.startTime=n[1]:n[2]&&(this.dvrData.duration=n[2]);this.dvrData.startTime&&(this.dvrData.maxTimeShift=Math.min(Math.floor((new Date).getTime()/1e3-this.dvrData.startTime),this.dvrData.duration))},e}(Plugin$4);videojs.registerPlugin("Dvr",Dvr);var Component$12=videojs.getComponent("Component"),LiveProgressControl=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on("mousemove",r.handleMouseMove),r.on("mouseup",r.handleMouseUp),r.on("loadedmetadata",r.handleInit),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control tcp-live-progress-control"})},e.prototype.update=function(t){this.getChild("LiveSeekBar").update(t)},e.prototype.handleInit=function(){"dvrLive"!==this.player.dvrMode()?this.hide():(this.player.removeClass("vjs-live"),this.show(),player.controlBar.currentTimeDisplay.show())},e.prototype.handleMouseMove=function(t){var e=this.getChild("LiveSeekBar"),n=e.calculateDistance(t),i=e.getChild("LiveMouseTimeDisplay");i&&i.update(videojs.dom.getBoundingClientRect(e.el()),n)},e.prototype.handleMouseUp=function(t){this.getChild("LiveSeekBar").handleMouseUp(t)},e}(Component$12);LiveProgressControl.prototype.options_={children:["LiveSeekBar"]},videojs.registerComponent("LiveProgressControl",LiveProgressControl);var Slider$3=videojs.getComponent("Slider"),LiveSeekBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.percent_=1,r.update=throttle_1(videojs.bind(r,r.update),50),r.on(n,"timeupdate",r.update),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update=function(t){t!=undefined&&(this.percent_=t,this.bar.update(videojs.dom.getBoundingClientRect(this.el_),t),this.updateAriaAttributes(t))},e.prototype.handleMouseDown=function(e){t.prototype.handleMouseDown.call(this,e),this.isMouseDown=!0},e.prototype.handleMouseMove=function(t){var e=this.calculateDistance(t);this.update(e)},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this);var n=this.calculateDistance(e);this.update(n),this.player().LiveDvr().timeShift(n)},e.prototype.stepBack=function(){},e.prototype.stepForward=function(){},e.prototype.updateAriaAttributes=function(t){this.el().setAttribute("aria-valuenow",(100*t).toFixed(2))},e.prototype.getPercent=function(){return this.percent_},e}(Slider$3);LiveSeekBar.prototype.options_={children:["LiveMouseTimeDisplay","LiveTimeShiftBar"],barName:"LiveTimeShiftBar"},videojs.registerComponent("LiveSeekBar",LiveSeekBar);var LiveTimeShiftBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.el_.style.width="100%",r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar tcp-dvr-time-shift tcp-live-time-shift",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 100%</span>"})},e.prototype.update=function(t,e){var n=(100*e).toFixed(2)+"%";this.el_.style.width=n},e}(Component$12);videojs.registerComponent("LiveTimeShiftBar",LiveTimeShiftBar);var MouseTimeDisplay$3=videojs.getComponent("MouseTimeDisplay"),LiveMouseTimeDisplay=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player().VttThumbnail().liveDuration,r=videojs.formatTime(e*i,i);n.el_.style.left=t.width*e+"px",n.getChild("timeTooltip").update(t,e,r)})},e}(MouseTimeDisplay$3);videojs.registerComponent("LiveMouseTimeDisplay",LiveMouseTimeDisplay);var Button$5=videojs.getComponent("Button"),LiveButton$1=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){var t=Button$5.prototype.createEl.call(this,"button",{className:"vjs-live-control vjs-control"});return this.contentEl_=videojs.dom.createEl("div",{className:"vjs-live-display",innerHTML:this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},e.prototype.update=function(){},e.prototype.updateControlText=function(t){this.controlText(t?"直播中":"返回直播")},e.prototype.handleClick=function(t){this.player().LiveDvr().seekToLive()},e}(Button$5);LiveButton$1.prototype.controlText_="返回直播",videojs.registerComponent("LiveButton",LiveButton$1);var LARGE_ARRAY_SIZE=200,defineProperty$1=function(){try{var t=_getNative(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),_defineProperty=defineProperty$1,_baseAssignValue=baseAssignValue,objectProto$5=Object.prototype,hasOwnProperty$6=objectProto$5.hasOwnProperty,_assignValue=assignValue,argsTag$1="[object Arguments]",_baseIsArguments=baseIsArguments,objectProto$7=Object.prototype,hasOwnProperty$8=objectProto$7.hasOwnProperty,propertyIsEnumerable=objectProto$7.propertyIsEnumerable,isArguments=_baseIsArguments(function(){return arguments}())?_baseIsArguments:function(t){return isObjectLike_1(t)&&hasOwnProperty$8.call(t,"callee")&&!propertyIsEnumerable.call(t,"callee")},stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule(function(t,e){var n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,r=i&&i.exports===n,o=r?_root.Buffer:undefined,s=o?o.isBuffer:undefined,a=s||stubFalse_1;t.exports=a}),MAX_SAFE_INTEGER$1=9007199254740991,isLength_1=isLength,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag$2="[object Function]",mapTag$1="[object Map]",numberTag$1="[object Number]",objectTag$1="[object Object]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag$1]=typedArrayTags[float64Tag$1]=typedArrayTags[int8Tag$1]=typedArrayTags[int16Tag$1]=typedArrayTags[int32Tag$1]=typedArrayTags[uint8Tag$1]=typedArrayTags[uint8ClampedTag$1]=typedArrayTags[uint16Tag$1]=typedArrayTags[uint32Tag$1]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$1]=typedArrayTags[boolTag$1]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag$1]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag$2]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag$1]=typedArrayTags[objectTag$1]=typedArrayTags[regexpTag$1]=typedArrayTags[setTag$1]=typedArrayTags[stringTag$1]=typedArrayTags[weakMapTag$1]=!1;var _baseIsTypedArray=baseIsTypedArray,_baseUnary=baseUnary,_nodeUtil=createCommonjsModule(function(t,e){var n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,r=i&&i.exports===n,o=r&&_freeGlobal.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(e){}}();t.exports=s}),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,_overArg=overArg,nativeKeys=_overArg(Object.keys,Object),_cloneBuffer=createCommonjsModule(function(t,e){function n(t,e){if(e)return t.slice();var n=t.length,i=a?a(n):new t.constructor(n);return t.copy(i),i}var i=e&&!e.nodeType&&e,r=i&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===i,s=o?_root.Buffer:undefined,a=s?s.allocUnsafe:undefined;t.exports=n}),getPrototype=_overArg(Object.getPrototypeOf,Object),DataView$1=_getNative(_root,"DataView"),_DataView=DataView$1,Promise$1=_getNative(_root,"Promise"),_Promise=Promise$1,Set$1=_getNative(_root,"Set"),_Set=Set$1,WeakMap=_getNative(_root,"WeakMap"),_WeakMap=WeakMap,mapTag$2="[object Map]",promiseTag="[object Promise]",setTag$2="[object Set]",weakMapTag$2="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=_toSource(_DataView),mapCtorString=_toSource(_Map),promiseCtorString=_toSource(_Promise),setCtorString=_toSource(_Set),weakMapCtorString=_toSource(_WeakMap),getTag=_baseGetTag;(_DataView&&getTag(new _DataView(new ArrayBuffer(1)))!=dataViewTag$2||_Map&&getTag(new _Map)!=mapTag$2||_Promise&&getTag(_Promise.resolve())!=promiseTag||_Set&&getTag(new _Set)!=setTag$2||_WeakMap&&getTag(new _WeakMap)!=weakMapTag$2)&&(getTag=function(t){var e=_baseGetTag(t),n="[object Object]"==e?t.constructor:undefined,i=n?_toSource(n):"";if(i)switch(i){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$2;case promiseCtorString:return promiseTag;case setCtorString:return setTag$2;case weakMapCtorString:return weakMapTag$2}return e});var _getTag=getTag,mapTag$4="[object Map]",_baseIsMap=baseIsMap,nodeIsMap=_nodeUtil&&_nodeUtil.isMap,isMap=nodeIsMap?_baseUnary(nodeIsMap):_baseIsMap,setTag$4="[object Set]",_baseIsSet=baseIsSet,nodeIsSet=_nodeUtil&&_nodeUtil.isSet,isSet=nodeIsSet?_baseUnary(nodeIsSet):_baseIsSet,Plugin$5=videojs.getPlugin("plugin"),LiveDvr=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));r.isInit=!1,r.options=i;var o=r;return n.ready(function(){var t=n.tech(!0),e=t&&t.hlsProvider,i=t&&t.webrtcProvider;(e||i)&&n.one("loadedmetadata",function(e){t.el_.setAttribute("poster",""),o.init()})}),r}return inherits(e,t),e.prototype.init=function(){var t=this,e=this.player;e.on("loadedmetadata",function(){t.durationTimer&&clearInterval(t.durationTimer);var n=e.dvrMode();"dvrLive"===n&&(e.controlBar.getChild("ProgressControl").hide(),e.controlBar.getChild("LiveProgressControl")?e.controlBar.getChild("LiveProgressControl").show():e.controlBar.addChild("LiveProgressControl",{},5),e.controlBar.PDTDisplay.hide(),e.removeClass("vjs-live"),e.addClass("vjs-live-dvr")),"dvrEvent"===n&&(e.controlBar.getChild("ProgressControl").show(),e.controlBar.getChild("LiveProgressControl",{},5).hide(),e.controlBar.PDTDisplay.show(),e.removeClass("vjs-live"),e.removeClass("vjs-live-dvr"))});var n=setInterval(function(){t.liveDuration=e.VttThumbnail().liveDuration,t.liveDuration&&(t.initControl(),t.isInit=!0,clearInterval(n))},500)},e.prototype.initControl=function(){var t=this.player;"dvrLive"===t.dvrMode()&&(t.removeClass("vjs-live"),t.addClass("vjs-live-dvr"),t.controlBar.getChild("ProgressControl").hide(),t.controlBar.getChild("LiveDisplay").hide(),t.controlBar.addChild("LiveProgressControl",{},5),t.controlBar.playbackRateMenuButton.hide(),t.controlBar.durationDisplay.hide(),t.controlBar.timeDivider.hide(),t.controlBar.currentTimeDisplay.show())},e.prototype.timeShift=function(t){var e=this.player,n=e.tech_.currentSource_;if(100===t&&this.options.liveURL){e.src(this.options.liveURL);try{e.controlBar.getChild("LiveProgressControl").LiveSeekBar.LiveTimeShiftBar.el_.style.width="100%"}catch(i){}}else n.src=this.options.shiftURL,e.src(e.tech_.currentSource_.src),e.one("loadedmetadata",function(){var n=e.duration()*t;e.currentTime(n)});e.bigPlayButton.hide(),e.posterImage.hide(),e.tech_.one("hlsManifestParsed",videojs.bind(this,function(){e.play()}))},e}(Plugin$5);videojs.registerPlugin("LiveDvr",LiveDvr);var Menu$4=videojs.getComponent("Menu"),QualitySwitcherMenu=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.addItem=function(e){t.prototype.addItem.call(this,e)},e}(Menu$4),MenuItem$6=videojs.getComponent("MenuItem"),QualitySwitcherMenuItem=function(t){function e(n,i){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.handleClick=function(e){if(t.prototype.handleClick.call(this,e),this.updateItems(),this.options_.callback(this.options_),"video"==this.options_.trackType){var n=this.player().controlBar.getChild(this.options_.trackType+"QualitySwitcherMenuButton");n.updateLabel(this.options_),n.unpressButton()}},e.prototype.updateItems=function(){for(var t=this.player().controlBar.getChild(this.options_.trackType+"QualitySwitcherMenuButton"),e=t.getChild(this.options_.trackType+"QualitySwitcherMenu"),n=e.children(),i=0;i<n.length;i++){var r=n[i];this!==r?(r.selected(!1),r.options_.selected=!1):r.options_.selected=!0}},e}(MenuItem$6),MenuButton$2=videojs.getComponent("MenuButton"),Menu$3=videojs.getComponent("Menu"),QualitySwitcherMenuButton=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelEl_=videojs.dom.createEl("div",{className:"tcp-quality-switcher-value",innerHTML:""}),e.appendChild(this.labelEl_),e},e.prototype.createMenu=function(){for(var t=this.options_.qualityList,e=new QualitySwitcherMenu(this.player(),{name:this.options_.trackType+"QualitySwitcherMenu"}),n=void 0,i=t.length-1;i>-1;i--){var r=t[i];n=videojs.mergeOptions(r,{trackType:this.options_.trackType,callback:this.options_.callback,selectable:!0}),e.addItem(new QualitySwitcherMenuItem(this.player(),n)),r.selected&&this.updateLabel(r)}return e},e.prototype.updateLabel=function(t){this.labelEl_.innerHTML="<p>"+this.localize(t.label)+"</p>"},e}(MenuButton$2),Plugin$6=videojs.getPlugin("plugin"),TRACK_TYPES=["video","audio","subtitle"],TRACK_CLASS={video:"tcp-video-quality-switcher",audio:"tcp-audio-quality-switcher",subtitle:"tcp-subtitle-quality-switcher"},log$4=videojs.log,QualitySwitcher=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,n.on("qualitydataloaded",videojs.bind(r,r.init)),r}return inherits(e,t),e.prototype.init=function(t){log$4("QualitySwitcher initializing",t);var e=this.player,n=t.data.qualityData,i=t.data.callbacks;if(this.setOptions({qualityData:n,callbacks:i}),!e.controlBar)return void log$4("QualitySwitcher can not initialize without control bar");for(var r=0;r<TRACK_TYPES.length;r++){var o=TRACK_TYPES[r],s=o+"QualitySwitcherMenuButton",a=e.controlBar.getChild(s);n[o]&&n[o].length>0&&e.controlBar.options_.QualitySwitcherMenuButton&&(a&&a.el()&&(a.dispose(),e.controlBar.removeChild(a)),this.repleaceLabel(o,n),a=new QualitySwitcherMenuButton(e,{name:s,qualityList:n[o],callback:i[o],trackType:o}),a.addClass(TRACK_CLASS[o]),e.controlBar.addChild(a,{},10))}log$4("QualitySwitcher initialized",t,this)},e.prototype.setOptions=function(t){this.options=videojs.mergeOptions(this.options,t)},e.prototype.setVideoQuality=function(t){if(this.options.qualityData&&this.options.callbacks.video){for(var e=this.options.qualityData.video,n=0;n<e.length;n++)e[n].selected&&(e[n].selected=!1),e[n].id===t.id&&(e[n].selected=!0);this.options.callbacks.video(t)}},e.prototype.getVideoQualityData=function(){return this.options.qualityData?this.options.qualityData.video:undefined},e.prototype.repleaceLabel=function(t,e){if(this.options.qualityLabelList){var n=this.options.qualityLabelList[t],i=e[t];if(i&&i.length>0&&n&&n.length>0)for(var r=0;r<i.length;r++){var o=i[r].label;o=o.slice(0,o.length-1);for(var s=0;s<n.length;s++)if(n[s].height==o){i[r].label=n[s].resolutionName;break}}}},e.prototype.reset=function(){for(var t=this.player,e=0;e<TRACK_TYPES.length;e++){var n=TRACK_TYPES[e],i=t.controlBar&&t.controlBar.getChild(n+"QualitySwitcherMenuButton");i&&i.el()&&(i.dispose(),t.controlBar.removeChild(i))}},e}(Plugin$6);videojs.registerPlugin("QualitySwitcher",QualitySwitcher);var Plugin$7=videojs.getPlugin("plugin"),log$5=videojs.log,defaultOptions={labels:{FLU:"流畅",SD:"标清",HD:"高清",FHD:"超清"},showOrder:["FLU","SD","HD","FHD"],defaultRes:"SD"},MultiResolution=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,i.useManualOption&&(r.manualOptions=extend({},i)),r.hasInit=!1,n.on("multiresolutionchange",videojs.bind(r,function(t){t.data&&this.update(data)})),n.on(["resolutionswitching","resolutionswitched"],videojs.bind(r,function(t){"resolutionswitching"==t.type?this.player.addClass("tcp-res-switching"):this.player.removeClass("tcp-res-switching")})),n.ready(videojs.bind(r,function(){var t=n.tech(!0);t&&(t.on("masterplaylistchange",videojs.bind(this,this.onMasterPlaylistChange)),t.on("hlsresolutionswitching",videojs.bind(this,this.onHlsLevelChange)),t.on("hlsresolutionswitched",videojs.bind(this,this.onHlsLevelChange)),t.on("dashqualityswitching",videojs.bind(this,this.onDashQualityChange)),t.on("dashqualityswitched",videojs.bind(this,this.onDashQualityChange))),this.hasInit=!0})),r.init(r.player.options_.multiResolution),r}return inherits(e,t),e.prototype.init=function(t){var e={};this.player.options_.label&&(e.label=this.player.options_.label),this.player.options_.labels&&(e.labels=this.player.options_.label),this.player.options_.showOrder&&(e.showOrder=this.player.options_.showOrder),this.player.options_.defaultRes&&(e.defaultRes=this.player.options_.defaultRes);var n=this.player,i=extend({},defaultOptions,t,this.manualOptions,e),r=i&&i.sources;if(this.options=i,r){log$5("MultiResolution initializing",i);var o=void 0;if(this.currentID=i.defaultRes=r[i.defaultRes]?i.defaultRes:Object.keys(r).shift(),o=r[this.currentID],"mediaLoader"!=n.options_.children[0]||this.hasInit)n.src(o);else{var s;(s=n.options_.sources).push.apply(s,o)}this.hasInit||(this.hasInit=!0),n.ready(videojs.bind(this,function(){n.trigger({type:"qualitydataloaded",data:this.initQualityData(i)}),n.one("loadedmetadata",function(){var t=this.tech(!0);"flash"!=t.name_&&t.el_.getAttribute("poster")&&(t.el_.removeAttribute("poster"),delete t.el_.poster)})})),log$5("MultiResolution initialized")}},e.prototype.reset=function(){this.player.QualitySwitcher().reset()},e.prototype.update=function(t){this.init(t)},e.prototype.store=function(t){if(!t)return this.options;this.options=videojs.mergeOptions(defaultOptions,this.options,t)},e.prototype.onMasterPlaylistChange=function(t){this.player.trigger({type:"qualitydataloaded",data:t.data})},e.prototype.onHlsLevelChange=function(t){"hlsresolutionswitching"==t.type?this.player.trigger({type:"resolutionswitching",data:t.data}):"hlsresolutionswitched"==t.type&&this.player.trigger({type:"resolutionswitched",data:t.data})},e.prototype.onDashQualityChange=function(t){"dashqualityswitching"==t.type?this.player.trigger({type:"resolutionswitching",data:t.data}):"dashqualityswitched"==t.type&&this.player.trigger({type:"resolutionswitched",data:t.data})},e.prototype.switchResolution=function(t){if(this.currentID!=t.id){var e=this.player,n=e.currentTime(),i=(e.paused(),Infinity===e.duration());if(e.trigger({type:"resolutionswitching",data:t}),i)e.bigPlayButton&&e.bigPlayButton.hide(),e.posterImage&&e.posterImage.hide(),e.one("loadstart",function(){e.play(),e.trigger({type:"resolutionswitched",data:t})});else{var r=e.ended(),o=e.playbackRate(),s=e.controlBar&&e.controlBar.progressControl&&e.controlBar.progressControl.seekBar.playProgressBar.el().style.width||0,a=videojs.browser.IS_IOS||videojs.browser.IS_ANDROID?"loadeddata":"loadedmetadata";e.one(a,function(){e.controlBar&&e.controlBar.progressControl&&(e.controlBar.progressControl.seekBar.playProgressBar.el().style.width=s),r||e.currentTime(n),"Flash"==e.techName_?(e.play(),e.tech(!0).trigger("seeked")):(e.play(),e.playbackRate()!=o&&e.playbackRate(o)),e.trigger({type:"resolutionswitched",data:t})}),e.bigPlayButton&&e.bigPlayButton.hide(),e.posterImage&&e.posterImage.hide(),"none"==e.options_.preload&&e.one("suspend",function(){e.load()})}e.src(this.options.sources[t.id]),i&&setTimeout(function(){e.play(),setTimeout(function(){e.play()},900)},100),this.currentID=t.id}},e.prototype.initQualityData=function(t){var e=[],n=(t.sources,t.labels),i=t.showOrder;return i.length>0&&i.forEach(function(i,r){var o={};o.id=i,o.selected=t.defaultRes===i,o.label=n[i]||i,e.push(o)}),{qualityData:{video:e},callbacks:{video:videojs.bind(this,this.switchResolution)}}},e.prototype.sortSourceOrder=function(t){return[]},e}(Plugin$7);videojs.registerPlugin("MultiResolution",MultiResolution);var FlashObj=videojs.getComponent("Flash"),defaultDismiss=!videojs.browser.IS_IPHONE,registerPlugin=videojs.registerPlugin||videojs.plugin,defaults$1={header:"",code:"",message:"",timeout:45e3,dismiss:defaultDismiss,progressDisabled:!1,errors:{1:{type:"MEDIA_ERR_ABORTED"},2:{type:"MEDIA_ERR_NETWORK"},3:{type:"MEDIA_ERR_DECODE"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED"},5:{type:"MEDIA_ERR_ENCRYPTED"},unknown:{type:"MEDIA_ERR_UNKNOWN"},"-1":{type:"PLAYER_ERR_NO_SRC",message:"No video has been loaded."},"-2":{type:"PLAYER_ERR_TIMEOUT",message:"Could not download the video."},10:{type:"SERVER_ERR",message:"Request timed out."},11:{type:"SERVER_ERR",message:"Server is not respond."},12:{type:"DATA_ERR",message:"Server respond error data."},13:{type:"DATA_ERR",message:"No video transcoding information found."},14:{type:"HLS_NETWORK_ERR",message:"A network error caused the media download to fail part-way."},15:{type:"HLS_MEDIA_ERR",message:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support."},16:{type:"HLS_MUX_ERR",message:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support."},17:{type:"HLS_OTHER_ERR",message:"Rise an internal exception when playing HLS."},18:{type:"DRM_ERR",message:"Current browser not support DRM."},20:{type:"PERMISSION_ERR",message:"This website needs a permission to access device motion."},21:{type:"PERMISSION_ERR",message:"This website needs a permission to access device motion."},30:{type:"FILE_NETWORK_ERR",message:"Failed to load hls.js file"},31:{type:"FILE_NETWORK_ERR",message:"Failed to load webrtc file"},32:{type:"FILE_NETWORK_ERR",message:"Failed to load flv file"},33:{type:"FILE_NETWORK_ERR",message:"Failed to load dash file"},50:{type:"LICENSE_ERR",message:"License verification failed."},51:{type:"LICENSE_ERR",message:"The license has expired."},52:{type:"LICENSE_ERR",message:"Domain verification failed."},53:{type:"LICENSE_ERR",message:"Time verification failed."},54:{type:"LICENSE_ERR",message:"License type error."},55:{type:"LICENSE_ERR",message:"Lack license url."},56:{type:"LICENSE_ERR",message:"Get license data failed."},60:{type:"SAFECHECK_ERR",message:"Elements check failed."},61:{type:"SAFECHECK_ERR",message:"API check failed."},62:{type:"SAFECHECK_ERR",message:"Environment check failed."},63:{type:"SAFECHECK_ERR",message:"Environment check failed."},403:{type:"SERVER_ERR",message:"Authentication failed."},500:{type:"SERVER_ERR",message:"Server failed."},1001:{type:"SERVER_ERR",message:"The media file does not exist. Please check if the fileID is correct."},1002:{type:"SERVER_ERR",message:"The trial duration is illegal. The trial duration must be within the video duration."},1003:{type:"SERVER_ERR",message:"Param pcfg is not unique."},1004:{type:"SERVER_ERR",message:"The license has expired. Please check whether the expiration time setting is reasonable."},1005:{type:"SERVER_ERR",message:"Did not find an adaptive stream that can be played."},1006:{type:"SERVER_ERR",message:"Invalid request format, please check the request format."},1007:{type:"SERVER_ERR",message:"AppID is not exist, Please check if the AppID is correct."},1008:{type:"SERVER_ERR",message:"Without anti-leech information."},1009:{type:"SERVER_ERR",message:"psign check failed."},1010:{type:"SERVER_ERR",message:"Other errors."},1011:{type:"SERVER_ERR",message:"Get DRM license url failed"},1012:{type:"SERVER_ERR",message:"Get DRM certificate url failed"},1013:{type:"SERVER_ERR",message:"Psign missing contentInfo error"},1014:{type:"SERVER_ERR",message:"Psign contentInfo.audioVideoType invalid"},1015:{type:"SERVER_ERR",message:"Psign missing rawAdaptiveDefinition error"},1016:{type:"SERVER_ERR",message:"Psign missing drmAdaptiveInfo error"},1017:{type:"SERVER_ERR",message:"Psign missing transcodeDefinition error"},1018:{type:"SERVER_ERR",message:"Psign contentInfo.ResolutionNames json marshal error"},1019:{type:"SERVER_ERR",message:"Get super player config error"},1020:{type:"SERVER_ERR",message:"Get play key info error"},1021:{type:"SERVER_ERR",message:"Qsign invalid"},1022:{type:"SERVER_ERR",message:"Ciphered overlay info invalid"},1023:{type:"SERVER_ERR",message:"Ghost watermark info text is too long"},2001:{type:"SERVER_ERR",message:"System error"},2002:{type:"SERVER_ERR",message:"Panic error"},19:{type:"DATA_ERR",message:"Response data verification failed."},10008:{type:"SERVER_ERR",message:"The media file does not exist. Please check if the fileID is correct."},"-2001":{type:"SERVER_ERR",message:"Current browser not support play this stream, please select another one."},"-2002":{type:"SERVER_ERR",message:"Server respond error data.(eg. stream not exist)"},"-2003":{type:"SERVER_ERR",message:"Video play failed, please refresh to start play again."},"-2004":{type:"SERVER_ERR",message:"Connection to the server has failed and the number of connection retries has exceeded the set value."},"-2005":{type:"SERVER_ERR",message:"Video decoding failure."},PLAYER_ERR_DOMAIN_RESTRICTED:{
19
19
  message:"This video is restricted from playing on your current domain."},PLAYER_ERR_IP_RESTRICTED:{message:"This video is restricted at your current IP address."},PLAYER_ERR_GEO_RESTRICTED:{message:"This video is restricted from playing in your current geographic region."}}},initPlugin=function e(t,n){var i=void 0,r=void 0,o=void 0,s=[];videojs.getComponent("ErrorDisplay").prototype.options_.fillAlways=!1;var a=function(t){n.errors=videojs.mergeOptions(n.errors,t),Object.keys(n.errors).forEach(function(t){var e=n.errors[t];e.type||(e.type=t)})};a();var u=function(){t.clearTimeout(r),o&&(o=!1,t.removeClass("vjs-waiting")),r=t.setTimeout(function(){t.error()||t.paused()||t.ended()||(o=!0,t.addClass("vjs-waiting"))},1e3),t.clearTimeout(i),i=t.setTimeout(function(){t.error()||t.paused()||t.ended()||t.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},n.timeout),t.error()&&-2===t.error().code&&t.error(null)},l=function(){for(var e=void 0;s.length;)e=s.shift(),t.off(e[0],e[1]);t.clearTimeout(i),t.clearTimeout(r)},c=function(e,n){var i=function(){if(!t.error()){var e=t.$(".vjs-tech");if(e&&"application/x-shockwave-flash"===e.type&&!e.vjs_getProperty)return void t.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});if(t.paused())return u();if(t.ended())return u()}n.call(this)};t.on(e,i),s.push([e,i])},h=function(){var e=0;l(),u(),c(["timeupdate","adtimeupdate"],function(){var n=t.currentTime();n!==e&&(e=n,u())}),n.progressDisabled||c("progress",u)},p=function(e){var i="",r=t.error(),o=document_1.createElement("div"),s="";if(r){r=videojs.mergeOptions(r,n.errors[r.code||0]),r.message&&(i='<div class="vjs-errors-message">'+t.localize(r.message)+"</div>"),r.code&&(i+='<div class="vjs-errors-code">'+this.localize("Error Code")+" : "+r.code+"</div>"),r.type&&(i+='<div class="vjs-errors-type">'+this.localize("Error Type")+" : "+r.type+"</div>"),"10"==r.code||r.code,r.code,r.code,o.className="vjs-errors-dialog",s='<div class="vjs-errors-content-container">\n '+i+"\n </div>";var a=t.getChild("errorDisplay");a&&a.closeable(!("dismiss"in r)||r.dismiss)?(o.innerHTML=s,a.fillWith(o),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el())):(o.innerHTML=s,a.fillWith(o)),a.one("modalclose",function(){return t.error(null)})}},d=function y(){l(),t.removeClass("vjs-errors"),t.off("dispose",y),t.off(["aderror","error"],p)},f=function(n){d(),e(t,videojs.mergeOptions(defaults$1,n))};f.extend=function(t){return a(t)},f.getAll=function(){return videojs.mergeOptions(n.errors)},f.disableProgress=function(t){n.progressDisabled=t,h()},t.on("dispose",d),t.on(["aderror","error"],p),t.ready(function(){t.addClass("vjs-errors")}),t.errors=f},errors=function(t){initPlugin(this,videojs.mergeOptions(defaults$1,t))};["extend","getAll","disableProgress"].forEach(function(t){errors[t]=function(){videojs.log.warn("The errors."+t+"() method is not available until the plugin has been initialized!")}}),registerPlugin("Errors",errors);var Plugin$8=videojs.getPlugin("plugin"),cgiSeq={},STATUS_CODE_REPORT_URL="//report.huatuo.qq.com/code.cgi",log$6=videojs.log,Reporter=function(t){function e(n,i){classCallCheck(this,e),log$6("Reporter initilaizing");var r=possibleConstructorReturn(this,t.call(this,n));if(!n.options_.plugins.Reporter){var o;return o=!1,possibleConstructorReturn(r,o)}return r.reportContent={status:"idle"},r.mtaReportCache=[],log$6("Reporter initilaized"),r}return inherits(e,t),e.prototype.setStorage=function(t,e){localStorage.setItem(t,e)},e.prototype.getStorage=function(t){localStorage.getItem(t)},e.prototype.sender=function(t){var e=new Image;e.onload=e.onerror=e.onabort=function(){e.onload=e.onerror=e.onabort=null,e=null},e.src=t},e.prototype.initPlayCgiCodeReport=function(){var t=this.player;t.on("playcgistart",videojs.bind(this,this.onPlayCgiStart)),t.on("playcgiend",videojs.bind(this,this.onPlayCgiEnd))},e.prototype.onPlayCgiStart=function(t){cgiSeq[t.data.time]=cgiSeq[t.data.time]||{},cgiSeq[t.data.time].startTime=t.data.time,cgiSeq[t.data.time].url=t.data.url},e.reportPlayMetrics=function(t,e){xhr.post("https://datacenter.live.tlivesource.com",{body:JSON.stringify(t)},function(){e&&e()})},e.prototype.onPlayCgiEnd=function(t){if(cgiSeq[t.data.startTime]){var e=t.data,n=void 0,i=void 0,r=void 0;if(e.error)switch(i=2,e.error.message){case"Timeout":n=10;break;case"ServerError":n=11}else 0==e.result.code?(i=1,n=0):(i=3,n=e.result.code),r=e.result.requestId;this.reportPlayCgiToISD("","",i,n,t.data.time-cgiSeq[t.data.startTime].startTime,r,void 0,void 0)}},e.prototype.reportPlayCgiToISD=function(t,e,n,i,r,o,s,a){var u={domain:t||"playvideo.qcloud.com",cgi:e||"/getplayinfo/v2",type:n,code:i,time:r,appid:20370,platform:videojs.browser.IS_IOS?"ios":videojs.browser.IS_ANDROID?"android":"pc",expansion1:o,expansion2:s,expansion3:a};this.sender(unifyProtocol(STATUS_CODE_REPORT_URL)+"?"+serializeParams(u))},e.prototype.reportMTA=function(t,e){window.MtaH5?(this.mtaReportCache.length>0&&(this.mtaReportCache.forEach(function(t){t.call()}),this.mtaReportCache=0),MtaH5.clickStat(t,e)):this.mtaReportCache.push(function(){MtaH5.clickStat(t,e)})},e}(Plugin$8);videojs.registerPlugin("Reporter",Reporter);var store2=createCommonjsModule(function(t){!function(e,n){var i={version:"2.12.0",areas:{},apis:{},inherit:function(t,e){for(var n in t)e.hasOwnProperty(n)||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e},stringify:function(t){return t===undefined||"function"==typeof t?t+"":JSON.stringify(t)},parse:function(t,e){try{return JSON.parse(t,e||i.revive)}catch(n){return t}},fn:function(t,e){i.storeAPI[t]=e;for(var n in i.apis)i.apis[n][t]=e},get:function(t,e){return t.getItem(e)},set:function(t,e,n){t.setItem(e,n)},remove:function(t,e){t.removeItem(e)},key:function(t,e){return t.key(e)},length:function(t){return t.length},clear:function(t){t.clear()},Store:function(t,e,n){var r=i.inherit(i.storeAPI,function(t,e,n){return 0===arguments.length?r.getAll():"function"==typeof e?r.transact(t,e,n):e!==undefined?r.set(t,e,n):"string"==typeof t||"number"==typeof t?r.get(t):"function"==typeof t?r.each(t):t?r.setAll(t,e):r.clear()});r._id=t;try{e.setItem("__store2_test","ok"),r._area=e,e.removeItem("__store2_test")}catch(o){r._area=i.storage("fake")}return r._ns=n||"",i.areas[t]||(i.areas[t]=r._area),i.apis[r._ns+r._id]||(i.apis[r._ns+r._id]=r),r},storeAPI:{area:function(t,e){var n=this[t];return n&&n.area||(n=i.Store(t,e,this._ns),this[t]||(this[t]=n)),n},namespace:function(t,e){if(!t)return this._ns?this._ns.substring(0,this._ns.length-1):"";var n=t,r=this[n];if(!(r&&r.namespace||(r=i.Store(this._id,this._area,this._ns+n+"."),this[n]||(this[n]=r),e)))for(var o in i.areas)r.area(o,i.areas[o]);return r},isFake:function(){return"fake"===this._area.name},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(t){return this._area.has?this._area.has(this._in(t)):!!(this._in(t)in this._area)},size:function(){return this.keys().length},each:function(t,e){for(var n=0,r=i.length(this._area);n<r;n++){var o=this._out(i.key(this._area,n));if(o!==undefined&&!1===t.call(this,o,this.get(o),e))break;r>i.length(this._area)&&(r--,n--)}return e||this},keys:function(t){return this.each(function(t,e,n){n.push(t)},t||[])},get:function(t,e){var n,r=i.get(this._area,this._in(t));return"function"==typeof e&&(n=e,e=null),null!==r?i.parse(r,n):null!=e?e:r},getAll:function(t){return this.each(function(t,e,n){n[t]=e},t||{})},transact:function(t,e,n){var i=this.get(t,n),r=e(i);return this.set(t,r===undefined?i:r),this},set:function(t,e,n){var r=this.get(t);return null!=r&&!1===n?e:i.set(this._area,this._in(t),i.stringify(e),n)||r},setAll:function(t,e){var n,i;for(var r in t)i=t[r],this.set(r,i,e)!==i&&(n=!0);return n},add:function(t,e){var n=this.get(t);if(n instanceof Array)e=n.concat(e);else if(null!==n){var r=typeof n;if(r===typeof e&&"object"===r){for(var o in e)n[o]=e[o];e=n}else e=n+e}return i.set(this._area,this._in(t),i.stringify(e)),e},remove:function(t,e){var n=this.get(t,e);return i.remove(this._area,this._in(t)),n},clear:function(){return this._ns?this.each(function(t){i.remove(this._area,this._in(t))},1):i.clear(this._area),this},clearAll:function(){var t=this._area;for(var e in i.areas)i.areas.hasOwnProperty(e)&&(this._area=i.areas[e],this.clear());return this._area=t,this},_in:function(t){return"string"!=typeof t&&(t=i.stringify(t)),this._ns?this._ns+t:t},_out:function(t){return this._ns?t&&0===t.indexOf(this._ns)?t.substring(this._ns.length):undefined:t}},storage:function(t){return i.inherit(i.storageAPI,{items:{},name:t})},storageAPI:{length:0,has:function(t){return this.items.hasOwnProperty(t)},key:function(t){var e=0;for(var n in this.items)if(this.has(n)&&t===e++)return n},setItem:function(t,e){this.has(t)||this.length++,this.items[t]=e},removeItem:function(t){this.has(t)&&(delete this.items[t],this.length--)},getItem:function(t){return this.has(t)?this.items[t]:null},clear:function(){for(var t in this.items)this.removeItem(t)}}},r=i.Store("local",function(){try{return localStorage}catch(t){}}());r.local=r,r._=i,r.area("session",function(){try{return sessionStorage}catch(t){}}()),r.area("page",i.storage("page")),"function"==typeof n&&n.amd!==undefined?n("store2",[],function(){return r}):t.exports?t.exports=r:(e.store&&(i.conflict=e.store),e.store=r)}(commonjsGlobal,commonjsGlobal&&commonjsGlobal.define)}),Plugin$9=videojs.getPlugin("plugin"),log$7=videojs.log,ContinuePlay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,r.init(),r}return inherits(e,t),e.prototype.init=function(t){var e=this.player,n=e.options_,i=void 0;e.off("timeupdate",videojs.bind(this,this.onTimeUpdate)),e.ready(videojs.bind(this,function(){i=n&&n.appID&&n.fileID?n.fileID:this.options.playID,this.playID=i,t&&t.src?this.source=t.src.split("?")[0]:e.cache_&&e.cache_.source&&e.cache_.source.src&&(this.source=e.cache_.source.src.split("?")[0]),(i||this.source)&&(log$7("ContinuePlay initializing"),this.lastTime=store2.get(this.getStoreKey()),e.off("timeupdate",videojs.bind(this,this.onTimeUpdate)),e.on("timeupdate",videojs.bind(this,this.onTimeUpdate)),e.one(this.getTriggerEvent(),videojs.bind(this,this.onPlay)),!this.options.auto&&e.getChild("ContinuePlayTips")&&e.getChild("ContinuePlayTips").close(),log$7("ContinuePlay initialized"),e.trigger({type:"feature",data:"continue"}))}))},e.prototype.onTimeUpdate=function(t){store2.set(this.getStoreKey(),this.player.currentTime())},e.prototype.onPlay=function(t){var e=this.player;Math.round(this.lastTime)>1&&this.player.duration()>1&&this.player.duration()!==Infinity&&Math.round(this.lastTime)!=Math.round(this.player.duration())?this.options.auto?this.start():e.addChild("ContinuePlayTips",videojs.mergeOptions(this.options,{time:this.lastTime,resumeCallback:videojs.bind(this,this.start)})):"Flash"==e.techName_&&Math.round(this.lastTime)>1&&Math.round(this.lastTime)!=Math.round(this.player.duration())&&this.player.duration()!==Infinity&&!this.player.duration()&&e.one("loadedmetadata",videojs.bind(this,this.onPlay))},e.prototype.start=function(){var t=this.player;t.currentTime(this.lastTime),"Flash"==t.techName_&&t.tech(!0).trigger("seeked"),t.trigger({type:"continueplay",data:{lastTime:this.lastTime}})},e.prototype.generatePlayID=function(){},e.prototype.getStoreKey=function(){return"tcplayer-lpt-"+(this.playID||this.source)},e.prototype.getTriggerEvent=function(){var t=this.player,e=t.options_;return e.autoplay&&"Flash"==t.techName_?"loadedmetadata":"playing"},e}(Plugin$9);videojs.registerPlugin("ContinuePlay",ContinuePlay);var defaults$2={align:"top-left",className:"",content:"",debug:!1,showBackground:!0,attachToControlBar:!1,overlays:[]},Component$13=videojs.getComponent("Component"),dom$1=videojs.dom||videojs,registerPlugin$1=videojs.registerPlugin||videojs.plugin,isNumber=function(t){return"number"==typeof t&&t===t},hasNoWhitespace=function(t){return"string"==typeof t&&/^\S+$/.test(t)},Overlay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return["start","end"].forEach(function(t){var e=r.options_[t];if(isNumber(e))r[t+"Event_"]="timeupdate";else if(hasNoWhitespace(e))r[t+"Event_"]=e;else if("start"===t)throw new Error('invalid "start" option; expected number or string')}),["endListener_","rewindListener_","startListener_"].forEach(function(t){r[t]=function(n){return e.prototype[t].call(r,n)}}),"timeupdate"===r.startEvent_&&r.on(n,"timeupdate",r.rewindListener_),r.debug('created, listening to "'+r.startEvent_+'" for "start" and "'+(r.endEvent_||"nothing")+'" for "end"'),r.hide(),r}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_,e=t.content,n=t.showBackground?"tcp-overlay-background":"tcp-overlay-no-background",i=dom$1.createEl("div",{className:"\n tcp-overlay\n tcp-overlay-"+t.align+"\n "+t.className+"\n "+n+"\n vjs-hidden\n "});return"string"==typeof e?i.innerHTML=e:videojs.browser.IS_IE8||e instanceof window_1.DocumentFragment?i.appendChild(e):dom$1.appendContent(i,e),i},e.prototype.debug=function(){if(this.options_.debug){for(var t=videojs.log,e=t,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];t.hasOwnProperty(i[0])&&"function"==typeof t[i[0]]&&(e=t[i.shift()]),e.apply(undefined,["overlay#"+this.id()+": "].concat(i))}},e.prototype.hide=function(){return t.prototype.hide.call(this),this.debug("hidden"),this.debug('bound `startListener_` to "'+this.startEvent_+'"'),this.endEvent_&&(this.debug('unbound `endListener_` from "'+this.endEvent_+'"'),this.off(this.player(),this.endEvent_,this.endListener_)),this.options_.once?(videojs.browser.IS_IOS&&videojs.browser.IS_WECHAT?this.player().hasStarted()||this.player().ready(videojs.bind(this,function(){this.startListener_({type:this.startEvent_})})):this.player().hasStarted()||this.on(this.player(),this.startEvent_,this.startListener_),this):("pause"===this.startEvent_?this.on(this.player(),this.startEvent_,this.startOnPause_):this.on(this.player(),this.startEvent_,this.startListener_),this)},e.prototype.startOnPause_=function(t){var e=this.player();"pause"===t.type?e.seeking()||e.ended()||this.startListener_({type:"pause"}):e.paused()&&this.startListener_({type:"pause"})},e.prototype.shouldHide_=function(t,e){var n=this.options_.end;return isNumber(n)?t>=n:n===e},e.prototype.show=function(){return t.prototype.show.call(this),"pause"===this.startEvent_&&this.off(this.player(),this.startEvent_,this.startOnPause_),this.off(this.player(),this.startEvent_,this.startListener_),this.debug("shown"),this.debug('unbound `startListener_` from "'+this.startEvent_+'"'),this.endEvent_&&(this.debug('bound `endListener_` to "'+this.endEvent_+'"'),this.on(this.player(),this.endEvent_,this.endListener_)),this},e.prototype.shouldShow_=function(t,e){var n=this.options_.start,i=this.options_.end;return isNumber(n)?isNumber(i)?t>=n&&t<i:this.hasShownSinceSeek_?Math.floor(t)===n:(this.hasShownSinceSeek_=!0,t>=n):n===e},e.prototype.startListener_=function(t){var e=this.player().currentTime();this.shouldShow_(e,t.type)&&this.show()},e.prototype.endListener_=function(t){var e=this.player().currentTime();this.shouldHide_(e,t.type)&&this.hide()},e.prototype.rewindListener_=function(t){var e=this.player().currentTime(),n=this.previousTime_,i=this.options_.start,r=this.options_.end;e<n&&(this.debug("rewind detected"),isNumber(r)&&!this.shouldShow_(e)?(this.debug("hiding; "+r+" is an integer and overlay should not show at this time"),this.hasShownSinceSeek_=!1,this.hide()):hasNoWhitespace(r)&&e<i&&(this.debug("hiding; show point ("+i+") is before now ("+e+") and end point ("+r+") is an event"),this.hasShownSinceSeek_=!1,this.hide())),this.previousTime_=e},e}(Component$13);videojs.registerComponent("Overlay",Overlay);var plugin=function(t){var e=this,n=videojs.mergeOptions(defaults$2,t);Array.isArray(this.overlays_)&&this.overlays_.forEach(function(t){e.removeChild(t),e.controlBar&&e.controlBar.removeChild(t),t.dispose()});var i=n.overlays;delete n.overlays,this.overlays_=i.map(function(t){var i=videojs.mergeOptions(n,t);return i.attachToControlBar&&e.controlBar&&-1!==i.align.indexOf("bottom")?e.controlBar.addChild("overlay",i):e.addChild("overlay",i)})};registerPlugin$1("Patch",plugin);var Plugin$10=videojs.getPlugin("plugin"),log$8=videojs.log,locations=["start","pause","ended"],startEvent=["loadstart","pause","ended"],endEvent=["play","play","play"],ImagePatch=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.hasInit=!1,r.init(i),r}return inherits(e,t),e.prototype.init=function(t){var e=this,n=this.player,i={showBackground:!1,overlays:[]};Array.isArray(t)&&t.length>0&&(log$8("ImagePatch initializing"),t.forEach(function(t){var n=void 0,r=void 0,o=void 0,s=void 0,a=document.createDocumentFragment();o=document.createElement("a"),o.className="tcp-overlay-link",o.target="_blank",t.link&&(o.href=t.link),t.url&&(s=e.loadImg(unifyProtocol(t.url),videojs.bind(e,e.onImgLoaded)),s.className="tcp-overlay-img",o.appendChild(s),videojs.browser.IS_IE8?(n=document.createElement("div"),n.className="tcp-overlay-table",r=document.createElement("div"),r.className="tcp-overlay-cell",r.appendChild(o),n.appendChild(r),a.appendChild(n)):a.appendChild(o),i.overlays.push({content:a,className:"tcp-image-patch tcp-image-patch-"+locations[t.location],start:startEvent[t.location],end:endEvent[t.location],once:0==t.location,align:"center"}))}),i.overlays.length>0?(n.Patch(i),n.trigger({type:"feature",data:"patch"}),this.hasInit=!0):this.reset(),log$8("ImagePatch initialized"))},e.prototype.loadImg=function(t,e){var n,i,r,o,s,a=new Image;return a.src=t,a.complete?(e&&e.call(e,a),a):(i=a.width,r=a.height,a.onerror=function(){n.end=!0,a=a.onload=a.onerror=null},n=function(){o=a.width,s=a.height,(o!==i||s!==r||o*s>1024)&&(e&&e.call(e,a),n.end=!0)},n(),a.onload=function(){!n.end&&n(),a=a.onload=a.onerror=null},a)},e.prototype.onImgLoaded=function(t){if(videojs.browser.IE_VERSION){var e=parseInt(this.player.el().currentStyle.width),n=parseInt(this.player.el().currentStyle.height);if(t.width>e||t.height>n){var i=e/(t.width/t.height);t.width/t.height>e/n||(t.style.marginTop=(n-i)/2+"px"),t.style.width="100%",t.style.height="auto"}}},e.prototype.reset=function(){this.hasInit&&(log$8("ImagePatch reset"),this.player.Patch(),this.hasInit=!1)},e}(Plugin$10);videojs.registerPlugin("ImagePatch",ImagePatch);var Plugin$11=videojs.getPlugin("plugin"),log$9=videojs.log,ContextMenu=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,log$9("ContextMenu initializing"),r.init(),log$9("ContextMenu initialized"),r}return inherits(e,t),e.prototype.init=function(){this.player.addChild("RightClickPopupMenu",this.options)},e}(Plugin$11);videojs.registerPlugin("ContextMenu",ContextMenu);var Plugin$12=videojs.getPlugin("plugin"),LevelSwitch=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,r.init(),r}return inherits(e,t),e.prototype.init=function(){var t=this.player,e=t.options_.plugins.ContextMenu;e&&e.levelSwitch&&e.levelSwitch.open&&t.addChild("LevelSwitchTips",this.options)},e}(Plugin$12);videojs.registerPlugin("LevelSwitch",LevelSwitch);var getParams$2=getParams,Plugin$13=videojs.getPlugin("plugin"),log$11=videojs.log,VttThumbnail=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.hasInit=!1,r.spriteData=[],r.firstShowSprite=!0,r.defaults={width:0,height:0,basePath:""},(i.vttUrl||!0===i.enable)&&n.on("loadedmetadata",function(){r.getSpriteConfig(),r.init(i)}),r}return inherits(e,t),e.prototype.checkEventDvr=function(){var t=this.player.dvrMode();return!!this.player.src()&&("dvrLive"===t||"dvrEvent"===t)},e.prototype.loadTrackFile=function(t){var e=this,n=this.player,i=n.addRemoteTextTrack({src:t.vttUrl,kind:"metadata"},!0);i&&i.addEventListener("load",function(){e.trackInfo=i})},e.prototype.getSpriteConfig=function(){if(!this.checkEventDvr())return!1;var t=this,e=this.player;this.canGetNewSprite=!1;var n=e.src(),i=(getParams$2(n,"tsEnd"),parseInt((new Date).getTime()/1e3),get_1(e,"options_.plugins.Dvr.spriteURL")),r=get_1(e,"options_.plugins.Dvr.startTime"),o=i.indexOf("http://")>-1?"http://":"https://",s=i.replace("https://","").replace("http://","").split("/")[0];xhr({url:i,timeout:3e3},function(e,n,i){if(!i)return!1;t.spriteData=JSON.parse(i),t.lastTime=t.spriteData[t.spriteData.length-1].last_time,t.liveDuration=0,t.spriteData.sort(function(t,e){return t.start_time-e.start_time});for(var a=0;a<t.spriteData.length;a++){var u=t.spriteData[a];0==a&&r>u.start_time?(u.hidden_dur=r-u.start_time,u.play_dur=u.end_time-r,u.hasOwnProperty("duration")&&(u.play_dur=u.duration*u.play_dur/(u.end_time-u.start_time),u.hidden_dur=u.duration-u.play_dur,t.liveDuration+=u.play_dur)):(u.hidden_dur=0,u.play_dur=u.end_time-u.start_time,u.hasOwnProperty("duration")&&(u.play_dur=u.duration,t.liveDuration+=u.play_dur))}t.initLiveDuration=t.liveDuration,t.canGetNewSprite=!0,t.baseHost=o+s,t.prefix=t.baseHost+t.spriteData[t.spriteData.length-1].path,t.durationTimer&&clearInterval(t.durationTimer),t.durationTimer=setInterval(function(){t.player&&!t.player.paused()&&(t.liveDuration=t.liveDuration+1)},1e3)})},e.prototype.init=function(t){if(!videojs.browser.IS_IOS&&!videojs.browser.IS_ANDROID&&this.player.controlBar&&this.player.controlBar.progressControl){if(log$11("VttThumbnail initializing",t),!this.player.controlBar)return void log$11("VttThumbnail can not initialize without control bar");this.options=t;var e=this.player;t.vttUrl&&(this.loadTrackFile(t),this.defaults.basePath=parseBasePath(t.vttUrl)),this.initUI(),this.hasInit=!0,log$11("VttThumbnail initialized"),e.trigger({type:"feature",data:"thumbnail"})}},e.prototype.initTrackFile=function(t){t.track;this.trackInfo=t},e.prototype.initUI=function(){var t=this,e=videojs.dom.createEl("div",{className:"tcp-vtt-thumbnail-container"}),n=videojs.dom.createEl("img",{className:"tcp-vtt-thumbnail-img"});e.appendChild(n),this.containerEl=e,this.imgEl=n,this.cleanTimer&&clearInterval(this.cleanTimer),this.cleanTimer=setInterval(function(){"0"===window.getComputedStyle(t.imgEl).opacity&&(t.containerEl.style.display="none")},200);var i=setInterval(function(){var n=t.player.dvrMode(),r=void 0;(r="dvrLive"===n?t.player.controlBar.getChild("LiveProgressControl"):t.player.controlBar.progressControl)&&(r.el().appendChild(e),r.on("mouseenter",videojs.bind(t,t.onMouseEnter)),r.on("mousemove",videojs.bind(t,t.onMouseMove)),r.on("mouseleave",videojs.bind(t,t.onMouseOut)),clearInterval(i))},500)},e.prototype.onMouseEnter=function(){this.containerEl.style.display="block"},e.prototype.getRelativeOffset=function(t){for(var e=0,n=t,i=0,r=0;r<this.spriteData.length;r++){if(t<e+this.spriteData[r].play_dur){i=r,n=t-e+this.spriteData[r].hidden_dur;break}e+=this.spriteData[r].play_dur}return{relativeOffset:n,gConfigIndex:i}},e.prototype.getSpritePosition=function(t){var e=this.getRelativeOffset(t),n=e.relativeOffset,i=e.gConfigIndex,r=Math.floor(n/60),o=Math.floor(n%60/10);this.prefix=this.baseHost+this.spriteData[i].path;var s=this.baseHost+this.spriteData[i].path+r+".jpg";return s+="?txTimeshift=on",{picUrl:s,xpos:160*Math.floor(o%3),ypos:90*Math.floor(o/3)}},e.prototype.onMouseMove=function(t){var e=void 0,n=void 0,i=void 0,r=void 0,o=void 0,s=void 0,a=void 0,u=void 0,l=0,c=void 0,h=void 0,p=void 0,d=void 0,f=this.player.dvrMode();if(i="dvrLive"===f?this.player.controlBar.getChild("LiveProgressControl"):this.player.controlBar.progressControl,r="dvrLive"===f?i.LiveSeekBar:i.seekBar,o=offsetParent(i.el()).getBoundingClientRect(),s=offsetParent(r.el()).getBoundingClientRect(),e=t.clientX,u="dvrLive"===f?this.liveDuration:this.player.duration(),a=((e-s.left)/r.width()*u).toFixed(3),a>this.initLiveDuration&&this.canGetNewSprite&&this.getSpriteConfig(),!+a)return!1;if("dvrEvent"===f||"dvrLive"===f){var y=player.currentPDT()/100;if(y&&(y>this.lastTime||!this.prefix))return this.getSpriteConfig(),!1;var g=this.getSpritePosition(a);return p={h:90,left:0,src:g.picUrl,w:160,x:g.xpos,y:g.ypos},d=e-s.left+p.w/2-r.width(),d=Math.max(0,d),n=e-o.left-p.w/2-d,n=Math.max(r.el().offsetLeft,n),p.left=n,this.setView(p),!1}if(!this.trackInfo)return!1;for(c=this.trackInfo.track||this.trackInfo;l<c.cues.length;){if(h=c.cues[l],h.startTime<=a&&h.endTime>=a){p=parseImageLink(h.text,this.defaults);break}l++}if(!p)return this.onMouseOut(),!1;d=e-s.left+p.w/2-r.width(),d=Math.max(0,d),n=e-o.left-p.w/2-d,n=Math.max(r.el().offsetLeft,n),p.left=n,this.setView(p)},e.prototype.onMouseOut=function(){this.containerEl.style.display="none"},e.prototype.setView=function(t){var e=this.containerEl,n=this.imgEl,i=this.options;this.firstShowSprite&&(e.style.display="none",this.firstShowSprite=!1),e.style.width==t.w&&e.style.height==t.h||(e.style.width=t.w+"px",e.style.height=t.h+"px"),e.style.left=t.left+"px",n.src!==t.src&&(i.imgUrl&&n.src!=i.imgUrl?n.src=i.imgUrl:n.src=t.src),n.onload=function(){e.style.display="block"},n.onerror=function(){e.style.display="none",setTimeout(function(){e.style.display="none"},200)},n.style.left=-t.x+"px",n.style.top=-t.y+"px",n.style.clip="rect("+t.y+"px,"+(t.w+t.x)+"px,"+(t.y+t.h)+"px,"+t.x+"px)"},e.prototype.reset=function(){if(this.hasInit){log$11("VttThumbnail reset");var t=this.player,e=t.controlBar.progressControl;e.off("mousemove",videojs.bind(this,this.onMouseMove,10)),e.off("mouseleave",videojs.bind(this,this.onMouseOut)),this.hasInit=!1}},e}(Plugin$13),getComputedStyle=function(t,e){return function(n){return window.getComputedStyle?window.getComputedStyle(t,e)[n]:t.currentStyle[n]}},offsetParent=function n(t){return"HTML"!==t.nodeName&&"static"===getComputedStyle(t)("position")?n(t.offsetParent):t},parseImageLink=function(t,e){var n=void 0,i=void 0,r=void 0;if(-1===(i=t.indexOf("#")))return{src:t,w:0,h:0,x:0,y:0};if(n=t.substring(0,i),/^(http:|https:|\/\/)/.test(n)||(n=e.basePath+n),r=t.substring(i+1),"xywh="!==r.substring(0,5))return{src:n,w:0,h:0,x:0,y:0};var o=r.substring(5).split(",");return{src:n,w:parseInt(o[2]),h:parseInt(o[3]),x:parseInt(o[0]),y:parseInt(o[1])}},parseBasePath=function(t){/^(\/\/)/.test(t)&&(t="https:"+t);var e=/(\w+):\/\/([^\:|\/]+)(\:\d*)?(.*\/)([^#|\?|\n]+)?(#.*)?(\?.*)?/i,n=t.match(e);if(n&&n[2]&&n[4])return"//"+n[2]+n[4]};videojs.registerPlugin("VttThumbnail",VttThumbnail);var Plugin$14=videojs.getPlugin("plugin"),log$12=videojs.log,PlayerMetrics=function(t){function e(n,i){classCallCheck(this,e),log$12("PlayerMetrics initializing");var r=possibleConstructorReturn(this,t.call(this,n));if(!1===n.options_.reportable){var o;return o=!1,possibleConstructorReturn(r,o)}return r.player=n,r.checkPrevData(),r.initData(),r.registerListener(),log$12("PlayerMetrics initialized"),r}return inherits(e,t),e.prototype.checkPrevData=function(){var t=localStorage.getItem("tcplayer_data");if(t){var e=JSON.parse(t);Reporter.reportPlayMetrics(e,function(){localStorage.removeItem("tcplayer_data")})}},e.prototype.initData=function(){this.bytes_token=guid(),this.vodBaseData={uint32_service:2,uint32_platform:3,bytes_version:String(version),uint64_appid:0,bytes_bizid:this.guid("dev_uuid"),bytes_stream_id:"",uint32_module_id:1011,uint32_data_type:1,uint32_command:40303,uint64_data_time:0,bytes_token:this.bytes_token,token:this.bytes_token,dev_uuid:this.guid("dev_uuid"),str_app_name:"",str_app_version:"",str_stream_url:"",str_brand_type:this.getDevice(),str_device_resolution:screen.width+"_"+screen.height,str_device_type:"",str_package_name:"",str_sdk_name:"TCPlayer",str_user_id:this.guid("dev_uuid"),sys_type:this.getSystem(),sys_version:String(this.getSystemVer()),str_user_agent:USER_AGENT,str_browser_version:String(this.getBrowserVer()),str_browser_model:String(this.getBrowser()),u32_app_id:String(this.player.options_.appID),str_fileid:String(this.player.options_.fileID),u32_network_type:this.getNetworkType()},this.liveBaseData={str_user_id:this.guid("dev_uuid"),dev_uuid:this.guid("dev_uuid"),str_session_id:this.bytes_token,bytes_token:this.bytes_token,str_device_type:"",str_os_info:this.getSystem(),str_package_name:"",u32_network_type:"0xFF"!==this.getNetworkType()?this.getNetworkType():"",u32_server_ip:"",str_stream_url:this.player.cache_.src,u64_timestamp:this.player.startTime,u32_link_type:1,u32_channel_type:1,str_app_version:"",platform:3,uint32_platform:3,str_browser_version:this.getBrowserVer(),str_browser_model:this.getBrowser(),str_user_agent:USER_AGENT,u32_video_drop:"",u32_drop_usage:"",float64_rtt:""},this.features=[],this.afterCanplay=!1,this.videoDuration=0,this.consumeDuration=0,this.playScene=this.player.options_.fileID?2:1,this.timing={},this.playStatus={isFirstPlay:!1,pauseDuration:0},this.contentComputTimePoint=[],this.firstFrameDuration=0,this.firstIFrameDuration=0,this.blockInterval=5e3,this.bufferBlock=[],this.u32_drm_type="plain",this.resetLagStatus(),this.resetBlockData()},e.prototype.getComsumeDuration=function(t){var e=getTimeStamp()-this.timing.firstPlaying;this.consumeDuration=e-this.lagStatus.lagDuration-this.playStatus.pauseDuration,t&&this.consumeDuration<0&&(this.consumeDuration=e>0?e:0)},e.prototype.registerListener=function(){var t=this.player;t.on("loadedmetadata",videojs.bind(this,this.onLoadedmetadata)),t.one("canplay",videojs.bind(this,this.oneCanplay)),t.one("play",videojs.bind(this,this.onePlay)),t.on("play",videojs.bind(this,this.onPlay)),t.on("playing",videojs.bind(this,this.onPlaying)),t.on("seeking",videojs.bind(this,this.onSeeking)),t.on("seeked",videojs.bind(this,this.onSeeked)),t.on("error",videojs.bind(this,this.onError)),t.on("resolutionswitching",videojs.bind(this,this.onResolutionSwitching)),t.on("pause",videojs.bind(this,this.onPause)),t.on("playcgiend",videojs.bind(this,this.onPlaycgiend)),t.on("ended",videojs.bind(this,this.onEnded)),t.on("feature",videojs.bind(this,this.onFeature)),t.on("dispose",videojs.bind(this,this.onDispose)),document.addEventListener("visibilitychange",videojs.bind(this,this.onVisibilityChange)),window.addEventListener("pagehide",videojs.bind(this,this.onPageHide))},e.prototype.onPageHide=function(){this.saveData()},e.prototype.onVisibilityChange=function(){"hidden"===document.visibilityState&&this.saveData()},e.prototype.saveData=function(){this.bytes_token&&3!==this.playScene&&this.player&&(this.getComsumeDuration(),this.report(2===this.playScene?40304:40102,{},function(t){localStorage.setItem("tcplayer_data",JSON.stringify(t))}))},e.prototype.onLoadedmetadata=function(){this.player.tech_.webrtcProvider?this.playScene=3:this.playScene=this.player.duration()===Infinity?1:2,this.videoDuration=parseInt(this.player.duration())||0,videojs.bind(this,this.calculateFirstFrameDuration)(),2===this.playScene&&this.report(40303)},e.prototype.oneCanplay=function(){videojs.bind(this,this.calculateFirstFrameDuration)(),1===this.playScene&&this.report(40101)},e.prototype.calculateFirstFrameDuration=function(){var t=getperformance();t.mark&&t.measure&&t.getEntriesByName&&(t.mark("firstIFrameEnd"),t.measure("firstIFrame","firstFrameStart","firstIFrameEnd"),this.firstIFrameDuration=t.getEntriesByName("firstIFrame")[0].duration)},e.prototype.onePlay=function(){var t=this;this.setTimingData({firstPlay:getTimeStamp()});var e=this.player.el_.firstChild;this.bufferStart=e&&e.buffered&&e.buffered.length>0?e.buffered.start(e.buffered.length-1):0,this.bufferBlock=[this.bufferStart];var n=this.player.getVideoPlaybackQuality();this.recvFrames=n.totalVideoFrames,this.renderedFrames=n.totalVideoFrames-n.droppedVideoFrames,this.blockStartTime=getTimeStamp(),this.blockTimer=setInterval(function(){if(2===t.playScene)return!1;if(t.lagStatus.lagging&&t.lagStatus.lagStart){var n=getTimeStamp()-t.lagStatus.lagStart
20
20
  ;n>t.blockInterval?t.blockData.lagBlockDuration=t.blockInterval:t.blockData.lagBlockDuration+=n}t.blockStartTime=getTimeStamp();var i=e&&e.buffered&&e.buffered.length>0?e.buffered.end(e.buffered.length-1):0,r=t.player.getVideoPlaybackQuality(),o=r.totalVideoFrames,s=r.totalVideoFrames-r.droppedVideoFrames;Object.assign(t.blockData,{buffer_avg:parseInt(1e3*(i-t.bufferStart)),recv_frames:o-t.recvFrames,render_frames:s-t.renderedFrames}),t.bufferBlock.push(t.blockData.buffer_avg),t.bufferStart=i,t.recvFrames=o,t.renderedFrames=s,t.report(40100)},this.blockInterval)},e.prototype.onDispose=function(){clearInterval(this.blockTimer)},e.prototype.onPlay=function(){this.playStatus.pauseTime&&(this.playStatus.pauseDuration=this.playStatus.pauseDuration+getTimeStamp()-this.playStatus.pauseTime,this.playStatus.pauseTime=0)},e.prototype.onPlaying=function(){var t=this;if(!this.playStatus.isFirstPlay&&(this.playStatus.isFirstPlay=!0,this.setTimingData({firstPlaying:getTimeStamp()}),this.player.on("waiting",function(){t.lagStatus.lagging||t.player.seeking()||t.lagStatus.skip||(t.lagStatus.lagging=!0,t.lagStatus.lagStart=getTimeStamp())}),this.player.currentSource().keySystems)){var e=this.player.currentSource().keySystems;e.plain&&(this.u32_drm_type="plain"),e.SimpleAES&&(this.u32_drm_type="SimpleAES")}this.lagStatus.lagging&&(this.lagStatus.lagEnd=getTimeStamp())-this.lagStatus.lagStart>this.lagStatus.lagInterval&&(this.lagStatus.lagging=!1,this.lagStatus.lagCount++,this.lagStatus.lagAvg.push(this.lagStatus.lagEnd-this.lagStatus.lagStart),this.lagStatus.lagDuration+=this.lagStatus.lagEnd-this.lagStatus.lagStart,this.lagStatus.lagStart<this.blockStartTime&&(this.blockData.lagBlockDuration=this.lagStatus.lagEnd-this.blockStartTime),this.lagStatus.lagStart>=this.blockStartTime&&(this.blockData.lagBlockDuration+=this.lagStatus.lagEnd-this.lagStatus.lagStart),this.lagStatus.lagEnd=this.lagStatus.lagStart=0,this.lagStatus.isFirstLag||(this.lagStatus.isFirstLag=!0,this.setTimingData({firstLag:getTimeStamp()}))),[60,200,500,1e3].forEach(function(e){t.lagStatus.lagging&&(t.lagStatus.lagEnd=getTimeStamp())-t.lagStatus.lagStart>e&&t.blockData["lagCount_"+e]++}),this.lagStatus.skip=!1},e.prototype.onSeeking=function(){this.contentComputTimePoint.push({type:"end",time:this.player.currentTime()})},e.prototype.onSeeked=function(){this.contentComputTimePoint.push({type:"start",time:this.player.currentTime()})},e.prototype.onError=function(t){this.getComsumeDuration(!0);var e={u64_err_code:t.data.code,str_err_info:t.data.message||(defaults$1.errors[t.data.code]||{}).message},n=(this.player.cache_.src||"").indexOf("vod")>-1||this.player.options_.fileID;t&&t.data&&t.data.code&&(2===this.playScene&&n?this.report(40304,e):this.afterCanplay?this.report(40102,e):this.report(40101,e))},e.prototype.onResolutionSwitching=function(){this.lagStatus.skip=!0},e.prototype.onPause=function(){this.playStatus.pauseTime=getTimeStamp(),this.lagStatus.lagging&&(this.lagStatus.skip=!0)},e.prototype.onPlaycgiend=function(t){var e=this,n=t.data;n.result&&0==n.result.code&&(this.playStatus.requestID=n.result.requestId,setTimeout(function(){if(e.player.currentSources().length>0&&e.player.currentSources()[0].keySystems){var t=e.player.currentSources()[0].keySystems;t["com.widevine.alpha"]&&e.reportMTA("drm",{initialized:"Widevine"}),t["com.apple.fps.1_0"]&&e.reportMTA("drm",{initialized:"FairPlay"})}else e.player.options_.plugins.DRM&&e.player.options_.plugins.DRM.token&&e.reportMTA("drm",{initialized:"SimpleAES"})},0)),this.setTimingData({cgiStart:t.data.startTime,cgiEnd:t.data.time})},e.prototype.onEnded=function(){this.getComsumeDuration(),1===this.playScene?this.report(40102):this.report(40304)},e.prototype.onFeature=function(t){-1==this.features.indexOf(t.data)&&this.features.push(t.data)},e.prototype.guid=function(t){var e=localStorage.getItem(t);return e||(e=guid(),localStorage.setItem(t,e)),e},e.prototype.report=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=arguments[2];if(3===this.playScene)return!1;t&&this["report_"+t](e,n)},e.prototype.report_40101=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!this.player)return!1;if(3===this.playScene&&!t.fromTxliveplayer)return!1;var e={uint64_data_time:getTimeStampBySecond(),str_stream_url:this.player.cache_.src,u64_timestamp:this.player.startTime,u32_dns_time:"",u32_connect_server_time:parseInt(this.firstFrameDuration),u32_video_decode_type:0,u32_first_frame_down:parseInt(this.firstFrameDuration),u32_first_video_decode_time:parseInt(this.firstIFrameDuration),u32_first_i_frame:parseInt(this.firstIFrameDuration),u32_first_audio_frame_down:parseInt(this.firstFrameDuration),u32_first_audio_render_time:parseInt(this.firstIFrameDuration),u64_err_code:t.u64_err_code||"",str_err_info:t.str_err_info||""},n={app_id:0,data:[Object.assign({},this.liveBaseData,e,t)],module_id:1005,command:40101};Reporter.reportPlayMetrics(n)},e.prototype.report_40100=function(t){var e=this;if(3===this.playScene&&!t.fromTxliveplayer)return!1;var n=this.player||{};this.blockData=this.blockData||{};var i={u32_cpu_usage:"",u32_app_cpu_usage:"",u32_avg_memory:"",u32_avg_cpu_usage:"",str_stream_url:n.cache_&&n.cache_.src,uint64_data_time:getTimeStampBySecond(),u32_recv_av_diff_time:0,u32_play_av_diff_time:0,u64_playtime:getTimeStamp()-this.timing.firstPlaying,u32_audio_decode_type:2,u32_audio_block_count:this.blockData.lagCount_500,u32_audio_cache_time:this.blockData.buffer_avg,u32_audio_drop:"",u32_video_decode_type:0,u32_video_recv_fps:this.blockData.recv_frames,u32_fps:this.blockData.render_frames,u32_video_cache_time:this.blockData.buffer_avg,u32_avg_cache_count:0,u32_video_block_count:this.blockData.lagCount_1000,u32_avg_net_speed:"",u32_video_light_block_count:this.blockData.lagCount_200,u32_video_large_block_count:this.blockData.lagCount_500,u32_audio_jitter_60ms_count:this.blockData.lagCount_60,u32_video_decode_fail:"",u32_audio_decode_fail:"",u32_avg_video_bitrate:0,u32_avg_audio_bitrate:0,u32_block_usage:1e3*parseInt(this.blockData.lagBlockDuration/this.blockInterval)},r={app_id:0,data:[Object.assign({},this.liveBaseData,i,t)],module_id:1005,command:40100};Reporter.reportPlayMetrics(r,function(){e.resetBlockData()})},e.prototype.report_40102=function(){var t=this,e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=arguments[1];if(3===this.playScene&&!e.fromTxliveplayer)return!1;var i=this.player||{},r=0,o=0,s=0;if("{}"!==JSON.stringify(i)){r=this.lagStatus.lagAvg.length>0?this.lagStatus.lagAvg.reduce(function(t,e){return t+e},0)/this.lagStatus.lagAvg.length:0,o=this.bufferBlock.length>0?this.bufferBlock.reduce(function(t,e){return t+e},0)/this.bufferBlock.length:0;s=(i.getVideoPlaybackQuality&&i.getVideoPlaybackQuality()||{}).totalVideoFrames/e.duration}else this.resetLagStatus();var a={uint64_data_time:getTimeStampBySecond(),str_stream_url:i.cache_&&i.cache_.src,u64_timestamp:getTimeStamp(),u32_avg_cpu_usage:"",u32_avg_memory:"",u64_begin_timestamp:i.startTime,u32_result:this.consumeDuration,u64_err_code:e.u64_err_code,u32_speed_cnt:0,u32_avg_cache_time:o,u32_max_load:Math.max.apply(Math,this.lagStatus.lagAvg),u32_audio_block_time:this.lagStatus.lagDuration,u32_avg_load:r,u32_load_cnt:this.lagStatus.lagAvg.length||0,u32_nodata_cnt:this.lagStatus.lagAvg.length||0,u32_first_i_frame:this.firstIFrameDuration,u32_video_width:i.width_,u32_video_height:i.height_,u32_video_avg_fps:s,u32_avg_block_time:r,u64_block_count:this.lagStatus.lagAvg.length||0,u32_video_block_time:this.lagStatus.lagDuration,u64_jitter_cache_max:0,u64_block_duration_max:Math.max.apply(Math,this.lagStatus.lagAvg),u64_jitter_cache_avg:0,u32_ip_count_quic:"",u32_connect_count_quic:"",u32_connect_count_tcp:"",u32_is_real_time:"",u32_first_frame_black:"",u32_delay_report:0},u={app_id:0,data:[Object.assign({},this.liveBaseData,a,e)],module_id:1005,command:40102};return e.u32_delay_report?(localStorage.setItem("tcplayer_data",JSON.stringify(u)),!1):n?(u.data.u32_delay_report=1,n(u)):void Reporter.reportPlayMetrics(u,function(){t.bytes_token=null,localStorage.removeItem("tcplayer_data")})},e.prototype.report_40303=function(){this.setTimingData({initEnd:getTimeStamp()});var t={msg_client_ip:{uint32_ip:""},uint32_service:this.playScene,uint64_data_time:getTimeStampBySecond(),str_stream_url:this.player.cache_.src,uint32_command:40303,u32_app_id:String(this.player.options_.appID),str_fileid:String(this.player.options_.fileID)},e={app_id:0,data:[Object.assign({},this.vodBaseData,t)],module_id:1011,command:40303};Reporter.reportPlayMetrics(e)},e.prototype.report_40304=function(){var t=this,e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},n=arguments[1],i=this.lagStatus.lagAvg.length>0?this.lagStatus.lagAvg.reduce(function(t,e){return t+e},0)/this.lagStatus.lagAvg.length:0,r={u32_app_id:String(this.player.options_.appID),str_fileid:String(this.player.options_.fileID),uint64_data_time:getTimeStampBySecond(),uint32_command:40304,str_stream_url:this.player.cache_.src,u32_timeuse:String(parseInt(this.consumeDuration/1e3)||0),u32_videotime:String(this.videoDuration),u32_avg_load:String(i),u32_load_cnt:String(this.lagStatus.lagCount),u32_max_load:this.lagStatus.lagAvg.length>0?String(Math.max.apply(Math,this.lagStatus.lagAvg)):String(0),u32_avg_block_time:String(this.lagStatus.lagDuration),u32_player_type:String(4),u32_dns_time:"",u32_tcp_did_connect:"",u32_first_video_packet:String(parseInt(this.firstFrameDuration)),u32_first_i_frame:String(parseInt(this.firstIFrameDuration)),u32_server_ip:"",u32_drm_type:this.u32_drm_type,u32_playmode:String(1),u64_err_code:String(e.u64_err_code||""),str_err_info:String(e.str_err_info||""),u32_video_decode_type:String(0),u32_speed:this.player&&String(100*this.player.playbackRate())||"1000"},o={app_id:0,data:[Object.assign({},this.vodBaseData,r)],module_id:1011,command:40304};if(n)return n(o);Reporter.reportPlayMetrics(o,function(){t.bytes_token=null,localStorage.removeItem("tcplayer_data")})},e.prototype.setTimingData=function(t){this.timing=videojs.mergeOptions(this.timing,t)},e.prototype.reset=function(){this.playStatus={isFirstPlay:!1}},e.prototype.resetLagStatus=function(){this.lagStatus={lagCount:0,lagging:!1,lagStart:0,lagEnd:0,lagInterval:500,lagDuration:0,lagAvg:[],isFirstLag:!1,skip:!1}},e.prototype.resetBlockData=function(){this.blockData={lagCount_60:0,lagCount_200:0,lagCount_500:0,lagCount_1000:0,lagBlockDuration:0,buffer_avg:0,recv_frames:0,render_frames:0}},e.prototype.reportMTA=function(t,e){},e.prototype.getSystem=function(){return IS_IOS?"ios":IS_ANDROID?"android":IS_WIN?"win":IS_MAC?"mac":"other"},e.prototype.getSystemVer=function(){var t=this.getSystem();return"ios"==t?IOS_VERSION:"android"==t?ANDROID_VERSION:"win"==t?WIN_VER:"mac"==t?MAC_VER:void 0},e.prototype.getBrowser=function(){return IS_FIREFOX?"firefox":IS_EDGE?"edge":IS_MQQB?"mqq":IS_QQB?"qq":IS_TBS?"tbs":IS_CHROME?"chrome":IE_VERSION?"ie":IS_SAFARI?"safari":"other"},e.prototype.getBrowserVer=function(){var t=this.getBrowser();return"firefox"==t?FIREFOX_VER:"edge"==t?EDGE_VER:"chrome"==t?CHROME_VER:"ie"==t?IE_VERSION:"safari"==t?SAFARI_VER:"qq"==t||"mqq"==t?QQ_VER:"tbs"==t?TBS_VERSION:"other"},e.prototype.getDevice=function(){return IS_IOS?"IPHONE":IS_HUAWEI?"HUAWEI":IS_XIAOMI?"XIAOMI":IS_OPPO?"OPPO":IS_VIVO?"VIVO":IS_SX?"SUMSUNG":IS_CP?"COOLPAD":IS_ONE?"ONEPLUS":IS_ZX?"ZTE":"OTHER"},e.prototype.getMediaType=function(){return this.player.src()&&/\/(.+)\.(.+)\?|\/(.+)\.(.+)/.test(this.player.src()),RegExp.$2||RegExp.$4},e.prototype.getNetworkType=function(){var t=navigator.userAgent,e=t.match(/NetType\/\w+/)?t.match(/NetType\/\w+/)[0]:"NetType/other";e=e.toLowerCase().replace("nettype/","");var n;switch(e){case"wifi":n="1";break;case"4g":n="2";break;case"3g":case"3gnet":n="3";break;case"2g":n="4";break;default:n="0xFF"}return n},e}(Plugin$14);videojs.registerPlugin("PlayerMetrics",PlayerMetrics);var Plugin$15=videojs.getPlugin("plugin"),log$13=videojs.log,ProgressMarker=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return n.ready(videojs.bind(r,r.init)),r}return inherits(e,t),e.prototype.init=function(){var t=this.player;if(t.options_.dots){var e=function i(){Array.isArray(t.options_.dots)&&t.options_.dots.length>0&&(t.options_.dots.forEach(function(e){!e.emitted&&e.timeOffset-1e3*(t.currentTime()||0)<500&&(e.emitted=!0,t.trigger("marker",e.content))}),t.options_.dots[t.options_.dots.length-1].emitted||window.requestAnimationFrame(i))};window.requestAnimationFrame(e)}if(IS_IOS||IS_ANDROID)return!1;if(!t.controlBar||!this.player.controlBar.progressControl)return void log$13("ProgressMarker can not initialize without control bar or progress control");log$13("ProgressMarker initializing");var n=t.controlBar.getChild("ProgressControl").getChild("SeekBar");n.getChild("ProgressMarkerGenerator")&&n.removeChild("ProgressMarkerGenerator"),t.options_.plugins.ProgressMarker&&(n.addChild("ProgressMarkerGenerator"),log$13("ProgressMarker initialized"),t.trigger({type:"feature",data:"marker"}))},e}(Plugin$15);videojs.registerPlugin("ProgressMarker",ProgressMarker);var Component$16=videojs.getComponent("Component"),PlayListItem=function(t){function e(n,i){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_,e=videojs.dom.createEl("div",{className:"tcp-playlist-item"}),n=videojs.dom.createEl("div",{className:"tcp-playlist-item-video",innerHTML:t.img?'<img src="'+t.img+'" class="tcp-playlist-item-img">':'<img src="https://imgcache.qq.com/open_proj/proj_qcloud_v2/mc_2014/video/console/v2/css/img/vod/default-cover.png" height="100" class="tcp-playlist-item-img">'}),i=videojs.dom.createEl("div",{className:"tcp-playlist-item-duration",textContent:this.timeFormat(t.duration)});n.appendChild(i);var r=videojs.dom.createEl("div",{className:"tcp-playlist-item-desc",textContent:t.text});return e.appendChild(n),e.appendChild(r),this.bindEvent(e),e},e.prototype.bindEvent=function(t){var e=this;videojs.on(t,["click"],function(){e.player_.trigger({type:"playItem",data:e.options_})})},e.prototype.timeFormat=function(t){var e="",n=Math.floor(t/3600);0!=n&&(t-=3600*n,n<10&&(n="0"+n),e+=n+":");var i=Math.floor(t/60);return i<10&&(i="0"+i),t-=60*i,t<10&&(t="0"+t),e+=i+":"+t},e}(Component$16);videojs.registerComponent("PlayListItem",PlayListItem);var Component$17=videojs.getComponent("Component"),PlayListTitle=function(t){function e(n,i){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_;return videojs.dom.createEl("div",{className:"tcp-playlist-title",textContent:t.title})},e}(Component$17);videojs.registerComponent("PlayListTitle",PlayListTitle);var Component$15=videojs.getComponent("Component"),PlayListBox=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.init(),r.activeIndex=-1,r}return inherits(e,t),e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-playlist-box"})},e.prototype.init=function(){var t=this,e=this.options_.data;this.addChild("PlayListTitle",{title:this.options_.title}),e.forEach(function(e,n){e.index=n,t.addChild("PlayListItem",e)}),this.player_.on("ready",function(){t.options_.loop&&(t.activeIndex=0,t.player_.on("ended",videojs.bind(t,function(){t.player_.trigger({type:"playItem"})})))}),this.player_.on("playItem",function(n){var i=n.data,r=void 0;t.activeIndex=i?i.index:(t.activeIndex+1)%e.length,r=e[t.activeIndex],t.player_.loadVideoByID({fileID:r.fileID,appID:r.appID,psign:r.psign}),t.player_.one("loadedmetadata",videojs.bind(t,function(){t.player_.play()})),document.querySelectorAll(".tcp-playlist-item").forEach(function(t){videojs.dom.removeClass(t,"tcp-playlist-item-active")});var o=document.querySelectorAll(".tcp-playlist-item")[t.activeIndex];videojs.dom.addClass(o,"tcp-playlist-item-active")})},e}(Component$15);videojs.registerComponent("PlayListBox",PlayListBox);var Component$18=videojs.getComponent("Component"),PlayListToggle=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.status=0,r}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-playlist-toggle",textContent:"<"});return this.bindEvent(t),t},e.prototype.bindEvent=function(t){var e=this;videojs.on(t,["click"],function(n){e.status=!e.status;var i=document.querySelector(".tcp-playlist");e.status?(t.textContent=">",videojs.dom.addClass(i,"tcp-playlist-open"),videojs.dom.removeClass(i,"tcp-playlist-close")):(videojs.dom.addClass(i,"tcp-playlist-close"),videojs.dom.removeClass(i,"tcp-playlist-open"),t.textContent="<")})},e}(Component$18);videojs.registerComponent("PlayListToggle",PlayListToggle);var Component$14=videojs.getComponent("Component"),PlayList$1=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.init(),r}return inherits(e,t),e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-playlist tcp-playlist-close"})},e.prototype.init=function(){this.addChild("PlayListToggle"),this.addChild("PlayListBox",this.options_)},e}(Component$14);videojs.registerComponent("PlayList",PlayList$1);var Button$6=videojs.getComponent("Button"),PlayNextButton=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.addClass(),r}return inherits(e,t),e.prototype.addClass=function(){videojs.dom.addClass(this.el_,"vjs-play-next")},e.prototype.update=function(){},e.prototype.handleClick=function(t){this.player_.trigger({type:"playItem"})},e}(Button$6);PlayNextButton.prototype.controlText_="Play Next",videojs.registerComponent("PlayNextButton",PlayNextButton);var Plugin$16=videojs.getPlugin("plugin"),log$14=videojs.log,PlayList=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return IS_IOS||IS_ANDROID?possibleConstructorReturn(r):(r.options=i,i&&i.data instanceof Array&&i.data.length>0&&n.ready(videojs.bind(r,r.init)),r)}return inherits(e,t),e.prototype.init=function(){log$14("PlayList initializing"),this.player.addChild("PlayList",this.options),this.player.controlBar.addChild("PlayNextButton",{},1),log$14("PlayList initialized"),this.player.trigger({type:"feature",data:"playlist"})},e}(Plugin$16);videojs.registerPlugin("PlayList",PlayList);var Plugin$17=videojs.getPlugin("plugin"),log$15=videojs.log,HLSToken=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return log$15("HLSToken",n,i),r.init(i),r}return inherits(e,t),e.prototype.init=function(t){log$15("HLSToken init",t,this.player);var e=this.player;t.token&&(this.options=t,e.on("playcgiend",videojs.bind(this,function(t){this.modifyData(t.data)})))},e.prototype.modifyData=function(t){var e=this;if(log$15("HLSToken modifyData",t),0===t.result.code){var n=t.result.videoInfo;if(n.masterPlayList){var i=n.masterPlayList.url.split("/");i[i.length-1]="voddrm.token."+this.options.token+"."+i[i.length-1],n.masterPlayList.url=i.join("/")}n.transcodeList&&n.transcodeList.length>0&&(n.transcodeList=n.transcodeList.map(function(t){var n=t.url.split("/");return n[n.length-1]="voddrm.token."+e.options.token+"."+n[n.length-1],t.url=n.join("/"),t}))}},e}(Plugin$17);videojs.registerPlugin("HLSToken",HLSToken);var getMessageContents=function(t){var e=(new window_1.DOMParser).parseFromString(String.fromCharCode.apply(null,new Uint16Array(t)),"application/xml"),n=e.getElementsByTagName("HttpHeaders")[0],i={};if(n)for(var r=n.getElementsByTagName("name"),o=n.getElementsByTagName("value"),s=0;s<r.length;s++)i[r[s].childNodes[0].nodeValue]=o[s].childNodes[0].nodeValue;var a=e.getElementsByTagName("Challenge")[0],u=void 0;return a&&(u=window_1.atob(a.childNodes[0].nodeValue)),{headers:i,message:u}},requestPlayreadyLicense=function(t,e,n){var i=getMessageContents(e),r=i.headers,o=i.message;videojs.xhr({uri:t,method:"post",headers:r,body:o,responseType:"arraybuffer"},n)},getSupportedKeySystem=function(t){var e=void 0;return Object.keys(t).forEach(function(n){var i={},r=t[n].audioContentType,o=t[n].videoContentType;r&&(i.audioCapabilities=[{contentType:r}]),o&&(i.videoCapabilities=[{contentType:o}]),e=e?e["catch"](function(t){return window_1.navigator.requestMediaKeySystemAccess(n,[i])}):window_1.navigator.requestMediaKeySystemAccess(n,[i])}),e},makeNewRequest=function(t){var e=t.mediaKeys,n=t.initDataType,i=t.initData,r=t.options,o=t.getLicense,s=t.removeSession,a=t.eventBus,u=e.createSession();u.addEventListener("message",function(t){o(r,t.message).then(function(t){return u.update(t)})["catch"](videojs.log.error.bind(videojs.log.error,"failed to get and set license"))},!1),u.addEventListener("keystatuseschange",function(t){var e=!1;u.keyStatuses.forEach(function(n,i){switch(a.trigger({keyId:i,status:n,target:u,type:"keystatuschange"}),n){case"expired":e=!0;break;case"internal-error":videojs.log.warn('Key status reported as "internal-error." Leaving the session open since we don\'t have enough details to know if this error is fatal.',t)}}),e&&u.close().then(function(){s(i)})},!1),u.generateRequest(n,i)["catch"](videojs.log.error.bind(videojs.log.error,"Unable to create or initialize key session"))},addSession=function(t){var e=t.video,n=t.initDataType,i=t.initData,r=t.options,o=t.getLicense,s=t.removeSession,a=t.eventBus;e.mediaKeysObject?makeNewRequest({mediaKeys:e.mediaKeysObject,initDataType:n,initData:i,options:r,getLicense:o,removeSession:s,eventBus:a}):e.pendingSessionData.push({initDataType:n,initData:i})},setMediaKeys=function(t){var e=t.video,n=t.certificate,i=t.createdMediaKeys,r=t.options,o=t.getLicense,s=t.removeSession,a=t.eventBus;e.mediaKeysObject=i,n&&i.setServerCertificate(n);for(var u=0;u<e.pendingSessionData.length;u++){var l=e.pendingSessionData[u];makeNewRequest({mediaKeys:e.mediaKeysObject,initDataType:l.initDataType,initData:l.initData,options:r,getLicense:o,removeSession:s,eventBus:a})}return e.pendingSessionData=[],e.setMediaKeys(i)},defaultPlayreadyGetLicense=function(t){return function(e,n,i){requestPlayreadyLicense(t,n,function(t,e,n){if(t)return void i(t);i(null,n)})}},defaultGetLicense=function(t){return function(e,n,i){videojs.xhr({uri:t,method:"POST",responseType:"arraybuffer",body:n,headers:{"Content-type":"application/octet-stream"}},function(t,e,n){if(t)return void i(t);i(null,n)})}},promisifyGetLicense=function(t,e){return function(n,i){return new Promise(function(r,o){t(n,i,function(t,n){e&&e.trigger("licenserequestattempted"),t&&o(t),r(n)})})}},standardizeKeySystemOptions=function(t,e){if("string"==typeof e&&(e={url:e}),!e.url&&!e.getLicense)throw new Error("Neither URL nor getLicense function provided to get license");return e.url&&!e.getLicense&&(e.getLicense="com.microsoft.playready"===t?defaultPlayreadyGetLicense(e.url):defaultGetLicense(e.url)),e},standard5July2016=function(t){var e=t.video,n=t.initDataType,i=t.initData,r=t.options,o=t.removeSession,s=t.eventBus,a=Promise.resolve();if("undefined"==typeof e.mediaKeysObject){e.mediaKeysObject=null,e.pendingSessionData=[];var u=void 0,l=void 0;if(!(a=getSupportedKeySystem(r.keySystems)))return videojs.log.error("No supported key system found"),Promise.resolve();a=a.then(function(t){return new Promise(function(n,i){if(e.keySystem=t.keySystem,l=standardizeKeySystemOptions(t.keySystem,r.keySystems[t.keySystem]),!l.getCertificate)return void n(t);l.getCertificate(r,function(e,r){if(e)return void i(e);u=r,n(t)})})}).then(function(t){return t.createMediaKeys()}).then(function(t){return setMediaKeys({video:e,certificate:u,createdMediaKeys:t,options:r,getLicense:promisifyGetLicense(l.getLicense,s),removeSession:o,eventBus:s})})["catch"](videojs.log.error.bind(videojs.log.error,"Failed to create and initialize a MediaKeys object"))}return a.then(function(){addSession({video:e,initDataType:n,initData:i,options:r,getLicense:e.keySystem?promisifyGetLicense(standardizeKeySystemOptions(e.keySystem,r.keySystems[e.keySystem]).getLicense,s):null,removeSession:o,eventBus:s})})},stringToUint16Array=function(t){for(var e=new ArrayBuffer(2*t.length),n=new Uint16Array(e),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n},uint8ArrayToString=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},getHostnameFromUri=function(t){var e=document_1.createElement("a");return t=t.match(/.*(skd\:\/\/.+)/i)[1],e.href=t,e.hostname},arrayBuffersEqual=function(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(var n=new DataView(t),i=new DataView(e),r=0;r<n.byteLength;r++)if(n.getUint8(r)!==i.getUint8(r))return!1;return!0},arrayBufferFrom=function(t){return t instanceof Uint8Array||t instanceof Uint16Array?t.buffer:t},FAIRPLAY_KEY_SYSTEM="com.apple.fps.1_0",concatInitDataIdAndCertificate=function(t){var e=t.initData,n=t.id,i=t.cert;"string"==typeof n&&(n=stringToUint16Array(n));var r=0,o=new ArrayBuffer(e.byteLength+4+n.byteLength+4+i.byteLength),s=new DataView(o);new Uint8Array(o,r,e.byteLength).set(e),r+=e.byteLength,s.setUint32(r,n.byteLength,!0),r+=4;var a=new Uint16Array(o,r,n.length);return a.set(n),r+=a.byteLength,s.setUint32(r,i.byteLength,!0),r+=4,new Uint8Array(o,r,i.byteLength).set(i),new Uint8Array(o,0,o.byteLength)},addKey=function(t){var e=t.video,n=t.contentId,i=t.initData,r=t.cert,o=t.options,s=t.getLicense,a=t.eventBus;return new Promise(function(t,u){if(e.webkitKeys||e.webkitSetMediaKeys(new window_1.WebKitMediaKeys(FAIRPLAY_KEY_SYSTEM)),!e.webkitKeys)return void u("Could not create MediaKeys");var l=e.webkitKeys.createSession("video/mp4",concatInitDataIdAndCertificate({id:n,initData:i,cert:r}));if(!l)return void u("Could not create key session");l.contentId=n,l.addEventListener("webkitkeymessage",function(t){s(o,n,t,function(t,e){if(a&&a.trigger("licenserequestattempted"),t)return void u(t);l.update(new Uint8Array(e))})}),l.addEventListener("webkitkeyadded",function(e){t(e)}),l.addEventListener("webkitkeyerror",function(t){u(t)})})},defaultGetCertificate=function(t){return function(e,n){videojs.xhr({uri:t,responseType:"arraybuffer"},function(t,e,i){if(t)return void n(t);n(null,new Uint8Array(i))})}},defaultGetContentId=function(t,e){return getHostnameFromUri(uint8ArrayToString(e))},defaultGetLicense$1=function(t){return function(e,n,i,r){videojs.xhr({uri:t,method:"POST",responseType:"arraybuffer",body:i.message,headers:{"Content-type":"application/x-www-form-urlencoded"}},function(t,e,n){if(t)return void r(t);r(null,n)})}},fairplay=function(t){var e=t.video,n=t.initData,i=t.options,r=t.eventBus,o=i.keySystems[FAIRPLAY_KEY_SYSTEM],s=o.getCertificate||defaultGetCertificate(o.certificateUri),a=o.getContentId||defaultGetContentId,u=o.getLicense||defaultGetLicense$1(o.licenseUri);return new Promise(function(t,e){s(i,function(n,i){if(n)return void e(n);t(i)})}).then(function(t){return addKey({video:e,cert:t,initData:n,getLicense:u,options:i,contentId:a(i,n),eventBus:r})})["catch"](function(t){r.player_.error({code:3,message:t})})},PLAYREADY_KEY_SYSTEM="com.microsoft.playready",addKeyToSession=function(t,e,n,i){var r=t.keySystems[PLAYREADY_KEY_SYSTEM];if("function"==typeof r.getKey)return void r.getKey(t,n.destinationURL,n.message.buffer,function(t,n){if(t)return void videojs.log.error("Unable to get key: "+t);e.update(n)});"string"==typeof r&&(r={url:r});var o=r.url||n.destinationURL;requestPlayreadyLicense(o,n.message.buffer,function(t,n){if(i&&i.trigger("licenserequestattempted"),t)return void videojs.log.error("Unable to request key from url: "+o);e.update(new Uint8Array(n.body))})},createSession=function(t,e,n,i){var r=t.msKeys.createSession("video/mp4",e);if(!r)return void videojs.log.error("Could not create key session.");r.addEventListener("mskeymessage",function(t){addKeyToSession(n,r,t,i)}),r.addEventListener("mskeyerror",function(t){videojs.log.error("Unexpected key error from key session with code: "+r.error.code+" and systemCode: "+r.error.systemCode)})},msPrefixed=function(t){var e=t.video,n=t.initData,i=t.options,r=t.eventBus;e.msKeys&&delete e.msKeys;try{e.msSetMediaKeys(new window_1.MSMediaKeys(PLAYREADY_KEY_SYSTEM))}catch(o){return void videojs.log.error("Unable to create media keys for PlayReady key system. Error: "+o.message)}createSession(e,n,i,r)},Plugin$18=videojs.getPlugin("plugin"),hasSession=function(t,e){for(var n=0;n<t.length;n++)if(t[n].initData){var i=arrayBufferFrom(t[n].initData),r=arrayBufferFrom(e);if(arrayBuffersEqual(i,r))return!0}return!1},removeSession=function(t,e){for(var n=0;n<t.length;n++)if(t[n].initData===e)return void t.splice(n,1)},handleEncryptedEvent=function(t,e,n,i){if(!e||!e.keySystems||e.src&&e.src.indexOf("m3u8")>-1)return Promise.resolve();var r=t.initData;return getSupportedKeySystem(e.keySystems).then(function(o){var s=o.keySystem;if(e.keySystems[s]&&e.keySystems[s].pssh&&(r=e.keySystems[s].pssh),!hasSession(n,r)&&r)return n.push({initData:r}),standard5July2016({video:t.target,initDataType:t.initDataType,initData:r,options:e,removeSession:removeSession.bind(null,n),eventBus:i})})},handleWebKitNeedKeyEvent=function(t,e,n){if(e.keySystems&&e.keySystems[FAIRPLAY_KEY_SYSTEM]&&t.initData)return fairplay({video:t.target,initData:t.initData,options:e,eventBus:n})},handleMsNeedKeyEvent=function(t,e,n,i){if(e.keySystems&&e.keySystems[PLAYREADY_KEY_SYSTEM]&&!n.reduce(function(t,e){return t||e.playready},!1)){var r=t.initData;e.keySystems[PLAYREADY_KEY_SYSTEM]&&e.keySystems[PLAYREADY_KEY_SYSTEM].pssh&&(r=e.keySystems[PLAYREADY_KEY_SYSTEM].pssh),r&&(n.push({playready:!0,initData:r}),msPrefixed({video:t.target,initData:r,options:e,eventBus:i}))}},getOptions=function(t){return videojs.mergeOptions(t.currentSource(),t.eme.options)},setupSessions=function(t){var e=t.src();e!==t.eme.activeSrc&&(t.eme.activeSrc=e,t.eme.sessions=[])},onPlayerReady=function(t){"video"===t.$(".vjs-tech").tagName.toLowerCase()&&t.tech_&&(setupSessions(t),t.tech_.el_.addEventListener("encrypted",function(e){if(t.currentSource().keySystems&&t.currentSource().keySystems["com.widevine.alpha"]&&"application/dash+xml"===t.currentSource().type)return!1;setupSessions(t),handleEncryptedEvent(e,getOptions(t),t.eme.sessions,t.tech_)}),t.tech_.el_.addEventListener("webkitneedkey",function(e){setupSessions(t),handleWebKitNeedKeyEvent(e,getOptions(t),t.tech_)}),videojs.browser.IS_EDGE||t.tech_.el_.addEventListener("msneedkey",function(e){setupSessions(t),handleMsNeedKeyEvent(e,getOptions(t),t.eme.sessions,t.tech_)}))},DRM=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,n.ready(function(){return onPlayerReady(n)}),n.eme={initializeMediaKeys:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){},r=videojs.mergeOptions(n.currentSource(),i,t),o={initDataType:"cenc",initData:null,target:n.tech_.el_};setupSessions(n),n.tech_.el_.setMediaKeys?handleEncryptedEvent(o,r,n.eme.sessions,n.tech_).then(function(){return e()})["catch"](function(t){return e(t)}):n.tech_.el_.msSetMediaKeys&&(handleMsNeedKeyEvent(o,r,n.eme.sessions,n.tech_),e())},options:i},r}return inherits(e,t),e.prototype.setOptions=function(t){this.options=t,this.player.options_.plugins.DRM=t},e}(Plugin$18),registerPlugin$2=videojs.registerPlugin||videojs.plugin;registerPlugin$2("DRM",DRM);var Plugin$19=videojs.getPlugin("plugin"),PDT=function(t){function e(n){classCallCheck(this,e);var i=possibleConstructorReturn(this,t.call(this,n));return n.plugins=n.plugins||{},n.plugins.pdt=!0,i}return inherits(e,t),e}(Plugin$19);videojs.registerPlugin("PDT",PDT);var Plugin$20=videojs.getPlugin("plugin"),dom$2=videojs.dom;if(!window.requestAnimationFrame){var lastTime=0
21
- ;window.requestAnimationFrame=function(t){var e=(new Date).getTime(),n=Math.max(0,16.7-(e-lastTime)),i=window.setTimeout(function(){t(e+n)},n);return lastTime=e+n,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)});var DynamicWatermark=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i||{},r.content=r.options.content,r.options.content&&r.init(),r}return inherits(e,t),e.prototype.dispose=function(){this.stopAnimation(),this.player.$(".tcp-dynamic-watermark-container")&&this.player.el().removeChild(this.containerElement),t.prototype.dispose.call(this)},e.prototype.init=function(){var t=this,e=this.player;this.isFirstShow=!0,this.initUI(),this.initStyle(),this.initSpeed(),e.on("canplay",function(){t.calculateStyle(),t.setStyle(),dom$2.removeClass(t.containerElement,"vjs-hidden")}),e.one("play",function(){t.encModule=new Enc,t.ghostCycle=t.encModule.calculateGhost(t.player.duration()),t.startAnimation()}),e.on(["fullscreenchange","playerresize"],function(){setTimeout(function(){t.calculateStyle()},200)})},e.prototype.initUI=function(){var t=this.player,e=dom$2.createEl("div",{className:"tcp-dynamic-watermark-container vjs-hidden"}),n=dom$2.createEl("div",{innerHTML:encodeHTML(this.options.content),className:"tcp-dynamic-watermark-content"});if(e.appendChild(n),!this.options.keep&&this.options.content&&t.el().appendChild(e),this.containerElement=e,this.markContentElement=n,"image"===this.options.type){var i=document.createElement("img");this.options.width&&(i.style.width=this.options.width),this.options.height&&(i.style.height=this.options.height),i.setAttribute("src",this.options.content),this.markContentElement.innerHTML="",this.markContentElement.appendChild(i)}},e.prototype.initStyle=function(){this.style={containerWidth:"",containerHeight:"",containerLeft:"",containerTop:"",contentLeft:80*Math.random(),contentTop:80*Math.random(),margin:0,padding:0,display:"block",visibility:"visible",opacity:.5,position:"absolute",color:"rgba(255, 255, 255)"}},e.prototype.initSpeed=function(){if(this.options.keep&&(!this.options.speed||0===this.options.speed))return this.speed=.2,!1;this.speed=this.options.speed},e.prototype.calculateStyle=function(){var t=this.player,e=this.style,n=t.videoWidth(),i=t.videoHeight(),r=dom$2.getBoundingClientRect(t.el()),o=r.width,s=r.height,a=(o/s).toFixed(2),u=(n/i).toFixed(2),l=void 0,c=void 0;u<a?(c=s,l=c*u):u>a?(l=o,c=l/u):u==a&&(l=o,c=s),e.containerLeft=(o-l)/2/o*100,e.containerTop=(s-c)/2/s*100,e.containerWidth=l/o*100,e.containerHeight=c/s*100},e.prototype.setStyle=function(){var t=this.containerElement,e=this.markContentElement,n=this.style;t.style.left=n.containerLeft+"%",t.style.top=n.containerTop+"%",t.style.width=n.containerWidth+"%",t.style.height=n.containerHeight+"%",t.style.display=e.style.display=n.display,t.style.visibility=e.style.visibility=n.visibility,t.style.opacity=e.style.opacity=n.opacity,t.style.position=e.style.position=n.position,t.style.margin=e.style.margin=n.margin,t.style.padding=e.style.padding=n.padding,e.style.left=this.options.left||n.contentLeft+"%",e.style.top=this.options.top||n.contentTop+"%",this.options.right&&(e.style.right=this.options.right),this.options.bottom&&(e.style.bottom=this.options.bottom),e.style.color=this.options.color||n.color,this.options.keep||(t.style.opacity=e.style.opacity=this.options.opacity||n.opacity),"text"===this.options.type&&(e.style.fontSize=this.options.fontSize||"12px",e.innerHTML=encodeHTML(this.options.content))},e.prototype.setContent=function(t){this.options.content=t},e.prototype.startAnimation=function(){var t=this;if(!this.rafID){var e=(this.player,this.style),n=this.containerElement,i=this.markContentElement,r=1,o=1,s=Math.random(),a=function u(){try{if(!t.isPauseAnimation){var a=Math.min(1,0===t.speed?0:t.speed?t.speed:.2),l=dom$2.getBoundingClientRect(n),c=dom$2.getBoundingClientRect(i),h=c.left-l.left,p=c.top-l.top;h+=a*r*s,p+=a*o*(1-s),h+c.width>l.width?(r=-1,s=Math.random()):h<0&&(r=1,s=Math.random()),p+c.height>l.height?(o=-1,s=Math.random()):p<0&&(o=1,s=Math.random()),h=Math.min(l.width-c.width,h),p=Math.min(l.height-c.height,p),e.contentLeft=h/l.width*100,e.contentTop=p/l.height*100,t.setStyle()}}catch(d){t.player&&t.encModule.handleWatermarkElementAdd(t)}if(t.isStopAnimation)return t.isStopAnimation=!1,cancelAnimationFrame(t.rafID),void(t.rafID=null);0!==t.speed&&requestAnimationFrame(u)};this.rafID=requestAnimationFrame(a)}},e.prototype.resumeAnimation=function(){this.isPauseAnimation=!1},e.prototype.pauseAnimation=function(){this.isPauseAnimation=!0},e.prototype.stopAnimation=function(){this.isStopAnimation=!0},e}(Plugin$20);videojs.registerPlugin("DynamicWatermark",DynamicWatermark);var Plugin$21=videojs.getPlugin("plugin"),XP2PHlsjsPlugin=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,r.hlsp2p=null,r}return inherits(e,t),e.prototype.startHLSP2P=function(t,e,n){var i=this,r=this.player.tech_,o=r.options_,s=o.xp2pConfig;if(e.isSupported()&&!window.hlsp2p){for(var a=["videoType","xp2pPackage","xp2pAppId","tencentCloudAppId"],u=a,l=Array.isArray(u),c=0,u=l?u:u[Symbol.iterator]();;){var h;if(l){if(c>=u.length)break;h=u[c++]}else{if(c=u.next(),c.done)break;h=c.value}var p=h;if(s[p]===undefined)return}var d={videoId:o.playerId+"_html5_api",url:o.source.src,videoType:s.videoType,cloudAppId:s.tencentCloudAppId,domain:s.xp2pPackage,xp2pAppId:s.xp2pAppId,p2pStartDelay:1e3},f=HLSP2P.create(t,Object.assign(d,s));f.on(HLSP2P.Events.Rollback,function(t){i.destroy(),n&&n(t)}),this.hlsp2p=f}},e.prototype.destroy=function(){this.hlsp2p&&(this.hlsp2p.destroy(),this.hlsp2p=null,window.hlsp2p=undefined)},e.prototype.dispose=function(){this.destroy()},e}(Plugin$21);videojs.registerPlugin("XP2PHlsjsPlugin",XP2PHlsjsPlugin);var Plugin$22=videojs.getPlugin("plugin"),XP2PFlvjsPlugin=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,r}return inherits(e,t),e.prototype.createLoader=function(t,e,n){var i=this.player.tech();return function(t){function r(e,n){classCallCheck(this,r);var i=possibleConstructorReturn(this,t.call(this));return i._qvbp2p=null,i._receivedLength=0,i._config=n,i}return inherits(r,t),r.isSupported=function(){return e&&e.isSupported()},r.prototype.destroy=function(){this._destroyQVBP2P(),t.prototype.destroy.call(this)},r.prototype.open=function(t){this._createQVBP2P(),this._qvbp2p.on(e.ComEvents.STATE_CHANGE,this._onQVBP2PStateChange.bind(this)),this._qvbp2p.setMediaElement(i.el());var n={src:t.url};this._qvbp2p.loadSource(n)},r.prototype.abort=function(){this._destroyQVBP2P()},r.prototype._onQVBP2PStateChange=function(t,n){var i=e.ComCodes;switch(n.code){case i.RECEIVE_BUFFER:this._receiveBuffer(n.payload);break;case i.ROLLBACK:this._rollback(n)}},r.prototype._receiveBuffer=function(t){var e=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,e,this._receivedLength)},r.prototype._rollback=function(t){n&&n(t)},r.prototype._createQVBP2P=function(){this._qvbp2p&&this._destroyQVBP2P(),this._qvbp2p=e.create(this._config.xp2pConfig),window.qvbp2p=this._qvbp2p},r.prototype._destroyQVBP2P=function(){this._qvbp2p&&(this._qvbp2p.destroy(),this._qvbp2p=null,window.qvbp2p=null)},r}(t.BaseLoader)},e}(Plugin$22);videojs.registerPlugin("XP2PFlvjsPlugin",XP2PFlvjsPlugin);var defaultConfig$1={enableStashBuffer:!1,lazyLoadMaxDuration:300},Html5FlvJS=function(){function t(e,n,i){var r=this;classCallCheck(this,t),this.tech=n,this.player=this.tech.player();var o=function(){var t=window.flvjs;r.flvjs=t;var o=videojs.mergeOptions(defaultConfig$1,i.flvConfig,{xp2pConfig:i.xp2pConfig}),s=n.player();if(window.QVBP2P&&i.xp2pConfig&&i.xp2pConfig.useXP2P&&s.XP2PFlvjsPlugin){var a=s.XP2PFlvjsPlugin().createLoader(t,window.QVBP2P,function(t){r.dispose(),i.xp2pConfig.useXP2P=!1;var e=r.tech.player(),n=r.tech.currentSource_.src;e.src(n)});r.xp2pFlvLoader=a,o.customLoader=a}var u=new t.createPlayer(Object.assign({isLive:!1,url:e.src,type:"flv"},o),o);u.on(t.Events.ERROR,videojs.bind(r,r.onError));for(var l in t.Events)!function(e){u.on(t.Events[e],videojs.bind(r,function(t){this.onEvent(e,t)}))}(l);u.on(t.Events.STATISTICS_INFO,function(t){var e=(t.bps_audio||0)+(t.bps_video||0);s.trigger({type:"playstatus",data:{type:"flv",decodedFrames:t.decodedFrames,droppedFrames:t.droppedFrames,speed:t.speed.toFixed(0),bitrate:e||0,bpsAudio:t.bps_audio||0,bpsVideo:t.bps_video||0}})}),r.flv=u,s.trigger({type:"flvInstanceCreated",data:{flv:u}}),r._id=(new Date).getTime(),n.el().srcObject&&(n.el().srcObject=null),u.attachMediaElement(n.el()),u.load()};Promise.all([function(){return i.xp2pConfig&&i.xp2pConfig.useXP2P&&"flv"===i.xp2pConfig.format&&!window.QVBP2P?new Promise(function(t){loadScript(XP2P_FLV_PATH,function(){t()})}):Promise.resolve()}(),function(){return window.flvjs?Promise.resolve():new Promise(function(t){loadScript(FLV_PATH,function(){t()})})}()]).then(function(){o()})["catch"](function(t){r.player.error({code:32})})}return t.prototype.onError=function(t,e,n){var i=this.tech.player();t===this.flvjs.ErrorTypes.NETWORK_ERROR&&i.error({code:2,source:n}),t===this.flvjs.ErrorTypes.MEDIA_ERROR&&i.error({code:3,source:n})},t.prototype.onEvent=function(t,e){this.tech.player().trigger({type:"FLVJS_EVENT",data:{type:t,data:e}})},t.prototype.dispose=function(){if(this.tech.player().pause(),this.tech.flvProvider)try{this.flv.destroy()}catch(t){}this.tech.flvProvider=null},t}(),flvTypeRE=/^video\/flv$/i,flvExtRE=/.flv(?![^?])/i,flvProtoRE=/^(ws:\/\/)/i,FlvSourceHandler={name:"flvSourceHandler",canHandleSource:function(t){return flvTypeRE.test(t.type)?"probably":flvExtRE.test(t.src)||flvProtoRE.test(t.src)?"maybe":""},handleSource:function(t,e,n){return e.flvProvider&&e.flvProvider.dispose(),e.flvProvider=new Html5FlvJS(t,e,n),e.flvProvider},canPlayType:function(t){if(flvTypeRE.test(t))return"probably"}};TCPlayer.mountFlvProvider=mountFlvProvider,mountFlvProvider();var guid$1=function(t){var e=localStorage.getItem(t);return e||(e=guid(),localStorage.setItem(t,e)),e},bytes_token=guid(),liveBaseData={str_user_id:guid$1("dev_uuid"),dev_uuid:guid$1("dev_uuid"),str_session_id:bytes_token,bytes_token:bytes_token,str_device_type:"",str_package_name:"",str_stream_url:"http://pulldrm.buzzcast.com/live/unknown.m3u8",u32_link_type:1001,u32_channel_type:1,str_app_version:"",platform:3,uint32_platform:3,str_user_agent:USER_AGENT,uint64_data_time:getTimeStampBySecond(),u64_timestamp:getTimeStamp(),u32_avg_cpu_usage:"",u32_avg_memory:"",u64_begin_timestamp:"",u32_result:"",u64_err_code:"",u32_speed_cnt:0,u32_avg_cache_time:"",u32_max_load:"",u32_audio_block_time:"",u32_avg_load:"",u32_load_cnt:0,u32_nodata_cnt:0,u32_first_i_frame:"",u32_video_width:"",u32_video_height:"",u32_video_avg_fps:"",u32_avg_block_time:"",u64_block_count:0,u32_video_block_time:0,u64_jitter_cache_max:0,u64_block_duration_max:0,u64_jitter_cache_avg:0,u32_ip_count_quic:"",u32_connect_count_quic:"",u32_connect_count_tcp:"",u32_is_real_time:"",u32_first_frame_black:"",u32_delay_report:0},reportLog=function(t,e){return!1},defaultConfig$2={connectRetryCount:2,connectTimeout:5,receiveVideo:!0,receiveAudio:!0,showLog:!1},WebRTCProvider=function(){function t(e,n,i){var r=this;classCallCheck(this,t),this.tech=n,this.player=this.tech.player();var o=function(){if(!r.player)return!1;r.playerMetrics=r.player.PlayerMetrics(),r.report=r.player.options_.reportable;var t=window.TXLivePlayer;r.TXLivePlayer=t,r.eventStack=[];var e=videojs.mergeOptions(defaultConfig$2,i.webrtcConfig);i.xp2pConfig&&"webrtc"===i.xp2pConfig.format&&i.xp2pConfig.useXP2P&&Object.assign(e,{p2pEnable:i.xp2pConfig.useXP2P,p2pConfig:{cloudAppid:i.xp2pConfig.tencentCloudAppId,xp2pAppid:i.xp2pConfig.xp2pAppId,appKey:i.xp2pConfig.xp2pAppKey,xp2pDomain:i.xp2pConfig.xp2pPackage}});var o=new t;r.webrtcConfig=e,o.setPlayerView(n.el()),o.setConfig(e),o.setPlayListener({onPlayEvent:videojs.bind(r,r.onPlayEvent),onPlayStats:videojs.bind(r,r.onPlayStats),onPlayReport:videojs.bind(r,r.onPlayReport),onPlaySEI:videojs.bind(r,r.onPlaySEI)}),o.startPlay(r.player.currentSrc()),r.player.one("playing",function(){0!==r.eventStack.length&&reportLog({str_ext_content:"eventStack on playing: "+JSON.stringify(r.eventStack),str_stream_url:r.player.cache_&&r.player.cache_.src})}),r.player.one("error",function(){0!==r.eventStack.length&&reportLog({str_ext_content:"eventStack on error: "+JSON.stringify(r.eventStack),str_stream_url:r.player.cache_&&r.player.cache_.src})}),r.webrtcPlayer=o,IS_IOS&&(r.player.cache_.volume||0===r.player.cache_.volume)&&o.setVolume(100*r.player.cache_.volume),r.player.trigger({type:"webrtcInstanceCreated",data:{webrtc:o}})};Promise.all([function(){return window.TXLivePlayer?Promise.resolve():new Promise(function(t,e){loadScript(WEBRTC_PATH,function(n){n?e():t()})})}()]).then(function(){o()})["catch"](function(t){r.player.error({code:31})})}return t.prototype.onPlayStats=function(t){this.tech.player().trigger({type:"webrtcstats",data:t})},t.prototype.onPlayEvent=function(t,e){-2003===t?this.eventStack.push({event:t,data:e}):this.eventStack.push({event:t,message:e&&e.message});var n=this.tech.player();if(n.trigger({type:"debug",data:{code:t,data:e}}),1005===t&&n.addClass("vjs-waiting"),1007===t&&(this.traceId="webrtc_user="+e.iceInfo),t<-2e3){if(-2003===t&&e&&e.videoActive&&(n.trigger("blocked"),n.trigger({type:"webrtcevent",data:{code:2005}})),IS_IOS&&1101===t&&(n.trigger("blocked"),n.trigger({type:"webrtcevent",data:{code:2005}})),-2003===t||-2006===t)return!1;if(-2005===t||-2001===t||-2004===t){n.trigger({type:"debug",data:{message:"debug === webrtc 状态码 "+t+",进入降级逻辑"}});var i=n.options_.webrtcConfig;if(!i||!1!==i.fallback)return this.switchPlaySource(t),!1}return n.error({code:t,source:e}),!1}n.trigger({type:"webrtcevent",data:{code:t,data:e}})},t.prototype.onPlayReport=function(t){if(!1===this.report||!this)return!1;if(t.fromTxliveplayer=!0,40101===t.uint32_command){var e=this.tech.player();e&&e.trigger({type:"debug",data:{code:"report",data:t}}),this.playerMetrics.report_40101(t)}40100===t.uint32_command&&this.playerMetrics.report_40100(t),40102===t.uint32_command&&this.playerMetrics.report_40102(t)},t.prototype.onPlaySEI=function(t){var e=this.tech.player();e&&e.trigger({type:"webrtcsei",data:t})},t.prototype.dispose=function(){this.webrtcPlayer&&(this.webrtcPlayer.setPlayListener({onPlayEvent:function(){},onPlayStats:function(){}}),this.webrtcPlayer.stopPlay(),this.webrtcPlayer.setPlayerView(videojs.dom.createEl("video"))),this.webrtcPlayer=null},t.prototype.setSource=function(t){var e=this;this.webrtcPlayer.startPlay(t.src),this.tech.player().one("webrtcevent",function(t){-1002===t.data.code&&e.tech.player().play()})},t.prototype.recovery=function(){var t=this,e=this.tech.player(),n=void 0;e.one("waiting",function(){n=setTimeout(function(){e.one("webrtcevent",function(n){if(1004===n.data.code){t.webrtcPlayer&&t.webrtcPlayer.startPlay(e.src()),e.play();var i=function r(t){1002===t.data.code&&(e.play(),e.off("webrtcevent",r))};e.on("webrtcevent",i)}}),t.webrtcPlayer&&t.webrtcPlayer.stopPlay()},2e3)}),e.one("playing",function(){n&&clearTimeout(n)})},t.prototype.switchPlaySource=function(t){var e=this.tech.player(),n=void 0,i=this.tech.currentSource_.src;n=this.webrtcConfig&&this.webrtcConfig.fallbackUrl?[{src:this.webrtcConfig.fallbackUrl}]:[{src:(this.convertProtocol(i)||[])[0]}],e.trigger({type:"webrtcfallback",data:{target:n[0].src,code:t,traceId:this.traceId}}),e.options_.autoplay&&(e.bigPlayButton&&e.bigPlayButton.hide(),e.posterImage&&e.posterImage.hide());var r=[];e.options_.hlsConfig&&e.options_.hlsConfig.skipHlsJs?n.forEach(function(t){t.src?r.push({src:t.src,skipHlsJs:!0}):r.push({src:t,skipHlsJs:!0})}):r=[].concat(n),reportLog({str_ext_content:"webrtc fallback: "+JSON.stringify(r),str_stream_url:e.cache_&&e.cache_.src}),e.src(r);var o=videojs.browser.IS_IOS||videojs.browser.IS_ANDROID?"loadeddata":"loadedmetadata",s=function a(){e.options_.autoplay&&e.play(),e.one("progress",function(){e.options_.autoplay&&e.play(),e.off(o,a)})};e.on(o,s)},t.prototype.convertProtocol=function(t){var e=[];if(t.indexOf(".sdp")>-1)t=t.replace(".sdp",".flv"),e.push(t.replace(".sdp",".m3u8"));else{var n=t.replace("webrtc://","https://").replace("?",".flv?");-1===n.indexOf("?")&&-1===n.indexOf(".flv")&&(n+=".flv");var i=t.replace("webrtc://","https://").replace("?",".m3u8?");-1===i.indexOf("?")&&-1===i.indexOf(".m3u8")&&(i+=".m3u8"),e.push(i)}return e},t}(),webrtcTypeRE=/^webrtc/i,webrtcExtRE=/\.sdp/i,webrtcProtoRE=/^(webrtc:\/\/)/i,sourceHandler={name:"webrtcSourceHandler",canHandleSource:function(t){return webrtcTypeRE.test(t.type)?"probably":webrtcExtRE.test(t.src)||webrtcProtoRE.test(t.src)?"maybe":""},handleSource:function(t,e,n){return e.webrtcProvider&&e.webrtcProvider.dispose(),e.webrtcProvider=new WebRTCProvider(t,e,n),e.webrtcProvider},canPlayType:function(t){if(webrtcTypeRE.test(t))return"probably"}};mountWebRTCProvider();var Html5DashJS$4=function(){function t(e,n,i){var r=this;classCallCheck(this,t);var o=function(){var o=window_1.dashjs;if(r.dashjs=o,i=i||n.options_,r.player=videojs(i.playerId),r.player.dash=r.player.dash||{},r.tech_=n,r.el_=n.el(),r.elParent_=r.el_.parentNode,r.hasFiniteDuration_=!1,e.src){n.isReady_=!1;var s=e.src;r.keySystemOptions_=t.buildDashJSProtData(e.keySystemOptions||e.keySystems),shaka.polyfill.installAll();shaka.Player.isBrowserSupported()&&function(){var t=new shaka.Player(r.el_);i.dashConfig&&t.configure(i.dashConfig),r.mediaPlayer_=t,window_1.splayer=t,t.addEventListener("error",r.onErrorEvent),r.dashPlayer=t;r.keySystemOptions_&&r.keySystemOptions_["com.widevine.alpha"]?r.keySystemOptions_["com.widevine.alpha"].serverCertificateURL?new Promise(function(t,e){if(!r.keySystemOptions_["com.widevine.alpha"].serverCertificateURL)return void t(null);fetch(r.keySystemOptions_["com.widevine.alpha"].serverCertificateURL).then(function(t){if(!t.ok)throw new Error("HTTP error! status: "+t.status);return t.arrayBuffer()}).then(function(e){t(new Uint8Array(e))})["catch"](function(t){e(new Error("获取Widevine服务器证书失败: "+t.message))})}).then(function(e){r.keySystemOptions_["com.widevine.alpha"].serverURL&&t.configure({drm:{servers:{"com.widevine.alpha":r.keySystemOptions_["com.widevine.alpha"].serverURL},advanced:{"com.widevine.alpha":{serverCertificate:e}}}}),t.load(s).then(function(){r.onMetaData()})["catch"](r.onError)}):(t.configure({drm:{servers:{"com.widevine.alpha":r.keySystemOptions_["com.widevine.alpha"].serverURL}}}),t.load(s).then(function(){r.onMetaData()})["catch"](r.onError)):t.load(s).then(function(){r.onMetaData()})["catch"](r.onError)}(),r.player.trigger({type:"shakaInstanceCreated",data:{instance:r.mediaPlayer_}}),r.player.trigger({type:"instanceCreated",data:{instance:r.mediaPlayer_,type:"shaka"}}),r.tech_.triggerReady()}};window_1.dashjs?o():loadScript(SHAKA_PATH,function(){o()})}return t.prototype.onError=function(t){t.severity===shaka.util.Error.Severity.CRITICAL&&this.player.error({code:14,message:"specific error code: "+t.code})},t.prototype.onErrorEvent=function(t){this.onError(t.detail)},t.buildDashJSProtData=function(t){var e={};if(!t)return null;if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n],r=videojs.mergeOptions({},i.options);r.licenseUrl&&(r.serverURL=r.licenseUrl,delete r.licenseUrl),e[i.name]=r}else e=t;return e},t.prototype.dispose=function(){if(this.mediaPlayer_)try{this.mediaPlayer_.destroy()}catch(t){}this.player.dash&&delete this.player.dash},t.prototype.unload=function(){if(this.mediaPlayer_)try{this.mediaPlayer_.unload()}catch(t){}this.player.dash&&delete this.player.dash},t.prototype.duration=function(){return this.mediaPlayer_?this.mediaPlayer_.isLive()?Infinity:this.mediaPlayer_.getDuration():0},t.hooks=function(e,n){return t.hooks_[e]=t.hooks_[e]||[],n&&(t.hooks_[e]=t.hooks_[e].concat(n)),t.hooks_[e]},t.hook=function(e,n){t.hooks(e,n)},t.removeHook=function(e,n){var i=t.hooks(e).indexOf(n);return-1!==i&&(t.hooks_[e]=t.hooks_[e].slice(),t.hooks_[e].splice(i,1),!0)},t.prototype.onMetaData=function(t){var e=this,n=this.mediaPlayer_;window_1._mediaPlayer=n;var i=n.getVariantTracks(),r=[];if(i.length>0){r.push({id:-1,label:"auto",selected:!0}),i.forEach(function(t,n){r.push({id:n,label:e.getLevelLabel(t),selected:!1})});var o={qualityData:{video:r},callbacks:{video:videojs.bind(this,this.switchQuality)}};this.tech_.setTimeout(function(){this.trigger({type:"masterplaylistchange",data:o})},1)}},t.prototype.switchQuality=function(t){var e=this,n=this.mediaPlayer_,i=n.getVariantTracks(),r=n.getVariantTracks().find(function(t){return t.active});if(r.id===t.id)return!1;if(-1!==t.id){this.tech_.trigger({type:"dashqualityswitching"});var o=setInterval(function(){var t=e.el_.videoHeight;r.height!==t&&(e.tech_.trigger({type:"dashqualityswitched"}),clearInterval(o))},1e3)}-1===t.id?n.configure({abr:{enabled:!0}}):-1!=t.id&&i[t.id]&&(n.configure({abr:{enabled:!1}}),n.selectVariantTrack(i[t.id],!1))},t.prototype.getLevelLabel=function(t){return t.height?t.height+"p":t.width?Math.round(9*t.width/16)+"p":t.bitrate?t.bitrate/1e3+"kbps":0},t.prototype.onEvent=function(t){switch(this.tech_.trigger({type:"dash_"+t.type,data:t}),t.type){case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_REQUESTED:this.tech_.trigger({type:"dashqualityswitching",data:t});break;case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_RENDERED:this.tech_.trigger({type:"dashqualityswitched",data:t}),this.currentQuality[t.mediaType]=t.newQuality}},t}(),Html5DashJS$2=IS_TV?Html5DashJS$4:Html5DashJS;Html5DashJS$2.hooks_={};var canHandleKeySystems=function(t){t=JSON.parse(JSON.stringify(t)),Html5DashJS$2.updateSourceData&&(videojs.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),t=Html5DashJS$2.updateSourceData(t)),Html5DashJS$2.hooks("updatesource").forEach(function(e){t=e(t)});var e=document_1.createElement("video");return!(t.keySystemOptions&&!window_1.navigator.requestMediaKeySystemAccess&&!e.msSetMediaKeys)};videojs.DashSourceHandler=function(){return{name:"dashSourceHandler",canHandleSource:function(t){var e=/\.mpd/i;return canHandleKeySystems(t)?videojs.DashSourceHandler.canPlayType(t.type)?"probably":e.test(t.src)?"maybe":"":""},handleSource:function(t,e,n){return e.dashProvider&&e.dashProvider.dispose(),e.dashProvider=new Html5DashJS$2(t,e,n),e.dashProvider},canPlayType:function(t){return videojs.DashSourceHandler.canPlayType(t)}}},videojs.DashSourceHandler.canPlayType=function(t){return/^application\/dash\+xml/i.test(t)?"probably":""},TCPlayer.mountDashProvider=mountDashProvider,mountDashProvider(),videojs.Html5DashJS=Html5DashJS$2;for(var Tech$2=videojs.getComponent("Tech"),Dom$1=videojs.dom,Url$1=videojs.url,createTimeRange=videojs.createTimeRange,mergeOptions$1=videojs.mergeOptions,navigator$2=window_1&&window_1.navigator||{},Flash=function(t){function e(n,i,r){classCallCheck(this,e);var o=possibleConstructorReturn(this,t.call(this,n,i,r));return i.source&&o.ready(function(){this.setSource(i.source)},!0),i.startTime&&o.ready(function(){this.load(),this.play(),this.currentTime(i.startTime)},!0),window_1.videojs=window_1.videojs||{},window_1.videojs.Flash=window_1.videojs.Flash||{},window_1.videojs.Flash.onReady=e.onReady,window_1.videojs.Flash.onEvent=e.onEvent,window_1.videojs.Flash.onError=e.onError,o.on("seeked",function(){this.lastSeekTarget_=undefined}),o}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_;t.swf||(t.swf=unifyProtocol("//imgcache.qq.com/open/qcloud/video/tcplayer/player.swf"));var n=t.techId,i=mergeOptions$1({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:t.autoplay,preload:t.preload,loop:t.loop,muted:t.muted},t.flashVars),r=mergeOptions$1({wmode:"opaque",bgcolor:"#000000"},t.params),o=mergeOptions$1({id:n,name:n,"class":"vjs-tech"},t.attributes);return this.el_=e.embed(t.swf,i,r,o),this.el_.tech=this,this.el_},e.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},e.prototype.pause=function(){this.el_.vjs_pause()},e.prototype.src=function(t){return t===undefined?this.currentSrc():this.setSrc(t)},e.prototype.setSrc=function(t){var e=this;t=Url$1.getAbsoluteURL(t),this.el_.vjs_src(t),this.autoplay()&&this.setTimeout(function(){return e.play()},0)},e.prototype.seeking=function(){return this.lastSeekTarget_!==undefined},e.prototype.setCurrentTime=function(e){var n=this.seekable();n.length&&(e=e>n.start(0)?e:n.start(0),e=e<n.end(n.length-1)?e:n.end(n.length-1),this.lastSeekTarget_=e,this.trigger("seeking"),this.el_.vjs_setProperty("currentTime",e),t.prototype.setCurrentTime.call(this))},e.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.vjs_getProperty("currentTime")},e.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.vjs_getProperty("currentSrc")},e.prototype.duration=function(){if(0===this.readyState())return NaN;var t=this.el_.vjs_getProperty("duration");return t>=0?t:Infinity},e.prototype.load=function(){this.el_.vjs_load()},e.prototype.poster=function(){this.el_.vjs_getProperty("poster")},e.prototype.setPoster=function(){},e.prototype.seekable=function(){var t=this.duration();return 0===t?createTimeRange():createTimeRange(0,t)},e.prototype.buffered=function(){var t=this.el_.vjs_getProperty("buffered");return 0===t.length?createTimeRange():createTimeRange(t[0][0],t[0][1])},e.prototype.supportsFullScreen=function(){return!1},e.prototype.enterFullScreen=function(){return!1},e.prototype.getVideoPlaybackQuality=function(){var t=this.el_.vjs_getProperty("getVideoPlaybackQuality");return window_1.performance&&"function"==typeof window_1.performance.now?t.creationTime=window_1.performance.now():window_1.performance&&window_1.performance.timing&&"number"==typeof window_1.performance.timing.navigationStart&&(t.creationTime=window_1.Date.now()-window_1.performance.timing.navigationStart),t},e}(Tech$2),_readWrite=["rtmpConnection","rtmpStream","preload","defaultPlaybackRate","playbackRate","autoplay","loop","controls","volume","muted","defaultMuted"],_readOnly=["networkState","readyState","initialTime","startOffsetTime","paused","ended","videoWidth","videoHeight"],_api=Flash.prototype,i$2=0;i$2<_readWrite.length;i$2++)_createGetter(_readWrite[i$2]),_createSetter(_readWrite[i$2]);for(var _i$1=0;_i$1<_readOnly.length;_i$1++)_createGetter(_readOnly[_i$1]);Flash.isSupported=function(){return Flash.version()[0]>=10},Tech$2.withSourceHandlers(Flash),Flash.nativeSourceHandler={},Flash.nativeSourceHandler.canPlayType=function(t){return t in Flash.formats?"maybe":""},Flash.nativeSourceHandler.canHandleSource=function(t,e){var n=void 0;return n=t.type?t.type.replace(/;.*/,"").toLowerCase():function(t){var e=Url$1.getFileExtension(t);return e?"video/"+e:""}(t.src),Flash.nativeSourceHandler.canPlayType(n)},Flash.nativeSourceHandler.handleSource=function(t,e,n){e.setSrc(t.src)},Flash.nativeSourceHandler.dispose=function(){},Flash.registerSourceHandler(Flash.nativeSourceHandler),Flash.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},Flash.onReady=function(t){var e=Dom$1.$("#"+t),n=e&&e.tech;n&&n.el()&&Flash.checkReady(n)},Flash.checkReady=function(t){t.el()&&(t.el().vjs_getProperty?t.triggerReady():this.setTimeout(function(){Flash.checkReady(t)},50))},Flash.onEvent=function(t,e){var n=Dom$1.$("#"+t).tech,i=Array.prototype.slice.call(arguments,2);n.setTimeout(function(){n.trigger(e,i)},1)},Flash.onError=function(t,e){var n=Dom$1.$("#"+t).tech;if("srcnotfound"===e)return n.error(4);n.error("FLASH: "+e)},Flash.version=function(){var t="0,0,0";try{t=new window_1.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(e){try{navigator$2.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(t=(navigator$2.plugins["Shockwave Flash 2.0"]||navigator$2.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(e){}}return t.split(",")},Flash.embed=function(t,e,n,i){var r=Flash.getEmbedCode(t,e,n,i);return Dom$1.createEl("div",{innerHTML:r}).childNodes[0]},Flash.getEmbedCode=function(t,e,n,i){var r="",o="",s="";return e&&Object.getOwnPropertyNames(e).forEach(function(t){r+=t+"="+e[t]+"&amp;"}),n=mergeOptions$1({movie:t,flashvars:r,allowScriptAccess:"always",allowNetworking:"all"},n),Object.getOwnPropertyNames(n).forEach(function(t){o+='<param name="'+t+'" value="'+n[t]+'" />'}),i=mergeOptions$1({data:t,width:"100%",height:"100%"},i),Object.getOwnPropertyNames(i).forEach(function(t){s+=t+'="'+i[t]+'" '}),'<object type="application/x-shockwave-flash" '+s+">"+o+"</object>"},FlashRtmpDecorator(Flash),Tech$2.getTech("Flash")?(videojs.log.warn("Not using videojs-flash as it appears to already be registered"),videojs.log.warn("videojs-flash should only be used with video.js@6 and above")):videojs.registerTech("Flash",Flash);var FlashlsSourceHandler={},mpegurlRE$1=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;FlashlsSourceHandler.canPlayType=function(t){return mpegurlRE$1.test(t)?"maybe":""},FlashlsSourceHandler.canHandleSource=function(t,e){return"maybe"===FlashlsSourceHandler.canPlayType(t.type)},FlashlsSourceHandler.handleSource=function(t,e,n){e.setSrc(t.src)},FlashlsSourceHandler.dispose=function(){},videojs.getTech("Flash").registerSourceHandler(FlashlsSourceHandler,0),FlashlsSourceHandler.VERSION="__VERSION__";var Play="播放",Pause="暂停",LIVE="直播",Loaded="加载完毕",Progress="进度",Fullscreen="全屏",Rotate="旋转",CssFullscreen="页面全屏",Mute="静音",Unmute="取消静音",Subtitles="字幕",Captions="内嵌字幕",Chapters="节目段落",Descriptions="描述",Close="关闭",Replay="重播",Text="文字",White="白",Black="黑",Red="红",Green="绿",Blue="蓝",Yellow="黄",Magenta="紫红",Cyan="青",Background="背景",Window="视窗",Transparent="透明",Opaque="不透明",None="无",Raised="浮雕",Depressed="压低",Uniform="均匀",Dropshadow="下阴影",Casual="舒适",Script="手写体",Reset="重启",Done="完成",auto="自动",Mirror="镜像",CN={Play:Play,Pause:Pause,LIVE:LIVE,Loaded:Loaded,Progress:Progress,Fullscreen:Fullscreen,Rotate:Rotate,CssFullscreen:CssFullscreen,Mute:Mute,Unmute:Unmute,Subtitles:Subtitles,Captions:Captions,Chapters:Chapters,Descriptions:Descriptions,Close:Close,Replay:Replay,Text:Text,White:White,Black:Black,Red:Red,Green:Green,Blue:Blue,Yellow:Yellow,Magenta:Magenta,Cyan:Cyan,Background:Background,Window:Window,Transparent:Transparent,Opaque:Opaque,None:None,Raised:Raised,Depressed:Depressed,Uniform:Uniform,Dropshadow:Dropshadow,Casual:Casual,Script:Script,Reset:Reset,Done:Done,auto:auto,Mirror:Mirror,"Current Time":"当前时间","Duration Time":"时长","Remaining Time":"剩余时间","Stream Type":"媒体流类型","Non-Fullscreen":"退出全屏","Picture-in-Picture":"画中画","Exit Picture-in-Picture":"退出画中画","Playback Rate":"播放速度","subtitles off":"关闭字幕","captions off":"关闭内嵌字幕","Close Modal Dialog":"关闭弹窗","descriptions off":"关闭描述","Audio Track":"音轨","You aborted the media playback":"视频播放被终止","A network error caused the media download to fail part-way.":"网络错误导致视频下载中途失败。","The media could not be loaded, either because the server or network failed or because the format is not supported.":"视频因格式不支持或者服务器或网络的问题无法加载。","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。","No compatible source was found for this media.":"无法找到此视频兼容的源或者当前环境无法播放该视频。","The media is encrypted and we do not have the keys to decrypt it.":"视频已加密,无法解密。","Play Video":"播放视频","Modal Window":"弹窗","This is a modal window":"这是一个弹窗","This modal can be closed by pressing the Escape key or activating the close button.":"可以按ESC按键或启用关闭按钮来关闭此弹窗。",", opens captions settings dialog":", 开启标题设置弹窗",", opens subtitles settings dialog":", 开启字幕设置弹窗",
21
+ ;window.requestAnimationFrame=function(t){var e=(new Date).getTime(),n=Math.max(0,16.7-(e-lastTime)),i=window.setTimeout(function(){t(e+n)},n);return lastTime=e+n,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)});var DynamicWatermark=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i||{},r.content=r.options.content,r.options.content&&r.init(),r}return inherits(e,t),e.prototype.dispose=function(){this.stopAnimation(),this.player.$(".tcp-dynamic-watermark-container")&&this.player.el().removeChild(this.containerElement),t.prototype.dispose.call(this)},e.prototype.init=function(){var t=this,e=this.player;this.isFirstShow=!0,this.initUI(),this.initStyle(),this.initSpeed(),e.on("canplay",function(){t.calculateStyle(),t.setStyle(),dom$2.removeClass(t.containerElement,"vjs-hidden")}),e.one("play",function(){t.encModule=new Enc,t.ghostCycle=t.encModule.calculateGhost(t.player.duration()),t.startAnimation()}),e.on(["fullscreenchange","playerresize"],function(){setTimeout(function(){t.calculateStyle()},200)})},e.prototype.initUI=function(){var t=this.player,e=dom$2.createEl("div",{className:"tcp-dynamic-watermark-container vjs-hidden"}),n=dom$2.createEl("div",{innerHTML:encodeHTML(this.options.content),className:"tcp-dynamic-watermark-content"});if(e.appendChild(n),!this.options.keep&&this.options.content&&t.el().appendChild(e),this.containerElement=e,this.markContentElement=n,"image"===this.options.type){var i=document.createElement("img");this.options.width&&(i.style.width=this.options.width),this.options.height&&(i.style.height=this.options.height),i.setAttribute("src",this.options.content),this.markContentElement.innerHTML="",this.markContentElement.appendChild(i)}},e.prototype.initStyle=function(){this.style={containerWidth:"",containerHeight:"",containerLeft:"",containerTop:"",contentLeft:80*Math.random(),contentTop:80*Math.random(),margin:0,padding:0,display:"block",visibility:"visible",opacity:.5,position:"absolute",color:"rgba(255, 255, 255)"}},e.prototype.initSpeed=function(){if(this.options.keep&&(!this.options.speed||0===this.options.speed))return this.speed=.2,!1;this.speed=this.options.speed},e.prototype.calculateStyle=function(){var t=this.player,e=this.style,n=t.videoWidth(),i=t.videoHeight(),r=dom$2.getBoundingClientRect(t.el()),o=r.width,s=r.height,a=(o/s).toFixed(2),u=(n/i).toFixed(2),l=void 0,c=void 0;u<a?(c=s,l=c*u):u>a?(l=o,c=l/u):u==a&&(l=o,c=s),e.containerLeft=(o-l)/2/o*100,e.containerTop=(s-c)/2/s*100,e.containerWidth=l/o*100,e.containerHeight=c/s*100},e.prototype.setStyle=function(){var t=this.containerElement,e=this.markContentElement,n=this.style;t.style.left=n.containerLeft+"%",t.style.top=n.containerTop+"%",t.style.width=n.containerWidth+"%",t.style.height=n.containerHeight+"%",t.style.display=e.style.display=n.display,t.style.visibility=e.style.visibility=n.visibility,t.style.opacity=e.style.opacity=n.opacity,t.style.position=e.style.position=n.position,t.style.margin=e.style.margin=n.margin,t.style.padding=e.style.padding=n.padding,e.style.left=this.options.left||n.contentLeft+"%",e.style.top=this.options.top||n.contentTop+"%",this.options.right&&(e.style.right=this.options.right),this.options.bottom&&(e.style.bottom=this.options.bottom),e.style.color=this.options.color||n.color,this.options.keep||(t.style.opacity=e.style.opacity=this.options.opacity||n.opacity),"text"===this.options.type&&(e.style.fontSize=this.options.fontSize||"12px",e.innerHTML=encodeHTML(this.options.content))},e.prototype.setContent=function(t){this.options.content=t},e.prototype.startAnimation=function(){var t=this;if(!this.rafID){var e=(this.player,this.style),n=this.containerElement,i=this.markContentElement,r=1,o=1,s=Math.random(),a=function u(){try{if(!t.isPauseAnimation){var a=Math.min(1,0===t.speed?0:t.speed?t.speed:.2),l=dom$2.getBoundingClientRect(n),c=dom$2.getBoundingClientRect(i),h=c.left-l.left,p=c.top-l.top;h+=a*r*s,p+=a*o*(1-s),h+c.width>l.width?(r=-1,s=Math.random()):h<0&&(r=1,s=Math.random()),p+c.height>l.height?(o=-1,s=Math.random()):p<0&&(o=1,s=Math.random()),h=Math.min(l.width-c.width,h),p=Math.min(l.height-c.height,p),e.contentLeft=h/l.width*100,e.contentTop=p/l.height*100,t.setStyle()}}catch(d){t.player&&t.encModule.handleWatermarkElementAdd(t)}if(t.isStopAnimation)return t.isStopAnimation=!1,cancelAnimationFrame(t.rafID),void(t.rafID=null);0!==t.speed&&requestAnimationFrame(u)};this.rafID=requestAnimationFrame(a)}},e.prototype.resumeAnimation=function(){this.isPauseAnimation=!1},e.prototype.pauseAnimation=function(){this.isPauseAnimation=!0},e.prototype.stopAnimation=function(){this.isStopAnimation=!0},e}(Plugin$20);videojs.registerPlugin("DynamicWatermark",DynamicWatermark);var Plugin$21=videojs.getPlugin("plugin"),XP2PHlsjsPlugin=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,r.hlsp2p=null,r}return inherits(e,t),e.prototype.startHLSP2P=function(t,e,n){var i=this,r=this.player.tech_,o=r.options_,s=o.xp2pConfig;if(e.isSupported()&&!window.hlsp2p){for(var a=["videoType","xp2pPackage","xp2pAppId","tencentCloudAppId"],u=a,l=Array.isArray(u),c=0,u=l?u:u[Symbol.iterator]();;){var h;if(l){if(c>=u.length)break;h=u[c++]}else{if(c=u.next(),c.done)break;h=c.value}var p=h;if(s[p]===undefined)return}var d={videoId:o.playerId+"_html5_api",url:o.source.src,videoType:s.videoType,cloudAppId:s.tencentCloudAppId,domain:s.xp2pPackage,xp2pAppId:s.xp2pAppId,p2pStartDelay:1e3},f=HLSP2P.create(t,Object.assign(d,s));f.on(HLSP2P.Events.Rollback,function(t){i.destroy(),n&&n(t)}),this.hlsp2p=f}},e.prototype.destroy=function(){this.hlsp2p&&(this.hlsp2p.destroy(),this.hlsp2p=null,window.hlsp2p=undefined)},e.prototype.dispose=function(){this.destroy()},e}(Plugin$21);videojs.registerPlugin("XP2PHlsjsPlugin",XP2PHlsjsPlugin);var Plugin$22=videojs.getPlugin("plugin"),XP2PFlvjsPlugin=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,r}return inherits(e,t),e.prototype.createLoader=function(t,e,n){var i=this.player.tech();return function(t){function r(e,n){classCallCheck(this,r);var i=possibleConstructorReturn(this,t.call(this));return i._qvbp2p=null,i._receivedLength=0,i._config=n,i}return inherits(r,t),r.isSupported=function(){return e&&e.isSupported()},r.prototype.destroy=function(){this._destroyQVBP2P(),t.prototype.destroy.call(this)},r.prototype.open=function(t){this._createQVBP2P(),this._qvbp2p.on(e.ComEvents.STATE_CHANGE,this._onQVBP2PStateChange.bind(this)),this._qvbp2p.setMediaElement(i.el());var n={src:t.url};this._qvbp2p.loadSource(n)},r.prototype.abort=function(){this._destroyQVBP2P()},r.prototype._onQVBP2PStateChange=function(t,n){var i=e.ComCodes;switch(n.code){case i.RECEIVE_BUFFER:this._receiveBuffer(n.payload);break;case i.ROLLBACK:this._rollback(n)}},r.prototype._receiveBuffer=function(t){var e=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,e,this._receivedLength)},r.prototype._rollback=function(t){n&&n(t)},r.prototype._createQVBP2P=function(){this._qvbp2p&&this._destroyQVBP2P(),this._qvbp2p=e.create(this._config.xp2pConfig),window.qvbp2p=this._qvbp2p},r.prototype._destroyQVBP2P=function(){this._qvbp2p&&(this._qvbp2p.destroy(),this._qvbp2p=null,window.qvbp2p=null)},r}(t.BaseLoader)},e}(Plugin$22);videojs.registerPlugin("XP2PFlvjsPlugin",XP2PFlvjsPlugin);var defaultConfig$1={enableStashBuffer:!1,lazyLoadMaxDuration:300},Html5FlvJS=function(){function t(e,n,i){var r=this;classCallCheck(this,t),this.tech=n,this.player=this.tech.player();var o=function(){var t=window.flvjs;r.flvjs=t;var o=videojs.mergeOptions(defaultConfig$1,i.flvConfig,{xp2pConfig:i.xp2pConfig}),s=n.player();if(window.QVBP2P&&i.xp2pConfig&&i.xp2pConfig.useXP2P&&s.XP2PFlvjsPlugin){var a=s.XP2PFlvjsPlugin().createLoader(t,window.QVBP2P,function(t){r.dispose(),i.xp2pConfig.useXP2P=!1;var e=r.tech.player(),n=r.tech.currentSource_.src;e.src(n)});r.xp2pFlvLoader=a,o.customLoader=a}var u=new t.createPlayer(Object.assign({isLive:!1,url:e.src,type:"flv"},o),o);u.on(t.Events.ERROR,videojs.bind(r,r.onError));for(var l in t.Events)!function(e){u.on(t.Events[e],videojs.bind(r,function(t){this.onEvent(e,t)}))}(l);u.on(t.Events.STATISTICS_INFO,function(t){var e=(t.bps_audio||0)+(t.bps_video||0);s.trigger({type:"playstatus",data:{type:"flv",decodedFrames:t.decodedFrames,droppedFrames:t.droppedFrames,speed:t.speed.toFixed(0),bitrate:e||0,bpsAudio:t.bps_audio||0,bpsVideo:t.bps_video||0}})}),r.flv=u,s.trigger({type:"flvInstanceCreated",data:{flv:u}}),r._id=(new Date).getTime(),n.el().srcObject&&(n.el().srcObject=null),u.attachMediaElement(n.el()),u.load()};Promise.all([function(){return i.xp2pConfig&&i.xp2pConfig.useXP2P&&"flv"===i.xp2pConfig.format&&!window.QVBP2P?new Promise(function(t){loadScript(XP2P_FLV_PATH,function(){t()})}):Promise.resolve()}(),function(){return window.flvjs?Promise.resolve():new Promise(function(t){loadScript(FLV_PATH,function(){t()})})}()]).then(function(){o()})["catch"](function(t){r.player.error({code:32})})}return t.prototype.onError=function(t,e,n){var i=this.tech.player();t===this.flvjs.ErrorTypes.NETWORK_ERROR&&i.error({code:2,source:n}),t===this.flvjs.ErrorTypes.MEDIA_ERROR&&i.error({code:3,source:n})},t.prototype.onEvent=function(t,e){this.tech.player().trigger({type:"FLVJS_EVENT",data:{type:t,data:e}})},t.prototype.dispose=function(){if(this.tech.player().pause(),this.tech.flvProvider)try{this.flv.destroy()}catch(t){}this.tech.flvProvider=null},t}(),flvTypeRE=/^video\/flv$/i,flvExtRE=/.flv(?![^?])/i,flvProtoRE=/^(ws:\/\/)/i,FlvSourceHandler={name:"flvSourceHandler",canHandleSource:function(t){return flvTypeRE.test(t.type)?"probably":flvExtRE.test(t.src)||flvProtoRE.test(t.src)?"maybe":""},handleSource:function(t,e,n){return e.flvProvider&&e.flvProvider.dispose(),e.flvProvider=new Html5FlvJS(t,e,n),e.flvProvider},canPlayType:function(t){if(flvTypeRE.test(t))return"probably"}};TCPlayer.mountFlvProvider=mountFlvProvider,mountFlvProvider();var guid$1=function(t){var e=localStorage.getItem(t);return e||(e=guid(),localStorage.setItem(t,e)),e},bytes_token=guid(),liveBaseData={str_user_id:guid$1("dev_uuid"),dev_uuid:guid$1("dev_uuid"),str_session_id:bytes_token,bytes_token:bytes_token,str_device_type:"",str_package_name:"",str_stream_url:"http://pulldrm.buzzcast.com/live/unknown.m3u8",u32_link_type:1001,u32_channel_type:1,str_app_version:"",platform:3,uint32_platform:3,str_user_agent:USER_AGENT,uint64_data_time:getTimeStampBySecond(),u64_timestamp:getTimeStamp(),u32_avg_cpu_usage:"",u32_avg_memory:"",u64_begin_timestamp:"",u32_result:"",u64_err_code:"",u32_speed_cnt:0,u32_avg_cache_time:"",u32_max_load:"",u32_audio_block_time:"",u32_avg_load:"",u32_load_cnt:0,u32_nodata_cnt:0,u32_first_i_frame:"",u32_video_width:"",u32_video_height:"",u32_video_avg_fps:"",u32_avg_block_time:"",u64_block_count:0,u32_video_block_time:0,u64_jitter_cache_max:0,u64_block_duration_max:0,u64_jitter_cache_avg:0,u32_ip_count_quic:"",u32_connect_count_quic:"",u32_connect_count_tcp:"",u32_is_real_time:"",u32_first_frame_black:"",u32_delay_report:0},reportLog=function(t,e){return!1},defaultConfig$2={connectRetryCount:2,connectTimeout:5,receiveVideo:!0,receiveAudio:!0,showLog:!1},WebRTCProvider=function(){function t(e,n,i){var r=this;classCallCheck(this,t),this.tech=n,this.player=this.tech.player();var o=function(){if(!r.player)return!1;r.playerMetrics=r.player.PlayerMetrics(),r.report=r.player.options_.reportable;var t=window.TXLivePlayer;r.TXLivePlayer=t,r.eventStack=[];var e=videojs.mergeOptions(defaultConfig$2,i.webrtcConfig);i.xp2pConfig&&"webrtc"===i.xp2pConfig.format&&i.xp2pConfig.useXP2P&&Object.assign(e,{p2pEnable:i.xp2pConfig.useXP2P,p2pConfig:{cloudAppid:i.xp2pConfig.tencentCloudAppId,xp2pAppid:i.xp2pConfig.xp2pAppId,appKey:i.xp2pConfig.xp2pAppKey,xp2pDomain:i.xp2pConfig.xp2pPackage}});var o=new t;r.webrtcConfig=e,o.setPlayerView(n.el()),o.setConfig(e),o.setPlayListener({onPlayEvent:videojs.bind(r,r.onPlayEvent),onPlayStats:videojs.bind(r,r.onPlayStats),onPlayReport:videojs.bind(r,r.onPlayReport),onPlaySEI:videojs.bind(r,r.onPlaySEI)}),o.startPlay(r.player.currentSrc()),r.player.one("playing",function(){0!==r.eventStack.length&&reportLog({str_ext_content:"eventStack on playing: "+JSON.stringify(r.eventStack),str_stream_url:r.player.cache_&&r.player.cache_.src})}),r.player.one("error",function(){0!==r.eventStack.length&&reportLog({str_ext_content:"eventStack on error: "+JSON.stringify(r.eventStack),str_stream_url:r.player.cache_&&r.player.cache_.src})}),r.webrtcPlayer=o,IS_IOS&&(r.player.cache_.volume||0===r.player.cache_.volume)&&o.setVolume(100*r.player.cache_.volume),r.player.trigger({type:"webrtcInstanceCreated",data:{webrtc:o}})};Promise.all([function(){return window.TXLivePlayer?Promise.resolve():new Promise(function(t,e){loadScript(WEBRTC_PATH,function(n){n?e():t()})})}()]).then(function(){o()})["catch"](function(t){r.player.error({code:31})})}return t.prototype.onPlayStats=function(t){this.tech.player().trigger({type:"webrtcstats",data:t})},t.prototype.onPlayEvent=function(t,e){-2003===t?this.eventStack.push({event:t,data:e}):this.eventStack.push({event:t,message:e&&e.message});var n=this.tech.player();if(n.trigger({type:"debug",data:{code:t,data:e}}),1005===t&&n.addClass("vjs-waiting"),1007===t&&(this.traceId="webrtc_user="+e.iceInfo),IS_IOS&&1101===t&&(n.trigger("blocked"),n.trigger({type:"webrtcevent",data:{code:2005}})),t<-2e3){if(-2003===t&&e&&e.videoActive&&(n.trigger("blocked"),n.trigger({type:"webrtcevent",data:{code:2005}})),-2003===t||-2006===t)return!1;if(-2005===t||-2001===t||-2004===t){n.trigger({type:"debug",data:{message:"debug === webrtc 状态码 "+t+",进入降级逻辑"}});var i=n.options_.webrtcConfig;if(!i||!1!==i.fallback)return this.switchPlaySource(t),!1}return n.error({code:t,source:e}),!1}n.trigger({type:"webrtcevent",data:{code:t,data:e}})},t.prototype.onPlayReport=function(t){if(!1===this.report||!this)return!1;if(t.fromTxliveplayer=!0,40101===t.uint32_command){var e=this.tech.player();e&&e.trigger({type:"debug",data:{code:"report",data:t}}),this.playerMetrics.report_40101(t)}40100===t.uint32_command&&this.playerMetrics.report_40100(t),40102===t.uint32_command&&this.playerMetrics.report_40102(t)},t.prototype.onPlaySEI=function(t){var e=this.tech.player();e&&e.trigger({type:"webrtcsei",data:t})},t.prototype.dispose=function(){this.webrtcPlayer&&(this.webrtcPlayer.setPlayListener({onPlayEvent:function(){},onPlayStats:function(){}}),this.webrtcPlayer.stopPlay(),this.webrtcPlayer.setPlayerView(videojs.dom.createEl("video"))),this.webrtcPlayer=null},t.prototype.setSource=function(t){var e=this;this.webrtcPlayer.startPlay(t.src),this.tech.player().one("webrtcevent",function(t){-1002===t.data.code&&e.tech.player().play()})},t.prototype.recovery=function(){var t=this,e=this.tech.player(),n=void 0;e.one("waiting",function(){n=setTimeout(function(){e.one("webrtcevent",function(n){if(1004===n.data.code){t.webrtcPlayer&&t.webrtcPlayer.startPlay(e.src()),e.play();var i=function r(t){1002===t.data.code&&(e.play(),e.off("webrtcevent",r))};e.on("webrtcevent",i)}}),t.webrtcPlayer&&t.webrtcPlayer.stopPlay()},2e3)}),e.one("playing",function(){n&&clearTimeout(n)})},t.prototype.switchPlaySource=function(t){var e=this.tech.player(),n=void 0,i=this.tech.currentSource_.src;n=this.webrtcConfig&&this.webrtcConfig.fallbackUrl?[{src:this.webrtcConfig.fallbackUrl}]:[{src:(this.convertProtocol(i)||[])[0]}],e.trigger({type:"webrtcfallback",data:{target:n[0].src,code:t,traceId:this.traceId}}),e.options_.autoplay&&(e.bigPlayButton&&e.bigPlayButton.hide(),e.posterImage&&e.posterImage.hide());var r=[];e.options_.hlsConfig&&e.options_.hlsConfig.skipHlsJs?n.forEach(function(t){t.src?r.push({src:t.src,skipHlsJs:!0}):r.push({src:t,skipHlsJs:!0})}):r=[].concat(n),reportLog({str_ext_content:"webrtc fallback: "+JSON.stringify(r),str_stream_url:e.cache_&&e.cache_.src}),e.src(r);var o=videojs.browser.IS_IOS||videojs.browser.IS_ANDROID?"loadeddata":"loadedmetadata",s=function a(){e.options_.autoplay&&e.play(),e.one("progress",function(){e.options_.autoplay&&e.play(),e.off(o,a)})};e.on(o,s)},t.prototype.convertProtocol=function(t){var e=[];if(t.indexOf(".sdp")>-1)t=t.replace(".sdp",".flv"),e.push(t.replace(".sdp",".m3u8"));else{var n=t.replace("webrtc://","https://").replace("?",".flv?");-1===n.indexOf("?")&&-1===n.indexOf(".flv")&&(n+=".flv");var i=t.replace("webrtc://","https://").replace("?",".m3u8?");-1===i.indexOf("?")&&-1===i.indexOf(".m3u8")&&(i+=".m3u8"),e.push(i)}return e},t}(),webrtcTypeRE=/^webrtc/i,webrtcExtRE=/\.sdp/i,webrtcProtoRE=/^(webrtc:\/\/)/i,sourceHandler={name:"webrtcSourceHandler",canHandleSource:function(t){return webrtcTypeRE.test(t.type)?"probably":webrtcExtRE.test(t.src)||webrtcProtoRE.test(t.src)?"maybe":""},handleSource:function(t,e,n){return e.webrtcProvider&&e.webrtcProvider.dispose(),e.webrtcProvider=new WebRTCProvider(t,e,n),e.webrtcProvider},canPlayType:function(t){if(webrtcTypeRE.test(t))return"probably"}};mountWebRTCProvider();var Html5DashJS$4=function(){function t(e,n,i){var r=this;classCallCheck(this,t);var o=function(){var o=window_1.dashjs;if(r.dashjs=o,i=i||n.options_,r.player=videojs(i.playerId),r.player.dash=r.player.dash||{},r.tech_=n,r.el_=n.el(),r.elParent_=r.el_.parentNode,r.hasFiniteDuration_=!1,e.src){n.isReady_=!1;var s=e.src;r.keySystemOptions_=t.buildDashJSProtData(e.keySystemOptions||e.keySystems),shaka.polyfill.installAll();shaka.Player.isBrowserSupported()&&function(){var t=new shaka.Player(r.el_);i.dashConfig&&t.configure(i.dashConfig),r.mediaPlayer_=t,window_1.splayer=t,t.addEventListener("error",r.onErrorEvent),r.dashPlayer=t;r.keySystemOptions_&&r.keySystemOptions_["com.widevine.alpha"]?r.keySystemOptions_["com.widevine.alpha"].serverCertificateURL?new Promise(function(t,e){if(!r.keySystemOptions_["com.widevine.alpha"].serverCertificateURL)return void t(null);fetch(r.keySystemOptions_["com.widevine.alpha"].serverCertificateURL).then(function(t){if(!t.ok)throw new Error("HTTP error! status: "+t.status);return t.arrayBuffer()}).then(function(e){t(new Uint8Array(e))})["catch"](function(t){e(new Error("获取Widevine服务器证书失败: "+t.message))})}).then(function(e){r.keySystemOptions_["com.widevine.alpha"].serverURL&&t.configure({drm:{servers:{"com.widevine.alpha":r.keySystemOptions_["com.widevine.alpha"].serverURL},advanced:{"com.widevine.alpha":{serverCertificate:e}}}}),t.load(s).then(function(){r.onMetaData()})["catch"](r.onError)}):(t.configure({drm:{servers:{"com.widevine.alpha":r.keySystemOptions_["com.widevine.alpha"].serverURL}}}),t.load(s).then(function(){r.onMetaData()})["catch"](r.onError)):t.load(s).then(function(){r.onMetaData()})["catch"](r.onError)}(),r.player.trigger({type:"shakaInstanceCreated",data:{instance:r.mediaPlayer_}}),r.player.trigger({type:"instanceCreated",data:{instance:r.mediaPlayer_,type:"shaka"}}),r.tech_.triggerReady()}};window_1.dashjs?o():loadScript(SHAKA_PATH,function(){o()})}return t.prototype.onError=function(t){t.severity===shaka.util.Error.Severity.CRITICAL&&this.player.error({code:14,message:"specific error code: "+t.code})},t.prototype.onErrorEvent=function(t){this.onError(t.detail)},t.buildDashJSProtData=function(t){var e={};if(!t)return null;if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n],r=videojs.mergeOptions({},i.options);r.licenseUrl&&(r.serverURL=r.licenseUrl,delete r.licenseUrl),e[i.name]=r}else e=t;return e},t.prototype.dispose=function(){if(this.mediaPlayer_)try{this.mediaPlayer_.destroy()}catch(t){}this.player.dash&&delete this.player.dash},t.prototype.unload=function(){if(this.mediaPlayer_)try{this.mediaPlayer_.unload()}catch(t){}this.player.dash&&delete this.player.dash},t.prototype.duration=function(){return this.mediaPlayer_?this.mediaPlayer_.isLive()?Infinity:this.mediaPlayer_.getDuration():0},t.hooks=function(e,n){return t.hooks_[e]=t.hooks_[e]||[],n&&(t.hooks_[e]=t.hooks_[e].concat(n)),t.hooks_[e]},t.hook=function(e,n){t.hooks(e,n)},t.removeHook=function(e,n){var i=t.hooks(e).indexOf(n);return-1!==i&&(t.hooks_[e]=t.hooks_[e].slice(),t.hooks_[e].splice(i,1),!0)},t.prototype.onMetaData=function(t){var e=this,n=this.mediaPlayer_;window_1._mediaPlayer=n;var i=n.getVariantTracks(),r=[];if(i.length>0){r.push({id:-1,label:"auto",selected:!0}),i.forEach(function(t,n){r.push({id:n,label:e.getLevelLabel(t),selected:!1})});var o={qualityData:{video:r},callbacks:{video:videojs.bind(this,this.switchQuality)}};this.tech_.setTimeout(function(){this.trigger({type:"masterplaylistchange",data:o})},1)}},t.prototype.switchQuality=function(t){var e=this,n=this.mediaPlayer_,i=n.getVariantTracks(),r=n.getVariantTracks().find(function(t){return t.active});if(r.id===t.id)return!1;if(-1!==t.id){this.tech_.trigger({type:"dashqualityswitching"});var o=setInterval(function(){var t=e.el_.videoHeight;r.height!==t&&(e.tech_.trigger({type:"dashqualityswitched"}),clearInterval(o))},1e3)}-1===t.id?n.configure({abr:{enabled:!0}}):-1!=t.id&&i[t.id]&&(n.configure({abr:{enabled:!1}}),n.selectVariantTrack(i[t.id],!1))},t.prototype.getLevelLabel=function(t){return t.height?t.height+"p":t.width?Math.round(9*t.width/16)+"p":t.bitrate?t.bitrate/1e3+"kbps":0},t.prototype.onEvent=function(t){switch(this.tech_.trigger({type:"dash_"+t.type,data:t}),t.type){case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_REQUESTED:this.tech_.trigger({type:"dashqualityswitching",data:t});break;case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_RENDERED:this.tech_.trigger({type:"dashqualityswitched",data:t}),this.currentQuality[t.mediaType]=t.newQuality}},t}(),Html5DashJS$2=IS_TV?Html5DashJS$4:Html5DashJS;Html5DashJS$2.hooks_={};var canHandleKeySystems=function(t){t=JSON.parse(JSON.stringify(t)),Html5DashJS$2.updateSourceData&&(videojs.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),t=Html5DashJS$2.updateSourceData(t)),Html5DashJS$2.hooks("updatesource").forEach(function(e){t=e(t)});var e=document_1.createElement("video");return!(t.keySystemOptions&&!window_1.navigator.requestMediaKeySystemAccess&&!e.msSetMediaKeys)};videojs.DashSourceHandler=function(){return{name:"dashSourceHandler",canHandleSource:function(t){var e=/\.mpd/i;return canHandleKeySystems(t)?videojs.DashSourceHandler.canPlayType(t.type)?"probably":e.test(t.src)?"maybe":"":""},handleSource:function(t,e,n){return e.dashProvider&&e.dashProvider.dispose(),e.dashProvider=new Html5DashJS$2(t,e,n),e.dashProvider},canPlayType:function(t){return videojs.DashSourceHandler.canPlayType(t)}}},videojs.DashSourceHandler.canPlayType=function(t){return/^application\/dash\+xml/i.test(t)?"probably":""},TCPlayer.mountDashProvider=mountDashProvider,mountDashProvider(),videojs.Html5DashJS=Html5DashJS$2;for(var Tech$2=videojs.getComponent("Tech"),Dom$1=videojs.dom,Url$1=videojs.url,createTimeRange=videojs.createTimeRange,mergeOptions$1=videojs.mergeOptions,navigator$2=window_1&&window_1.navigator||{},Flash=function(t){function e(n,i,r){classCallCheck(this,e);var o=possibleConstructorReturn(this,t.call(this,n,i,r));return i.source&&o.ready(function(){this.setSource(i.source)},!0),i.startTime&&o.ready(function(){this.load(),this.play(),this.currentTime(i.startTime)},!0),window_1.videojs=window_1.videojs||{},window_1.videojs.Flash=window_1.videojs.Flash||{},window_1.videojs.Flash.onReady=e.onReady,window_1.videojs.Flash.onEvent=e.onEvent,window_1.videojs.Flash.onError=e.onError,o.on("seeked",function(){this.lastSeekTarget_=undefined}),o}return inherits(e,t),e.prototype.createEl=function(){var t=this.options_;t.swf||(t.swf=unifyProtocol("//imgcache.qq.com/open/qcloud/video/tcplayer/player.swf"));var n=t.techId,i=mergeOptions$1({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:t.autoplay,preload:t.preload,loop:t.loop,muted:t.muted},t.flashVars),r=mergeOptions$1({wmode:"opaque",bgcolor:"#000000"},t.params),o=mergeOptions$1({id:n,name:n,"class":"vjs-tech"},t.attributes);return this.el_=e.embed(t.swf,i,r,o),this.el_.tech=this,this.el_},e.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},e.prototype.pause=function(){this.el_.vjs_pause()},e.prototype.src=function(t){return t===undefined?this.currentSrc():this.setSrc(t)},e.prototype.setSrc=function(t){var e=this;t=Url$1.getAbsoluteURL(t),this.el_.vjs_src(t),this.autoplay()&&this.setTimeout(function(){return e.play()},0)},e.prototype.seeking=function(){return this.lastSeekTarget_!==undefined},e.prototype.setCurrentTime=function(e){var n=this.seekable();n.length&&(e=e>n.start(0)?e:n.start(0),e=e<n.end(n.length-1)?e:n.end(n.length-1),this.lastSeekTarget_=e,this.trigger("seeking"),this.el_.vjs_setProperty("currentTime",e),t.prototype.setCurrentTime.call(this))},e.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.vjs_getProperty("currentTime")},e.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.vjs_getProperty("currentSrc")},e.prototype.duration=function(){if(0===this.readyState())return NaN;var t=this.el_.vjs_getProperty("duration");return t>=0?t:Infinity},e.prototype.load=function(){this.el_.vjs_load()},e.prototype.poster=function(){this.el_.vjs_getProperty("poster")},e.prototype.setPoster=function(){},e.prototype.seekable=function(){var t=this.duration();return 0===t?createTimeRange():createTimeRange(0,t)},e.prototype.buffered=function(){var t=this.el_.vjs_getProperty("buffered");return 0===t.length?createTimeRange():createTimeRange(t[0][0],t[0][1])},e.prototype.supportsFullScreen=function(){return!1},e.prototype.enterFullScreen=function(){return!1},e.prototype.getVideoPlaybackQuality=function(){var t=this.el_.vjs_getProperty("getVideoPlaybackQuality");return window_1.performance&&"function"==typeof window_1.performance.now?t.creationTime=window_1.performance.now():window_1.performance&&window_1.performance.timing&&"number"==typeof window_1.performance.timing.navigationStart&&(t.creationTime=window_1.Date.now()-window_1.performance.timing.navigationStart),t},e}(Tech$2),_readWrite=["rtmpConnection","rtmpStream","preload","defaultPlaybackRate","playbackRate","autoplay","loop","controls","volume","muted","defaultMuted"],_readOnly=["networkState","readyState","initialTime","startOffsetTime","paused","ended","videoWidth","videoHeight"],_api=Flash.prototype,i$2=0;i$2<_readWrite.length;i$2++)_createGetter(_readWrite[i$2]),_createSetter(_readWrite[i$2]);for(var _i$1=0;_i$1<_readOnly.length;_i$1++)_createGetter(_readOnly[_i$1]);Flash.isSupported=function(){return Flash.version()[0]>=10},Tech$2.withSourceHandlers(Flash),Flash.nativeSourceHandler={},Flash.nativeSourceHandler.canPlayType=function(t){return t in Flash.formats?"maybe":""},Flash.nativeSourceHandler.canHandleSource=function(t,e){var n=void 0;return n=t.type?t.type.replace(/;.*/,"").toLowerCase():function(t){var e=Url$1.getFileExtension(t);return e?"video/"+e:""}(t.src),Flash.nativeSourceHandler.canPlayType(n)},Flash.nativeSourceHandler.handleSource=function(t,e,n){e.setSrc(t.src)},Flash.nativeSourceHandler.dispose=function(){},Flash.registerSourceHandler(Flash.nativeSourceHandler),Flash.formats={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"},Flash.onReady=function(t){var e=Dom$1.$("#"+t),n=e&&e.tech;n&&n.el()&&Flash.checkReady(n)},Flash.checkReady=function(t){t.el()&&(t.el().vjs_getProperty?t.triggerReady():this.setTimeout(function(){Flash.checkReady(t)},50))},Flash.onEvent=function(t,e){var n=Dom$1.$("#"+t).tech,i=Array.prototype.slice.call(arguments,2);n.setTimeout(function(){n.trigger(e,i)},1)},Flash.onError=function(t,e){var n=Dom$1.$("#"+t).tech;if("srcnotfound"===e)return n.error(4);n.error("FLASH: "+e)},Flash.version=function(){var t="0,0,0";try{t=new window_1.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(e){try{navigator$2.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(t=(navigator$2.plugins["Shockwave Flash 2.0"]||navigator$2.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(e){}}return t.split(",")},Flash.embed=function(t,e,n,i){var r=Flash.getEmbedCode(t,e,n,i);return Dom$1.createEl("div",{innerHTML:r}).childNodes[0]},Flash.getEmbedCode=function(t,e,n,i){var r="",o="",s="";return e&&Object.getOwnPropertyNames(e).forEach(function(t){r+=t+"="+e[t]+"&amp;"}),n=mergeOptions$1({movie:t,flashvars:r,allowScriptAccess:"always",allowNetworking:"all"},n),Object.getOwnPropertyNames(n).forEach(function(t){o+='<param name="'+t+'" value="'+n[t]+'" />'}),i=mergeOptions$1({data:t,width:"100%",height:"100%"},i),Object.getOwnPropertyNames(i).forEach(function(t){s+=t+'="'+i[t]+'" '}),'<object type="application/x-shockwave-flash" '+s+">"+o+"</object>"},FlashRtmpDecorator(Flash),Tech$2.getTech("Flash")?(videojs.log.warn("Not using videojs-flash as it appears to already be registered"),videojs.log.warn("videojs-flash should only be used with video.js@6 and above")):videojs.registerTech("Flash",Flash);var FlashlsSourceHandler={},mpegurlRE$1=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;FlashlsSourceHandler.canPlayType=function(t){return mpegurlRE$1.test(t)?"maybe":""},FlashlsSourceHandler.canHandleSource=function(t,e){return"maybe"===FlashlsSourceHandler.canPlayType(t.type)},FlashlsSourceHandler.handleSource=function(t,e,n){e.setSrc(t.src)},FlashlsSourceHandler.dispose=function(){},videojs.getTech("Flash").registerSourceHandler(FlashlsSourceHandler,0),FlashlsSourceHandler.VERSION="__VERSION__";var Play="播放",Pause="暂停",LIVE="直播",Loaded="加载完毕",Progress="进度",Fullscreen="全屏",Rotate="旋转",CssFullscreen="页面全屏",Mute="静音",Unmute="取消静音",Subtitles="字幕",Captions="内嵌字幕",Chapters="节目段落",Descriptions="描述",Close="关闭",Replay="重播",Text="文字",White="白",Black="黑",Red="红",Green="绿",Blue="蓝",Yellow="黄",Magenta="紫红",Cyan="青",Background="背景",Window="视窗",Transparent="透明",Opaque="不透明",None="无",Raised="浮雕",Depressed="压低",Uniform="均匀",Dropshadow="下阴影",Casual="舒适",Script="手写体",Reset="重启",Done="完成",auto="自动",Mirror="镜像",CN={Play:Play,Pause:Pause,LIVE:LIVE,Loaded:Loaded,Progress:Progress,Fullscreen:Fullscreen,Rotate:Rotate,CssFullscreen:CssFullscreen,Mute:Mute,Unmute:Unmute,Subtitles:Subtitles,Captions:Captions,Chapters:Chapters,Descriptions:Descriptions,Close:Close,Replay:Replay,Text:Text,White:White,Black:Black,Red:Red,Green:Green,Blue:Blue,Yellow:Yellow,Magenta:Magenta,Cyan:Cyan,Background:Background,Window:Window,Transparent:Transparent,Opaque:Opaque,None:None,Raised:Raised,Depressed:Depressed,Uniform:Uniform,Dropshadow:Dropshadow,Casual:Casual,Script:Script,Reset:Reset,Done:Done,auto:auto,Mirror:Mirror,"Current Time":"当前时间","Duration Time":"时长","Remaining Time":"剩余时间","Stream Type":"媒体流类型","Non-Fullscreen":"退出全屏","Picture-in-Picture":"画中画","Exit Picture-in-Picture":"退出画中画","Playback Rate":"播放速度","subtitles off":"关闭字幕","captions off":"关闭内嵌字幕","Close Modal Dialog":"关闭弹窗","descriptions off":"关闭描述","Audio Track":"音轨","You aborted the media playback":"视频播放被终止","A network error caused the media download to fail part-way.":"网络错误导致视频下载中途失败。","The media could not be loaded, either because the server or network failed or because the format is not supported.":"视频因格式不支持或者服务器或网络的问题无法加载。","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。","No compatible source was found for this media.":"无法找到此视频兼容的源或者当前环境无法播放该视频。","The media is encrypted and we do not have the keys to decrypt it.":"视频已加密,无法解密。","Play Video":"播放视频","Modal Window":"弹窗","This is a modal window":"这是一个弹窗","This modal can be closed by pressing the Escape key or activating the close button.":"可以按ESC按键或启用关闭按钮来关闭此弹窗。",", opens captions settings dialog":", 开启标题设置弹窗",", opens subtitles settings dialog":", 开启字幕设置弹窗",
22
22
  ", opens descriptions settings dialog":", 开启描述设置弹窗",", selected":", 选择","captions settings":"字幕设定","Audio Player":"音频播放器","Video Player":"视频播放器","Progress Bar":"进度小节","Volume Level":"音量","subtitles settings":"字幕设定","descriptions settings":"描述设定","Semi-Transparent":"半透明","Font Size":"字体尺寸","Text Edge Style":"字体边缘样式","Font Family":"字体库","Proportional Sans-Serif":"比例无细体","Monospace Sans-Serif":"单间隔无细体","Proportional Serif":"比例细体","Monospace Serif":"单间隔细体","Small Caps":"小型大写字体","restore all settings to the default values":"恢复全部设定至预设值","Caption Settings Dialog":"字幕设定视窗","Beginning of dialog window. Escape will cancel and close the window.":"开始对话视窗。离开会取消及关闭视窗","End of dialog window.":"结束对话视窗","Request timed out.":"请求超时,请稍后再试。","Could not download the video.":"无法加载视频,请检查网络。","Server is not respond.":"服务器请求失败,请稍后再试。","Server respond error data.":"服务器返回数据有误,请稍后再试。","Last time play at ":"上次看到 ","Resume play":"恢复播放","Powered by Tencent Cloud.":"腾讯云提供技术支持","Rise an internal exception when playing HLS.":"播放 HLS 时出现内部异常。","Authentication failed.":"防盗链参数鉴权失败。","Server failed.":"媒体服务器错误。","Get file error.":"媒体服务器获取文件错误。","The media file does not exist. Please check if the fileID is correct.":"媒体文件不存在,请检查 fileID 是否正确。","No video transcoding information found.":"没有找到视频转码信息。","Current browser not support DRM.":"浏览器不支持当前 DRM 方案。","The trial duration is illegal. The trial duration must be within the video duration.":"试看时长不合法,试看时长要在视频时长范围内。","Param pcfg is not unique.":"pcfg 不唯一。","The license has expired. Please check whether the expiration time setting is reasonable.":"license 过期,请检查过期时间设置是否合理。","Did not find an adaptive stream that can be played.":"没有找到可以播放的自适应码流,<a href='https://cloud.tencent.com/document/product/266/34071' style='color: white;' target='_blank'>查看文档</a>。","Failed to load hls.js file":"hls.js 文件加载失败","Invalid request format, please check the request format.":"请求格式不合法,请检查请求格式。","AppID is not exist, Please check if the AppID is correct.":"AppID 不存在,请检查 AppID 是否正确。","Without anti-leech information.":"没带防盗链检测。","qsign invalid.":"播放参数 qsign 校验失败","psign check failed.":"播放参数 psign 校验失败,<a href='https://cloud.tencent.com/document/product/266/45554' style='color: white' target='_blank'>查看文档</a>。","Other errors.":"其他错误。","Internal error.":"内部错误。","Response data verification failed.":"响应数据校验失败","Video statistic":"视频统计信息","Play Next":"下一个","Current browser not support play this stream, please select another one.":"无法找到此视频兼容的源或者当前环境无法播放该视频,请选择其他视频播放。","Server respond error data.(eg. stream not exist)":"媒体服务器获取数据异常,可能该视频不存在,请选择其他视频播放。","Video play failed, please refresh to start play again.":"视频播放器失败,请刷新并重新播放。","Connection to the server has failed and the number of connection retries has exceeded the set value.":"媒体服务器连接异常,并达到最大重试次数,请检查网络是否正常并刷新重试","Video decoding failure.":"视频解码失败,请选择其他视频播放。"},log=videojs.log;if(Function.prototype.bind&&"object"==("undefined"==typeof console?"undefined":_typeof(console))&&"object"==_typeof(console.log))for(var logFns=["log","info","warn","error","assert","dir","clear","profile","profileEnd"],i=0;i<logFns.length;i++){var method=logFns[i];console[method]=Function.prototype.call.bind(console[method],console)}return videojs.addLanguage("zh-CN",CN),reportLog({str_ext_content:"load sdk success"}),window_1.addEventListener("error",function(t){reportLog({str_err_info:"window global error: "+t.message})}),Object.keys(videojs).forEach(function(t){TCPlayer[t]=videojs[t]}),TCPlayer.checkWidevineSupport=Enc.checkWidevineSupport,TCPlayer});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tcplayer.js",
3
3
  "description": "腾讯云 Web 播放器",
4
- "version": "5.3.4-beta.26",
4
+ "version": "5.3.4-beta.27",
5
5
  "main": "./dist/tcplayer.v5.3.4.min.js",
6
6
  "style": "./dist/tcplayer.min.css",
7
7
  "copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",