From f36367abd9b1537b3b01463347d01b186844fbef Mon Sep 17 00:00:00 2001 From: Anton Schubert Date: Sat, 30 Dec 2017 17:51:44 +0100 Subject: update shaka-player to 2.3.0, improve source-selection code for multiquality player --- assets/clapprio/dash-shaka-playback.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'assets/clapprio/dash-shaka-playback.min.js') diff --git a/assets/clapprio/dash-shaka-playback.min.js b/assets/clapprio/dash-shaka-playback.min.js index d7cb91e..6c746b6 100644 --- a/assets/clapprio/dash-shaka-playback.min.js +++ b/assets/clapprio/dash-shaka-playback.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("clappr")):"function"==typeof define&&define.amd?define(["clappr"],e):"object"==typeof exports?exports.DashShakaPlayback=e(require("clappr")):t.DashShakaPlayback=e(t.Clappr)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="dist/",e(e.s=0)}([function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in r)return r.value;var s=r.get;if(void 0!==s)return s.call(n)},o=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"";c.default.polyfill.installAll();var i=c.default.Player.isBrowserSupported(),n=t.split("?")[0].match(/.*\.(.*)$/)||[];return i&&("mpd"===n[1]||e.indexOf("application/dash+xml")>-1)}},{key:"Events",get:function(){return{SHAKA_READY:"shaka:ready"}}}]),o(e,[{key:"play",value:function(){if(this._player||this._setup(),!this.isReady)return void this.once(e.Events.SHAKA_READY,this.play);this._stopped=!1,this._src=this.el.src,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",this).call(this)}},{key:"setupSrc",value:function(){}},{key:"_ready",value:function(){}},{key:"_onShakaReady",value:function(){this._isShakaReadyState=!0,this.trigger(e.Events.SHAKA_READY),this.trigger(u.Events.PLAYBACK_READY,this.name)}},{key:"error",value:function(t){u.Log.error("an error was raised by the video tag",t,this.el.error)}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._stopped=!0,this._player?(this._sendStats(),this._player.unload().then(function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1}).catch(function(){u.Log.error("shaka could not be unloaded")})):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"getPlaybackType",value:function(){return(this.isReady&&this._player.isLive()?"live":"vod")||""}},{key:"selectAudioLanguage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._player.selectAudioLanguage(t,e)}},{key:"selectTrack",value:function(t){if("text"===t.type)this._player.selectTextTrack(t);else{if("variant"!==t.type)throw new Error("Unhandled track type:",t.type);this._player.selectVariantTrack(t),t.mimeType.startsWith("video/")&&this._onAdaptation()}}},{key:"_enableShakaTextTrack",value:function(t){this.el.textTracks&&(this._shakaTTVisible=t,Array.from(this.el.textTracks).filter(function(t){return"subtitles"===t.kind}).forEach(function(e){return e.mode=!0===t?"showing":"hidden"}))}},{key:"_checkForClosedCaptions",value:function(){if(!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(u.Events.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t}this._ccIsSetup=!0}}},{key:"destroy",value:function(){var t=this;clearInterval(this.sendStatsId),this._player?this._player.destroy().then(function(){return t._destroy()}).catch(function(){t._destroy(),u.Log.error("shaka could not be destroyed")}):this._destroy()}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._ccIsSetup=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player),this._player.load(this._options.src).then(function(){return t._loaded()}).catch(function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=new c.default.Player(this.el);return t.addEventListener("error",this._onError.bind(this)),t.addEventListener("adaptation",this._onAdaptation.bind(this)),t.addEventListener("buffering",this._onBuffering.bind(this)),t}},{key:"_onBuffering",value:function(t){if(!this._stopped){var e=t.buffering?u.Events.PLAYBACK_BUFFERING:u.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}}},{key:"_loaded",value:function(){this._onShakaReady(),this._startToSendStats(),this._fillLevels(),this._checkForClosedCaptions()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.slice(0).reverse(),this.trigger(u.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this,e=this._options.shakaSendStatsInterval||3e4;this.sendStatsId=setInterval(function(){return t._sendStats()},e)}},{key:"_sendStats",value:function(){this.trigger(u.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._onError(t)}},{key:"_onError",value:function(t){var e=this;u.Log.error("Shaka error event:",t.detail),this.trigger(u.Events.PLAYBACK_ERROR,t,this.name),2==t.detail.severity&&1002==t.detail.code&&(console.log("retrying"),this.stop(),setTimeout(function(){return e.play()},1e3))}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return!0===t.active})[0];this._fillLevels(),this._sendStats(),this._pendingAdaptationEvent_&&(this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_END),this._pendingAdaptationEvent=!1),u.Log.debug("an adaptation has happened:",t),this.trigger(u.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,language:t.language,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,u.Log.debug("shaka was destroyed")}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this.isReady&&this._player.getTextTracks()}},{key:"audioLanguages",get:function(){return this.isReady&&this._player.getAudioLanguages()}},{key:"audioTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("audio/")})}},{key:"videoTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("video/")})}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.textTracks||[]).filter(function(t){return"subtitle"===t.kind}).map(function(t){return{id:e(),name:t.label||t.language,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"closedCaptionsTrackId",this)},set:function(t){if(this._player){var e=this.closedCaptionsTracks,i=void 0;if(-1!==t){if(!(i=e.find(function(e){return e.id===t})))return void u.Log.warn('Track id "'+t+'" not found');if(this._shakaTTVisible&&!0===i.track.active)return void u.Log.info('Track id "'+t+'" already showing')}i?(this._player.selectTextTrack(i.track),this._enableShakaTextTrack(!0)):this._enableShakaTextTrack(!1),this._ccTrackId=t,this.trigger(u.Events.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}}]),e}(u.HTML5Video);e.default=l,t.exports=e.default},function(e,i){e.exports=t},function(t,e,i){var n;!function(){var r={};(function(t){function e(t,e){var i=t.split("."),n=$s;i[0]in n||!n.execScript||n.execScript("var "+i[0]);for(var r;i.length&&(r=i.shift());)i.length||void 0===e?n=n[r]?n[r]:n[r]={}:n[r]=e}function i(t){function e(){}var i=Se;e.prototype=i.prototype,t.Te=i.prototype,t.prototype=new e,t.prototype.constructor=t,t.Re=function(t,e,n){return i.prototype[e].apply(t,Array.prototype.slice.call(arguments,2))}}function n(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function r(t,e,i){var n=Math.pow(t.c,e);i=i*(1-n)+n*t.a,isNaN(i)||(t.a=i,t.b+=e)}function a(t){return t.a/(1-Math.pow(t.c,t.b))}function s(){this.b=new n(2),this.c=new n(5),this.a=0}function o(){}function u(){}function h(t,e,i,n){this.severity=t,this.category=e,this.code=i,this.data=Array.prototype.slice.call(arguments,3),this.handled=!1}function c(t){var e;t instanceof c?(l(this,t.ea),this.Aa=t.Aa,this.ja=t.ja,d(this,t.Ia),this.ba=t.ba,f(this,b(t.a)),this.ta=t.ta):t&&(e=String(t).match(Ws))?(l(this,e[1]||"",!0),this.Aa=p(e[2]||""),this.ja=p(e[3]||"",!0),d(this,e[4]),this.ba=p(e[5]||"",!0),f(this,e[6]||"",!0),this.ta=p(e[7]||"")):this.a=new g(null)}function l(t,e,i){t.ea=i?p(e,!0):e,t.ea&&(t.ea=t.ea.replace(/:$/,""))}function d(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.Ia=e}else t.Ia=null}function f(t,e,i){e instanceof g?t.a=e:(i||(e=m(e,to)),t.a=new g(e))}function p(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function m(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,v),i&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function v(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function g(t){this.b=t||null}function b(t){var e=new g;if(e.b=t.b,t.a){var i,n={};for(i in t.a)n[i]=t.a[i].concat();e.a=n,e.c=t.c}return e}function y(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i}function T(t,e,i){var n=E();this.j=null==t.maxAttempts?n.maxAttempts:t.maxAttempts,this.f=null==t.baseDelay?n.baseDelay:t.baseDelay,this.i=null==t.fuzzFactor?n.fuzzFactor:t.fuzzFactor,this.h=null==t.backoffFactor?n.backoffFactor:t.backoffFactor,this.a=0,this.b=this.f,this.c=e||!1,this.g=i||null,this.c&&(this.a=1)}function w(t){if(t.a>=t.j){if(!t.c)return Promise.reject();t.a=1,t.b=t.f}var e=new y;return t.a?(S(t,e.resolve,t.b*(1+(2*Math.random()-1)*t.i)),t.b*=t.h):e.resolve(),t.a++,e}function E(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function S(t,e,i){if(t.g)if(t.g()||!i)e();else{var n=Math.min(200,i);A(function(){S(this,e,i-n)}.bind(t),n)}else A(e,i)}function A(e,i){t.setTimeout(e,i)}function k(t,e,i,n,r){var a,s=r in n;for(a in e){var o=r+"."+a,u=s?n[r]:i[a];(s||a in t)&&(void 0===e[a]?void 0===u||s?delete t[a]:t[a]=u:u.constructor==Object&&e[a]&&e[a].constructor==Object?(t[a]||(t[a]=u),k(t[a],e[a],u,n,o)):typeof e[a]==typeof u&&null!=e[a]&&e[a].constructor==u.constructor&&(t[a]=e[a]))}}function I(t){function e(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t)return t;if(0<=i.indexOf(t))return null;var n=t.constructor==Array;if(t.constructor!=Object&&!n)return null;i.push(t);var r,a=n?[]:{};for(r in t)a[r]=e(t[r]);return n&&(a.length=t.length),a}}var i=[];return e(t)}function P(t,e){return t.reduce(function(t,e,i){return e.catch(t.bind(null,i))}.bind(null,e),Promise.reject())}function _(t,e){return t.concat(e)}function x(){}function R(t){return null!=t}function N(t,e,i){return i.indexOf(t)==e}function D(t){this.f=!1,this.a=[],this.b=[],this.c=[],this.g=t||null}function L(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function C(t,e,i,n,r,a,s){if(t.f||s())return Promise.reject();var o=new c(i.uris[r]),u=o.ea;if(u||(u=location.protocol,u=u.slice(0,-1),l(o,u),i.uris[r]=o.toString()),!(u=io[u]))return Promise.reject(new h(2,1,1e3,o));var d=Date.now();return u(i.uris[r],i,e).then(function(t){void 0==t.timeMs&&(t.timeMs=Date.now()-d);var i=Date.now(),n=Promise.resolve();return this.c.forEach(function(i){n=n.then(function(){return Promise.resolve(i(e,t))}.bind(this))}.bind(this)),n=n.catch(function(t){var e=2;throw t instanceof h&&(e=t.severity),new h(e,1,1007,t)}),n.then(function(){return t.timeMs+=Date.now()-i,t.timeMs+=a,t})}.bind(t)).catch(function(t){if(t&&1==t.severity)return r=(r+1)%i.uris.length,s()?Promise.reject():w(n).then(function(){return C(this,e,i,n,r,a,s)}.bind(this),function(){throw t});throw t}.bind(t))}function M(t,e){for(var i=[],n=0;n=t[e]}.bind(null,e);if(!e[0]&&!e[2])return tt(t,!1);if(!e[1]&&!e[3])return tt(t,!0);if(i(0)&&i(1)&&i(2)&&i(3))return Z(t);throw new h(2,2,2003)}function it(t){t=unescape(encodeURIComponent(t));for(var e=new Uint8Array(t.length),i=0;it.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function Nt(t,e){return!(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))&&(e>=t.start(0)&&e<=t.end(t.length-1))}function Dt(t,e){if(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))return 0;for(var i=0,n=t.length-1;0<=n&&t.end(n)>e;--n)i+=t.end(n)-Math.max(t.start(n),e);return i}function Lt(t){if(!t)return[];for(var e=[],i=0;i=this.h&&t.startTimei.end(0)-i.start(0)?null:1==i.length&&0>i.start(0)?0:i.length?i.start(0):null;return i}function Ht(t,e){try{return t.b[e].buffered}catch(t){return null}}function Kt(t,e,i,n,r){return"text"==e?Ot(t.a,i,n,r):Xt(t,e,t.Ae.bind(t,e,i))}function Gt(t,e){return"text"==e?t.a.remove(0,1/0):Xt(t,e,t.Ac.bind(t,e,0,t.f.duration))}function qt(t,e,i,n,r){return"text"==e?(t.a.i=i,t=t.a,t.h=n,t.g=r,Promise.resolve()):Promise.all([Xt(t,e,t.Pc.bind(t,e)),Xt(t,e,t.re.bind(t,e,i)),Xt(t,e,t.oe.bind(t,e,n,r))])}function Xt(t,e,i){if(t.i)return Promise.reject();if(i={start:i,p:new y},t.c[e].push(i),1==t.c[e].length)try{i.start()}catch(n){"QuotaExceededError"==n.name?i.p.reject(new h(2,3,3017,e)):i.p.reject(new h(2,3,3015,n)),zt(t,e)}return i.p}function Yt(t,e){if(t.i)return Promise.reject();var i,n=[];for(i in t.b){var r=new y,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.c[i].push(a),n.push(r),1==t.c[i].length&&a.start()}return Promise.all(n).then(function(){var t;try{e()}catch(t){var i=Promise.reject(new h(2,3,3015,t))}for(t in this.b)zt(this,t);return i}.bind(t),function(){return Promise.reject()}.bind(t))}function zt(t,e){t.c[e].shift();var i=t.c[e][0];if(i)try{i.start()}catch(n){i.p.reject(new h(2,3,3015,n)),zt(t,e)}}function $t(t,e,i){return i==e||t>=so&&i==e.split("-")[0]||t>=oo&&i.split("-")[0]==e.split("-")[0]}function Wt(t){t=t.toLowerCase().split("-");var e=uo[t[0]];return e&&(t[0]=e),t.join("-")}function Jt(t,e,i){var n=t.video;return!(n&&(n.widthe.maxWidth||n.width>i.width||n.heighte.maxHeight||n.height>i.height||n.width*n.heighte.maxPixels)||t.bandwidthe.maxBandwidth)}function Qt(t,e,i){var n=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=Jt(t,e,i),r!=t.allowedByApplication&&(n=!0)}),n}function Zt(t,e,i){var n=e.video,r=e.audio;for(e=0;en.indexOf(e)||i&&(t.mimeType!=i.mimeType||t.codecs.split(".")[0]!=i.codecs.split(".")[0]))}function ee(t,e,i){var n=null;return ae(t.variants).map(function(t){var r;r=t.video&&t.audio?i==t.video.id&&e==t.audio.id:t.video&&i==t.video.id||t.audio&&e==t.audio.id;var a="";t.video&&(a+=t.video.codecs),t.audio&&(""!=a&&(a+=", "),a+=t.audio.codecs,n=t.audio.label);var s=t.audio?t.audio.codecs:null,o=t.video?t.video.codecs:null,u=null;t.video?u=t.video.mimeType:t.audio&&(u=t.audio.mimeType);var h=null;t.audio?h=t.audio.kind:t.video&&(h=t.video.kind);var c=M((t.audio?t.audio.roles:[]).concat(t.video?t.video.roles:[]));return{id:t.id,active:r,type:"variant",bandwidth:t.bandwidth,language:t.language,label:n,kind:h||null,width:t.video?t.video.width:null,height:t.video?t.video.height:null,frameRate:t.video?t.video.frameRate:void 0,mimeType:u,codecs:a,audioCodec:s,videoCodec:o,primary:t.primary,roles:c,videoId:t.video?t.video.id:null,audioId:t.audio?t.audio.id:null,channelsCount:t.audio?t.audio.channelsCount:null,audioBandwidth:t.audio&&t.audio.bandwidth?t.audio.bandwidth:null,videoBandwidth:t.video&&t.video.bandwidth?t.video.bandwidth:null}})}function ie(t,e){return t.textStreams.map(function(t){return{id:t.id,active:e==t.id,type:"text",language:t.language,label:t.label,kind:t.kind,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles,channelsCount:null,audioBandwidth:null,videoBandwidth:null}})}function ne(t,e){for(var i=0;i=t.periods[i].startTime)return i;return 0}function fe(t,e){for(var i=0;ie?"-Infinity":"Infinity":e;return n}})}function ge(t){return JSON.parse(t,function(t,e){return"NaN"==e?NaN:"-Infinity"==e?-1/0:"Infinity"==e?1/0:e&&"object"==typeof e&&"TimeRanges"==e.__type__?be(e):e})}function be(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function ye(t,e,i,n,r,a){this.J=t,this.g=e,this.L=i,this.j=!1,this.C=n,this.D=r,this.w=a,this.b=this.h=!1,this.B="",this.i=null,this.l=this.mc.bind(this),this.m=this.Cd.bind(this),this.a={video:{},player:{}},this.s=0,this.c={},this.f=null}function Te(t){var e=Eo;e.removeUpdateListener(t.l),e.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.m)}function we(t){for(var e in t.c){var i=t.c[e];delete t.c[e],i.reject(new h(1,7,7e3))}}function Ee(t){t=ve(t),Eo.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},u)}function Se(){this.vb=new j,this.bb=this}function Ae(t,e,i){Se.call(this),this.c=t,this.b=e,this.i=this.g=this.f=this.j=this.h=null,this.a=new ye(i,this.ve.bind(this),this.we.bind(this),this.xe.bind(this),this.ye.bind(this),this.fc.bind(this)),ke(this)}function ke(t){t.a.init(),t.i=new B,ho.forEach(function(t){F(this.i,this.c,t,this.Me.bind(this))}.bind(t)),po.forEach(function(t){F(this.i,this.b,t,this.Yd.bind(this))}.bind(t)),t.h={};for(var e in t.c)Object.defineProperty(t.h,e,{configurable:!1,enumerable:!0,get:t.Le.bind(t,e),set:t.Ne.bind(t,e)});t.j={};for(e in t.b)Object.defineProperty(t.j,e,{configurable:!1,enumerable:!0,get:t.Xd.bind(t,e)});t.f=new Se,t.f.bb=t.h,t.g=new Se,t.g.bb=t.j}function Ie(t,e,i,n){Se.call(this),this.a=t,this.b=e,this.j={video:t,player:e},this.l=i||function(){},this.m=n||function(t){return t},this.i=!1,this.f=!0,this.h=this.g=this.c=null,Pe(this)}function Pe(e){var i=cast.receiver.CastReceiverManager.getInstance();i.onSenderConnected=e.tc.bind(e),i.onSenderDisconnected=e.tc.bind(e),i.onSystemVolumeChanged=e.Xc.bind(e),e.g=i.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.g.onMessage=e.xd.bind(e),e.c=i.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.c.onMessage=e.Ld.bind(e),i.start(),ho.forEach(function(t){this.a.addEventListener(t,this.wc.bind(this,"video"))}.bind(e)),po.forEach(function(t){this.b.addEventListener(t,this.wc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.Sb(3840,2160):e.b.Sb(1920,1080),e.b.addEventListener("loading",function(){this.f=!1,_e(this)}.bind(e)),e.a.addEventListener("playing",function(){this.f=!1,_e(this)}.bind(e)),e.a.addEventListener("pause",function(){_e(this)}.bind(e)),e.b.addEventListener("unloading",function(){this.f=!0,_e(this)}.bind(e)),e.a.addEventListener("ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.f=!0,_e(this))}.bind(this),5e3)}.bind(e))}function _e(t){Promise.resolve().then(function(){this.dispatchEvent(new G("caststatuschanged")),Ne(this,0)}.bind(t))}function xe(t,e,i){for(var n in e.player)t.b[n](e.player[n]);t.l(i),i=Promise.resolve();var r=t.a.autoplay;e.manifest&&(t.a.autoplay=!1,i=t.b.load(e.manifest,e.startTime),i.catch(function(t){this.b.dispatchEvent(new G("error",{detail:t}))}.bind(t))),i.then(function(){var t;for(t in e.video){var i=e.video[t];this.a[t]=i}for(t in e.playerAfterLoad)i=e.playerAfterLoad[t],this.b[t](i);this.a.autoplay=r,e.manifest&&(this.a.play(),Ne(this,0))}.bind(t))}function Re(t,e,i,n){t.i&&(t=ve(e),n?i.getCastChannel(n).send(t):i.broadcast(t))}function Ne(t,e,i){var n=So,n={mediaSessionId:0,playbackRate:t.a.playbackRate,playerState:t.f?n.IDLE:t.b.Oa?n.Lc:t.a.paused?n.Mc:n.Nc,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}};i&&(n.media=i),Re(t,{requestId:e,type:"MEDIA_STATUS",status:[n]},t.g)}function De(t,e){var i=Le(t,e);return 1!=i.length?null:i[0]}function Le(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t.tagName==e})}function Ce(t){var e=t.firstChild;return e&&e.nodeType==Node.TEXT_NODE?t.textContent.trim():null}function Me(t,e,i,n){var r=null;return t=t.getAttribute(e),null!=t&&(r=i(t)),null==r?void 0!=n?n:null:r}function Oe(t){return t?(/^\d+\-\d+\-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function Ue(t){return t&&(t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(t))?(t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(t)?t:null):null}function je(t){var e=/([0-9]+)-([0-9]+)/.exec(t);return e?(t=Number(e[1]),isFinite(t)?(e=Number(e[2]),isFinite(e)?{start:t,end:e}:null):null):null}function Be(t){return t=Number(t),t%1?null:t}function Fe(t){return t=Number(t),!(t%1)&&0(d=d||0))if(l+1=d)break;d=Math.ceil((d-f)/p)-1}else{if(1/0==u)break;if(f/r>=u)break;d=Math.ceil((u*r-f)/p)-1}0>>31,c=2147483647&c,d=n.u.F();if(n.u.I(4),1==l)throw new h(2,3,3006);r.push(new ei(r.length,s/a-e,(s+d)/a-e,function(){return i},t,t+c-1)),s+=d,t+=c}return r}function di(t){this.a=t}function fi(t,e){for(var i;t.a.length&&(i=t.a[t.a.length-1],i.startTime>=e);)t.a.pop();for(;t.a.length&&(i=t.a[0],0>=i.endTime);)t.a.shift();t.a.length&&(i=t.a[0],i.startTime=e&&!(i&1<<8-e);e++);if(8t||i&&t>=i?null:Math.floor(t/n)},getSegmentReference:function(t){var e=t*n;return 0>e||i&&e>=i?null:new ei(t,e,e+n,function(){var i=Ye(s,u,t+r,o,e*a);return q(h,[i])},0,null)}}}function Li(t,e){for(var i=[],n=0;ne.l||(e.f=t.setTimeout(e.ze.bind(e),1e3*Math.max(Math.max(3,e.l)-i,0)))}function Yi(t,e,i){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Fb:null},i=i||e.$;var n=Le(t,"BaseURL").map(Ce),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,s=t.getAttribute("codecs")||e.codecs,o=Me(t,"frameRate",He)||e.frameRate,u=!!Le(t,"InbandEventStream").length,h=Le(t,"AudioChannelConfiguration"),h=zi(h)||e.Fb;return r||(r=Qi(a,s)),{$:q(i,n),Wa:De(t,"SegmentBase")||e.Wa,pa:De(t,"SegmentList")||e.pa,Xa:De(t,"SegmentTemplate")||e.Xa,width:Me(t,"width",Ve)||e.width,height:Me(t,"height",Ve)||e.height,contentType:r,mimeType:a,codecs:s,frameRate:o,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id"),Fb:h}}function zi(t){for(var e=0;e>=1;return t}}}return null}function $i(t){var e=0+(t.Wa?1:0);return e+=t.pa?1:0,(e+=t.Xa?1:0)?(1!=e&&(t.Wa&&(t.pa=null),t.Xa=null),!0):"text"==t.contentType||"application"==t.contentType}function Wi(t,e,i,n){return e=q(e,[i]),e=L(e,t.b.retryParameters),e.method=n,t.a.networkingEngine.request(0,e).then(function(t){if("HEAD"==n){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=Z(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function Ji(t,e,i,n){i=i.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.b.dash.clockSyncUri;return n&&!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),P(i,function(t){var i=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Wi(this,e,i,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return Wi(this,e,i,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(i),isNaN(t)?0:t-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:return Promise.reject()}}.bind(t)).catch(function(){return 0})}function Qi(t,e){return ao[Q(t,e)]?"text":t.split("/")[0]}function Zi(t,e,i,n){this.uri=t,this.type=e,this.U=i,this.segments=n||null}function tn(t,e,i,n){this.id=t,this.name=e,this.a=i,this.value=n||null}function en(t,e){this.name=t,this.value=e}function nn(t,e,i){return i=i||null,(t=t.getAttribute(e))?t.value:i}function rn(t,e){this.U=e,this.uri=t}function an(t,e){return t.filter(function(t){return t.name==e})}function sn(t,e){var i=an(t,e);return i.length?i[0]:null}function on(t,e,i){return t.filter(function(t){var n=t.getAttribute("TYPE");return t=t.getAttribute("GROUP-ID"),n.value==e&&t.value==i})}function un(t){this.b=t,this.a=0}function hn(t,e){e.lastIndex=t.a;var i=(i=e.exec(t.b))?{position:i.index,length:i[0].length,he:i}:null;return t.a!=t.b.length&&i&&i.position==t.a?(t.a+=i.length,i.he):null}function cn(t){return t.a==t.b.length?null:(t=hn(t,/[^ \t\n]*/gm))?t[0]:null}function ln(){this.a=0}function dn(t,e,i){e=Z(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var n=e.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new h(2,4,4015);e=0;for(var r=[],a=1;an.position){var u=o.endTime-o.startTime,c=a,l=a+u,a=a+u;r.push(new ei(o.position,c,l,o.a,o.T,o.K))}}i=r,e.je.ob(i),i.length&&(e.Bb=i[i.length-1]),sn(t.U,"EXT-X-ENDLIST")&&(t=e.Bb.endTime,Vn(this,!1),this.a.ga(t))}.bind(t))}function bn(t,e,i){if(e=dn(t.w,e,i),0!=e.type)throw new h(2,4,4022);return yn(t,e).then(function(t){this.b.filterAllPeriods([t]),this.f&&this.a.Hc(3*this.l),this.B={presentationTimeline:this.a,periods:[t],offlineSessionIds:[],minBufferTime:0}}.bind(t))}function yn(t,e){var i=e.U,n=an(e.U,"EXT-X-MEDIA").filter(function(t){return"SUBTITLES"==Un(t,"TYPE")}.bind(t)).map(function(t){return Sn(this,t,e)}.bind(t));return Promise.all(n).then(function(t){var n=an(i,"EXT-X-STREAM-INF").map(function(t){return Tn(this,t,e)}.bind(this));return Promise.all(n).then(function(e){return e=e.reduce(_,[]),this.f||Dn(this,e),{startTime:0,variants:e,textStreams:t}}.bind(this))}.bind(t))}function Tn(t,e,i){var n=nn(e,"CODECS","avc1.42E01E,mp4a.40.2").split(","),r=e.getAttribute("RESOLUTION"),a=null,s=null,o=nn(e,"FRAME-RATE"),u=Number(Un(e,"BANDWIDTH"));if(r)var h=r.value.split("x"),a=h[0],s=h[1];var c=On(t,i);i=an(i.U,"EXT-X-MEDIA");var l=nn(e,"AUDIO"),d=nn(e,"VIDEO");if(l?i=on(i,"AUDIO",l):d&&(i=on(i,"VIDEO",d)),h=Ln("text",n)){var f=nn(e,"SUBTITLES");f&&(f=on(i,"SUBTITLES",f),f.length&&(t.g[f[0].id].stream.codecs=h)),n.splice(n.indexOf(h),1)}i=i.map(function(t){return An(this,t,n,c)}.bind(t));var p=[],m=[];return Promise.all(i).then(function(t){if(l?p=t:d&&(m=t),p.length||m.length)if(p.length)if(Un(e,"URI")==p[0].Pb){t="audio";var i=!0}else t="video";else t="audio";else i=!1,1==n.length?(t=Ln("video",n),t=r||o||t?"video":"audio"):(t="video",n=[n.join(",")]);return i?Promise.resolve():In(this,e,n,t,c)}.bind(t)).then(function(t){return t&&("audio"==t.stream.type?p=[t]:m=[t]),wn(this,p,m,u,a,s,o)}.bind(t))}function wn(t,e,i,n,r,a,s){i.forEach(function(t){(t=t.stream)&&(t.width=Number(r)||void 0,t.height=Number(a)||void 0,t.frameRate=Number(s)||void 0)}.bind(t)),e.length||(e=[null]),i.length||(i=[null]);for(var o=[],u=0;ui&&(t.c=i):(Vn(t,!0),t.c=i),t.l=Math.max(i,t.l)}}function xn(t,e){var i=null,n=0;t.f&&(i=Date.now()/1e3-e,n=3*t.l),t.a=new Ui(i,n),t.a.rb(!t.f)}function Rn(t){var e=an(t.U,"EXT-X-MAP");if(!e.length)return null;if(1=i?i-t.l.durationBackoff:e}function qn(t){return 0e.W()?e.ka():e.nb(),t.m=Gn(t,e),e}function Yn(t,e){t.f&&(t.f.cancel(),t.f=null),t.i=e,t.a.playbackRate=t.j||0>e?0:e,!t.j&&0>e&&(t.f=new rt(function(){this.a.currentTime+=e/4}.bind(t)),st(t.f,.25))}function zn(t,e){var i=Nt.bind(null,t.a.buffered),n=1*Math.max(t.c.minBufferTime||0,t.l.rebufferingGoal),r=t.c.presentationTimeline,a=r.ua(),s=r.Da(n),o=r.Da(5),n=r.Da(n+5);return e>=r.W()?Gn(t,e):e>a?a:e=s||i(e)?e:n}function $n(t,e,i){t.a.currentTime=i;var n=0,r=function(){!this.a||10<=n++||this.a.currentTime!=e||(this.a.currentTime=i,setTimeout(r,100))}.bind(t);setTimeout(r,100)}function Wn(t,e){var i=t.c.presentationTimeline.ka();return ei?i:e)}function Jn(t,e,i,n,r,a,s){this.a=t,this.B=e,this.g=i,this.w=n,this.l=r,this.h=a,this.C=s,this.c=[],this.j=new B,this.b=!1,this.i=-1,this.f=null,Zn(this)}function Qn(t){var e=I(t);return e.eventElement=t.eventElement,e}function Zn(e){tr(e),e.f=t.setTimeout(e.D.bind(e),250)}function tr(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function er(t,e){this.a=e,this.b=t,this.h=null,this.i=1,this.m=Promise.resolve(),this.g=[],this.j={},this.c={},this.s=!1,this.w=null,this.f=this.l=!1}function ir(t){var e=qn(t.a.Ua);return t.b.periods[de(t.b,e)]}function nr(t){var e=t.c.video||t.c.audio;return e?t.b.periods[e.wa]:null}function rr(t){return $(t.c,function(t){return t.oa||t.stream})}function ar(t,e){var i=t.c.video;if(i){var n=i.stream;if(n)if(e){var r=n.trickModeVideo;if(r){var a=i.oa;a||(or(t,r,!1),i.oa=n)}}else(a=i.oa)&&(i.oa=null,or(t,a,!0))}}function sr(t,e,i){e.video&&or(t,e.video,i),e.audio&&or(t,e.audio,i)}function or(t,e,i){var n=t.c[e.type];if(!n&&"text"==e.type&&t.h.ignoreTextStreamFailures)cr(t,{text:e});else if(n){var r=fe(t.b,e);i&&r!=n.wa?hr(t):(n.oa&&(e.trickModeVideo?(n.oa=e,e=e.trickModeVideo):n.oa=null),(r=t.g[r])&&r.Ka&&(r=t.j[e.id])&&r.Ka&&n.stream!=e&&("text"==e.type&&Ft(t.a.M,Q(e.mimeType,e.codecs)),n.stream=e,n.pb=!0,i&&(n.sa?n.tb=!0:n.xa?(n.ra=!0,n.tb=!0):(Pr(n),kr(t,n,!0)))))}}function ur(t){var e=qn(t.a.Ua);Object.keys(t.c).every(function(t){var i=this.a.M;return"text"==t?(t=i.a,t=e>=t.a&&ee?t.a.M.ga(e):t.a.M.ga(Math.pow(2,32))}function pr(t,e){var i=qn(t.a.Ua),n=e.Ea&&e.la?t.b.periods[fe(t.b,e.Ea)].startTime+e.la.endTime:Math.max(i,e.Bc),r=fe(t.b,e.stream),a=de(t.b,n),s=t.a.M,o=e.type;return"text"==o?(s=s.a,s=null==s.b||s.b=t.b.presentationTimeline.W()?(e.endOfStream=!0,null):(e.endOfStream=!1,e.wa=a,a!=r?null:s>=o?.5:(n=t.a.M,a=e.type,n="text"==a?n.a.b:Rt(Ht(n,a)),e.la&&e.stream==e.Ea?(a=e.la.position+1,n=mr(t,e,r,a)):(a=e.la?e.stream.findSegmentPosition(Math.max(0,t.b.periods[fe(t.b,e.Ea)].startTime+e.la.endTime-t.b.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(n||i)-t.b.periods[r].startTime)),null==a?n=null:(s=null,null==n&&(s=mr(t,e,r,Math.max(0,a-1))),n=s||mr(t,e,r,a))),n?(e.Bc=0,vr(t,e,i,r,n),null):1))}function mr(t,e,i,n){return i=t.b.periods[i],(e=e.stream.getSegmentReference(n))?(t=t.b.presentationTimeline,n=t.ua(),i.startTime+e.endTimen?null:e):null}function vr(t,e,i,n,r){var a=t.b.periods[n],s=e.stream,o=t.b.presentationTimeline.W(),u=t.b.periods[n+1];n=br(t,e,n,a.startTime,u?u.startTime:o),e.xa=!0,e.pb=!1,o=Ar(t,r),Promise.all([n,o]).then(function(t){if(!this.f&&!this.l)return yr(this,e,i,a,s,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.xa=!1,e.Ob=!1,e.ra||this.a.Ib(),Ir(this,e,0),wr(this,s))}.bind(t)).catch(function(t){this.f||this.l||(e.xa=!1,"text"==e.type&&this.h.ignoreTextStreamFailures?delete this.c.text:3017==t.code?gr(this,e,t):(e.Qa=!0,t.severity=2,_r(this,t)))}.bind(t))}function gr(t,e,i){if(!z(t.c).some(function(t){return t!=e&&t.Ob})){var n=Math.round(100*t.i);if(20=i?Promise.resolve():t.a.M.remove(e.type,n,n+i).then(function(){}.bind(t)))}function wr(t,e){if(!t.s&&(t.s=z(t.c).every(function(t){return"text"==t.type||!t.ra&&!t.sa&&t.la}),t.s)){var i=fe(t.b,e);for(t.g[i]||lr(t,i).then(function(){this.a.jc()}.bind(t)).catch(x),i=0;i=e.status&&202!=e.status)e.responseURL&&(t=e.responseURL),i({uri:t,data:e.response,headers:r,fromCache:!!r["x-shaka-from-cache"]});else{var a=null;try{a=et(e.response)}catch(t){}n(new h(401==e.status||403==e.status?2:1,1,1001,t,e.status,a,r))}},r.onerror=function(){n(new h(1,1,1002,t))},r.ontimeout=function(){n(new h(1,1,1003,t))};for(var a in e.headers)r.setRequestHeader(a,e.headers[a]);r.send(e.body)})}function Rr(){this.a=null,this.b=[],this.c={}}function Nr(t,e,i){return Cr(t,e,"readwrite",function(t){t.put(i)})}function Dr(t,e,i){return Cr(t,"segment","readwrite",function(t){for(var n=0;n=t.length?Promise.resolve():Yr(this,t[e++]).then(i):Promise.reject(new h(2,9,9002))}.bind(this);return i()}.bind(t));return t.b={},t.i=Promise.all(i).then(function(){return Nr(this.j,"manifest",e)}.bind(t)).then(function(){this.l=[]}.bind(t)),t.i}function Yr(t,e){var i=L(e.uris,t.w);(e.T||null!=e.K)&&(i.headers.Range="bytes="+e.T+"-"+(null==e.K?"":e.K));var n;return t.s.request(1,i).then(function(t){return this.a?(n=t.data.byteLength,this.l.push(e.Qb.key),e.Qb.data=t.data,Nr(this.j,"segment",e.Qb)):Promise.reject(new h(2,9,9002))}.bind(t)).then(function(){if(!this.a)return Promise.reject(new h(2,9,9002));null==e.K?(this.a.size+=n,this.f+=e.$b):this.h+=n;var t=(this.h+this.f)/(this.c+this.g),i=Ur(this.a);this.m.progressCallback(i,t)}.bind(t))}function zr(){this.a=-1}function $r(t){var e=new Ui(null,0);e.ga(t.duration);var i=t.drmInfo?[t.drmInfo]:[];return{presentationTimeline:e,minBufferTime:10,offlineSessionIds:t.sessionIds,periods:t.periods.map(function(t){return jr(t,i,e)})}}function Wr(t){if(/^offline:([0-9]+)$/.exec(t)){var e={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(e)}if(e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t)){var i=Number(e[1]),n=Kr();return n?n.init(Co).then(function(){return n.get("segment",i)}).then(function(e){return n.o().then(function(){if(!e)throw new h(2,9,9003,i);return{uri:t,data:e.data,headers:{}}})}):Promise.reject(new h(2,9,9e3))}return Promise.reject(new h(2,1,9004,t))}function Jr(t){this.a=null;for(var e=0;e=e.endTime)return null;var i=new VTTCue(e.startTime,e.endTime,e.payload);i.lineAlign=e.lineAlign,i.positionAlign=e.positionAlign,i.size=e.size;try{i.align=e.textAlign}catch(t){}if("center"==e.textAlign&&"center"!=i.align&&(i.align="middle"),e.writingDirection==Wo?i.vertical="lr":e.writingDirection==Jo&&(i.vertical="rl"),e.lineInterpretation==Zo&&(i.snapToLines=!1),null!=e.line&&(i.line=e.line),null!=e.position&&(i.position=e.position),t.VTTRegion&&e.region){var n=new VTTRegion;n.viewportAnchorX=e.region.x,n.viewportAnchorY=e.region.y,n.width=e.region.width,n.height=e.region.height,i.region=n}return i}function Zr(t,e){for(var i=t.b,n=[],r=0;r=n.a.length)t=i;else{var r=[];for(t=0;tt.textDecoration.indexOf("underline")&&t.textDecoration.push("underline");break;case"noUnderline":0<=t.textDecoration.indexOf("underline")&&U(t.textDecoration,"underline");break;case"lineThrough":0>t.textDecoration.indexOf("lineThrough")&&t.textDecoration.push("lineThrough");break;case"noLineThrough":0<=t.textDecoration.indexOf("lineThrough")&&U(t.textDecoration,"lineThrough");break;case"overline":0>t.textDecoration.indexOf("overline")&&t.textDecoration.push("overline");break;case"noOverline":0<=t.textDecoration.indexOf("overline")&&U(t.textDecoration,"overline")}}function Cs(t,e,i,n){return(t=Os(t,i,n))?t:Ms(e,i,n)}function Ms(t,e,i){for(var n=Ns(t),r=0;ri.length)return null;var n=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode)instanceof Element;);if(e=t)for(t=0;tthis.a?t:Math.min(a(this.b),a(this.c))},t.console&&t.console.log.bind&&(o=console.warn.bind(console)),e("shaka.util.Error",h),h.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},h.Severity={RECOVERABLE:1,CRITICAL:2},h.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},h.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_LIVE_CONTENT_NOT_SUPPORTED:4029,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7e3,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,CONTENT_UNSUPPORTED_BY_BROWSER:9009};var Ws=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;zs=c.prototype,zs.ea="",zs.Aa="",zs.ja="",zs.Ia=null,zs.ba="",zs.ta="",zs.toString=function(){var t=[],e=this.ea;if(e&&t.push(m(e,Js,!0),":"),e=this.ja){t.push("//");var i=this.Aa;i&&t.push(m(i,Js,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.Ia,null!=e&&t.push(":",String(e))}return(e=this.ba)&&(this.ja&&"/"!=e.charAt(0)&&t.push("/"),t.push(m(e,"/"==e.charAt(0)?Zs:Qs,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.ta)&&t.push("#",m(e,eo)),t.join("")},zs.resolve=function(t){var e=new c(this);"data"===e.ea&&(e=new c);var i=!!t.ea;i?l(e,t.ea):i=!!t.Aa,i?e.Aa=t.Aa:i=!!t.ja,i?e.ja=t.ja:i=null!=t.Ia;var n=t.ba;if(i)d(e,t.Ia);else if(i=!!t.ba){if("/"!=n.charAt(0))if(this.ja&&!this.ba)n="/"+n;else{var r=e.ba.lastIndexOf("/");-1!=r&&(n=e.ba.substr(0,r+1)+n)}if(".."==n||"."==n)n="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){for(var r=!n.lastIndexOf("/",0),n=n.split("/"),a=[],s=0;sn||i&&1e3>n)&&!this.a[e].na&&(this.a.splice(e,1),t.close()),at(this.D,.5)}},zs.$d=function(){function t(t,e){return"expired"==e}!Y(this.C)&&W(this.C,t)&&this.g(new h(2,6,6014)),this.s.Hb(this.C)},zs.Gd=function(){for(var t=0;t=this.b||(t<=this.a&&e>=this.b?this.a=this.b=null:t<=this.a&&ethis.a&&e>=this.b&&(this.b=t))}.bind(this))},Ut.prototype.parseInit=function(t){this.Ta(t,0,null,null)},Ut.prototype.parseMedia=function(t,e){return this.Ta(t,e.periodStart,e.segmentStart,e.segmentEnd)},zs=jt.prototype,zs.o=function(){this.i=!0;var t,e=[];for(t in this.c){var i=this.c[t],n=i[0];for(this.c[t]=i.slice(0,1),n&&e.push(n.p.catch(x)),n=1;n=r.bandwidth/this.a.bandwidthDowngradeTarget&&e<=a&&(i=r)}return this.f=Date.now(),i},pe.prototype.chooseVariant=pe.prototype.chooseVariant,pe.prototype.enable=function(){this.c=!0},pe.prototype.enable=pe.prototype.enable,pe.prototype.disable=function(){this.c=!1},pe.prototype.disable=pe.prototype.disable,pe.prototype.segmentDownloaded=function(t,e){var i=this.b;if(!(16e3>e)){var n=8e3*e/t,a=t/1e3;i.a+=e,r(i.b,a,n),r(i.c,a,n)}if(null!=this.f&&this.c)t:{if(this.i){if(Date.now()-this.f<1e3*this.a.switchInterval)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}i=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(i)}},pe.prototype.segmentDownloaded=pe.prototype.segmentDownloaded,pe.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},pe.prototype.getBandwidthEstimate=pe.prototype.getBandwidthEstimate,pe.prototype.setVariants=function(t){this.g=t},pe.prototype.setVariants=pe.prototype.setVariants,pe.prototype.configure=function(t){this.a=t},pe.prototype.configure=pe.prototype.configure;var ho="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),co="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),lo=["loop","playbackRate"],fo=["pause","play"],po="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),mo="drmInfo getAudioLanguages getBufferedInfo getConfiguration getExpiration getManifest getManifestUri getPlaybackRate getTextLanguages getTextTracks getStats getVariantTracks isAudioOnly isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),vo=["getPlayheadTimeAsDate","getPresentationStartTimeAsDate"],go=[["getConfiguration","configure"]],bo=[["isTextTrackVisible","setTextTrackVisibility"]],yo="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),To=["load","unload"],wo=!1,Eo=null;zs=ye.prototype,zs.o=function(){return we(this),Eo&&Te(this),this.D=this.C=this.g=null,this.b=this.h=!1,this.m=this.l=this.f=this.c=this.a=this.i=null,Promise.resolve()},zs.aa=function(){return this.b},zs.Nb=function(){return this.B},zs.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.g();var e=new chrome.cast.SessionRequest(this.J),e=new chrome.cast.ApiConfig(e,this.nc.bind(this),this.Id.bind(this),"origin_scoped");chrome.cast.initialize(e,function(){},function(){}),wo&&setTimeout(this.g.bind(this),20),(e=Eo)&&e.status!=chrome.cast.SessionStatus.STOPPED?this.nc(e):Eo=null}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},zs.Rb=function(t){this.i=t,this.b&&Ee({type:"appData",appData:this.i})},zs.cast=function(t){return this.h?wo?this.b?Promise.reject(new h(1,8,8002)):(this.f=new y,chrome.cast.requestSession(this.Jb.bind(this,t),this.lc.bind(this)),this.f):Promise.reject(new h(1,8,8001)):Promise.reject(new h(1,8,8e3))},zs.lb=function(){this.b&&(we(this),Eo&&(Te(this),Eo.stop(function(){},function(){}),Eo=null))},zs.get=function(t,e){if("video"==t){if(0<=fo.indexOf(e))return this.zc.bind(this,t,e)}else if("player"==t){if(0<=vo.indexOf(e)&&!this.get("player","isLive")())return function(){};if(0<=yo.indexOf(e))return this.zc.bind(this,t,e);if(0<=To.indexOf(e))return this.de.bind(this,t,e);if(0<=mo.indexOf(e))return this.vc.bind(this,t,e)}return this.vc(t,e)},zs.set=function(t,e,i){this.a[t][e]=i,Ee({type:"set",targetName:t,property:e,value:i})},zs.Jb=function(t,e){Eo=e,e.addUpdateListener(this.l),e.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m),this.mc(),Ee({type:"init",initState:t,appData:this.i}),this.f.resolve()},zs.lc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.f.reject(new h(2,8,e,t))},zs.vc=function(t,e){return this.a[t][e]},zs.zc=function(t,e){Ee({type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},zs.de=function(t,e){var i=Array.prototype.slice.call(arguments,2),n=new y,r=this.s.toString();return this.s++,this.c[r]=n,Ee({type:"asyncCall",targetName:t,methodName:e,args:i,id:r}),n},zs.nc=function(t){var e=this.w();this.f=new y,this.j=!0,this.Jb(e,t)},zs.Id=function(t){wo="available"==t,this.g()},zs.mc=function(){var t=!!Eo&&"connected"==Eo.status;if(this.b&&!t){this.D();for(var e in this.a)this.a[e]={};we(this)}this.B=(this.b=t)?Eo.receiver.friendlyName:"",this.g()},zs.Cd=function(t,e){var i=ge(e);switch(i.type){case"event":var n=i.targetName,r=i.event;this.C(n,new G(r.type,r));break;case"update":r=i.update;for(n in r){var i=this.a[n]||{};for(a in r[n])i[a]=r[n][a]}this.j&&(this.L(),this.j=!1);break;case"asyncComplete":n=i.id;var a=i.error;if(i=this.c[n],delete this.c[n],i)if(a){n=new h(a.severity,a.category,a.code);for(r in a)n[r]=a[r];i.reject(n)}else i.resolve()}},Se.prototype.addEventListener=function(t,e){this.vb.push(t,e)},Se.prototype.removeEventListener=function(t,e){this.vb.remove(t,e)},Se.prototype.dispatchEvent=function(t){for(var e=this.vb.get(t.type)||[],i=0;ithis.O.byteLength&&ni();var e=ri(this,this.v,this.v+t);return this.v+=t,new Uint8Array(e)},ii.prototype.readBytes=ii.prototype.Ja,ii.prototype.I=function(t){this.v+t>this.O.byteLength&&ni(),this.v+=t},ii.prototype.skip=ii.prototype.I,ii.prototype.Lb=function(){for(var t=this.v;this.da()&&this.O.getUint8(this.v);)this.v+=1;return t=ri(this,t,this.v),this.v+=1,Z(t)},ii.prototype.readTerminatedString=ii.prototype.Lb,e("shaka.util.Mp4Parser",ai),ai.prototype.G=function(t,e){var i=hi(t);return this.b[i]=0,this.a[i]=e,this},ai.prototype.box=ai.prototype.G,ai.prototype.ca=function(t,e){var i=hi(t);return this.b[i]=1,this.a[i]=e,this},ai.prototype.fullBox=ai.prototype.ca,ai.prototype.parse=function(t){for(t=new ii(new DataView(t),0);t.da();)this.qb(0,t)},ai.prototype.parse=ai.prototype.parse,ai.prototype.qb=function(t,e){var i=e.v,n=e.F(),r=e.F();switch(n){case 0:n=e.O.byteLength-i;break;case 1:n=e.Va()}var a=this.a[r];if(a){var s=null,o=null;1==this.b[r]&&(o=e.F(),s=o>>>24,o&=16777215),r=i+n-e.v,r=0=i.startTime&&tt||t>=this.a.length?null:this.a[t]):null},di.prototype.get=di.prototype.get,di.prototype.ob=function(t){for(var e,i,n,r=[],a=e=0;en.startTime?e||r.push(n):(.1t);++e);this.a.splice(0,e)},di.prototype.evict=di.prototype.xb;var Io;pi.prototype.da=function(){return this.a.da()},yi.prototype.parse=function(t,e,i,n){var r;if(e=new pi(new DataView(e)),440786851!=mi(e).id)throw new h(2,3,3008);var a=mi(e);if(408125543!=a.id)throw new h(2,3,3009);for(e=a.a.byteOffset,a=new pi(a.a),r=null;a.da();){var s=mi(a);if(357149030==s.id){r=s;break}}if(!r)throw new h(2,3,3010);for(a=new pi(r.a),r=1e6,s=null;a.da();){var o=mi(a);if(2807729==o.id)r=bi(o);else if(17545==o.id)if(s=o,4==s.a.byteLength)s=s.a.getFloat32(0);else{if(8!=s.a.byteLength)throw new h(2,3,3003);s=s.a.getFloat64(0)}}if(null==s)throw new h(2,3,3011);if(a=r/1e9,r=s*a,t=mi(new pi(new DataView(t))),475249515!=t.id)throw new h(2,3,3007);return Ti(t,e,a,r,i,n)};var Po={},_o={};e("shaka.media.ManifestParser.registerParserByExtension",function(t,e){_o[t]=e}),e("shaka.media.ManifestParser.registerParserByMime",function(t,e){Po[t]=e}),e("shaka.media.PresentationTimeline",Ui),Ui.prototype.W=function(){return this.a},Ui.prototype.getDuration=Ui.prototype.W,Ui.prototype.ga=function(t){this.a=t},Ui.prototype.setDuration=Ui.prototype.ga,Ui.prototype.gd=function(){return this.c},Ui.prototype.getPresentationStartTime=Ui.prototype.gd,Ui.prototype.Gc=function(t){this.i=t},Ui.prototype.setClockOffset=Ui.prototype.Gc,Ui.prototype.rb=function(t){this.h=t},Ui.prototype.setStatic=Ui.prototype.rb,Ui.prototype.jd=function(){return this.f},Ui.prototype.getSegmentAvailabilityDuration=Ui.prototype.jd,Ui.prototype.Ic=function(t){this.f=t},Ui.prototype.setSegmentAvailabilityDuration=Ui.prototype.Ic,Ui.prototype.Hc=function(t){this.j=t},Ui.prototype.setDelay=Ui.prototype.Hc,Ui.prototype.Ga=function(t,e){e.length&&(this.b=e.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.b))},Ui.prototype.notifySegments=Ui.prototype.Ga,Ui.prototype.Eb=function(t){this.b=Math.max(this.b,t)},Ui.prototype.notifyMaxSegmentDuration=Ui.prototype.Eb,Ui.prototype.R=function(){return 1/0==this.a&&!this.h},Ui.prototype.isLive=Ui.prototype.R,Ui.prototype.va=function(){return 1/0!=this.a&&!this.h},Ui.prototype.isInProgress=Ui.prototype.va,Ui.prototype.ka=function(){return this.Da(0)},Ui.prototype.getSegmentAvailabilityStart=Ui.prototype.ka,Ui.prototype.Da=function(t){if(1/0==this.f)return this.g;var e=this.ua();return Math.max(this.g,Math.min(e-this.f+t,e))},Ui.prototype.getSafeAvailabilityStart=Ui.prototype.Da,Ui.prototype.Fc=function(t){this.g=t},Ui.prototype.setAvailabilityStart=Ui.prototype.Fc,Ui.prototype.ua=function(){return this.R()||this.va()?Math.min(Math.max(0,(Date.now()+this.i)/1e3-this.b-this.c),this.a):this.a},Ui.prototype.getSegmentAvailabilityEnd=Ui.prototype.ua,Ui.prototype.nb=function(){return Math.max(0,this.ua()-(this.R()||this.va()?this.j:0))},Ui.prototype.getSeekRangeEnd=Ui.prototype.nb,e("shaka.dash.DashParser",ji),zs=ji.prototype,zs.configure=function(t){this.b=t},zs.start=function(t,e){return this.g=[t],this.a=e,Bi(this).then(function(){return this.a&&Xi(this,0),this.c}.bind(this))},zs.stop=function(){return this.b=this.a=null,this.g=[],this.c=null,this.i=[],this.j={},null!=this.f&&(t.clearTimeout(this.f),this.f=null),Promise.resolve()},zs.update=function(){Bi(this).catch(function(t){this.a&&this.a.onError(t)}.bind(this))},zs.onExpirationUpdated=function(){},zs.Td=function(t,e){t.V=Yi(e,t.Y,null);var i=!1,n=Le(e,"Role"),r=n.map(function(t){return t.getAttribute("value")}).filter(R),a=void 0;"text"==t.V.contentType&&(a="subtitle");for(var s=0;si.length||"data"!=i[0])throw new h(2,1,1004,e);if(i=i.slice(1).join(":").split(","),2>i.length)throw new h(2,1,1004,e);var n=i[0],i=t.decodeURIComponent(i.slice(1).join(",")),n=n.split(";"),r=null;if(1this.i?0:this.i;this.a.playbackRate&&this.a.playbackRate!=t&&Yn(this,this.a.playbackRate)},zs.pc=function(){var t=Xn(this);this.b.ha(this.a,"timeupdate"),this.g.cancel(),.001>Math.abs(this.a.currentTime-t)?(F(this.b,this.a,"seeking",this.sc.bind(this)),F(this.b,this.a,"playing",this.qc.bind(this))):(V(this.b,this.a,"seeking",this.Jd.bind(this)),this.a.currentTime=t)},zs.Jd=function(){F(this.b,this.a,"seeking",this.sc.bind(this)),F(this.b,this.a,"playing",this.qc.bind(this))},zs.rc=function(){if(this.a.readyState&&!this.a.paused){this.a.readyState!=this.D&&(this.s=!1,this.D=this.a.readyState);var t=this.l.smallGapLimit,e=this.a.currentTime,i=this.a.buffered;if(ei.end(0)-i.start(0))){var n=.1;/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(n=.5);for(var r=0;re&&(!r||i.end(r-1)-e<=n)){n=r;break t}}n=null}if(null==n){if(3>this.a.readyState&&0=i.start(n)&&e=this.c.presentationTimeline.nb())){var a=r-e,t=a<=t,s=!1;t||this.s||(this.s=!0,a=new G("largegap",{currentTime:e,gapSize:a}),a.cancelable=!0,this.J(a),this.l.jumpLargeGaps&&!a.defaultPrevented&&(s=!0)),(t||s)&&(n&&i.end(n-1),$n(this,e,r))}}}},zs.ud=function(){this.m=zn(this,this.a.currentTime)},zs.sc=function(){this.w=!1;var t=this.a.currentTime,e=zn(this,t);.001this.a.currentTime?1:e.info.endTime=n||this.a.ended||r;this.b?(i=1*Math.max(this.g.minBufferTime||0,this.w.rebufferingGoal),(e||t>=i)&&0!=this.b&&(this.b=!1,this.l(!1))):!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0)),this.c.forEach(this.m.bind(this,!1))},zs=er.prototype,zs.o=function(){for(var t in this.c)Pr(this.c[t]);return this.h=this.c=this.j=this.g=this.m=this.b=this.a=null,this.f=!0,Promise.resolve()},zs.configure=function(t){this.h=t,this.w=new T({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor,timeout:0},!0)},zs.init=function(){var t=qn(this.a.Ua),t=this.a.kc(this.b.periods[de(this.b,t)]);return t.variant||t.text?cr(this,t).then(function(){this.a&&this.a.yd&&this.a.yd()}.bind(this)):Promise.reject(new h(2,5,5005))},zs.Ce=function(t){if(!this.f&&!t.xa&&null!=t.qa&&!t.sa)if(t.qa=null,t.ra)kr(this,t,t.tb);else{try{var e=pr(this,t);null!=e&&(Ir(this,t,e),t.Qa=!1)}catch(t){return void _r(this,t)}e=z(this.c),Er(this,t),e.every(function(t){return t.endOfStream})&&this.a.M.endOfStream().then(function(){this.b.presentationTimeline.ga(this.a.M.W())}.bind(this))}},zs.Ud=function(t,e,i){var n=i.u.Lb(),r=i.u.Lb(),a=i.u.F(),s=i.u.F(),o=i.u.F(),u=i.u.F();i=i.u.Ja(i.u.O.byteLength-i.u.v),t=t.startTime+e.startTime+s/a,"urn:mpeg:dash:event:2012"==n?this.a.Ad():this.a.onEvent(new G("emsg",{detail:{startTime:t,endTime:t+o/a,schemeIdUri:n,value:r,timescale:a,presentationTimeDelta:s,eventDuration:o,id:u,messageData:i}}))},e("shaka.net.HttpPlugin",xr),io.http=xr,io.https=xr,zs=Rr.prototype,zs.init=function(t,e){return Mr(this,t,e).then(function(){var e=Object.keys(t);return Promise.all(e.map(function(t){return Lr(this,t).then(function(e){this.c[t]=e}.bind(this))}.bind(this)))}.bind(this))},zs.o=function(){return Promise.all(this.b.map(function(t){try{t.transaction.abort()}catch(t){}return t.N.catch(x)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))},zs.get=function(t,e){var i;return Cr(this,t,"readonly",function(t){i=t.get(e)}).then(function(){return i.result})},zs.forEach=function(t,e){return Cr(this,t,"readonly",function(t){t.openCursor().onsuccess=function(t){(t=t.target.result)&&(e(t.value),t.continue())}})},zs.remove=function(t,e){return Cr(this,t,"readwrite",function(t){t.delete(e)})};var Co={manifest:"key",segment:"key"};Gr.prototype.o=function(){var t=this.j,e=this.l,i=this.i||Promise.resolve();return e.length&&(i=i.then(function(){return Dr(t,e)})),this.b={},this.l=[],this.i=this.a=this.w=this.s=this.j=this.m=null,i},zs=zr.prototype,zs.configure=function(){},zs.start=function(t){var e=/^offline:([0-9]+)$/.exec(t);if(!e)return Promise.reject(new h(2,1,9004,t));var i=Number(e[1]),n=Kr();return this.a=i,n?n.init(Co).then(function(){return n.get("manifest",i)}).then(function(t){if(!t)throw new h(2,9,9003,i);return $r(t)}).then(function(t){return n.o().then(function(){return t})},function(t){return n.o().then(function(){throw t})}):Promise.reject(new h(2,9,9e3))},zs.stop=function(){return Promise.resolve()},zs.update=function(){},zs.onExpirationUpdated=function(t,e){var i=Kr();i.init(Co).then(function(){return i.get("manifest",this.a)}.bind(this)).then(function(n){if(n&&!(0>n.sessionIds.indexOf(t))&&(void 0==n.expiration||n.expiration>e))return n.expiration=e,Nr(i,"manifest",n)}).catch(function(){}).then(function(){return i.o()})},Po["application/x-offline-manifest"]=zr,e("shaka.offline.OfflineScheme",Wr),io.offline=Wr,e("shaka.text.SimpleTextDisplayer",Jr),Jr.prototype.remove=function(t,e){return!!this.a&&(Zr(this,function(i){return!(i.startTime>=e||i.endTime<=t)}),!0)},Jr.prototype.remove=Jr.prototype.remove,Jr.prototype.append=function(t){for(var e=[],i=0;ithis.eb.indexOf(t.id)}.bind(this))},ia.prototype.getTextTracks=ia.prototype.ld,ia.prototype.me=function(t){if(this.a){(t=re(ir(this.a),t))&&(ha(this,t,!1),this.Ba?this.X=t:or(this.a,t,!0))}},ia.prototype.selectTextTrack=ia.prototype.me,ia.prototype.ne=function(t,e){if(this.a){this.c.abr.enabled&&o("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=ir(this.a);(i=ne(i,t))&&i.allowedByApplication&&i.allowedByKeySystem&&(ua(this,i,!1),va(this,i,e))}},ia.prototype.selectVariantTrack=ia.prototype.ne,ia.prototype.Zc=function(){return this.a?ae(ir(this.a).variants).map(function(t){return t.language}).filter(N):[]},ia.prototype.getAudioLanguages=ia.prototype.Zc,ia.prototype.kd=function(){return this.a?ir(this.a).textStreams.map(function(t){return t.language}).filter(N):[]},ia.prototype.getTextLanguages=ia.prototype.kd,ia.prototype.ke=function(t,e){if(this.a){var i=ir(this.a);this.Ma=t,this.ab=e||"",Ta(this,i)}},ia.prototype.selectAudioLanguage=ia.prototype.ke,ia.prototype.le=function(t,e){if(this.a){var i=ir(this.a);this.$a=t,this.ub=e||"",Ta(this,i)}},ia.prototype.selectTextLanguage=ia.prototype.le,ia.prototype.rd=function(){return this.w?this.w.isTextVisible():this.jb},ia.prototype.isTextTrackVisible=ia.prototype.rd,ia.prototype.qe=function(t){this.w?this.w.setTextVisibility(t):this.jb=t,Sa(this)},ia.prototype.setTextTrackVisibility=ia.prototype.qe,ia.prototype.ed=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c+1e3*this.f.currentTime):null},ia.prototype.getPlayheadTimeAsDate=ia.prototype.ed,ia.prototype.hd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c):null},ia.prototype.getPresentationStartTimeAsDate=ia.prototype.hd,ia.prototype.yb=function(){return this.J?this.J.yb():{total:[],audio:[],video:[],text:[]}},ia.prototype.getBufferedInfo=ia.prototype.yb,ia.prototype.getStats=function(){ga(this),this.Za();var t=null,e=null,i=this.f,i=i&&i.getVideoPlaybackQuality?i.getVideoPlaybackQuality():{};return this.h&&this.b&&(t=de(this.b,qn(this.h)),e=this.C[t],e=le(e.audio,e.video,this.b.periods[t].variants),t=e.video||{}),t||(t={}),e||(e={}),{width:t.width||0,height:t.height||0,streamBandwidth:e.bandwidth||0,decodedFrames:Number(i.totalVideoFrames),droppedFrames:Number(i.droppedVideoFrames),estimatedBandwidth:this.g?this.g.getBandwidthEstimate():NaN,loadLatency:this.j.loadLatency,playTime:this.j.playTime,bufferingTime:this.j.bufferingTime,switchHistory:I(this.j.switchHistory),stateHistory:I(this.j.stateHistory)}},ia.prototype.getStats=ia.prototype.getStats,ia.prototype.addTextTrack=function(t,e,i,n,r,a){if(!this.a)return Promise.reject();for(var s,o=ir(this.a),u=0;uae(t.variants).length)throw new h(2,4,4012)}.bind(this))},zs.kb=function(t){var e=this.a?rr(this.a):{};if(Zt(this.l,e,t),e=0ae(t.variants).length,!e)throw new h(2,4,4011);if(t)throw new h(2,4,4012)},zs.ue=function(t,e){this.g&&this.g.segmentDownloaded(t,e)},zs.Jc=function(t){if(ga(this),this.Oa=t,this.Za(),this.h){var e=this.h;t!=e.j&&(e.j=t,Yn(e,e.i))}this.dispatchEvent(new G("buffering",{buffering:t}))},zs.se=function(){Ea(this)},zs.Za=function(){if(!this.D){var t=this.Oa?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",e=Date.now()/1e3;if(this.j.stateHistory.length){var i=this.j.stateHistory[this.j.stateHistory.length-1];if(i.duration=e-i.timestamp,t==i.state)return}this.j.stateHistory.push({timestamp:e,state:t,duration:0})}},zs.te=function(){if(this.B){var t=this.B;t.c.forEach(t.m.bind(t,!0))}this.a&&ur(this.a)},zs.td=function(t){this.Ba=!0,this.g.disable();var e={audio:!1,text:!1},i=se(t,this.Ma,this.ab,e);return t=oe(t,this.$a,this.ub,e),i=ya(this,i),t=t[0]||null,this.X=this.Na=null,i&&ua(this,i,!0),t&&(ha(this,t,!0),!nr(this.a)&&i&&i.audio&&e.text&&t.language!=i.audio.language&&(this.w.setTextVisibility(!0),Sa(this))),{variant:i,text:t}},zs.Rc=function(){this.Ba=!1,this.c.abr.enabled&&this.g.enable(),this.Na&&(sr(this.a,this.Na,this.Yb),this.Na=null),this.X&&(or(this.a,this.X,!0),this.X=null)},zs.Bd=function(){this.i&&this.i.update&&this.i.update()},zs.Kd=function(){this.h&&this.h.Ib()},zs.Kc=function(t,e){ua(this,t,!0),this.a&&(sr(this.a,t,e||!1),wa(this))},zs.Fe=function(t,e){if(this.a){var i=nr(this.a);(i=ce(t.audio,t.video,i?i.variants:[]))&&this.Kc(i,e)}},zs.La=function(t){if(!this.D){var e=new G("error",{detail:t});this.dispatchEvent(e),e.defaultPrevented&&(t.handled=!0)}},zs.Nd=function(t){this.B?this.B.s(t):this.hb.push(t)},zs.Ya=function(t){this.dispatchEvent(t)},zs.Od=function(){if(this.f.error){var t=this.f.error.code;if(1!=t){var e=this.f.error.msExtendedCode;e&&(0>e&&(e+=Math.pow(2,32)),e=e.toString(16)),this.La(new h(2,3,3016,t,e,this.f.error.message))}}},zs.zd=function(t){var e=["output-restricted","internal-error"],i=ir(this.a),n=!1,r=1==Object.keys(t).length&&"00"==Object.keys(t)[0];i.variants.forEach(function(i){var a=[];i.audio&&a.push(i.audio),i.video&&a.push(i.video),a.forEach(function(a){var s=i.allowedByKeySystem;a.keyId&&(a=t[r?"00":a.keyId],i.allowedByKeySystem=!!a&&0>e.indexOf(a)),s!=i.allowedByKeySystem&&(n=!0)})});var a=rr(this.a);(a=ce(a.audio,a.video,i.variants))&&!a.allowedByKeySystem&&Ta(this,i),n&&Ea(this)},zs.wd=function(t,e){this.i&&this.i.onExpirationUpdated&&this.i.onExpirationUpdated(t,e),this.dispatchEvent(new G("expirationupdated"))},e("shaka.offline.Storage",Aa),Aa.support=ka,Aa.prototype.o=function(){var t=this.a,e=this.i?this.i.o().catch(function(){}).then(function(){if(t)return t.o()}):Promise.resolve();return this.b=this.g=this.i=this.a=null,e},Aa.prototype.destroy=Aa.prototype.o,Aa.prototype.configure=function(t){k(this.b,t,Pa(this),{},"")},Aa.prototype.configure=Aa.prototype.configure,Aa.prototype.De=function(t,e,i){function n(t){a=t}if(this.s)return Promise.reject(new h(2,9,9006));this.s=!0;var r,a=null;return _a(this).then(function(){return Da(this),Ia(this,t,n,i)}.bind(this)).then(function(i){if(Da(this),this.f=i.manifest,this.c=i.Wc,this.f.presentationTimeline.R()||this.f.presentationTimeline.va())throw new h(2,9,9005,t);this.m(this.f.periods),this.h=this.a.c.manifest++,this.l=0,i=e||{};var n=this.f.periods.map(this.C.bind(this)),a=this.c.b,s=vt(this.c);if(a){if(!s.length)throw new h(2,9,9007,t);a.initData=[]}return r={key:this.h,originalManifestUri:t,duration:this.l,size:0,expiration:this.c.mb(),periods:n,sessionIds:this.b.usePersistentLicense?s:[],drmInfo:a,appMetadata:i},Xr(this.i,r)}.bind(this)).then(function(){if(Da(this),a)throw a;return xa(this)}.bind(this)).then(function(){return Ur(r)}.bind(this)).catch(function(t){return xa(this).catch(x).then(function(){throw t})}.bind(this))},Aa.prototype.store=Aa.prototype.De,Aa.prototype.remove=function(t){function e(t){6013!=t.code&&(s=t)}var i=t.offlineUri,n=/^offline:([0-9]+)$/.exec(i);if(!n)return Promise.reject(new h(2,9,9004,i));var r,a,s=null,o=Number(n[1]);return _a(this).then(function(){return Da(this),this.a.get("manifest",o)}.bind(this)).then(function(t){if(Da(this),!t)throw new h(2,9,9003,i);return r=t,t=$r(r),a=new dt({Sa:this.g.s,onError:e,Hb:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),a.configure(this.g.getConfiguration().drm),a.init(t,this.b.usePersistentLicense||!1)}.bind(this)).then(function(){return pt(a,r.sessionIds)}.bind(this)).then(function(){return a.o()}.bind(this)).then(function(){if(Da(this),s)throw s;var e=r.periods.map(function(t){return t.streams.map(function(t){var e=t.segments.map(function(t){return t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t.uri),Number(t[1])});return t.initSegmentUri&&(t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t.initSegmentUri),e.push(Number(t[1]))),e}).reduce(_,[])}).reduce(_,[]),i=0,n=e.length,a=this.b.progressCallback;return Dr(this.a,e,function(){i++,a(t,i/n)})}.bind(this)).then(function(){return Da(this),this.b.progressCallback(t,1),this.a.remove("manifest",o)}.bind(this))},Aa.prototype.remove=Aa.prototype.remove,Aa.prototype.list=function(){var t=[];return _a(this).then(function(){return Da(this),this.a.forEach("manifest",function(e){t.push(Ur(e))})}.bind(this)).then(function(){return t})},Aa.prototype.list=Aa.prototype.list,Aa.prototype.B=function(t){for(var e,i=[],n=Wt(this.g.getConfiguration().preferredAudioLanguage),r=[0,so,oo],a=t.filter(function(t){return"variant"==t.type}),r=r.map(function(t){return a.filter(function(e){return e=Wt(e.language),$t(t,n,e)})}),s=0;s=t.height});return o.length&&(o.sort(function(t,e){return e.height-t.height}),e=o.filter(function(t){return t.height==o[0].height})),e.sort(function(t,e){return t.bandwidth-e.bandwidth}),e.length&&i.push(e[Math.floor(e.length/2)]),i.push.apply(i,t.filter(function(t){return"text"==t.type})),i},Aa.prototype.m=function(t){t.forEach(this.w.bind(this))},Aa.prototype.w=function(t){var e={};if(this.j){var i=this.j.filter(function(t){return"variant"==t.type}),n=null;i.length&&(n=ne(t,i[0])),n&&(n.video&&(e.video=n.video),n.audio&&(e.audio=n.audio))}Zt(this.c,e,t),Qt(t,this.g.getConfiguration().restrictions,{width:1/0,height:1/0})},Aa.prototype.C=function(t){var e,i,n=ee(t,null,null),r=ie(t,null),n=this.b.trackSelectionCallback(n.concat(r));for(this.j||(this.j=n,this.m(this.f.periods)),r=n.length-1;0navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==Ma||(Uo=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Ma)}),La(function(){if(4503599627370497!=Math.round(4503599627370497)){var t=Math.round;Math.round=function(e){var i=e;return 4503599627370496>=e&&(i=t(e)),i}}}),Oa.prototype.c=function(t){if(!(1s[0].indexOf("--\x3e")&&(u=s[0],s.splice(0,1));var c=new un(s[0]),l=Gs(c),d=hn(c,/[ \t]+--\x3e[ \t]+/g),f=Gs(c);if(null==l||!d||null==f)throw new h(2,2,2001);for(s=new xs(l+o,f+o,s.slice(1).join("\n").trim()),hn(c,/[ \t]+/gm),o=cn(c);o;)Ks(s,o),hn(c,/[ \t]+/gm),o=cn(c);null!=u&&(s.id=u),u=s}u&&a.push(u)}return a},Mt("text/vtt",Hs),Mt('text/vtt; codecs="vtt"',Hs),qs.prototype.parseInit=function(t){var e=!1;if((new ai).G("moov",si).G("trak",si).G("mdia",si).ca("mdhd",function(t){0==t.version?(t.u.I(4),t.u.I(4),this.a=t.u.F(),t.u.I(4)):(t.u.I(8),t.u.I(8),this.a=t.u.F(),t.u.I(8)),t.u.I(4)}.bind(this)).G("minf",si).G("stbl",si).ca("stsd",oi).G("wvtt",function(){e=!0}).parse(t),!this.a)throw new h(2,2,2008);if(!e)throw new h(2,2,2008)},qs.prototype.parseMedia=function(t,e){var i=0,n=[],r=[],a=[],s=!1,o=!1,u=!1,c=null;if((new ai).G("moof",si).G("traf",si).ca("tfdt",function(t){s=!0,i=t.version?t.u.Va():t.u.F()}).ca("tfhd",function(t){var e=t.ec;t=t.u,t.I(4),1&e&&t.I(8),2&e&&t.I(4),c=8&e?t.F():null}).ca("trun",function(t){o=!0;var e=t.version,i=t.ec;t=t.u;var r=t.F();1&i&&t.I(4),4&i&&t.I(4);for(var a=[],s=0;s1&&void 0!==arguments[1]?arguments[1]:"";c.default.polyfill.installAll();var i=c.default.Player.isBrowserSupported(),n=t.split("?")[0].match(/.*\.(.*)$/)||[];return i&&("mpd"===n[1]||e.indexOf("application/dash+xml")>-1)}},{key:"Events",get:function(){return{SHAKA_READY:"shaka:ready"}}}]),o(e,[{key:"play",value:function(){if(this._player||this._setup(),!this.isReady)return void this.once(e.Events.SHAKA_READY,this.play);this._stopped=!1,this._src=this.el.src,s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"play",this).call(this)}},{key:"setupSrc",value:function(){}},{key:"_ready",value:function(){}},{key:"_onShakaReady",value:function(){this._isShakaReadyState=!0,this.trigger(e.Events.SHAKA_READY),this.trigger(u.Events.PLAYBACK_READY,this.name)}},{key:"error",value:function(t){u.Log.error("an error was raised by the video tag",t,this.el.error)}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._stopped=!0,this._player?(this._sendStats(),this._player.unload().then(function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1}).catch(function(){u.Log.error("shaka could not be unloaded")})):s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"getPlaybackType",value:function(){return(this.isReady&&this._player.isLive()?"live":"vod")||""}},{key:"selectAudioLanguage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._player.selectAudioLanguage(t,e)}},{key:"selectTrack",value:function(t){if("text"===t.type)this._player.selectTextTrack(t);else{if("variant"!==t.type)throw new Error("Unhandled track type:",t.type);this._player.selectVariantTrack(t),t.mimeType.startsWith("video/")&&this._onAdaptation()}}},{key:"_enableShakaTextTrack",value:function(t){this.el.textTracks&&(this._shakaTTVisible=t,Array.from(this.el.textTracks).filter(function(t){return"subtitles"===t.kind}).forEach(function(e){return e.mode=!0===t?"showing":"hidden"}))}},{key:"_checkForClosedCaptions",value:function(){if(!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(u.Events.PLAYBACK_SUBTITLE_AVAILABLE);var t=this.closedCaptionsTrackId;this.closedCaptionsTrackId=t}this._ccIsSetup=!0}}},{key:"destroy",value:function(){var t=this;clearInterval(this.sendStatsId),this._player?this._player.destroy().then(function(){return t._destroy()}).catch(function(){t._destroy(),u.Log.error("shaka could not be destroyed")}):this._destroy()}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._ccIsSetup=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player),this._player.load(this._options.src).then(function(){return t._loaded()}).catch(function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=new c.default.Player(this.el);return t.addEventListener("error",this._onError.bind(this)),t.addEventListener("adaptation",this._onAdaptation.bind(this)),t.addEventListener("buffering",this._onBuffering.bind(this)),t}},{key:"_onBuffering",value:function(t){if(!this._stopped){var e=t.buffering?u.Events.PLAYBACK_BUFFERING:u.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}}},{key:"_loaded",value:function(){this._onShakaReady(),this._startToSendStats(),this._fillLevels(),this._checkForClosedCaptions()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.slice(0).reverse(),this.trigger(u.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this,e=this._options.shakaSendStatsInterval||3e4;this.sendStatsId=setInterval(function(){return t._sendStats()},e)}},{key:"_sendStats",value:function(){this.trigger(u.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._onError(t)}},{key:"_onError",value:function(t){var e=this;u.Log.error("Shaka error event:",t.detail),this.trigger(u.Events.PLAYBACK_ERROR,t,this.name),t.detail&&2==t.detail.severity&&1002==t.detail.code&&(console.log("retrying"),this.stop(),setTimeout(function(){return e.play()},1e3))}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return!0===t.active})[0];this._fillLevels(),this._sendStats(),this._pendingAdaptationEvent_&&(this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_END),this._pendingAdaptationEvent=!1),u.Log.debug("an adaptation has happened:",t),this.trigger(u.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,language:t.language,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,u.Log.debug("shaka was destroyed")}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this.isReady&&this._player.getTextTracks()}},{key:"audioLanguages",get:function(){return this.isReady&&this._player.getAudioLanguages()}},{key:"audioTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("audio/")})}},{key:"videoTracks",get:function(){return this.isReady&&this._player.getVariantTracks().filter(function(t){return t.mimeType.startsWith("video/")})}},{key:"closedCaptionsTracks",get:function(){var t=0,e=function(){return t++};return(this.textTracks||[]).filter(function(t){return"subtitle"===t.kind}).map(function(t){return{id:e(),name:t.label||t.language,track:t}})}},{key:"closedCaptionsTrackId",get:function(){return s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"closedCaptionsTrackId",this)},set:function(t){if(this._player){var e=this.closedCaptionsTracks,i=void 0;if(-1!==t){if(!(i=e.find(function(e){return e.id===t})))return void u.Log.warn('Track id "'+t+'" not found');if(this._shakaTTVisible&&!0===i.track.active)return void u.Log.info('Track id "'+t+'" already showing')}i?(this._player.selectTextTrack(i.track),this._enableShakaTextTrack(!0)):this._enableShakaTextTrack(!1),this._ccTrackId=t,this.trigger(u.Events.PLAYBACK_SUBTITLE_CHANGED,{id:t})}}}]),e}(u.HTML5Video);e.default=l,t.exports=e.default},function(e,i){e.exports=t},function(t,e,i){var n;!function(){var r={};(function(t){function e(t,e){var i=t.split("."),n=Do;i[0]in n||!n.execScript||n.execScript("var "+i[0]);for(var r;i.length&&(r=i.shift());)i.length||void 0===e?n=n[r]?n[r]:n[r]={}:n[r]=e}function i(t){function e(){}var i=Re;e.prototype=i.prototype,t.ff=i.prototype,t.prototype=new e,t.prototype.constructor=t,t.df=function(t,e,n){return i.prototype[e].apply(t,Array.prototype.slice.call(arguments,2))}}function n(t){this.c=Math.exp(Math.log(.5)/t),this.b=this.a=0}function r(t,e,i){var n=Math.pow(t.c,e);i=i*(1-n)+n*t.a,isNaN(i)||(t.a=i,t.b+=e)}function a(t){return t.a/(1-Math.pow(t.c,t.b))}function s(){this.b=new n(2),this.c=new n(5),this.a=0}function o(){}function u(){}function h(t,e,i,n){this.severity=t,this.category=e,this.code=i,this.data=Array.prototype.slice.call(arguments,3),this.handled=!1}function c(t){var e;t instanceof c?(l(this,t.da),this.Ba=t.Ba,this.ia=t.ia,f(this,t.La),this.Y=t.Y,d(this,g(t.a)),this.ua=t.ua):t&&(e=String(t).match(Mo))?(l(this,e[1]||"",!0),this.Ba=p(e[2]||""),this.ia=p(e[3]||"",!0),f(this,e[4]),this.Y=p(e[5]||"",!0),d(this,e[6]||"",!0),this.ua=p(e[7]||"")):this.a=new v(null)}function l(t,e,i){t.da=i?p(e,!0):e,t.da&&(t.da=t.da.replace(/:$/,""))}function f(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.La=e}else t.La=null}function d(t,e,i){e instanceof v?t.a=e:(i||(e=m(e,jo)),t.a=new v(e))}function p(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function m(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,y),i&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function y(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function v(t){this.b=t||null}function g(t){var e=new v;if(e.b=t.b,t.a){var i,n={};for(i in t.a)n[i]=t.a[i].concat();e.a=n,e.c=t.c}return e}function b(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i}function T(t,e,i){var n=E();this.j=null==t.maxAttempts?n.maxAttempts:t.maxAttempts,this.f=null==t.baseDelay?n.baseDelay:t.baseDelay,this.i=null==t.fuzzFactor?n.fuzzFactor:t.fuzzFactor,this.h=null==t.backoffFactor?n.backoffFactor:t.backoffFactor,this.a=0,this.b=this.f,this.c=e||!1,this.g=i||null,this.c&&(this.a=1)}function w(t){if(t.a>=t.j){if(!t.c)return Promise.reject();t.a=1,t.b=t.f}var e=new b;return t.a?(S(t,e.resolve,t.b*(1+(2*Math.random()-1)*t.i)),t.b*=t.h):e.resolve(),t.a++,e}function E(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function S(t,e,i){if(t.g)if(t.g()||!i)e();else{var n=Math.min(200,i);A(function(){S(this,e,i-n)}.bind(t),n)}else A(e,i)}function A(e,i){t.setTimeout(e,i)}function k(t,e,i,n,r){var a,s=r in n;for(a in e){var o=r+"."+a,u=s?n[r]:i[a];(s||a in t)&&(void 0===e[a]?void 0===u||s?delete t[a]:t[a]=u:u.constructor==Object&&e[a]&&e[a].constructor==Object?(t[a]||(t[a]=u),k(t[a],e[a],u,n,o)):typeof e[a]==typeof u&&null!=e[a]&&e[a].constructor==u.constructor&&(t[a]=e[a]))}}function I(t){function e(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t)return t;if(0<=i.indexOf(t))return null;var n=t.constructor==Array;if(t.constructor!=Object&&!n)return null;i.push(t);var r,a=n?[]:{};for(r in t)a[r]=e(t[r]);return n&&(a.length=t.length),a}}var i=[];return e(t)}function _(t,e){return t.reduce(function(t,e,i){return e.catch(t.bind(null,i))}.bind(null,e),Promise.reject())}function P(t,e){return t.concat(e)}function x(){}function R(t){return null!=t}function N(t,e,i){return i.indexOf(t)==e}function L(t){this.f=!1,this.a=[],this.b=[],this.c=[],this.g=t||null}function D(t,e,i){i=i||3;var n=Fo[t];(!n||i>=n.ke)&&(Fo[t]={ke:i,ie:e})}function M(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function C(t,e,i,n,r,a,s){if(t.f||s())return Promise.reject();var o=new c(i.uris[r]),u=o.da;if(u||(u=location.protocol,u=u.slice(0,-1),l(o,u),i.uris[r]=o.toString()),!(u=(u=Fo[u])?u.ie:null))return Promise.reject(new h(2,1,1e3,o));var f=Date.now();return u(i.uris[r],i,e).then(function(t){void 0==t.timeMs&&(t.timeMs=Date.now()-f);var i=Date.now(),n=Promise.resolve();return this.c.forEach(function(i){n=n.then(function(){return Promise.resolve(i(e,t))}.bind(this))}.bind(this)),n=n.catch(function(t){var e=2;throw t instanceof h&&(e=t.severity),new h(e,1,1007,t)}),n.then(function(){return t.timeMs+=Date.now()-i,t.timeMs+=a,t})}.bind(t)).catch(function(t){if(t&&1==t.severity)return r=(r+1)%i.uris.length,s()?Promise.reject():w(n).then(function(){return C(this,e,i,n,r,a,s)}.bind(this),function(){throw t});throw t}.bind(t))}function O(t,e){for(var i=[],n=0;n=t[e]}.bind(null,e);if(!e[0]&&!e[2])return et(t,!1);if(!e[1]&&!e[3])return et(t,!0);if(i(0)&&i(1)&&i(2)&&i(3))return tt(t);throw new h(2,2,2003)}function nt(t){t=unescape(encodeURIComponent(t));for(var e=new Uint8Array(t.length),i=0;it.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function Dt(t,e){return!(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))&&(e>=t.start(0)&&e<=t.end(t.length-1))}function Mt(t,e){if(!t||!t.length||1==t.length&&1e-6>t.end(0)-t.start(0))return 0;for(var i=0,n=t.length-1;0<=n&&t.end(n)>e;--n)i+=t.end(n)-Math.max(t.start(n),e);return i}function Ct(t){if(!t)return[];for(var e=[],i=0;i>4).toString(16),r=r+(15&s).toString(16),i=i.replace(n[0],r);return i}function jt(t,e,i){return t.b=new b,t.c=[],null==i||t.f||(t.a.setBaseMediaDecodeTime(9e4*i),t.f=!0),e=new Uint8Array(e),t.a.push(e),t.a.flush(),t.b}function Bt(t){this.c=null,this.f=t,this.h=this.i=0,this.g=1/0,this.b=this.a=null}function Ft(t,e,i,n){return Promise.resolve().then(function(){if(this.c&&this.f)if(null==i||null==n)this.c.parseInit(new Uint8Array(e));else{var t={periodStart:this.i,segmentStart:i,segmentEnd:n},t=this.c.parseMedia(new Uint8Array(e),t).filter(function(t){return t.startTime>=this.h&&t.startTimei.end(0)-i.start(0)?null:1==i.length&&0>i.start(0)?0:i.length?i.start(0):null;return i}function Gt(t,e){try{return t.b[e].buffered}catch(t){return null}}function Xt(t,e,i,n,r){return"text"==e?Ft(t.a,i,n,r):t.h[e]?jt(t.h[e],i,n).then(function(t){return $t(this,e,this.Sc.bind(this,e,t.buffer))}.bind(t)):$t(t,e,t.Sc.bind(t,e,i))}function Yt(t,e){return"text"==e?t.a.remove(0,1/0):$t(t,e,t.Tc.bind(t,e,0,t.f.duration))}function zt(t,e,i,n,r){return"text"==e?(t.a.i=i,t=t.a,t.h=n,t.g=r,Promise.resolve()):Promise.all([$t(t,e,t.Zc.bind(t,e)),$t(t,e,t.Ce.bind(t,e,i)),$t(t,e,t.ze.bind(t,e,n,r))])}function $t(t,e,i){if(t.j)return Promise.reject();if(i={start:i,p:new b},t.c[e].push(i),1==t.c[e].length)try{i.start()}catch(n){"QuotaExceededError"==n.name?i.p.reject(new h(2,3,3017,e)):i.p.reject(new h(2,3,3015,n)),Jt(t,e)}return i.p}function Wt(t,e){if(t.j)return Promise.reject();var i,n=[];for(i in t.b){var r=new b,a={start:function(t){t.resolve()}.bind(null,r),p:r};t.c[i].push(a),n.push(r),1==t.c[i].length&&a.start()}return Promise.all(n).then(function(){var t;try{e()}catch(t){var i=Promise.reject(new h(2,3,3015,t))}for(t in this.b)Jt(this,t);return i}.bind(t),function(){return Promise.reject()}.bind(t))}function Jt(t,e){t.c[e].shift();var i=t.c[e][0];if(i)try{i.start()}catch(n){i.p.reject(new h(2,3,3015,n)),Jt(t,e)}}function Qt(t,e,i){return i==e||t>=qo&&i==e.split("-")[0]||t>=Go&&i.split("-")[0]==e.split("-")[0]}function Zt(t){t=t.toLowerCase().split("-");var e=Xo[t[0]];return e&&(t[0]=e),t.join("-")}function te(t,e,i){var n=t.video;return!(n&&(n.widthe.maxWidth||n.width>i.width||n.heighte.maxHeight||n.height>i.height||n.width*n.heighte.maxPixels)||t.bandwidthe.maxBandwidth)}function ee(t,e,i){var n=!1;return t.variants.forEach(function(t){var r=t.allowedByApplication;t.allowedByApplication=te(t,e,i),r!=t.allowedByApplication&&(n=!0)}),n}function ie(t,e,i,n){n.variants=n.variants.filter(function(n){return!(t&&t.K&&!Rt(t,n))&&(ne(n.audio,t,e)&&ne(n.video,t,i))}),n.textStreams=n.textStreams.filter(function(t){return!!Ko[Z(t.mimeType,t.codecs)]})}function ne(e,i,n){if(!e)return!0;var r=null;i&&i.K&&(r=i.u),i=Z(e.mimeType,e.codecs);var a,s=Z(e.mimeType,e.codecs),o=e.mimeType;for(a in Ho){var u=e[a],h=Ho[a];u&&(o+="; "+h+'="'+u+'"')}return!(!(Ko[s]||MediaSource.isTypeSupported(o)||t.muxjs&&"mp2t"==s.split(";")[0].split("/")[1]&&MediaSource.isTypeSupported(Ut(e.type,s)))||r&&e.encrypted&&0>r.indexOf(i)||n&&(e.mimeType!=n.mimeType||e.codecs.split(".")[0]!=n.codecs.split(".")[0]))}function re(t){var e=t.audio,i=t.video,n=e?e.codecs:null,r=i?i.codecs:null,a=[];r&&a.push(r),n&&a.push(n);var s=[];i&&s.push(i.mimeType),e&&s.push(e.mimeType);var s=s[0]||null,o=[];e&&o.push(e.kind),i&&o.push(i.kind);var o=o[0]||null,u=[];return e&&u.push.apply(u,e.roles),i&&u.push.apply(u,i.roles),u=O(u),t={id:t.id,active:!1,type:"variant",bandwidth:t.bandwidth,language:t.language,label:null,kind:o,width:null,height:null,frameRate:null,mimeType:s,codecs:a.join(", "),audioCodec:n,videoCodec:r,primary:t.primary,roles:u,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null},i&&(t.videoId=i.id,t.width=i.width||null,t.height=i.height||null,t.frameRate=i.frameRate||null,t.videoBandwidth=i.bandwidth||null),e&&(t.audioId=e.id,t.channelsCount=e.channelsCount,t.audioBandwidth=e.bandwidth||null,t.label=e.label),t}function ae(t){return{id:t.id,active:!1,type:"text",bandwidth:0,language:t.language,label:t.label,kind:t.kind||null,width:null,height:null,frameRate:null,mimeType:t.mimeType,codecs:t.codecs||null,audioCodec:null,videoCodec:null,primary:t.primary,roles:t.roles,videoId:null,audioId:null,channelsCount:null,audioBandwidth:null,videoBandwidth:null}}function se(t){var e=[],i=fe(t.variants);return t=t.textStreams,i.forEach(function(t){e.push(re(t))}),t.forEach(function(t){e.push(ae(t))}),e}function oe(t,e,i){return fe(t.variants).map(function(t){var n=re(t);return t.video&&t.audio?n.active=i==t.video.id&&e==t.audio.id:t.video?n.active=i==t.video.id:t.audio&&(n.active=e==t.audio.id),n})}function ue(t,e){return t.textStreams.map(function(t){var i=ae(t);return i.active=e==t.id,i})}function he(t,e){for(var i=0;i=t.periods[i].startTime)return i;return 0}function Te(t,e){for(var i=0;ie?"-Infinity":"Infinity":e;return n}})}function Ae(t){return JSON.parse(t,function(t,e){return"NaN"==e?NaN:"-Infinity"==e?-1/0:"Infinity"==e?1/0:e&&"object"==typeof e&&"TimeRanges"==e.__type__?ke(e):e})}function ke(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function Ie(t,e,i,n,r,a){this.J=t,this.g=e,this.K=i,this.j=!1,this.A=n,this.F=r,this.u=a,this.b=this.h=!1,this.w="",this.i=null,this.l=this.vc.bind(this),this.m=this.Ld.bind(this),this.a={video:{},player:{}},this.s=0,this.c={},this.f=null}function _e(t){var e=au;e.removeUpdateListener(t.l),e.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.m)}function Pe(t){for(var e in t.c){var i=t.c[e];delete t.c[e],i.reject(new h(1,7,7e3))}}function xe(t){t=Se(t),au.sendMessage("urn:x-cast:com.google.shaka.v2",t,function(){},u)}function Re(){this.xb=new F,this.eb=this}function Ne(t,e,i){Re.call(this),this.c=t,this.b=e,this.i=this.g=this.f=this.j=this.h=null,this.a=new Ie(i,this.He.bind(this),this.Ie.bind(this),this.Je.bind(this),this.Ke.bind(this),this.mc.bind(this)),Le(this)}function Le(t){t.a.init(),t.i=new V,Yo.forEach(function(t){H(this.i,this.c,t,this.We.bind(this))}.bind(t)),Jo.forEach(function(t){H(this.i,this.b,t,this.he.bind(this))}.bind(t)),t.h={};for(var e in t.c)Object.defineProperty(t.h,e,{configurable:!1,enumerable:!0,get:t.Ve.bind(t,e),set:t.Xe.bind(t,e)});t.j={};for(e in t.b)Object.defineProperty(t.j,e,{configurable:!1,enumerable:!0,get:t.ge.bind(t,e)});t.f=new Re,t.f.eb=t.h,t.g=new Re,t.g.eb=t.j}function De(t,e,i,n){Re.call(this),this.a=t,this.b=e,this.m={video:t,player:e},this.s=i||function(){},this.u=n||function(t){return t},this.l=!1,this.f=!0,this.g=0,this.j=!1,this.i=this.h=this.c=null,Me(this)}function Me(e){var i=cast.receiver.CastReceiverManager.getInstance();i.onSenderConnected=e.Cc.bind(e),i.onSenderDisconnected=e.Cc.bind(e),i.onSystemVolumeChanged=e.gd.bind(e),e.h=i.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.h.onMessage=e.Gd.bind(e),e.c=i.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.c.onMessage=e.Ud.bind(e),i.start(),Yo.forEach(function(t){this.a.addEventListener(t,this.Gc.bind(this,"video"))}.bind(e)),Jo.forEach(function(t){this.b.addEventListener(t,this.Gc.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.Yb(3840,2160):e.b.Yb(1920,1080),e.a.addEventListener("loadeddata",function(){this.j=!0}.bind(e)),e.b.addEventListener("loading",function(){this.f=!1,Ce(this)}.bind(e)),e.a.addEventListener("playing",function(){this.f=!1,Ce(this)}.bind(e)),e.a.addEventListener("pause",function(){Ce(this)}.bind(e)),e.b.addEventListener("unloading",function(){this.f=!0,Ce(this)}.bind(e)),e.a.addEventListener("ended",function(){t.setTimeout(function(){this.a&&this.a.ended&&(this.f=!0,Ce(this))}.bind(this),5e3)}.bind(e))}function Ce(t){Promise.resolve().then(function(){this.dispatchEvent(new X("caststatuschanged")),je(this,0)}.bind(t))}function Oe(t,e,i){for(var n in e.player)t.b[n](e.player[n]);t.s(i),i=Promise.resolve();var r=t.a.autoplay;e.manifest&&(t.a.autoplay=!1,i=t.b.load(e.manifest,e.startTime),i.catch(function(t){this.b.dispatchEvent(new X("error",{detail:t}))}.bind(t))),i.then(function(){var t;for(t in e.video){var i=e.video[t];this.a[t]=i}for(t in e.playerAfterLoad)i=e.playerAfterLoad[t],this.b[t](i);this.a.autoplay=r,e.manifest&&(this.a.play(),je(this,0))}.bind(t))}function Ue(t,e,i,n){t.l&&(t=Se(e),n?i.getCastChannel(n).send(t):i.broadcast(t))}function je(t,e,i){var n=t.a.playbackRate,r=su;r=t.f?r.IDLE:t.b.rc()?r.Uc:t.a.paused?r.Wc:r.Xc,n={mediaSessionId:0,playbackRate:n,playerState:r,currentTime:t.a.currentTime,supportedMediaCommands:15,volume:{level:t.a.volume,muted:t.a.muted}},i&&(n.media=i),Ue(t,{requestId:e,type:"MEDIA_STATUS",status:[n]},t.h)}function Be(t,e){var i=Fe(t,e);return 1!=i.length?null:i[0]}function Fe(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t.tagName==e})}function Ve(t){var e=t.firstChild;return e&&e.nodeType==Node.TEXT_NODE?t.textContent.trim():null}function He(t,e,i,n){var r=null;return t=t.getAttribute(e),null!=t&&(r=i(t)),null==r?void 0!=n?n:null:r}function Ke(t){return t?(/^\d+\-\d+\-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function qe(t){return t&&(t=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(t))?(t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null),isFinite(t)?t:null):null}function Ge(t){var e=/([0-9]+)-([0-9]+)/.exec(t);return e?(t=Number(e[1]),isFinite(t)?(e=Number(e[2]),isFinite(e)?{start:t,end:e}:null):null):null}function Xe(t){return t=Number(t),t%1?null:t}function Ye(t){return t=Number(t),!(t%1)&&0(f=f||0))if(l+1=f)break;f=Math.ceil((f-d)/p)-1}else{if(1/0==u)break;if(d/r>=u)break;f=Math.ceil((u*r-d)/p)-1}0>>31,c=2147483647&c,f=n.o.B();if(n.o.H(4),1==l)throw new h(2,3,3006);r.push(new ui(r.length,s/a-e,(s+f)/a-e,function(){return i},t,t+c-1)),s+=f,t+=c}return n.oa.stop(),r}function gi(t){this.a=t}function bi(t,e){for(var i;t.a.length&&(i=t.a[t.a.length-1],i.startTime>=e);)t.a.pop();for(;t.a.length&&(i=t.a[0],0>=i.endTime);)t.a.shift();t.a.length&&(i=t.a[0],i.startTime=e&&!(i&1<<8-e);e++);if(8t||i&&t>=i?null:Math.floor((t+s)/n)},getSegmentReference:function(t){var e=t*n-s,l=Math.min(e+n,i);return 0>l||i&&e>=i?null:new ui(t,e,l,function(){var i=ti(o,h,t+r,u,e*a);return Y(c,[i])},0,null)}}}function Bi(t,e){for(var i=[],n=0;ne.l||(e.f=t.setTimeout(e.Le.bind(e),1e3*Math.max(Math.max(3,e.l)-i,0)))}function Zi(t,e,i){e=e||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0,Nb:null},i=i||e.aa;var n=Fe(t,"BaseURL").map(Ve),r=t.getAttribute("contentType")||e.contentType,a=t.getAttribute("mimeType")||e.mimeType,s=t.getAttribute("codecs")||e.codecs,o=He(t,"frameRate",$e)||e.frameRate,u=!!Fe(t,"InbandEventStream").length,h=Fe(t,"AudioChannelConfiguration"),h=tn(h)||e.Nb;return r||(r=an(a,s)),{aa:Y(i,n),Ya:Be(t,"SegmentBase")||e.Ya,qa:Be(t,"SegmentList")||e.qa,Za:Be(t,"SegmentTemplate")||e.Za,width:He(t,"width",ze)||e.width,height:He(t,"height",ze)||e.height,contentType:r,mimeType:a,codecs:s,frameRate:o,containsEmsgBoxes:u||e.containsEmsgBoxes,id:t.getAttribute("id"),Nb:h}}function tn(t){for(var e=0;e>=1;return t}}}return null}function en(t){var e=0+(t.Ya?1:0);return e+=t.qa?1:0,(e+=t.Za?1:0)?(1!=e&&(t.Ya&&(t.qa=null),t.Za=null),!0):"text"==t.contentType||"application"==t.contentType}function nn(t,e,i,n){return e=Y(e,[i]),e=M(e,t.b.retryParameters),e.method=n,t.a.networkingEngine.request(0,e).then(function(t){if("HEAD"==n){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=tt(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function rn(t,e,i,n){i=i.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.b.dash.clockSyncUri;return n&&!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),_(i,function(t){var i=t.value;switch(t.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return nn(this,e,i,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return nn(this,e,i,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return t=Date.parse(i),isNaN(t)?0:t-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:return Promise.reject()}}.bind(t)).catch(function(){return 0})}function an(t,e){return Ko[Z(t,e)]?"text":t.split("/")[0]}function sn(t,e,i,n){this.uri=t,this.type=e,this.a=i,this.segments=n||null}function on(t,e,i,n){this.id=t,this.name=e,this.a=i,this.value=n||null}function un(t,e){this.name=t,this.value=e}function hn(t,e,i){return i=i||null,(t=t.getAttribute(e))?t.value:i}function cn(t,e){this.a=e,this.uri=t}function ln(t,e){return t.filter(function(t){return t.name==e})}function fn(t,e){var i=ln(t,e);return i.length?i[0]:null}function dn(t,e,i){return t.filter(function(t){var n=t.getAttribute("TYPE");return t=t.getAttribute("GROUP-ID"),n.value==e&&t.value==i})}function pn(t,e){return Y([t],[e])[0]}function mn(t){this.b=t,this.a=0}function yn(t,e){e.lastIndex=t.a;var i=(i=e.exec(t.b))?{position:i.index,length:i[0].length,te:i}:null;return t.a!=t.b.length&&i&&i.position==t.a?(t.a+=i.length,i.te):null}function vn(t){return t.a==t.b.length?null:(t=yn(t,/[^ \t\n]*/gm))?t[0]:null}function gn(){this.a=0}function bn(t,e,i){e=tt(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var n=e.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new h(2,4,4015);e=0;for(var r=[],a=1;a>4)&&2!=n||e(),3==n&&(n=t.$(),t.H(n)),1==t.B()>>8)return t.H(3),(i=t.$()>>6)&&1!=i||e(),t.$()||e(),i=t.$(),n=t.Xa(),t=t.Xa(),(1073741824*((14&i)>>1)+((65534&n)<<14|(65534&t)>>1))/9e4;t.seek(i+188),n=t.$(),71!=n&&(t.seek(i+192),n=t.$()),71!=n&&(t.seek(i+204),n=t.$()),71!=n&&e(),t.Lc(1)}}function Kn(t,e){for(var i=pu[t],n=0;n=i?i-t.l.durationBackoff:e}function Zn(t){return 0e.T()?e.ja():e.pb(),t.m=Qn(t,e),e}function er(t,e){t.f&&(t.f.cancel(),t.f=null),t.i=e,t.a.playbackRate=t.j||0>e?0:e,!t.j&&0>e&&(t.f=new at(function(){this.a.currentTime+=e/4}.bind(t)),ot(t.f,.25))}function ir(t,e){var i=Dt.bind(null,t.a.buffered),n=1*Math.max(t.c.minBufferTime||0,t.l.rebufferingGoal),r=t.c.presentationTimeline,a=r.Fa(0),s=r.va(),o=r.T(),u=r.Fa(n),h=r.Fa(5),n=r.Fa(n+5);return e>=o?Qn(t,e):e>s?s:e=u||i(e)?e:n}function nr(t,e,i){t.a.currentTime=i;var n=0,r=function(){!this.a||10<=n++||this.a.currentTime!=e||(this.a.currentTime=i,setTimeout(r,100))}.bind(t);setTimeout(r,100)}function rr(t,e){var i=t.c.presentationTimeline.ja();return ei?i:e)}function ar(t,e,i,n,r,a,s){this.a=t,this.w=e,this.g=i,this.u=n,this.l=r,this.h=a,this.A=s,this.c=[],this.j=new V,this.b=!1,this.i=-1,this.f=null,or(this)}function sr(t){var e=I(t);return e.eventElement=t.eventElement,e}function or(e){ur(e),e.f=t.setTimeout(e.F.bind(e),250)}function ur(e){e.f&&(t.clearTimeout(e.f),e.f=null)}function hr(t,e){this.a=e,this.b=t,this.h=null,this.i=1,this.m=Promise.resolve(),this.g=[],this.j={},this.c={},this.s=!1,this.A=null,this.w=this.f=this.l=!1,this.u=0}function cr(t){var e=Zn(t.a.Ka);return t.b.periods[be(t.b,e)]}function lr(t){var e=t.c.video||t.c.audio;return e?t.b.periods[e.xa]:null}function fr(t){return pr(t,"audio")}function dr(t){return pr(t,"video")}function pr(t,e){var i=t.c[e];return i?i.pa||i.stream:null}function mr(t,e){t.u++,t.w=!1;var i=t.u;return t.a.L.init({text:e}),Ar(t,[e]).then(function(){if(this.u==i&&!this.c.text&&!this.w){var t=Zn(this.a.Ka);this.c.text=Er(e,be(this.b,t)),jr(this,this.c.text,0)}}.bind(t))}function yr(t,e){var i=t.c.video;if(i){var n=i.stream;if(n)if(e){var r=n.trickModeVideo;if(r){var a=i.pa;a||(gr(t,r,!1),i.pa=n)}}else(a=i.pa)&&(i.pa=null,gr(t,a,!0))}}function vr(t,e,i){e.video&&gr(t,e.video,i),e.audio&&gr(t,e.audio,i)}function gr(t,e,i){var n=t.c[e.type];if(!n&&"text"==e.type&&t.h.ignoreTextStreamFailures)mr(t,e);else if(n){var r=Te(t.b,e);i&&r!=n.xa?Tr(t):(n.pa&&(e.trickModeVideo?(n.pa=e,e=e.trickModeVideo):n.pa=null),(r=t.g[r])&&r.Oa&&(r=t.j[e.id])&&r.Oa&&n.stream!=e&&("text"==e.type&&Kt(t.a.L,Z(e.mimeType,e.codecs)),n.stream=e,n.qb=!0,i&&(n.ta?n.wb=!0:n.ya?(n.sa=!0,n.wb=!0):(Br(n),Ur(t,n,!0)))))}}function br(t){var e=Zn(t.a.Ka);Object.keys(t.c).every(function(t){var i=this.a.L;return"text"==t?(t=i.a,t=e>=t.a&&ee?t.a.L.fa(e):t.a.L.fa(Math.pow(2,32))}function Ir(t,e){var i=Zn(t.a.Ka),n=e.Ga&&e.ka?t.b.periods[Te(t.b,e.Ga)].startTime+e.ka.endTime:Math.max(i,e.Jc),r=Te(t.b,e.stream),a=be(t.b,n),s=t.a.L,o=e.type;return"text"==o?(s=s.a,s=null==s.b||s.b=t.b.presentationTimeline.T()?(e.endOfStream=!0,null):(e.endOfStream=!1,e.xa=a,a!=r?null:s>=o?.5:(n=t.a.L,a=e.type,n="text"==a?n.a.b:Lt(Gt(n,a)),e.ka&&e.stream==e.Ga?(a=e.ka.position+1,n=_r(t,e,r,a)):(a=e.ka?e.stream.findSegmentPosition(Math.max(0,t.b.periods[Te(t.b,e.Ga)].startTime+e.ka.endTime-t.b.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(n||i)-t.b.periods[r].startTime)),null==a?n=null:(s=null,null==n&&(s=_r(t,e,r,Math.max(0,a-1))),n=s||_r(t,e,r,a))),n?(e.Jc=0,Pr(t,e,i,r,n),null):1))}function _r(t,e,i,n){return i=t.b.periods[i],(e=e.stream.getSegmentReference(n))?(n=t.b.presentationTimeline,t=n.ja(),n=n.va(),i.startTime+e.endTimen?null:e):null}function Pr(t,e,i,n,r){var a=t.b.periods[n],s=e.stream,o=t.b.presentationTimeline.T(),u=t.b.periods[n+1];n=Rr(t,e,n,a.startTime,u?u.startTime:o),e.ya=!0,e.qb=!1,o=Or(t,r),Promise.all([n,o]).then(function(t){if(!this.f&&!this.l)return Nr(this,e,i,a,s,r,t[1])}.bind(t)).then(function(){this.f||this.l||(e.ya=!1,e.Vb=!1,e.sa||this.a.Qb(),jr(this,e,0),Dr(this,s))}.bind(t)).catch(function(t){this.f||this.l||(e.ya=!1,"text"==e.type&&this.h.ignoreTextStreamFailures?delete this.c.text:3017==t.code?xr(this,e,t):(e.Ua=!0,t.severity=2,Fr(this,t)))}.bind(t))}function xr(t,e,i){if(!W(t.c).some(function(t){return t!=e&&t.Vb})){var n=Math.round(100*t.i);if(20=i?Promise.resolve():t.a.L.remove(e.type,n,n+i).then(function(){}.bind(t)))}function Dr(t,e){if(!t.s&&(t.s=W(t.c).every(function(t){return"text"==t.type||!t.sa&&!t.ta&&t.ka}),t.s)){var i=Te(t.b,e);for(t.g[i]||Sr(t,i).then(function(){this.a.sc()}.bind(t)).catch(x),i=0;i=e.status&&202!=e.status)e.responseURL&&(t=e.responseURL),i({uri:t,data:e.response,headers:r,fromCache:!!r["x-shaka-from-cache"]});else{var a=null;try{a=it(e.response)}catch(t){}n(new h(401==e.status||403==e.status?2:1,1,1001,t,e.status,a,r))}},r.onerror=function(){n(new h(1,1,1002,t))},r.ontimeout=function(){n(new h(1,1,1003,t))};for(var a in e.headers)r.setRequestHeader(a,e.headers[a]);r.send(e.body)})}function Hr(t,e,i){t.openCursor().onsuccess=function(t){var n=t.target.result;n?e(n.key,n.value,function(){n.continue()}):i()}}function Kr(t,e){function i(t){return c?t:(t.close(),Promise.reject(new h(2,9,9001,"Failed to issue upgrade after "+u+" retries")))}function n(t){return c?t:(t.close(),a().then(function(){return r()}))}function r(){return qr(t,s)}function a(){return new Promise(function(t){setTimeout(t,1e3)})}function s(t,e,i){o(t,e,i),c=!0}var o=sa,u=e||0,c=!1,l=Promise.resolve().then(r);if(u){for(var f=0;f=t.length?Promise.resolve():la(this,t[e++]).then(i):Promise.reject(new h(2,9,9002))}.bind(this);return i()}.bind(t));return t.b={},t.g=Promise.all(i).then(function(){return na(this.h,"manifest-v2",e)}.bind(t)).then(function(t){return this.i=[],t}.bind(t)),t.g}function la(t,e){var i=M(e.uris,t.m);(e.N||null!=e.D)&&(i.headers.Range="bytes="+e.N+"-"+(null==e.D?"":e.D));var n;return t.j.request(1,i).then(function(t){return this.a?(n=t.data.byteLength,na(this.h,"segment-v2",{data:t.data})):Promise.reject(new h(2,9,9002))}.bind(t)).then(function(t){if(!this.a)return Promise.reject(new h(2,9,9002));this.a.size+=n,this.f+=null==e.D?e.gc:e.D-e.N+1,this.i.push(t),e.Wd(t),fa(this)}.bind(t))}function fa(t){var e=t.c?t.f/t.c:0,i=t.a.size;t.l.forEach(function(t){t(e,i)})}function da(t){return(t=/^offline:manifest\/([0-9]+)$/.exec(t))?Number(t[1]):null}function pa(t,e,i){var n=void 0==e.expiration?1/0:e.expiration,r=e.presentationTimeline.T();return e=se(e.periods[0]),{offlineUri:null,originalManifestUri:t,duration:r,size:0,expiration:n,tracks:e,appMetadata:i}}function ma(t,e){var i=ya(e.periods[0],[],new Ki(null,0)),n=e.appMetadata||{},i=se(i);return{offlineUri:t,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:e.expiration,tracks:i,appMetadata:n}}function ya(t,e,i){var n=t.streams.filter(wa);return e=ga(n,t.streams.filter(Ea),e),n=t.streams.filter(Sa).map(ba),t.streams.forEach(function(t){t=t.segments.map(function(t,e){return va(e,t)}),i.Ia(0,t)}),{startTime:t.startTime,variants:e,textStreams:n}}function va(t,e){var i="offline:segment/"+e.dataKey;return new ui(t,e.startTime,e.endTime,function(){return[i]},0,null)}function ga(t,e,i){var n={},r=[];return r.push.apply(r,t),r.push.apply(r,e),r.forEach(function(t){t.variantIds.forEach(function(t){n[t]||(n[t]={id:t,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:i,allowedByApplication:!0,allowedByKeySystem:!0})})}),t.forEach(function(t){var e=ba(t);t.variantIds.forEach(function(t){t=n[t],t.language=e.language,t.primary=t.primary||e.primary,t.audio=e})}),e.forEach(function(t){var e=ba(t);t.variantIds.forEach(function(t){t=n[t],t.primary=t.primary||e.primary,t.video=e})}),W(n)}function ba(t){var e=t.segments.map(function(t,e){return va(e,t)}),e=new gi(e),e={id:t.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:null,presentationTimeOffset:t.presentationTimeOffset,mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate||void 0,kind:t.kind,encrypted:t.encrypted,keyId:t.keyId,language:t.language,label:t.label||null,type:t.contentType,primary:t.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[],channelsCount:null};return null!=t.initSegmentKey&&(e.initSegmentReference=Ta(t.initSegmentKey)),e}function Ta(t){var e="offline:segment/"+t;return new oi(function(){return[e]},0,null)}function wa(t){return"audio"==t.contentType}function Ea(t){return"video"==t.contentType}function Sa(t){return"text"==t.contentType}function Aa(){if(!t.indexedDB)return Promise.reject(new h(2,9,9e3));var e=new Qr("shaka_offline_db");return e.init().then(function(){return e})}function ka(){this.a=-1}function Ia(t){var e=new Ki(null,0);e.fa(t.duration);var i=t.drmInfo?[t.drmInfo]:[];return{presentationTimeline:e,minBufferTime:2,offlineSessionIds:t.sessionIds,periods:t.periods.map(function(t){return ya(t,i,e)})}}function _a(t){if(null!=da(t))return _a.a(t);var e=(e=/^offline:segment\/([0-9]+)$/.exec(t))?Number(e[1]):null;return null!=e?_a.b(e,t):Promise.reject(new h(2,1,9004,t))}function Pa(t){this.a=null;for(var e=0;e=t.endTime)return null;var e=new VTTCue(t.startTime,t.endTime,t.payload);e.lineAlign=t.lineAlign,e.positionAlign=t.positionAlign,e.size=t.size;try{e.align=t.textAlign}catch(t){}return"center"==t.textAlign&&"center"!=e.align&&(e.align="middle"),t.writingDirection==Mu?e.vertical="lr":t.writingDirection==Cu&&(e.vertical="rl"),t.lineInterpretation==Uu&&(e.snapToLines=!1),null!=t.line&&(e.line=t.line),null!=t.position&&(e.position=t.position),e}function Ra(t,e){for(var i=t.b,n=[],r=0;r=n.a.length)t=i;else{var r=[];for(t=0;tt.textDecoration.indexOf("underline")&&t.textDecoration.push("underline");break;case"noUnderline":0<=t.textDecoration.indexOf("underline")&&j(t.textDecoration,"underline");break;case"lineThrough":0>t.textDecoration.indexOf("lineThrough")&&t.textDecoration.push("lineThrough");break;case"noLineThrough":0<=t.textDecoration.indexOf("lineThrough")&&j(t.textDecoration,"lineThrough");break;case"overline":0>t.textDecoration.indexOf("overline")&&t.textDecoration.push("overline");break;case"noOverline":0<=t.textDecoration.indexOf("overline")&&j(t.textDecoration,"overline")}}function go(t,e,i,n){return(t=To(t,i,n))?t:bo(e,i,n)}function bo(t,e,i){for(var n=mo(t),r=0;ri.length)return null;var n=null,r=t;for(t=null;r&&!(t=r.getAttribute(e))&&(r=r.parentNode)instanceof Element;);if(e=t)for(t=0;tthis.a?t:Math.min(a(this.b),a(this.c))},t.console&&t.console.log.bind&&(o=console.warn.bind(console)),e("shaka.util.Error",h),h.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},h.Severity={RECOVERABLE:1,CRITICAL:2},h.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},h.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7e3,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,CONTENT_UNSUPPORTED_BY_BROWSER:9009,UNSUPPORTED_UPGRADE_REQUEST:9010};var Mo=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;Lo=c.prototype,Lo.da="",Lo.Ba="",Lo.ia="",Lo.La=null,Lo.Y="",Lo.ua="",Lo.toString=function(){var t=[],e=this.da;if(e&&t.push(m(e,Co,!0),":"),e=this.ia){t.push("//");var i=this.Ba;i&&t.push(m(i,Co,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.La,null!=e&&t.push(":",String(e))}return(e=this.Y)&&(this.ia&&"/"!=e.charAt(0)&&t.push("/"),t.push(m(e,"/"==e.charAt(0)?Uo:Oo,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.ua)&&t.push("#",m(e,Bo)),t.join("")},Lo.resolve=function(t){var e=new c(this);"data"===e.da&&(e=new c);var i=!!t.da;i?l(e,t.da):i=!!t.Ba,i?e.Ba=t.Ba:i=!!t.ia,i?e.ia=t.ia:i=null!=t.La;var n=t.Y;if(i)f(e,t.La);else if(i=!!t.Y){if("/"!=n.charAt(0))if(this.ia&&!this.Y)n="/"+n;else{var r=e.Y.lastIndexOf("/");-1!=r&&(n=e.Y.substr(0,r+1)+n)}if(".."==n||"."==n)n="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){for(var r=!n.lastIndexOf("/",0),n=n.split("/"),a=[],s=0;sn||i&&1e3>n)&&!this.a[e].ma&&(this.a.splice(e,1),t.close()),st(this.F,.5)}},Lo.le=function(){function t(t,e){return"expired"==e}!$(this.A)&&J(this.A,t)&&this.g(new h(2,6,6014)),this.s.Pb(this.A)},Lo.Pd=function(){for(var t=0;t=this.b||(t<=this.a&&e>=this.b?this.a=this.b=null:t<=this.a&&ethis.a&&e>=this.b&&(this.b=t))}.bind(this))},Lo=Vt.prototype,Lo.destroy=function(){this.j=!0;var t,e=[];for(t in this.c){var i=this.c[t],n=i[0];for(this.c[t]=i.slice(0,1),n&&e.push(n.p.catch(x)),n=1;n=r.bandwidth/this.a.bandwidthDowngradeTarget&&e<=a&&(i=r)}return this.f=Date.now(),i},we.prototype.chooseVariant=we.prototype.chooseVariant,we.prototype.enable=function(){this.c=!0},we.prototype.enable=we.prototype.enable,we.prototype.disable=function(){this.c=!1},we.prototype.disable=we.prototype.disable,we.prototype.segmentDownloaded=function(t,e){var i=this.b;if(!(16e3>e)){var n=8e3*e/t,a=t/1e3;i.a+=e,r(i.b,a,n),r(i.c,a,n)}if(null!=this.f&&this.c)t:{if(this.i){if(Date.now()-this.f<1e3*this.a.switchInterval)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}i=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(i)}},we.prototype.segmentDownloaded=we.prototype.segmentDownloaded,we.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},we.prototype.getBandwidthEstimate=we.prototype.getBandwidthEstimate,we.prototype.setVariants=function(t){this.g=t},we.prototype.setVariants=we.prototype.setVariants,we.prototype.configure=function(t){this.a=t},we.prototype.configure=we.prototype.configure;var Yo="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),zo="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),$o=["loop","playbackRate"],Wo=["pause","play"],Jo="adaptation buffering emsg error loading streaming texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading".split(" "),Qo={drmInfo:20,getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getManifestUri:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1},Zo={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},tu=[["getConfiguration","configure"]],eu=[["isTextTrackVisible","setTextTrackVisibility"]],iu="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),nu=["load","unload"],ru=!1,au=null;Lo=Ie.prototype,Lo.destroy=function(){return Pe(this),au&&_e(this),this.F=this.A=this.g=null,this.b=this.h=!1,this.m=this.l=this.f=this.c=this.a=this.i=null,Promise.resolve()},Lo.X=function(){return this.b},Lo.Ub=function(){return this.w},Lo.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.h=!0,this.g();var e=new chrome.cast.SessionRequest(this.J),e=new chrome.cast.ApiConfig(e,this.wc.bind(this),this.Rd.bind(this),"origin_scoped");chrome.cast.initialize(e,function(){},function(){}),ru&&setTimeout(this.g.bind(this),20),(e=au)&&e.status!=chrome.cast.SessionStatus.STOPPED?this.wc(e):au=null}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},Lo.Xb=function(t){this.i=t,this.b&&xe({type:"appData",appData:this.i})},Lo.cast=function(t){return this.h?ru?this.b?Promise.reject(new h(1,8,8002)):(this.f=new b,chrome.cast.requestSession(this.Rb.bind(this,t),this.uc.bind(this)),this.f):Promise.reject(new h(1,8,8001)):Promise.reject(new h(1,8,8e3))},Lo.nb=function(){this.b&&(Pe(this),au&&(_e(this),au.stop(function(){},function(){}),au=null))},Lo.get=function(t,e){if("video"==t){if(0<=Wo.indexOf(e))return this.Ic.bind(this,t,e)}else if("player"==t){if(Zo[e]&&!this.get("player","isLive")())return function(){};if(0<=iu.indexOf(e))return this.Ic.bind(this,t,e);if(0<=nu.indexOf(e))return this.pe.bind(this,t,e);if(Qo[e])return this.Fc.bind(this,t,e)}return this.Fc(t,e)},Lo.set=function(t,e,i){this.a[t][e]=i,xe({type:"set",targetName:t,property:e,value:i})},Lo.Rb=function(t,e){au=e,e.addUpdateListener(this.l),e.addMessageListener("urn:x-cast:com.google.shaka.v2",this.m),this.vc(),xe({type:"init",initState:t,appData:this.i}),this.f.resolve()},Lo.uc=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.f.reject(new h(2,8,e,t))},Lo.Fc=function(t,e){return this.a[t][e]},Lo.Ic=function(t,e){xe({type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},Lo.pe=function(t,e){var i=Array.prototype.slice.call(arguments,2),n=new b,r=this.s.toString();return this.s++,this.c[r]=n,xe({type:"asyncCall",targetName:t,methodName:e,args:i,id:r}),n},Lo.wc=function(t){var e=this.u();this.f=new b,this.j=!0,this.Rb(e,t)},Lo.Rd=function(t){ru="available"==t,this.g()},Lo.vc=function(){var t=!!au&&"connected"==au.status;if(this.b&&!t){this.F();for(var e in this.a)this.a[e]={};Pe(this)}this.w=(this.b=t)?au.receiver.friendlyName:"",this.g()},Lo.Ld=function(t,e){var i=Ae(e);switch(i.type){case"event":var n=i.targetName,r=i.event;this.A(n,new X(r.type,r));break;case"update":r=i.update;for(n in r){var i=this.a[n]||{};for(a in r[n])i[a]=r[n][a]}this.j&&(this.K(),this.j=!1);break;case"asyncComplete":n=i.id;var a=i.error;if(i=this.c[n],delete this.c[n],i)if(a){n=new h(a.severity,a.category,a.code);for(r in a)n[r]=a[r];i.reject(n)}else i.resolve()}},Re.prototype.addEventListener=function(t,e){this.xb.push(t,e)},Re.prototype.removeEventListener=function(t,e){this.xb.remove(t,e)},Re.prototype.dispatchEvent=function(t){for(var e=this.xb.get(t.type)||[],i=0;ithis.G.byteLength&&ci();var e=new Uint8Array(this.G.buffer,this.G.byteOffset+this.a,t);return this.a+=t,new Uint8Array(e)},hi.prototype.readBytes=hi.prototype.Ma,hi.prototype.H=function(t){this.a+t>this.G.byteLength&&ci(),this.a+=t},hi.prototype.skip=hi.prototype.H,hi.prototype.Lc=function(t){this.at||t>this.G.byteLength)&&ci(),this.a=t},hi.prototype.seek=hi.prototype.seek,hi.prototype.Tb=function(){for(var t=this.a;this.ca()&&this.G.getUint8(this.a);)this.a+=1;return t=new Uint8Array(this.G.buffer,this.G.byteOffset+t,this.a-t),this.a+=1,tt(t)},hi.prototype.readTerminatedString=hi.prototype.Tb,e("shaka.util.Mp4Parser",li),li.prototype.C=function(t,e){var i=mi(t);return this.c[i]=0,this.b[i]=e,this},li.prototype.box=li.prototype.C,li.prototype.ba=function(t,e){var i=mi(t);return this.c[i]=1,this.b[i]=e,this},li.prototype.fullBox=li.prototype.ba,li.prototype.stop=function(){this.a=!0},li.prototype.stop=li.prototype.stop,li.prototype.parse=function(t,e){var i=new Uint8Array(t),i=new hi(new DataView(i.buffer,i.byteOffset,i.byteLength),0);for(this.a=!1;i.ca()&&!this.a;)this.rb(0,i,e)},li.prototype.parse=li.prototype.parse,li.prototype.rb=function(t,e,i){var n=e.U(),r=e.B(),a=e.B();switch(r){case 0:r=e.G.byteLength-n;break;case 1:r=e.Na()}var s=this.b[a];if(s){var o=null,u=null;1==this.c[a]&&(u=e.B(),o=u>>>24,u&=16777215),a=n+r,i&&a>e.G.byteLength&&(a=e.G.byteLength),a-=e.U(),e=0=i.startTime&&tt||t>=this.a.length?null:this.a[t]):null},gi.prototype.get=gi.prototype.get,gi.prototype.offset=function(t){for(var e=0;en.startTime?e||r.push(n):(.1t);++e);this.a.splice(0,e)},gi.prototype.evict=gi.prototype.Bb;var hu;Ti.prototype.ca=function(){return this.a.ca()},ki.prototype.parse=function(t,e,i,n){var r;if(e=new Ti(new DataView(e)),440786851!=wi(e).id)throw new h(2,3,3008);var a=wi(e);if(408125543!=a.id)throw new h(2,3,3009);for(e=a.a.byteOffset,a=new Ti(a.a),r=null;a.ca();){var s=wi(a);if(357149030==s.id){r=s;break}}if(!r)throw new h(2,3,3010);for(a=new Ti(r.a),r=1e6,s=null;a.ca();){var o=wi(a);if(2807729==o.id)r=Ai(o);else if(17545==o.id)if(s=o,4==s.a.byteLength)s=s.a.getFloat32(0);else{if(8!=s.a.byteLength)throw new h(2,3,3003);s=s.a.getFloat64(0)}}if(null==s)throw new h(2,3,3011);if(a=r/1e9,r=s*a,t=wi(new Ti(new DataView(t))),475249515!=t.id)throw new h(2,3,3007);return Ii(t,e,a,r,i,n)};var cu={},lu={};e("shaka.media.ManifestParser.registerParserByExtension",function(t,e){lu[t]=e}),e("shaka.media.ManifestParser.registerParserByMime",function(t,e){cu[t]=e}),e("shaka.media.PresentationTimeline",Ki),Ki.prototype.T=function(){return this.a},Ki.prototype.getDuration=Ki.prototype.T,Ki.prototype.fa=function(t){this.a=t},Ki.prototype.setDuration=Ki.prototype.fa,Ki.prototype.qd=function(){return this.c},Ki.prototype.getPresentationStartTime=Ki.prototype.qd,Ki.prototype.Pc=function(t){this.i=t},Ki.prototype.setClockOffset=Ki.prototype.Pc,Ki.prototype.ub=function(t){this.h=t},Ki.prototype.setStatic=Ki.prototype.ub,Ki.prototype.sd=function(){return this.f},Ki.prototype.getSegmentAvailabilityDuration=Ki.prototype.sd,Ki.prototype.Zb=function(t){this.f=t},Ki.prototype.setSegmentAvailabilityDuration=Ki.prototype.Zb,Ki.prototype.Qc=function(t){this.j=t},Ki.prototype.setDelay=Ki.prototype.Qc,Ki.prototype.Ia=function(t,e){e.length&&(this.b=e.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.b))},Ki.prototype.notifySegments=Ki.prototype.Ia,Ki.prototype.Mb=function(t){this.b=Math.max(this.b,t)},Ki.prototype.notifyMaxSegmentDuration=Ki.prototype.Mb,Ki.prototype.P=function(){return 1/0==this.a&&!this.h},Ki.prototype.isLive=Ki.prototype.P,Ki.prototype.wa=function(){return 1/0!=this.a&&!this.h},Ki.prototype.isInProgress=Ki.prototype.wa,Ki.prototype.ja=function(){return this.Fa(0)},Ki.prototype.getSegmentAvailabilityStart=Ki.prototype.ja,Ki.prototype.Fa=function(t){if(1/0==this.f)return this.g;var e=this.va();return Math.max(this.g,Math.min(e-this.f+t,e))},Ki.prototype.getSafeAvailabilityStart=Ki.prototype.Fa,Ki.prototype.Oc=function(t){this.g=t},Ki.prototype.setAvailabilityStart=Ki.prototype.Oc,Ki.prototype.va=function(){return this.P()||this.wa()?Math.min(Math.max(0,(Date.now()+this.i)/1e3-this.b-this.c),this.a):this.a},Ki.prototype.getSegmentAvailabilityEnd=Ki.prototype.va,Ki.prototype.pb=function(){var t=this.P()||this.wa()?this.j:0;return Math.max(0,this.va()-t)},Ki.prototype.getSeekRangeEnd=Ki.prototype.pb,e("shaka.dash.DashParser",qi),Lo=qi.prototype,Lo.configure=function(t){this.b=t},Lo.start=function(t,e){return this.g=[t],this.a=e,Gi(this).then(function(){return this.a&&Qi(this,0),this.c}.bind(this))},Lo.stop=function(){return this.b=this.a=null,this.g=[],this.c=null,this.i=[],this.j={},null!=this.f&&(t.clearTimeout(this.f),this.f=null),Promise.resolve()},Lo.update=function(){Gi(this).catch(function(t){this.a&&this.a.onError(t)}.bind(this))},Lo.onExpirationUpdated=function(){},Lo.ce=function(t,e){t.S=Zi(e,t.Z,null);var i=!1,n=Fe(e,"Role"),r=n.map(function(t){return t.getAttribute("value")}).filter(R),a=void 0;"text"==t.S.contentType&&(a="subtitle");for(var s=0;si.length||"data"!=i[0])throw new h(2,1,1004,e);if(i=i.slice(1).join(":").split(","),2>i.length)throw new h(2,1,1004,e);var n=i[0],i=t.decodeURIComponent(i.slice(1).join(",")),n=n.split(";"),r=null;if(1this.i?0:this.i;this.a.playbackRate&&this.a.playbackRate!=t&&er(this,this.a.playbackRate)},Lo.yc=function(){var t=tr(this);this.b.ga(this.a,"timeupdate"),this.g.cancel(),.001>Math.abs(this.a.currentTime-t)?(H(this.b,this.a,"seeking",this.Bc.bind(this)),H(this.b,this.a,"playing",this.zc.bind(this))):(K(this.b,this.a,"seeking",this.Sd.bind(this)),this.a.currentTime=t)},Lo.Sd=function(){H(this.b,this.a,"seeking",this.Bc.bind(this)),H(this.b,this.a,"playing",this.zc.bind(this))},Lo.Ac=function(){if(this.a.readyState&&!this.a.paused){this.a.readyState!=this.F&&(this.s=!1,this.F=this.a.readyState);var t=this.l.smallGapLimit,e=this.a.currentTime,i=this.a.buffered,n=this.c.presentationTimeline.ja();if(ei.end(0)-i.start(0))){n=.1,/(Edge\/|Trident\/|Tizen)/.test(navigator.userAgent)&&(n=.5);for(var r=0;re&&(!r||i.end(r-1)-e<=n)){n=r;break t}}n=null}if(null==n){if(3>this.a.readyState&&0=i.start(t)&&e=a)){var a=r-e,t=a<=t,s=!1;t||this.s||(this.s=!0,a=new X("largegap",{currentTime:e,gapSize:a}),a.cancelable=!0,this.J(a),this.l.jumpLargeGaps&&!a.defaultPrevented&&(s=!0)),(t||s)&&(n&&i.end(n-1),nr(this,e,r))}}}}},Lo.Dd=function(){this.m=ir(this,this.a.currentTime)},Lo.Bc=function(){this.u=!1;var t=this.a.currentTime,e=ir(this,t);.001this.a.currentTime?1:e.info.endTime=n,i="ended"==this.w.readyState,e=e||this.a.ended||i;this.b?(i=1*Math.max(this.g.minBufferTime||0,this.u.rebufferingGoal),(e||t>=i)&&0!=this.b&&(this.b=!1,this.l(!1))):!e&&.5>t&&1!=this.b&&(this.b=!0,this.l(!0)),this.c.forEach(this.m.bind(this,!1))},Lo=hr.prototype,Lo.destroy=function(){for(var t in this.c)Br(this.c[t]);return this.h=this.c=this.j=this.g=this.m=this.b=this.a=null,this.f=!0,Promise.resolve()},Lo.configure=function(t){this.h=t,this.A=new T({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor,timeout:0},!0)},Lo.init=function(){var t=Zn(this.a.Ka),t=this.a.tc(this.b.periods[be(this.b,t)]);return t.variant||t.text?wr(this,t).then(function(){this.a&&this.a.Hd&&this.a.Hd()}.bind(this)):Promise.reject(new h(2,5,5005))},Lo.Ne=function(t){if(!this.f&&!t.ya&&null!=t.ra&&!t.ta)if(t.ra=null,t.sa)Ur(this,t,t.wb);else{try{var e=Ir(this,t);null!=e&&(jr(this,t,e),t.Ua=!1)}catch(t){return void Fr(this,t)}e=W(this.c),Mr(this,t),e.every(function(t){return t.endOfStream})&&this.a.L.endOfStream().then(function(){this.b.presentationTimeline.fa(this.a.L.T())}.bind(this))}},Lo.de=function(t,e,i){var n=i.o.Tb(),r=i.o.Tb(),a=i.o.B(),s=i.o.B(),o=i.o.B(),u=i.o.B(),h=i.o.Ma(i.o.G.byteLength-i.o.U());t=t.startTime+e.startTime+s/a,"urn:mpeg:dash:event:2012"==n?this.a.Jd():this.a.onEvent(new X("emsg",{detail:{startTime:t,endTime:t+o/a,schemeIdUri:n,value:r,timescale:a,presentationTimeDelta:s,eventDuration:o,id:u,messageData:h}})),i.oa.stop()},e("shaka.net.HttpPlugin",Vr),D("http",Vr,1),D("https",Vr,1),Gr.prototype.a=function(t){t.createObjectStore("manifest-v2",{autoIncrement:!0}),t.createObjectStore("segment-v2",{autoIncrement:!0})},Xr.prototype.a=function(t,e){function i(){o.clear(),s.clear()}function n(t,e,i){e=Yr(e),a.add(e,t).onsuccess=i}var r=t.createObjectStore("segment-v2"),a=t.createObjectStore("manifest-v2"),s=e.objectStore("segment"),o=e.objectStore("manifest");Hr(s,function(t,e,i){r.add({data:e.data},t).onsuccess=i},function(){Hr(o,n,i)})},Qr.prototype.init=function(t){var e=this.c;return Promise.resolve().then(function(){return Kr(e,t)}).then(function(t){this.b=t}.bind(this))},Qr.prototype.destroy=function(){return Promise.all(this.a.map(function(t){try{t.transaction.abort()}catch(t){}return t.M.catch(x)})).then(function(){this.b&&(this.b.close(),this.b=null)}.bind(this))},Qr.prototype.Ea=function(t){return ta(this,"manifest-v2",t)},oa.prototype.destroy=function(){var t=this.h,e=this.i,i=this.g||Promise.resolve();return e.length&&(i=i.then(function(){return ra(t,"segment-v2",e,null)})),this.b={},this.i=[],this.g=this.a=this.m=this.j=this.h=null,i},oa.prototype.s=function(t){this.c+=null==t.D?t.gc:t.D-t.N+1},Lo=ka.prototype,Lo.configure=function(){},Lo.start=function(t){var e=da(t);if(null==e)return Promise.reject(new h(2,1,9004,t));this.a=e;var i;return Aa().then(function(t){return i=t,i.Ea(e)}.bind(this)).then(function(t){if(!t)throw new h(2,9,9003,e);return Ia(t)}).then(function(t){return i.destroy().then(function(){return t})},function(t){return i.destroy().then(function(){throw t})})},Lo.stop=function(){return Promise.resolve()},Lo.update=function(){},Lo.onExpirationUpdated=function(t,e){var i,n=this.a;Aa().then(function(t){return i=t,i.Ea(n)}).then(function(r){if(r&&!(0>r.sessionIds.indexOf(t))&&(void 0==r.expiration||r.expiration>e))return r.expiration=e,ia(i,n,r)}).catch(function(){}).then(function(){return i.destroy()})},cu["application/x-offline-manifest"]=ka,e("shaka.offline.OfflineScheme",_a),_a.a=function(t){return t={uri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},Promise.resolve(t)},_a.b=function(t,e){var i,n;return Aa().then(function(e){return i=e,ta(i,"segment-v2",t)}).then(function(t){return n=t,i.destroy()}).then(function(){if(!n)throw new h(2,9,9003,t);return{uri:e,data:n.data,headers:{}}})},D("offline",_a),e("shaka.text.SimpleTextDisplayer",Pa),Pa.prototype.remove=function(t,e){return!!this.a&&(Ra(this,function(i){return!(i.startTime>=e||i.endTime<=t)}),!0)},Pa.prototype.remove=Pa.prototype.remove,Pa.prototype.append=function(t){for(var e=[],i=0;ithis.gb.indexOf(t.id)}.bind(this))},Da.prototype.getTextTracks=Da.prototype.vd,Da.prototype.xe=function(t){if(this.a){(t=ce(cr(this.a),t))&&(Fa(this,t,!1),this.Ca?this.W=t:gr(this.a,t,!0))}},Da.prototype.selectTextTrack=Da.prototype.xe,Da.prototype.ye=function(t,e){if(this.a){this.c.abr.enabled&&o("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=cr(this.a);(i=he(i,t))&&le(i)&&(Ba(this,i,!1),Ya(this,i,e))}},Da.prototype.selectVariantTrack=Da.prototype.ye,Da.prototype.kd=function(){if(!this.a)return[];var t=cr(this.a),t=fe(t.variants).map(function(t){return t.audio}).filter(N);return ja(t)},Da.prototype.getAudioLanguagesAndRoles=Da.prototype.kd,Da.prototype.ud=function(){return this.a?ja(cr(this.a).textStreams):[]},Da.prototype.getTextLanguagesAndRoles=Da.prototype.ud,Da.prototype.jd=function(){return this.a?fe(cr(this.a).variants).map(function(t){return t.language}).filter(N):[]},Da.prototype.getAudioLanguages=Da.prototype.jd,Da.prototype.td=function(){return this.a?cr(this.a).textStreams.map(function(t){return t.language}).filter(N):[]},Da.prototype.getTextLanguages=Da.prototype.td,Da.prototype.ve=function(t,e){if(this.a){var i=cr(this.a);this.Qa=t,this.cb=e||"",Ja(this,i)}},Da.prototype.selectAudioLanguage=Da.prototype.ve,Da.prototype.we=function(t,e){if(this.a){var i=cr(this.a);this.Ra=t,this.bb=e||"",Ja(this,i)}},Da.prototype.selectTextLanguage=Da.prototype.we,Da.prototype.Ib=function(){return this.u?this.u.isTextVisible():this.lb},Da.prototype.isTextTrackVisible=Da.prototype.Ib,Da.prototype.Be=function(t){this.u&&this.u.setTextVisibility(t),this.lb=t,ts(this),this.a&&(t?(t=cr(this.a),t=pe(t,this.Ra,this.bb)[0],mr(this.a,t)):(t=this.a,t.w=!0,t.c.text&&(Br(t.c.text),delete t.c.text)))},Da.prototype.setTextTrackVisibility=Da.prototype.Be,Da.prototype.pd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c+1e3*this.f.currentTime):null},Da.prototype.getPlayheadTimeAsDate=Da.prototype.pd,Da.prototype.rd=function(){return this.b?new Date(1e3*this.b.presentationTimeline.c):null},Da.prototype.getPresentationStartTimeAsDate=Da.prototype.rd,Da.prototype.Cb=function(){return this.J?this.J.Cb():{total:[],audio:[],video:[],text:[]}},Da.prototype.getBufferedInfo=Da.prototype.Cb,Da.prototype.getStats=function(){za(this),this.ab();var t=null,e=null,i=this.f,i=i&&i.getVideoPlaybackQuality?i.getVideoPlaybackQuality():{};if(this.g&&this.b){var n=be(this.b,Zn(this.g)),r=this.b.periods[n];(n=this.A[n])&&(e=ge(n.audio,n.video,r.variants),t=e.video||{})}return t||(t={}),e||(e={}),{width:t.width||0,height:t.height||0,streamBandwidth:e.bandwidth||0,decodedFrames:Number(i.totalVideoFrames),droppedFrames:Number(i.droppedVideoFrames),estimatedBandwidth:this.h?this.h.getBandwidthEstimate():NaN,loadLatency:this.j.loadLatency,playTime:this.j.playTime,bufferingTime:this.j.bufferingTime,switchHistory:I(this.j.switchHistory),stateHistory:I(this.j.stateHistory)}},Da.prototype.getStats=Da.prototype.getStats,Da.prototype.addTextTrack=function(t,e,i,n,r,a){if(!this.a)return Promise.reject();for(var s,o=cr(this.a),u=0;ue&&(e+=Math.pow(2,32)),e=e.toString(16)),this.Pa(new h(2,3,3016,t,e,this.f.error.message))}}},Lo.Id=function(t){var e=["output-restricted","internal-error"],i=cr(this.a),n=!1,r=Object.keys(t),a=1==r.length&&"00"==r[0];r.length&&i.variants.forEach(function(i){var r=[];i.audio&&r.push(i.audio),i.video&&r.push(i.video),r.forEach(function(r){var s=i.allowedByKeySystem;r.keyId&&(r=t[a?"00":r.keyId],i.allowedByKeySystem=!!r&&0>e.indexOf(r)),s!=i.allowedByKeySystem&&(n=!0)})}),(r=ve(fr(this.a),dr(this.a),i.variants))&&!r.allowedByKeySystem&&Ja(this,i),n&&Za(this)},Lo.Fd=function(t,e){this.i&&this.i.onExpirationUpdated&&this.i.onExpirationUpdated(t,e),this.dispatchEvent(new X("expirationupdated"))},e("shaka.offline.Storage",es),es.support=is,es.prototype.destroy=function(){var t=this.g,e=this.c?this.c.destroy().catch(function(){}).then(function(){if(t)return t.destroy()}):Promise.resolve();return this.b=this.a=this.c=this.g=null,e},es.prototype.destroy=es.prototype.destroy,es.prototype.configure=function(t){k(this.b,t,os(this),{},"")},es.prototype.configure=es.prototype.configure,es.prototype.Oe=function(t,e,i){function n(t){a=t}if(this.l)return Promise.reject(new h(2,9,9006));this.l=!0;var r=e||{},a=null;return us(this).then(function(){return ps(this),ss(this,t,n,i)}.bind(this)).then(function(e){if(ps(this),a)throw a;return ns(this,t,e.manifest,r,e.fd)}.bind(this)).then(function(t){return ps(this),hs(this).then(function(){return t})}.bind(this)).catch(function(t){return a=a||t,hs(this).then(function(){throw a})}.bind(this))},es.prototype.store=es.prototype.Oe,es.prototype.remove=function(t){return t.offlineUri?(o("Removing downloaded content using shakaExtern.StoredContent is deprecated. Please remove using the offline uri."),rs(this,t.offlineUri)):rs(this,t)},es.prototype.remove=es.prototype.remove,es.prototype.list=function(){var t=[];return us(this).then(function(){return ps(this),Zr(this.g,function(e,i){var n=ma("offline:manifest/"+e,i);t.push(n)})}.bind(this)).then(function(){return t})},es.prototype.list=es.prototype.list,es.prototype.u=function(t){for(var e,i=[],n=Zt(this.a.getConfiguration().preferredAudioLanguage),r=[0,qo,Go],a=t.filter(function(t){return"variant"==t.type}),r=r.map(function(t){return a.filter(function(e){return e=Zt(e.language),Qt(t,n,e)})}),s=0;s=t.height});return o.length&&(o.sort(function(t,e){return e.height-t.height}),e=o.filter(function(t){return t.height==o[0].height})),e.sort(function(t,e){return t.bandwidth-e.bandwidth}),e.length&&i.push(e[Math.floor(e.length/2)]),i.push.apply(i,t.filter(function(t){return"text"==t.type})),i},es.prototype.j=function(t){t.forEach(this.m.bind(this))},es.prototype.m=function(t){var e=null;if(this.i){var i=this.i.filter(function(t){return"variant"==t.type})[0];i&&(e=he(t,i))}var n=i=null;e&&(e.audio&&(i=e.audio),e.video&&(n=e.video)),ie(this.f,i,n,t),ee(t,this.a.getConfiguration().restrictions,{width:1/0,height:1/0})},es.prototype.w=function(t){var e,i,n=oe(t,null,null),r=ue(t,null),n=this.b.trackSelectionCallback(n.concat(r));for(this.i||(this.i=n,this.j(this.h.periods)),r=n.length-1;0navigator.userAgent.indexOf("Trident/")||HTMLInputElement.prototype.addEventListener==gs||(wu=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=gs)}),ys(function(){if(4503599627370497!=Math.round(4503599627370497)){var t=Math.round;Math.round=function(e){var i=e;return 4503599627370496>=e&&(i=t(e)),i}}}),bs.prototype.c=function(t){if(!(1s[0].indexOf("--\x3e")&&(u=s[0],s.splice(0,1));var c=new mn(s[0]),l=Po(c),f=yn(c,/[ \t]+--\x3e[ \t]+/g),d=Po(c);if(null==l||!f||null==d)throw new h(2,2,2001);for(s=new fo(l+o,d+o,s.slice(1).join("\n").trim()),yn(c,/[ \t]+/gm),o=vn(c);o;)_o(s,o),yn(c,/[ \t]+/gm),o=vn(c);null!=u&&(s.id=u),u=s}u&&a.push(u)}return a},Ko["text/vtt"]=Io,Ko['text/vtt; codecs="vtt"']=Io,xo.prototype.parseInit=function(t){var e=!1;if((new li).C("moov",fi).C("trak",fi).C("mdia",fi).ba("mdhd",function(t){0==t.version?(t.o.H(4),t.o.H(4),this.a=t.o.B(),t.o.H(4)):(t.o.H(8),t.o.H(8),this.a=t.o.B(),t.o.H(8)),t.o.H(4)}.bind(this)).C("minf",fi).C("stbl",fi).ba("stsd",di).C("wvtt",function(){e=!0}).parse(t),!this.a)throw new h(2,2,2008);if(!e)throw new h(2,2,2008)},xo.prototype.parseMedia=function(t,e){if(!this.a)throw new h(2,2,2008);var i=0,n=[],r=[],a=[],s=!1,o=!1,u=!1,c=null;if((new li).C("moof",fi).C("traf",fi).ba("tfdt",function(t){s=!0,i=t.version?t.o.Na():t.o.B()}).ba("tfhd",function(t){var e=t.lc;t=t.o,t.H(4),1&e&&t.H(8),2&e&&t.H(4),c=8&e?t.B():null}).ba("trun",function(t){o=!0;var e=t.version,i=t.lc;t=t.o;var r=t.B();1&i&&t.H(4),4&i&&t.H(4);for(var a=[],s=0;s