aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/clapprio/dash-shaka-playback.js97
-rw-r--r--model/Room.php6
-rw-r--r--template/assemblies/player/dash.phtml14
-rw-r--r--template/assemblies/switcher/dash.phtml8
4 files changed, 112 insertions, 13 deletions
diff --git a/assets/clapprio/dash-shaka-playback.js b/assets/clapprio/dash-shaka-playback.js
index fc12904..36e555c 100644
--- a/assets/clapprio/dash-shaka-playback.js
+++ b/assets/clapprio/dash-shaka-playback.js
@@ -1,5 +1,92 @@
-!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)}(this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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 a=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),o=function(t,e,i){for(var n=!0;n;){var r=t,s=e,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(a)}var h=Object.getPrototypeOf(r);if(null===h)return;t=h,e=s,i=a,n=!0,o=h=void 0}},u=i(2),h=i(1),c=n(h),l=3e4,f=-1,d="shaka:ready",p=function(t){function e(t){r(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this._levels=[],t.autoPlay&&this.play()}return s(e,t),a(e,[{key:"name",get:function(){return"dash_shaka_playback"}},{key:"shakaVersion",get:function(){return c["default"].player.Player.version}},{key:"levels",get:function(){return this._levels}},{key:"currentLevel",set:function(t){var e=this;this._currentLevelId=t;var i=this._currentLevelId===f;this._player.configure({abr:{enable:!i}}),this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_START),i||this.selectTrack(this.videoTracks.filter(function(t){return t.id===e._currentLevelId})[0]),this.trigger(u.Events.PLAYBACK_LEVEL_SWITCH_END)},get:function(){return this._currentLevelId||f}}]),a(e,[{key:"play",value:function(){return!this._player&&this._setup(),this.isReady?(this._src=this.el.src,void o(Object.getPrototypeOf(e.prototype),"play",this).call(this)):void this.once(d,this.play)}},{key:"setupSrc",value:function(){}},{key:"_ready",value:function(){}},{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!!this.highDefinition}},{key:"stop",value:function(){var t=this;clearInterval(this.sendStatsId),this._sendStats(),this._player.unload().then(function(){o(Object.getPrototypeOf(e.prototype),"stop",t).call(t),t._player=null,t._isShakaReadyState=!1})["catch"](function(){u.Log.error("shaka could not be unloaded")})}},{key:"getPlaybackType",value:function(){return(this._player&&this._player.isLive()?"live":"vod")||""}},{key:"selectTrack",value:function(t){this._player.selectTrack(t),this._onAdaptation()}},{key:"destroy",value:function(){var t=this;clearInterval(this.sendStatsId),this._player?this._destroy():this._player.destroy().then(function(){return t._destroy()})["catch"](function(){t._destroy(),u.Log.error("shaka could not be destroyed")})}},{key:"_setup",value:function(){var t=this;this._isShakaReadyState=!1,this._player=this._createPlayer(),this._options.shakaConfiguration&&this._player.configure(this._options.shakaConfiguration),this._options.shakaOnBeforeLoad&&this._options.shakaOnBeforeLoad(this._player);var e=this._player.load(this._options.src);e.then(function(){return t._loaded()})["catch"](function(e){return t._setupError(e)})}},{key:"_createPlayer",value:function(){var t=this,e=new c["default"].Player(this.el);return e.addEventListener("error",function(e,i){return t._error(e,i)}),e.addEventListener("adaptation",function(){return t._onAdaptation()}),e.addEventListener("buffering",function(e){return t._onBuffering(e)}),e}},{key:"_onBuffering",value:function(t){var e=t.buffering?u.Events.PLAYBACK_BUFFERING:u.Events.PLAYBACK_BUFFERFULL;this.trigger(e)}},{key:"_loaded",value:function(){this._isShakaReadyState=!0,this.trigger(d),this._shakaReady(),this._startToSendStats(),this._fillLevels()}},{key:"_fillLevels",value:function(){0===this._levels.length&&(this._levels=this.videoTracks.map(function(t){return{id:t.id,label:t.height+"p"}}).reverse(),this.trigger(u.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels))}},{key:"_startToSendStats",value:function(){var t=this;this.sendStatsId=setInterval(function(){return t._sendStats()},l)}},{key:"_sendStats",value:function(){this.trigger(u.Events.PLAYBACK_STATS_ADD,this._player.getStats())}},{key:"_setupError",value:function(t){this._error("error",{detail:t.detail})}},{key:"_error",value:function(t,i){u.Log.error("an error was raised support=",e.support),u.Log.error("an error was raised by shaka player",i.detail),this.trigger(u.Events.PLAYBACK_ERROR,i.detail,this.name)}},{key:"_onAdaptation",value:function(){var t=this.videoTracks.filter(function(t){return t.active===!0})[0];this._fillLevels(),u.Log.debug("an adaptation has happened:",t),this.highDefinition=t.height>=720,this.trigger(u.Events.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(u.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,width:t.width,height:t.height,level:t.id})}},{key:"_destroy",value:function(){o(Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,u.Log.debug("shaka was destroyed")}},{key:"_shakaReady",value:function(){o(Object.getPrototypeOf(e.prototype),"_ready",this).call(this)}},{key:"isReady",get:function(){return this._isShakaReadyState}},{key:"textTracks",get:function(){return this._player&&this._player.getTracks().filter(function(t){return"text"===t.type})}},{key:"audioTracks",get:function(){return this._player&&this._player.getTracks().filter(function(t){return"audio"===t.type})}},{key:"videoTracks",get:function(){return this._player&&this._player.getTracks().filter(function(t){return"video"===t.type})}}]),e}(u.HTML5Video);e["default"]=p,p.canPlay=function(t){var e=arguments.length<=1||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)},t.exports=e["default"]},function(t,e,i){var n;!function(){var r={};(function(t){function e(t,e){var i=t.split("."),n=Yr;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=je;e.prototype=i.prototype,t.md=i.prototype,t.prototype=new e,t.prototype.constructor=t,t.fd=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 s(t){return t.a/(1-Math.pow(t.c,t.b))}function a(){this.c=new n(2),this.f=new n(5),this.a=0,this.b=5e5}function o(){}function u(){}function h(){this.g=null,this.f=!1,this.b=new a,this.h={},this.a={},this.i=!1,this.c=null}function c(t){return(t=t.h.audio)?(t=f(t),t[Math.floor(t.length/2)]):null}function l(t){var e=t.h.video;if(!e)return null;var e=f(e),i=t.a.audio,i=i&&i.bandwidth||0;t=t.b.getBandwidthEstimate();for(var n=e[0],r=0;r<e.length;++r){var s=e[r];if(s.bandwidth){var a=((r+1<e.length?e[r+1]:{bandwidth:1/0}).bandwidth+i)/.85;t>=(s.bandwidth+i)/.95&&t<=a&&(n=s)}}return n}function f(t){return t.streams.slice(0).filter(function(t){return t.allowedByApplication&&t.allowedByKeySystem}).sort(function(t,e){return t.bandwidth-e.bandwidth})}function d(t){var e;t instanceof d?(p(this,t.R),this.ka=t.ka,this.T=t.T,m(this,t.wa),this.O=t.O,y(this,E(t.a)),this.ca=t.ca):t&&(e=String(t).match(Wr))?(p(this,e[1]||"",!0),this.ka=b(e[2]||""),this.T=b(e[3]||"",!0),m(this,e[4]),this.O=b(e[5]||"",!0),y(this,e[6]||"",!0),this.ca=b(e[7]||"")):this.a=new w(null)}function p(t,e,i){t.R=i?b(e,!0):e,t.R&&(t.R=t.R.replace(/:$/,""))}function m(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.wa=e}else t.wa=null}function y(t,e,i){e instanceof w?t.a=e:(i||(e=g(e,Qr)),t.a=new w(e))}function b(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function g(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 w(t){this.b=t||null}function E(t){var e=new w;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 S(t,e,i){this.category=t,this.code=e,this.data=Array.prototype.slice.call(arguments,2)}function T(t,e){return t.reduce(function(t,e,i){return e["catch"](t.bind(null,i))}.bind(null,e),Promise.reject())}function k(t,e){return t.concat(e)}function P(){}function A(t){return null!=t}function I(t){return function(e){return e!=t}}function _(){}function R(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i}function N(t){this.f=!1,this.a=[],this.b=[],this.c=[],this.g=t||null}function C(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function M(t,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:e}}function x(t,e,i){for(var n=0;n<t.length;++n)if(i(t[n],e))return n;return-1}function D(){this.a={}}function O(){this.a=new D}function L(t,e,i,n){e=new U(e,i,n),t.a.push(i,e)}function j(t){var e,i=t.a,n=[];for(e in i.a)n.push.apply(n,i.a[e]);for(i=0;i<n.length;++i)n[i].ja();t.a.a={}}function U(t,e,i){this.target=t,this.type=e,this.a=i,this.target.addEventListener(e,i,!1)}function B(t){return!t||!Object.keys(t).length}function F(t){return Object.keys(t).map(function(e){return t[e]})}function K(t,e){return Object.keys(t).reduce(function(i,n){return i[n]=e(t[n],n),i},{})}function V(t,e){return Object.keys(t).every(function(i){return e(i,t[i])})}function q(t){if(!t)return"";t=new Uint8Array(t),239==t[0]&&187==t[1]&&191==t[2]&&(t=t.subarray(3)),t=escape($(t));try{return decodeURIComponent(t)}catch(e){throw new S(2,2004)}}function H(t,e){if(!t)return"";if(t.byteLength%2)throw new S(2,2004);var i;if(t instanceof ArrayBuffer)i=t;else{var n=new Uint8Array(t.byteLength);n.set(new Uint8Array(t)),i=n.buffer}var n=t.byteLength/2,r=new Uint16Array(n);i=new DataView(i);for(var s=0;s<n;s++)r[s]=i.getUint16(2*s,e);return $(r)}function G(t){var e=new Uint8Array(t);if(239==e[0]&&187==e[1]&&191==e[2])return q(e);if(254==e[0]&&255==e[1])return H(e.subarray(2),!1);if(255==e[0]&&254==e[1])return H(e.subarray(2),!0);var i=function(t,e){return t.byteLength<=e||32<=t[e]&&126>=t[e]}.bind(null,e);if(!e[0]&&!e[2])return H(t,!1);if(!e[1]&&!e[3])return H(t,!0);if(i(0)&&i(1)&&i(2)&&i(3))return q(t);throw new S(2,2003)}function z(t){t=unescape(encodeURIComponent(t));for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=t.charCodeAt(i);return e.buffer}function $(t){for(var e="",i=0;i<t.length;i+=16e3)e+=String.fromCharCode.apply(null,t.subarray(i,i+16e3));return e}function Y(t){this.a=null,this.b=function(){this.a=null,t()}.bind(this)}function W(t){t.cancel(),t.a=setTimeout(t.b,100)}function X(e){return t.btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=*$/,"")}function J(e){e=t.atob(e.replace(/-/g,"+").replace(/_/g,"/"));for(var i=new Uint8Array(e.length),n=0;n<e.length;++n)i[n]=e.charCodeAt(n);return i}function Z(e){for(var i=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)i[n/2]=t.parseInt(e.substr(n,2),16);return i}function Q(t){for(var e="",i=0;i<t.length;++i){var n=t[i].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function tt(t,e){if(!t&&!e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!=e[i])return!1;return!0}function et(t,e,i){this.l=this.g=this.m=null,this.A=!1,this.b=null,this.f=new O,this.a=[],this.s=[],this.j=new R,this.G=t,this.i=null,this.h=function(t){this.j.reject(t),e(t)}.bind(this),this.w={},this.J=i,this.v=new Y(this.yc.bind(this)),this.C=this.c=!1,this.j["catch"](function(){})}function it(t,e){if(!t.g)return L(t.f,e,"encrypted",function(){this.f.ja(e,"encrypted"),this.h(new S(6,6010))}.bind(t)),Promise.resolve();t.l=e;var i=t.l.setMediaKeys(t.g),i=i["catch"](function(t){return Promise.reject(new S(6,6003,t.message))}),n=null;return t.b.serverCertificate&&(n=t.g.setServerCertificate(t.b.serverCertificate),n=n["catch"](function(t){return Promise.reject(new S(6,6004,t.message))})),Promise.all([i,n]).then(function(){return this.c?Promise.reject():(rt(this),void(this.b.initData.length||this.s.length||L(this.f,this.l,"encrypted",this.ec.bind(this))))}.bind(t))["catch"](function(t){return this.c?Promise.resolve():Promise.reject(t)}.bind(t))}function nt(t,e){return Promise.all(e.map(function(t){return ft(this,t).then(function(t){if(t)return t.remove()})}.bind(t)))}function rt(t){var e=t.b?t.b.initData:[];return e.forEach(function(t){dt(this,t.initDataType,t.initData)}.bind(t)),t.s.forEach(function(t){ft(this,t)}.bind(t)),e.length||t.s.length||t.j.resolve(),t.j}function st(t){return t.a.map(function(t){return t.ya.sessionId})}function at(t,e,i,n,r){var s=ht(t),a=0<=navigator.userAgent.indexOf("Edge/");e.periods.forEach(function(t){t.streamSets.forEach(function(t){"text"!=t.type&&(s&&(t.drmInfos=[s]),t.drmInfos.forEach(function(e){ut(this,e);var s=n[e.keySystem];s||(s={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:i?"required":"optional",sessionTypes:[i?"persistent-license":"temporary"],label:e.keySystem,drmInfos:[]},n[e.keySystem]=s,r.push(e.keySystem)),s.drmInfos.push(e),e.distinctiveIdentifierRequired&&(s.distinctiveIdentifier="required"),e.persistentStateRequired&&(s.persistentState="required");var o="video"==t.type?s.videoCapabilities:s.audioCapabilities,u=("video"==t.type?e.videoRobustness:e.audioRobustness)||"";t.streams.forEach(function(t){var i=t.mimeType;t.codecs&&(i+='; codecs="'+t.codecs+'"'),t.keyId&&e.keyIds.push(t.keyId),a&&"com.microsoft.playready"==e.keySystem&&o.length||o.push({robustness:u,contentType:i})}.bind(this))}.bind(this)))}.bind(this))}.bind(t))}function ot(t,e,i){if(1==i.length&&""==i[0])return Promise.reject(new S(6,6e3));var n=new R,r=n;return[!0,!1].forEach(function(t){i.forEach(function(i){var n=e[i];n.drmInfos.some(function(t){return!!t.licenseServerUri})==t&&(n.audioCapabilities.length||delete n.audioCapabilities,n.videoCapabilities.length||delete n.videoCapabilities,r=r["catch"](function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(i,[n])}.bind(this)))}.bind(this))}.bind(t)),r=r["catch"](function(){return Promise.reject(new S(6,6001))}),r=r.then(function(t){if(this.c)return Promise.reject();var i=t.getConfiguration();return this.m=(i.audioCapabilities||[]).concat(i.videoCapabilities||[]).map(function(t){return t.contentType}),this.m.length||(this.m=null),i=e[t.keySystem],ct(this,t.keySystem,i,i.drmInfos),this.b.licenseServerUri?t.createMediaKeys():Promise.reject(new S(6,6012))}.bind(t)).then(function(t){return this.c?Promise.reject():(this.g=t,void(this.A=!0))}.bind(t))["catch"](function(t){return this.c?Promise.resolve():(this.m=this.b=null,t instanceof S?Promise.reject(t):Promise.reject(new S(6,6002,t.message)))}.bind(t)),n.reject(),r}function ut(t,e){var i=e.keySystem;if(i){if(!e.licenseServerUri){var n=t.i.servers[i];n&&(e.licenseServerUri=n)}e.keyIds||(e.keyIds=[]),(i=t.i.advanced[i])&&(e.distinctiveIdentifierRequired||(e.distinctiveIdentifierRequired=i.distinctiveIdentifierRequired),e.persistentStateRequired||(e.persistentStateRequired=i.persistentStateRequired),e.videoRobustness||(e.videoRobustness=i.videoRobustness),e.audioRobustness||(e.audioRobustness=i.audioRobustness),e.serverCertificate||(e.serverCertificate=i.serverCertificate))}}function ht(e){if(B(e.i.clearKeys))return null;var i,n=[],r=[];for(i in e.i.clearKeys){var s=e.i.clearKeys[i],a=Z(i),s=Z(s),a={kty:"oct",kid:X(a),k:X(s)};n.push(a),r.push(a.kid)}return e=JSON.stringify({keys:n}),r=JSON.stringify({kids:r}),r=[{initData:new Uint8Array(z(r)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+t.btoa(e),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:r,keyIds:[]}}function ct(t,e,i,n){var r=[],s=[],a=[],o=[];lt(n,r,s,a,o),t.b={keySystem:e,licenseServerUri:r[0],distinctiveIdentifierRequired:"required"==i.distinctiveIdentifier,persistentStateRequired:"required"==i.persistentState,audioRobustness:i.audioCapabilities?i.audioCapabilities[0].robustness:"",videoRobustness:i.videoCapabilities?i.videoCapabilities[0].robustness:"",serverCertificate:s[0],initData:a,keyIds:o}}function lt(t,e,i,n,r){function s(t,e){return t.initDataType==e.initDataType&&tt(t.initData,e.initData)}t.forEach(function(t){if(-1==e.indexOf(t.licenseServerUri)&&e.push(t.licenseServerUri),t.serverCertificate&&-1==x(i,t.serverCertificate,tt)&&i.push(t.serverCertificate),t.initData&&t.initData.forEach(function(t){-1==x(n,t,s)&&n.push(t)}),t.keyIds)for(var a=0;a<t.keyIds.length;++a)-1==r.indexOf(t.keyIds[a])&&r.push(t.keyIds[a])})}function ft(t,e){var i;try{i=t.g.createSession("persistent-license")}catch(n){var r=new S(6,6005,n.message);return t.h(r),Promise.reject(r)}L(t.f,i,"message",t.wb.bind(t)),L(t.f,i,"keystatuseschange",t.rb.bind(t));var s={initData:null,ya:i,loaded:!1};return t.a.push(s),i.load(e).then(function(t){if(!this.c){if(t)return s.loaded=!0,this.a.every(function(t){return t.loaded})&&this.j.resolve(),i;this.a.splice(this.a.indexOf(s),1),this.h(new S(6,6013))}}.bind(t),function(t){this.c||(this.a.splice(this.a.indexOf(s),1),this.h(new S(6,6005,t.message)))}.bind(t))}function dt(t,e,i){var n;try{n=t.C?t.g.createSession("persistent-license"):t.g.createSession()}catch(r){return void t.h(new S(6,6005,r.message))}L(t.f,n,"message",t.wb.bind(t)),L(t.f,n,"keystatuseschange",t.rb.bind(t)),t.a.push({initData:i,ya:n,loaded:!1}),n.generateRequest(e,i.buffer)["catch"](function(t){if(!this.c){for(var e=0;e<this.a.length;++e)if(this.a[e].ya==n){this.a.splice(e,1);break}this.h(new S(6,6006,t.message))}}.bind(t))}function pt(t){for(var e=H(t.body,!0),e=(new DOMParser).parseFromString(e,"application/xml"),i=e.getElementsByTagName("HttpHeader"),n=0;n<i.length;++n)t.headers[i[n].querySelector("name").textContent]=i[n].querySelector("value").textContent;t.body=J(e.querySelector("Challenge").textContent).buffer}function mt(){var t=[],e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],i=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],n={};return"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(e){var r=navigator.requestMediaKeySystemAccess(e,i).then(function(t){return t.createMediaKeys()}).then(function(t){var i=!1;try{t.createSession("persistent-license"),i=!0}catch(r){}n[e]={persistentState:i}},function(){n[e]=null});t.push(r)}),Promise.all(t).then(function(){return n})}function yt(){var t,e={};for(t in is)e[t]=!0;for(t in ns)e[t]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(t){e[t]=!!is[t]}),["mpd","m3u8","ism"].forEach(function(t){e[t]=!!ns[t]}),e}function bt(t,e,i,n){var r=n;return r||(n=new d(t).O.split("/").pop().split("."),1<n.length&&(n=n.pop().toLowerCase(),r=ns[n])),r?Promise.resolve(r):(i=M([t],i),i.method="HEAD",e.request(0,i).then(function(e){return(e=e.headers["content-type"])&&(e=e.toLowerCase()),(r=is[e])?r:Promise.reject(new S(4,4e3,t))},function(t){return Promise.reject(t)}))}function gt(t,e,i){this.h=rs[e],this.c=t,this.g=0,this.f=1/0,this.a=this.b=null,this.i=i}function vt(t,e,i){return t>=e?null:new ss(t,e,i)}function wt(t,e,i,n){var r=t.g;return Promise.resolve().then(function(){if(this.c){var t=this.h(e,r,i,n,this.i);if(null!=i&&null!=n){for(var s=0;s<t.length&&!(t[s].startTime>=this.f);++s)this.c.addCue(t[s]);null==this.b&&(this.b=i),this.a=Math.min(n,this.f)}}}.bind(t))}function Et(t,e){return null==t.a||t.a<e||e<t.b?0:t.a-e}function St(t,e){for(var i=t.c.cues,n=[],r=0;r<i.length;++r)e(i[r])&&n.push(i[r]);for(r=0;r<n.length;++r)t.c.removeCue(n[r])}function Tt(t){return!t||1==t.length&&1e-6>t.end(0)-t.start(0)?null:t.length?t.end(t.length-1):null}function kt(t,e){var i=0;if(!t||1==t.length&&1e-6>t.end(0)-t.start(0))return i;var n=!1,r=1e-4;e||(r=.25);for(var s=0;s<t.length;++s)if(e+r>=t.start(s)&&e<t.end(s))i+=t.end(s)-e,n=!0;else if(n&&.04>=t.start(s)-t.end(s-1))i+=t.end(s)-t.start(s),i+=t.start(s)-t.end(s-1);else if(0<s&&e+r<t.start(s)&&e+r>=t.end(s-1)){if(!(.04>=t.start(s)-e))break;i+=t.end(s)-e,n=!0}else n=!1;return i}function Pt(t,e,i){this.f=t,this.h=e,this.j=i,this.c={},this.b=null,this.a={},this.g=new O,this.i=!1}function At(){var t={};return'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hvc1.1.6.L93.90",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(e){t[e]=!!rs[e]||MediaSource.isTypeSupported(e);var i=e.split(";")[0];t[i]=t[i]||t[e]}),t}function It(t,e){var i;return"text"==e?i=t.b.b:(i=Rt(t,e),i=!i||1==i.length&&1e-6>i.end(0)-i.start(0)?null:1==i.length&&0>i.start(0)?0:i.length?i.start(0):null),i}function _t(t,e,i){return"text"==e?(e=Et(t.b,i),e||(e=Et(t.b,i+.1))&&(e+=.1)):(t=Rt(t,e),e=kt(t,i),e||(e=kt(t,i+.1))&&(e+=.1)),e}function Rt(t,e){try{return t.c[e].buffered}catch(i){return null}}function Nt(t,e,i,n,r){return"text"==e?wt(t.b,i,n,r):Dt(t,e,t.Tc.bind(t,e,i))}function Ct(t,e){return"text"==e?t.b.remove(0,1/0):Dt(t,e,t.Bb.bind(t,e,0,t.h.duration))}function Mt(t,e,i){return"text"==e?(t.b.g=i,Promise.resolve()):Dt(t,e,t.Jc.bind(t,e,i))}function xt(t,e,i){return"text"==e?(t.b.f=i,Promise.resolve()):Promise.all([Dt(t,e,t.Lb.bind(t,e)),Dt(t,e,t.Hc.bind(t,e,i))])}function Dt(t,e,i){if(t.i)return Promise.reject();if(i={start:i,p:new R},t.a[e].push(i),1==t.a[e].length)try{i.start()}catch(n){"QuotaExceededError"==n.name?i.p.reject(new S(3,3017,e)):i.p.reject(new S(3,3015,n)),Lt(t,e)}return i.p}function Ot(t,e){if(t.i)return Promise.reject();var i,n=[];for(i in t.c){var r=new R,s={start:function(t){t.resolve()}.bind(null,r),p:r};t.a[i].push(s),n.push(r),1==t.a[i].length&&s.start()}return Promise.all(n).then(function(){var t,i;try{e()}catch(n){i=Promise.reject(new S(3,3015,n))}for(t in this.c)Lt(this,t);return i}.bind(t),function(){return Promise.reject()}.bind(t))}function Lt(t,e){t.a[e].shift();var i=t.a[e][0];if(i)try{i.start()}catch(n){i.p.reject(new S(3,3015,n)),Lt(t,e)}}function jt(t,e,i){this.a=t,this.L=e,this.D=i}function Ut(t,e,i,n,r,s){this.position=t,this.startTime=e,this.endTime=i,this.a=n,this.L=r,this.D=s}function Bt(t,e){this.j=t,this.i=e,this.c=this.a=1/0,this.b=1,this.g=this.f=0,this.h=!0}function Ft(t,e,i,n,r,s){this.a=t,this.c=e,this.j=i,this.s=n,this.l=r,this.m=s,this.b=new O,this.h=!1,this.g=1,this.i=this.f=null,0<t.readyState?this.sb():L(this.b,t,"loadedmetadata",this.sb.bind(this)),L(this.b,t,"ratechange",this.lc.bind(this)),Ht(this)}function Kt(t){return 0<t.a.readyState?Wt(t,t.a.currentTime):Vt(t)}function Vt(t){return t.s?Wt(t,t.s):1/0>t.c.da()?t.c.ra():Math.max(t.c.Ua(),t.c.ra())}function qt(t,e){e!=t.h&&(t.h=e,zt(t,t.g),t.l(e))}function Ht(e){Gt(e),e.i=t.setTimeout(e.pc.bind(e),250)}function Gt(e){e.i&&(t.clearTimeout(e.i),e.i=null)}function zt(e,i){null!=e.f&&(t.clearInterval(e.f),e.f=null),e.g=i,e.a.playbackRate=e.h||0>i?0:i,!e.h&&0>i&&(e.f=t.setInterval(function(){this.a.currentTime+=i/4}.bind(e),250))}function $t(t,e){var i=t.c,n=i.ra(),r=i.ea();return i.U()&&1/0!=i.c?(i=n+1,n=i+t.j,e>=n&&e<=r||kt(t.a.buffered,e)&&e>=i&&e<=r?e:e>r?r:r<n&&e>=i&&e<=r?e:Math.min(n+2,r)):e<n?n:e>r?r:e}function Yt(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 Wt(t,e){var i=t.c.ra();return e<i?i:(i=t.c.ea(),e>i?i:e)}function Xt(t,e,i){return i==e||t>=as&&i==e.split("-")[0]||t>=os&&i.split("-")[0]==e.split("-")[0]}function Jt(t){t=t.toLowerCase().split("-");var e=us[t[0]];return e&&(t[0]=e),t.join("-")}function Zt(t,e,i){var n=!1;return t.streamSets.forEach(function(t){t.streams.forEach(function(r){var s=r.allowedByApplication;r.allowedByApplication=!0,"video"==t.type?(r.width<e.minWidth||r.width>e.maxWidth||r.width>i.width||r.height<e.minHeight||r.height>e.maxHeight||r.height>i.height||r.width*r.height<e.minPixels||r.width*r.height>e.maxPixels||r.bandwidth<e.minVideoBandwidth||r.bandwidth>e.maxVideoBandwidth)&&(r.allowedByApplication=!1):"audio"==t.type&&(r.bandwidth<e.minAudioBandwidth||r.bandwidth>e.maxAudioBandwidth)&&(r.allowedByApplication=!1),s!=r.allowedByApplication&&(n=!0)})}),n}function Qt(t,e,i){var n="",r=null;for(t&&t.A&&(n=t.keySystem(),r=t.m),t=0;t<i.streamSets.length;++t){var s=i.streamSets[t];if(n&&s.drmInfos.length&&!s.drmInfos.some(function(t){return t.keySystem==n}))i.streamSets.splice(t,1),--t;else{for(var a=e[s.type],o=0;o<s.streams.length;++o){var u=s.streams[o],h=ae(u.mimeType,u.codecs);rs[h]||MediaSource.isTypeSupported(h)?r&&u.encrypted&&0>r.indexOf(h)?(s.streams.splice(o,1),--o):!a||u.mimeType==a.mimeType&&u.codecs.split(".")[0]==a.codecs.split(".")[0]||(s.streams.splice(o,1),--o):(s.streams.splice(o,1),--o)}s.streams.length||(i.streamSets.splice(t,1),--t)}}}function te(t,e){return t.streamSets.map(function(t){var i=e?e[t.type]:null;return t.streams.filter(function(t){return t.allowedByApplication&&t.allowedByKeySystem}).map(function(e){return{id:e.id,active:i==e,type:t.type,bandwidth:e.bandwidth,language:t.language,kind:e.kind||null,width:e.width||null,height:e.height||null,frameRate:e.frameRate||void 0,codecs:e.codecs||null}})}).reduce(k,[])}function ee(t,e){for(var i=0;i<t.streamSets.length;i++)for(var n=t.streamSets[i],r=0;r<n.streams.length;r++){var s=n.streams[r];if(s.id==e.id)return{stream:s,Wc:n}}return null}function ie(t){return t.streams.some(function(t){return t.allowedByApplication&&t.allowedByKeySystem})}function ne(t,e,i){var n={};t.streamSets.forEach(function(t){!ie(t)||t.type in n||(n[t.type]=t)});var r=0;return t.streamSets.forEach(function(t){if(ie(t)&&"video"==t.type){var e=se(t);e>r?(r=e,n.video=t):e==r&&re(t)<re(n.video)&&(n.video=t)}}),t.streamSets.forEach(function(t){ie(t)&&t.primary&&(n[t.type].primary?re(t)<re(n[t.type])&&(n[t.type]=t):n[t.type]=t)}),[os,as,0].forEach(function(r){t.streamSets.forEach(function(t){if(ie(t)){var s;if("audio"==t.type?s=e.preferredAudioLanguage:"text"==t.type&&(s=e.preferredTextLanguage),s){s=Jt(s);var a=Jt(t.language);Xt(r,s,a)&&(t.language==n[t.type].language?re(t)<re(n[t.type])&&(n[t.type]=t):n[t.type]=t,i&&(i[t.type]=!0))}}})}),n}function re(t){var e=0;return!t||1>t.streams.length?e:(t.streams.forEach(function(t){e+=t.bandwidth}),e/t.streams.length)}function se(t){var e=0;return t?(t.streams.forEach(function(t){t.height>e&&(e=t.height)}),e):e}function ae(t,e){var i=t;return e&&(i+='; codecs="'+e+'"'),i}function oe(t,e,i,n,r,s,a,o,u){this.m=t,this.c=e,this.S=i,this.a=n,this.G=r,this.v=s,this.j=a,this.w=o||null,this.A=u||null,this.h=null,this.i=1,this.C=Promise.resolve(),this.g=[],this.l={},this.b={},this.f=this.s=this.J=!1}function ue(t){return t.a.periods[Ie(t,Kt(t.m))]}function he(t){return K(t.b,function(t){return t.stream})}function ce(t,e){var i={};return i.text=e,fe(t,i)}function le(t,e,i,n){var r=t.b[e];!r&&"text"==e&&t.h.ignoreTextStreamFailures?ce(t,i):r&&(e=t.g[_e(t,i)])&&e.xa&&(e=t.l[i.id])&&e.xa&&r.stream!=i&&(r.stream=i,r.La=!0,n&&(r.aa?r.Pa=!0:r.ga?(r.la=!0,r.Pa=!0):(Me(r),Ne(t,r,!0))))}function fe(t,e){var i=Ie(t,Kt(t.m)),n=K(e,function(t){return ae(t.mimeType,t.codecs)});return t.c.init(n,t.h.useRelativeCueTimestamps),me(t),n=F(e),pe(t,n).then(function(){if(!this.f)for(var t in e){var n=e[t];this.b[t]||(this.b[t]={stream:n,type:t,ta:null,V:null,La:!0,Ma:i,endOfStream:!1,ga:!1,$:null,la:!1,Pa:!1,aa:!1,bb:!1},Ce(this,this.b[t],0))}}.bind(t))}function de(t,e){var i=t.g[e];if(i)return i.I;i={I:new R,xa:!1},t.g[e]=i;var n=t.a.periods[e].streamSets.map(function(t){return t.streams}).reduce(k,[]);return t.C=t.C.then(function(){if(!this.f)return pe(this,n)}.bind(t)).then(function(){this.f||(this.g[e].I.resolve(),this.g[e].xa=!0)}.bind(t))["catch"](function(t){this.f||(this.g[e].I.reject(),delete this.g[e],this.j(t))}.bind(t)),i.I}function pe(t,e){for(var i=[],n=0;n<e.length;++n){var r=e[n],s=t.l[r.id];s?i.push(s.I):(t.l[r.id]={I:new R,xa:!1},i.push(r.createSegmentIndex()))}return Promise.all(i).then(function(){if(!this.f)for(var t=0;t<e.length;++t){var i=this.l[e[t].id];i.xa||(i.I.resolve(),i.xa=!0)}}.bind(t))["catch"](function(t){if(!this.f)return this.l[r.id].I.reject(),delete this.l[r.id],Promise.reject(t)}.bind(t))}function me(t){var e=t.a.presentationTimeline.da();1/0>e?t.c.za(e):t.c.za(Math.pow(2,32))}function ye(t,e){var i,n,r=Kt(t.m);n=t.c;var s=e.type;n="text"==s?n.b.a:Tt(Rt(n,s));var s=e.ta&&e.V?t.a.periods[_e(t,e.ta)].startTime+e.V.endTime:r,a=_e(t,e.stream),o=Ie(t,s),u=t.a.periods[o];return i=a!=o?null:be(t,e,r,n,o),(i?u.startTime+i.startTime-r:_t(t.c,e.type,r))>=Math.max(t.i*Math.max(t.a.minBufferTime||0,t.h.rebufferingGoal),t.i*t.h.bufferingGoal)?.5:s>=t.a.presentationTimeline.da()?(e.endOfStream=!0,null):(e.endOfStream=!1,o!=a?(e.Ma=o,null):(i=be(t,e,r,n,a))?(ve(t,e,r,a,i),null):1)}function be(t,e,i,n,r){if(e.V&&e.stream==e.ta)return i=e.V.position+1,ge(t,e,r,i);if(i=e.V?e.stream.findSegmentPosition(Math.max(0,t.a.periods[_e(t,e.ta)].startTime+e.V.endTime-t.a.periods[r].startTime)):e.stream.findSegmentPosition(Math.max(0,(n||i)-t.a.periods[r].startTime)),null==i)return null;var s=null;return null==n&&(s=ge(t,e,r,Math.max(0,i-1))),s||ge(t,e,r,i)}function ge(t,e,i,n){return i=t.a.periods[i],(e=e.stream.getSegmentReference(n))?(t=t.a.presentationTimeline,n=t.ea(),i.startTime+e.endTime<t.sa()||i.startTime+e.startTime>n?null:e):null}function ve(t,e,i,n,r){var s=t.a.periods[n],a=e.stream,o=t.a.periods[n+1],u=null,u=o?o.startTime:t.a.presentationTimeline.da();n=Ee(t,e,n,u),e.ga=!0,e.La=!1,o=Re(t,r),Promise.all([n,o]).then(function(t){if(!this.f&&!this.s)return Se(this,e,i,s,a,r,t[1])}.bind(t)).then(function(){this.f||this.s||(e.ga=!1,e.bb=!1,Ce(this,e,0),ke(this,a))}.bind(t))["catch"](function(t){this.f||this.s||(e.ga=!1,1001==t.code||1002==t.code||1003==t.code?"text"==e.type&&this.h.ignoreTextStreamFailures&&1001==t.code?delete this.b.text:(this.j(t),Ce(this,e,4)):3017==t.code?we(this,e,t):this.j(t))}.bind(t))}function we(t,e,i){if(!F(t.b).some(function(t){return t!=e&&t.bb})){var n=Math.round(100*t.i);if(20<n)t.i-=.2;else{if(!(4<n))return t.s=!0,void t.j(i);t.i-=.04}e.bb=!0}Ce(t,e,4)}function Ee(t,e,i,n){return e.La?(i=Mt(t.c,e.type,t.a.periods[i].startTime-e.stream.presentationTimeOffset),n=null!=n?xt(t.c,e.type,n):Promise.resolve(),e.stream.initSegmentReference?(t=Re(t,e.stream.initSegmentReference).then(function(t){if(!this.f)return Nt(this.c,e.type,t,null,null)}.bind(t))["catch"](function(t){
-return e.La=!0,Promise.reject(t)}),Promise.all([i,n,t])):Promise.all([i,n])):Promise.resolve()}function Se(t,e,i,n,r,s,a){return Te(t,e,i).then(function(){if(!this.f)return Nt(this.c,e.type,a,s.startTime+n.startTime,s.endTime+n.startTime)}.bind(t)).then(function(){if(!this.f)return e.ta=r,e.V=s,Promise.resolve()}.bind(t))}function Te(t,e,i){var n=It(t.c,e.type);return null==n?Promise.resolve():(i=i-n-t.h.bufferBehind,0>=i?Promise.resolve():t.c.remove(e.type,n,n+i).then(function(){}.bind(t)))}function ke(t,e){if(!t.J&&(t.J=F(t.b).every(function(t){return!t.la&&!t.aa&&t.V}),t.J)){var i=_e(t,e);for(t.g[i]||de(t,i).then(function(){this.v()}.bind(t))["catch"](P),i=0;i<t.a.periods.length;++i)de(t,i)["catch"](P);t.A&&t.A()}}function Pe(t,e){if(e.Ma!=_e(t,e.stream)){var i=e.Ma,n=F(t.b);n.every(function(t){return t.Ma==i})&&n.every(Ae)&&de(t,i).then(function(){if(!this.f){var t,e=this.G(this.a.periods[i]);for(t in this.b)if(!e[t])return void this.j(new S(5,5005));for(t in e)if(!(this.b[t]||"text"==t&&this.h.ignoreTextStreamFailures))return void this.j(new S(5,5005));for(t in this.b){le(this,t,e[t],!1);var n=this.b[t];Ae(n)&&Ce(this,n,0)}this.v()}}.bind(t))["catch"](P)}}function Ae(t){return!t.ga&&null==t.$&&!t.la&&!t.aa}function Ie(t,e){for(var i=t.a.periods.length-1;0<i;--i)if(e>=t.a.periods[i].startTime)return i;return 0}function _e(t,e){for(var i=0;i<t.a.periods.length;++i)for(var n=t.a.periods[i],r=0;r<n.streamSets.length;++r)if(0<=n.streamSets[r].streams.indexOf(e))return i;return-1}function Re(t,e){var i=M(e.a(),t.h.retryParameters);if(e.L||null!=e.D){var n="bytes="+e.L+"-";null!=e.D&&(n+=e.D),i.headers.Range=n}return t.S.request(1,i).then(function(t){return t.data})}function Ne(t,e,i){e.la=!1,e.Pa=!1,e.aa=!0,Ct(t.c,e.type).then(function(){if(i){var t=this.c,n=e.type;return"text"==n?Promise.resolve():Dt(t,n,t.Ub.bind(t,n))}}.bind(t)).then(function(){this.f||(e.ta=null,e.V=null,e.aa=!1,Ce(this,e,0))}.bind(t))}function Ce(e,i,n){i.$=t.setTimeout(e.X.bind(e,i),1e3*n)}function Me(e){null!=e.$&&(t.clearTimeout(e.$),e.$=null)}function xe(){this.a=Promise.resolve(),this.c=this.b=this.f=!1,this.h=new Promise(function(t){this.g=t}.bind(this))}function De(t){return t.f||(t.a=t.a.then(function(t){return this.b=!0,Promise.resolve(t)}.bind(t),function(t){return this.b=!0,Promise.reject(t)}.bind(t))),t.f=!0,t.a}function Oe(t,e,i,n,r){var s,a=r in n;for(s in e){var o=r+"."+s,u=a?n[r]:i[s],h=!!{".abr.manager":!0}[o];(a||s in t)&&(void 0===e[s]?void 0===u||a?delete t[s]:t[s]=u:h?t[s]=e[s]:"object"==typeof t[s]&&"object"==typeof e[s]?Oe(t[s],e[s],u,n,o):typeof e[s]==typeof u&&(t[s]=e[s]))}}function Le(e,i){var n,r=i||{};for(n in r)this[n]=r[n];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=t.performance&&t.performance.now?t.performance.now():Date.now(),this.type=e,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function je(){this.Aa=new D,this.S=this}function Ue(t,e){je.call(this),this.A=!1,this.f=t,this.s=null,this.w=new O,this.Ja=new h,this.na=this.c=this.m=this.b=this.j=this.oa=this.G=this.h=this.g=this.i=null,this.Qa=1e9,this.ma=[],this.Ca=!1,this.qa=!0,this.l=null,this.v={},this.a=qe(this),this.Ba={width:1/0,height:1/0},this.C=[],this.X=this.J=this.pa=0,e&&e(this),this.i=new N(this.Oc.bind(this)),this.oa=Be(this);for(var i=0;i<this.f.textTracks.length;++i){var n=this.f.textTracks[i];n.mode="disabled","Shaka Player TextTrack"==n.label&&(this.s=n)}this.s||(this.s=this.f.addTextTrack("subtitles","Shaka Player TextTrack")),this.s.mode="hidden",L(this.w,this.f,"error",this.oc.bind(this))}function Be(e){e.h=new MediaSource;var i=new R;return L(e.w,e.h,"sourceopen",i.resolve),e.f.src=t.URL.createObjectURL(e.h),i}function Fe(t){t.m&&t.m.configure(t.a.manifest),t.g&&t.g.configure(t.a.drm),t.b&&(t.b.configure(t.a.streaming),t.c.periods.forEach(t.Na.bind(t)),$e(t,ue(t.b))),t.a.abr.enabled&&!t.qa?t.a.abr.manager.enable():t.a.abr.manager.disable(),t.a.abr.manager.setDefaultEstimate(t.a.abr.defaultBandwidthEstimate)}function Ke(t){t.w&&t.w.ja(t.h,"sourceopen"),t.f&&(t.f.removeAttribute("src"),t.f.load());var e=Promise.all([t.a?t.a.abr.manager.stop():null,t.g?t.g.o():null,t.G?t.G.o():null,t.j?t.j.o():null,t.b?t.b.o():null,t.m?t.m.stop():null]);return t.g=null,t.G=null,t.j=null,t.b=null,t.m=null,t.c=null,t.na=null,t.oa=null,t.h=null,t.v={},t.C=[],t.pa=0,t.J=0,e}function Ve(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:null}}}function qe(t){return{drm:{retryParameters:C(),servers:{},clearKeys:{},advanced:{}},manifest:{retryParameters:C(),dash:{customScheme:function(t){if(t)return null},clockSyncUri:""}},streaming:{retryParameters:C(),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,useRelativeCueTimestamps:!1},abr:{manager:t.Ja,enabled:!0,defaultBandwidthEstimate:5e5},preferredAudioLanguage:"",preferredTextLanguage:"",restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minAudioBandwidth:0,maxAudioBandwidth:1/0,minVideoBandwidth:0,maxVideoBandwidth:1/0}}}function He(t,e,i){for(var n in e){var r=e[n],s=i||!1;"text"==n&&(s=!0),t.qa?t.v[n]={stream:r,Rb:s}:le(t.b,n,r,s)}}function Ge(t){if(t.c){var e=Date.now()/1e3;t.Ca?t.J+=e-t.X:t.pa+=e-t.X,t.X=e}}function ze(t,e,i){if(!F(e).some(ie))return t.Z(new S(4,4012)),{};var n={};if(i)["video","audio","text"].forEach(function(t){t in e&&(n[t]=e[t])});else{i=he(t.b);for(var r in i){var s=i[r];s.allowedByApplication&&s.allowedByKeySystem&&e[r].language==s.language||(n[r]=e[r])}}if(B(n))return{};u(Object.keys(n));var a=t.a.abr.manager.chooseStreams(n);return V(n,function(t){return!!a[t]})?a:(t.Z(new S(4,4012)),{})}function $e(t,e){var i,n={audio:!1,text:!1},r=ne(e,t.a,n),s=ze(t,r);for(i in s)t.C.push({timestamp:Date.now()/1e3,id:s[i].id,type:i,fromAdaptation:!0});He(t,s,!0),Ye(t),r.text&&r.audio&&n.text&&r.text.language!=r.audio.language&&(t.s.mode="showing",Xe(t))}function Ye(t){Promise.resolve().then(function(){this.A||this.dispatchEvent(new Le("adaptation"))}.bind(t))}function We(t){Promise.resolve().then(function(){this.A||this.dispatchEvent(new Le("trackschanged"))}.bind(t))}function Xe(t){t.dispatchEvent(new Le("texttrackvisibility"))}function Je(t){return JSON.stringify(t,function(t,e){if("manager"!=t&&"function"!=typeof e){if(e instanceof Event||e instanceof Le){var i,n={};for(i in e){var r=e[i];r&&"object"==typeof r||i in Event||(n[i]=r)}return n}if(e instanceof TimeRanges)for(n={__type__:"TimeRanges",length:e.length,start:[],end:[]},i=0;i<e.length;++i)n.start.push(e.start(i)),n.end.push(e.end(i));else n="number"==typeof e?isNaN(e)?"NaN":isFinite(e)?e:0>e?"-Infinity":"Infinity":e;return n}})}function Ze(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__?Qe(e):e})}function Qe(t){return{length:t.length,start:function(e){return t.start[e]},end:function(e){return t.end[e]}}}function ti(t,e,i,n,r){this.C=t,this.l=e,this.w=i,this.A=n,this.s=r,this.f=this.j=this.g=!1,this.v="",this.a=this.i=null,this.b={video:{},player:{}},this.m=0,this.c={},this.h=null}function ei(t){for(var e in t.c){var i=t.c[e];delete t.c[e],i.reject(new S(7,7e3))}}function ii(t,e){var i=Je(e);t.a.sendMessage("urn:x-cast:com.google.shaka.v2",i,function(){},o)}function ni(t,e,i){je.call(this),this.c=t,this.b=e,this.i=this.f=this.g=this.j=this.l=null,this.a=new ti(i,this.Pc.bind(this),this.Qc.bind(this),this.Rc.bind(this),this.mb.bind(this)),ri(this)}function ri(t){t.a.init(),t.i=new O,cs.forEach(function(t){L(this.i,this.c,t,this.cd.bind(this))}.bind(t)),ps.forEach(function(t){L(this.i,this.b,t,this.xc.bind(this))}.bind(t)),t.l={};for(var e in t.c)Object.defineProperty(t.l,e,{configurable:!1,enumerable:!0,get:t.bd.bind(t,e),set:t.dd.bind(t,e)});t.j={};for(e in t.b)Object.defineProperty(t.j,e,{configurable:!1,enumerable:!0,get:t.wc.bind(t,e)});t.g=new je,t.g.S=t.l,t.f=new je,t.f.S=t.j}function si(t,e,i){je.call(this),this.b=t,this.a=e,this.j={video:t,player:e},this.l=i||function(){},this.i=!1,this.c=!0,this.f=this.g=null,ai(this)}function ai(e){var i=cast.receiver.CastReceiverManager.getInstance();i.onSenderConnected=e.vb.bind(e),i.onSenderDisconnected=e.vb.bind(e),i.onSystemVolumeChanged=e.Tb.bind(e),e.g=i.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.g.onMessage=e.hc.bind(e),i.start(),cs.forEach(function(t){this.b.addEventListener(t,this.yb.bind(this,"video"))}.bind(e)),ps.forEach(function(t){this.a.addEventListener(t,this.yb.bind(this,"player"))}.bind(e)),e.a.Gb(1920,1080),e.a.addEventListener("loading",function(){this.c=!1,oi(this)}.bind(e)),e.b.addEventListener("playing",function(){this.c=!1,oi(this)}.bind(e)),e.a.addEventListener("unloading",function(){this.c=!0,oi(this)}.bind(e)),e.b.addEventListener("ended",function(){t.setTimeout(function(){this.b&&this.b.ended&&(this.c=!0,oi(this))}.bind(this),5e3)}.bind(e))}function oi(t){Promise.resolve().then(function(){this.dispatchEvent(new Le("caststatuschanged"))}.bind(t))}function ui(t,e,i){for(var n in e.player)t.a[n](e.player[n]);t.l(i),i=Promise.resolve();var r=t.b.autoplay;e.manifest&&(t.b.autoplay=!1,i=t.a.load(e.manifest,e.startTime),i["catch"](function(t){this.a.dispatchEvent(new Le("error",{detail:t}))}.bind(t))),i.then(function(){for(var t in e.video){var i=e.video[t];this.b[t]=i}for(t in e.playerAfterLoad)i=e.playerAfterLoad[t],this.a[t](i);this.b.autoplay=r,e.manifest&&this.b.play()}.bind(t))}function hi(t,e,i){t.i&&(e=Je(e),i?t.g.getCastChannel(i).send(e):t.g.broadcast(e))}function ci(t,e){var i=li(t,e);return 1!=i.length?null:i[0]}function li(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return t.tagName==e})}function fi(t){var e=t.firstChild;return e&&e.nodeType==Node.TEXT_NODE?t.textContent.trim():null}function di(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 pi(t){return t?(t=Date.parse(t),isNaN(t)?null:Math.floor(t/1e3)):null}function mi(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 yi(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 bi(t){return t=Number(t),t%1?null:t}function gi(t){return t=Number(t),!(t%1)&&0<t?t:null}function vi(t){return t=Number(t),!(t%1)&&0<=t?t:null}function wi(t){var e;return t=(e=t.match(/^(\d+)\/(\d+)$/))?Number(e[1]/e[2]):Number(t),isNaN(t)?null:t}function Ei(t,e){var i=Pi(t),n=null,r=i.filter(function(t){return"urn:mpeg:dash:mp4protection:2011"!=t.Db||(n=t.init||n,!1)}),s=i.map(function(t){return t.keyId}).filter(A),a=null;if(0<s.length&&(a=s[0],s.some(I(a))))throw new S(4,4010);return s=[],0<r.length?(s=ki(n,e,r),s.length||(s=[Ti("",n)])):0<i.length&&(s=F(ws).map(function(t){return Ti(t,n)})),{jb:a,gd:n,drmInfos:s,lb:!0}}function Si(t,e,i){var n=Ei(t,e);if(i.lb)t=1==i.drmInfos.length&&!i.drmInfos[0].keySystem,e=!n.drmInfos.length,(!i.drmInfos.length||t&&!e)&&(i.drmInfos=n.drmInfos),i.lb=!1;else if(0<n.drmInfos.length&&(i.drmInfos=i.drmInfos.filter(function(t){return n.drmInfos.some(function(e){return e.keySystem==t.keySystem})}),!i.drmInfos.length))throw new S(4,4008);return n.jb||i.jb}function Ti(t,e){return{keySystem:t,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:e||[],keyIds:[]}}function ki(t,e,i){return i.map(function(i){var n=ws[i.Db];return n?[Ti(n,i.init||t)]:e(i.node)||[]}).reduce(k,[])}function Pi(t){return t.map(function(t){var e=t.getAttribute("schemeIdUri"),i=t.getAttribute("cenc:default_KID"),n=li(t,"cenc:pssh").map(fi);if(!e)return null;if(e=e.toLowerCase(),i&&(i=i.replace(/-/g,"").toLowerCase(),0<=i.indexOf(" ")))throw new S(4,4009);var r=[];try{r=n.map(function(t){return{initDataType:"cenc",initData:J(t)}})}catch(s){throw new S(4,4007)}return{node:t,Db:e,keyId:i,init:0<r.length?r:null}}).filter(A)}function Ai(e,i,n,r,s){null!==s&&(s=Math.round(s));var a={RepresentationID:i,Number:n,Bandwidth:r,Time:s};return e.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(e,i,n){if("$$"==e)return"$";var r=a[i];return null==r?e:("RepresentationID"==i&&n&&(n=void 0),e=r.toString(),n=t.parseInt(n,10)||1,Array(Math.max(0,n-e.length)+1).join("0")+e)})}function Ii(t,e,i){if(i.length){var n=i[0];n.startTime<=Es&&(i[0]=new Ut(n.position,0,n.endTime,n.a,n.L,n.D)),t||(t=i[i.length-1],t.startTime>e||(i[i.length-1]=new Ut(t.position,t.startTime,e,t.a,t.L,t.D)))}}function _i(t,e){if(!e.length)return t;var i=e.map(function(t){return new d(t)});return t.map(function(t){return new d(t)}).map(function(t){return i.map(t.resolve.bind(t))}).reduce(k,[]).map(function(t){return t.toString()})}function Ri(t,e){var i=Ni(t,e,"timescale"),n=1;i&&(n=gi(i)||1),i=Ni(t,e,"duration"),(i=gi(i||""))&&(i/=n);var r=Ni(t,e,"startNumber"),s=Ni(t,e,"presentationTimeOffset"),a=vi(r||"");null!=r&&null!=a||(a=1);var o=Ci(t,e,"SegmentTimeline"),r=null;if(o){for(var r=n,u=Number(s),h=t.H.duration||1/0,o=li(o,"S"),c=[],l=0,f=0;f<o.length;++f){var d=o[f],p=di(d,"t",vi),m=di(d,"d",vi),d=di(d,"r",bi);if(null!=p&&(p-=u),!m)break;if(p=null!=p?p:l,d=d||0,0>d)if(f+1<o.length){if(d=di(o[f+1],"t",vi),null==d)break;if(p>=d)break;d=Math.ceil((d-p)/m)-1}else{if(1/0==h)break;if(p/r>=h)break;d=Math.ceil((h*r-p)/m)-1}0<c.length&&p!=l&&(c[c.length-1].end=p/r);for(var y=0;y<=d;++y)l=p+m,c.push({start:p/r,end:l/r}),p=l}r=c}return{Ia:n,F:i,ha:a,presentationTimeOffset:Number(s)/n||0,B:r}}function Ni(t,e,i){return[e(t.u),e(t.P),e(t.K)].filter(A).map(function(t){return t.getAttribute(i)}).reduce(function(t,e){return t||e})}function Ci(t,e,i){return[e(t.u),e(t.P),e(t.K)].filter(A).map(function(t){return ci(t,i)}).reduce(function(t,e){return t||e})}function Mi(t){this.b=t,this.c=0==Ss,this.a=0}function xi(t){return t.a<t.b.byteLength}function Di(t){try{var e=t.b.getUint8(t.a)}catch(i){Ki()}return t.a+=1,e}function Oi(t){try{var e=t.b.getUint16(t.a,t.c)}catch(i){Ki()}return t.a+=2,e}function Li(t){try{var e=t.b.getUint32(t.a,t.c)}catch(i){Ki()}return t.a+=4,e}function ji(t){var e,i;try{t.c?(e=t.b.getUint32(t.a,!0),i=t.b.getUint32(t.a+4,!0)):(i=t.b.getUint32(t.a,!1),e=t.b.getUint32(t.a+4,!1))}catch(n){Ki()}if(2097151<i)throw new S(3,3001);return t.a+=8,i*Math.pow(2,32)+e}function Ui(t,e){t.a+e>t.b.byteLength&&Ki();var i=t.b.buffer.slice(t.a,t.a+e);return t.a+=e,new Uint8Array(i)}function Bi(t,e){t.a+e>t.b.byteLength&&Ki(),t.a+=e}function Fi(t){var e=t.a;try{for(;xi(t)&&t.b.getUint8(t.a);)t.a+=1}catch(i){Ki()}return e=t.b.buffer.slice(e,t.a),t.a+=1,q(e)}function Ki(){throw new S(3,3e3)}function Vi(t,e){for(;xi(e);){var i=e.a,n=Li(e),r=Li(e);if(1==n?n=ji(e):n||(n=e.b.byteLength-i),r==t)return n;Bi(e,n-(e.a-i))}return-1}function qi(t,e){for(var i=new Mi(new DataView(t)),n=[[1836019574,0],[1953653099,0],[1835297121,0],[1835626086,0],[1937007212,0],[1937011556,8],[e,0]],r=-1,s=0;s<n.length;s++){var a=n[s][1],r=Vi(n[s][0],i);if(-1==r)return-1;Bi(i,a)}return r}function Hi(t,e,i,n){var r=[];t=new Mi(new DataView(t));var s=Vi(1936286840,t);if(-1==s)throw new S(3,3004);var a=Di(t);Bi(t,3),Bi(t,4);var o=Li(t);if(!o)throw new S(3,3005);var u,h;for(a?(u=ji(t),h=ji(t)):(u=Li(t),h=Li(t)),Bi(t,2),a=Oi(t),n=u-n,e=e+s+h,s=0;s<a;s++){u=Li(t),h=(2147483648&u)>>>31,u&=2147483647;var c=Li(t);if(Bi(t,4),1==h)throw new S(3,3006);r.push(new Ut(r.length,n/o,(n+c)/o,function(){return i},e,e+u-1)),n+=c,e+=u}return r}function Gi(t){this.a=t}function zi(t){this.b=t,this.a=new Mi(t),Ts||(Ts=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function $i(t){var e;if(e=Yi(t),7<e.length)throw new S(3,3002);for(var i=0,n=0;n<e.length;n++)i=256*i+e[n];e=i,i=Yi(t);t:{for(n=0;n<Ts.length;n++)if(tt(i,Ts[n])){n=!0;break t}n=!1}if(n)i=t.b.byteLength-t.a.a;else{if(8==i.length&&224&i[1])throw new S(3,3001);for(var n=i[0]&(1<<8-i.length)-1,r=1;r<i.length;r++)n=256*n+i[r];i=n}return i=t.a.a+i<=t.b.byteLength?i:t.b.byteLength-t.a.a,n=new DataView(t.b.buffer,t.b.byteOffset+t.a.a,i),Bi(t.a,i),new Wi(e,n)}function Yi(t){var e,i=Di(t.a);for(e=1;8>=e&&!(i&1<<8-e);e++);if(8<e)throw new S(3,3002);var n=new Uint8Array(e);for(n[0]=i,i=1;i<e;i++)n[i]=Di(t.a);return n}function Wi(t,e){this.id=t,this.a=e}function Xi(t){if(8<t.a.byteLength)throw new S(3,3002);if(8==t.a.byteLength&&224&t.a.getUint8(0))throw new S(3,3001);for(var e=0,i=0;i<t.a.byteLength;i++)var n=t.a.getUint8(i),e=256*e+n;return e}function Ji(t,e,i,n,r,s){function a(){return r}var o=[];t=new zi(t.a);for(var u=-1,h=-1;xi(t.a);){var c=$i(t);if(187==c.id){var l=Zi(c);l&&(c=i*(l.ad-s),l=e+l.Ac,0<=u&&o.push(new Ut(o.length,u,c,a,h,l-1)),u=c,h=l)}}return 0<=u&&o.push(new Ut(o.length,u,n,a,h,null)),o}function Zi(t){var e=new zi(t.a);if(t=$i(e),179!=t.id)throw new S(3,3013);if(t=Xi(t),e=$i(e),183!=e.id)throw new S(3,3012);for(var e=new zi(e.a),i=0;xi(e.a);){var n=$i(e);if(241==n.id){i=Xi(n);break}}return{ad:t,Ac:i}}function Qi(t,e){var i=Ci(t,e,"Initialization");if(!i)return null;var n=t.u.M,r=i.getAttribute("sourceURL");r&&(n=_i(t.u.M,[r]));var r=0,s=null;return(i=di(i,"range",yi))&&(r=i.start,s=i.end),new jt(function(){return n},r,s)}function tn(t,e){var i,n=Ni(t,nn,"presentationTimeOffset"),r=Qi(t,nn);i=Number(n);var s=t.u.contentType,a=t.u.mimeType.split("/")[1];if("text"!=s&&"mp4"!=a&&"webm"!=a)throw new S(4,4006);if("webm"==a&&!r)throw new S(4,4005);var s=Ci(t,nn,"RepresentationIndex"),o=Ni(t,nn,"indexRange"),u=t.u.M,o=yi(o||"");if(s){var h=s.getAttribute("sourceURL");h&&(u=_i(t.u.M,[h])),o=di(s,"range",yi,o)}if(!o)throw new S(4,4002);return i=en(t,e,r,u,o.start,o.end,a,i),{createSegmentIndex:i.createSegmentIndex,findSegmentPosition:i.findSegmentPosition,getSegmentReference:i.getSegmentReference,initSegmentReference:r,presentationTimeOffset:Number(n)||0}}function en(t,e,i,n,r,s,a,o){var u=t.presentationTimeline,h=t.H.start,c=t.H.duration,l=e,f=null;return{createSegmentIndex:function(){var e=[l(n,r,s),"webm"==a?l(i.a(),i.L,i.D):null];return l=null,Promise.all(e).then(function(e){var i,s,l=e[0];if(e=e[1]||null,"mp4"==a)l=Hi(l,r,n,o);else{if(e=new zi(new DataView(e)),440786851!=$i(e).id)throw new S(3,3008);if(s=$i(e),408125543!=s.id)throw new S(3,3009);for(e=s.a.byteOffset,s=new zi(s.a),i=null;xi(s.a);){var d=$i(s);if(357149030==d.id){i=d;break}}if(!i)throw new S(3,3010);for(i=new zi(i.a),d=1e6,s=null;xi(i.a);){var p=$i(i);if(2807729==p.id)d=Xi(p);else if(17545==p.id)if(s=p,4==s.a.byteLength)s=s.a.getFloat32(0);else{if(8!=s.a.byteLength)throw new S(3,3003);s=s.a.getFloat64(0)}}if(null==s)throw new S(3,3011);if(i=d/=1e9,s*=d,l=$i(new zi(new DataView(l))),475249515!=l.id)throw new S(3,3007);l=Ji(l,e,i,s,n,o)}Ii(t.Ra,c,l),u.Fa(h,l),f=new Gi(l)})},findSegmentPosition:function(t){return f.find(t)},getSegmentReference:function(t){return f.get(t)}}}function nn(t){return t.Ga}function rn(t,e){var i,n=Qi(t,sn);i=on(t);var r=Ri(t,sn),s=r.ha;s||(s=1);var a=0;if(r.F?a=r.F*(s-1)-r.presentationTimeOffset:r.B&&0<r.B.length&&(a=r.B[0].start),i={F:r.F,startTime:a,ha:s,presentationTimeOffset:r.presentationTimeOffset,B:r.B,ua:i},!i.F&&!i.B&&1<i.ua.length)throw new S(4,4002);if(!i.F&&!t.H.duration&&!i.B&&1==i.ua.length)throw new S(4,4002);if(i.B&&!i.B.length)throw new S(4,4002);return s=r=null,t.K.id&&t.u.id&&(s=t.K.id+","+t.u.id,r=e[s]),a=an(t.H.duration,i.ha,t.u.M,i),Ii(t.Ra,t.H.duration,a),r?(r.Xa(a),r.Sa(t.presentationTimeline.sa()-t.H.start)):(t.presentationTimeline.Fa(t.H.start,a),r=new Gi(a),s&&(e[s]=r)),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:n,presentationTimeOffset:i.presentationTimeOffset}}function sn(t){return t.Y}function an(t,e,i,n){var r=n.ua.length;n.B&&n.B.length!=n.ua.length&&(r=Math.min(n.B.length,n.ua.length));for(var s=[],a=n.startTime,o=0;o<r;o++){var u,h=n.ua[o],c=_i(i,[h.dc]);u=null!=n.F?a+n.F:n.B?n.B[o].end:a+t,s.push(new Ut(o+e,a,u,function(t){return t}.bind(null,c),h.start,h.end)),a=u}return s}function on(t){return[t.u.Y,t.P.Y,t.K.Y].filter(A).map(function(t){return li(t,"SegmentURL")}).reduce(function(t,e){return 0<t.length?t:e}).map(function(t){var e=t.getAttribute("media");return t=di(t,"mediaRange",yi,{start:0,end:null}),{dc:e,start:t.start,end:t.end}})}function un(t,e,i,n){var r,s=fn(t);r=Ri(t,hn);var a=Ni(t,hn,"media"),o=Ni(t,hn,"index");if(r={F:r.F,Ia:r.Ia,ha:r.ha,presentationTimeOffset:r.presentationTimeOffset,B:r.B,Wa:a,Ea:o},a=0+(r.Ea?1:0),a+=r.B?1:0,a+=r.F?1:0,!a)throw new S(4,4002);if(1!=a&&(r.Ea&&(r.B=null),r.F=null),!r.Ea&&!r.Wa)throw new S(4,4002);if(r.Ea){if(i=t.u.mimeType.split("/")[1],"mp4"!=i&&"webm"!=i)throw new S(4,4006);if("webm"==i&&!s)throw new S(4,4005);n=Ai(r.Ea,t.u.id,null,t.bandwidth||null,null),n=_i(t.u.M,[n]),t=en(t,e,s,n,0,null,i,r.presentationTimeOffset)}else r.F?(n||t.presentationTimeline.Ya(r.F),t=cn(t,r)):(n=e=null,t.K.id&&t.u.id&&(n=t.K.id+","+t.u.id,e=i[n]),a=ln(t,r),Ii(t.Ra,t.H.duration,a),e?(e.Xa(a),e.Sa(t.presentationTimeline.sa()-t.H.start)):(t.presentationTimeline.Fa(t.H.start,a),e=new Gi(a),n&&(i[n]=e)),t={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e)});return{createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,initSegmentReference:s,presentationTimeOffset:r.presentationTimeOffset}}function hn(t){return t.Ha}function cn(t,e){var i=t.H.duration,n=e.F,r=e.ha,s=e.Ia,a=e.Wa,o=t.bandwidth||null,u=t.u.id,h=t.u.M;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0>t||i&&t>=i?null:Math.floor(t/n)},getSegmentReference:function(t){var e=t*n;return new Ut(t,e,e+n,function(){var i=Ai(a,u,t+r,o,e*s);return _i(h,[i])},0,null)}}}function ln(t,e){for(var i=[],n=0;n<e.B.length;n++){var r=e.B[n].start,s=n+e.ha;i.push(new Ut(s,r,e.B[n].end,function(t,e,i,n,r,s){return t=Ai(t,e,r,i,s),_i(n,[t]).map(function(t){return t.toString()})}.bind(null,e.Wa,t.u.id,t.bandwidth||null,t.u.M,s,(r+e.presentationTimeOffset)*e.Ia),0,null))}return i}function fn(t){var e=Ni(t,hn,"initialization");if(!e)return null;var i=t.u.id,n=t.bandwidth||null,r=t.u.M;return new jt(function(){var t=Ai(e,i,null,n,null);return _i(r,[t])},0,null)}function dn(){this.m=this.l=this.j=this.c=this.a=null,this.h=[],this.b=null,this.g=[],this.v=1,this.i={},this.s=0,this.f=null,this.Ka=this.Ka.bind(this)}function pn(t){return t.a.request(0,M(t.h,t.c.retryParameters)).then(function(t){if(this.a)return mn(this,t.data,t.uri)}.bind(t))}function mn(t,e,i){var n=q(e),r=new DOMParser,s=null;e=null;try{s=r.parseFromString(n,"text/xml")}catch(a){}if(s&&"MPD"==s.documentElement.tagName&&(e=s.documentElement),!e)throw new S(4,4001);i=[i],n=li(e,"Location").map(fi).filter(A),0<n.length&&(i=t.h=n),n=li(e,"BaseURL").map(fi),i=_i(i,n);var o=di(e,"minBufferTime",mi);t.s=di(e,"minimumUpdatePeriod",mi,-1);var u,h=di(e,"availabilityStartTime",pi),n=di(e,"timeShiftBufferDepth",mi),c=di(e,"suggestedPresentationDelay",mi),r=di(e,"maxSegmentDuration",mi),s=e.getAttribute("type")||"static";if(t.b)u=t.b.presentationTimeline;else{var l=Math.max(10,1.5*o);u=new Bt(h,null!=c?c:l)}var h=yn(t,{Ra:"static"!=s,presentationTimeline:u,K:null,H:null,P:null,u:null,bandwidth:void 0},i,e),c=h.duration,f=h.periods;return u.Ib("static"==s),u.za(c||1/0),u.Hb(null!=n?n:1/0),u.Ya(r||1),t.b?Promise.resolve():(e=li(e,"UTCTiming"),n=u.U(),h.ba&&t.a.zb(t.Ka),Sn(t,i,e,n).then(function(t){this.a&&(u.Fb(t),this.b={presentationTimeline:u,periods:f,offlineSessionIds:[],minBufferTime:o||0})}.bind(t)))}function yn(t,e,i,n){var r=di(n,"mediaPresentationDuration",mi),s=!1,a=[],o=0;n=li(n,"Period");for(var u=0;u<n.length;u++){var h=n[u],o=di(h,"start",mi,o),c=di(h,"duration",mi);if(null==c)if(u+1!=n.length){var l=di(n[u+1],"start",mi);null!=l&&(c=l-o)}else null!=r&&(c=r-o);var h={start:o,duration:c,node:h,ba:!1},f=t,d=e,l=h;if(d.K=gn(l.node,null,i),d.H=l,d.K.id||(d.K.id="__shaka_period_"+l.start),f=li(l.node,"AdaptationSet").map(f.uc.bind(f,d)).filter(A),!f.length)throw new S(4,4004);for(d=0;d<f.length;d++)f[d].ba&&(l.ba=!0);if(f=vn(f),l={startTime:l.start,streamSets:f},a.push(l),s=s||h.ba,h=e.K.id,t.g.every(I(h))&&(t.j(l),t.g.push(h),t.b&&t.b.periods.push(l)),null==c){o=null;break}o+=c}return null!=r?{periods:a,duration:r,ba:s}:{periods:a,duration:o,ba:s}}function bn(e,i){0>e.s||(e.f=t.setTimeout(e.Sc.bind(e),1e3*Math.max(Math.max(3,e.s)-i,0)))}function gn(t,e,i){e=e||{contentType:"",mimeType:"",codecs:"",frameRate:void 0},i=i||e.M;var n=li(t,"BaseURL").map(fi),r=t.getAttribute("contentType")||e.contentType,s=t.getAttribute("mimeType")||e.mimeType,a=t.getAttribute("codecs")||e.codecs,o=di(t,"frameRate",wi)||e.frameRate;return r||(r=Tn(s,a)),{M:_i(i,n),Ga:ci(t,"SegmentBase")||e.Ga,Y:ci(t,"SegmentList")||e.Y,Ha:ci(t,"SegmentTemplate")||e.Ha,width:di(t,"width",vi)||e.width,height:di(t,"height",vi)||e.height,contentType:r,mimeType:s,codecs:a,frameRate:o,id:t.getAttribute("id")}}function vn(t){var e={};t.forEach(function(t){e[t.id]=[t]}),t.forEach(function(t){var i=e[t.id];t.Yc.forEach(function(t){(t=e[t])&&t!=i&&(i.push.apply(i,t),t.forEach(function(t){e[t.id]=i}))})});var i=[],n=[];return F(e).forEach(function(t){if(!(0<=n.indexOf(t))){n.push(t);var e=new D;t.forEach(function(t){e.push(t.contentType||"",t)}),e.keys().forEach(function(t){var n=new D;e.get(t).forEach(function(t){n.push(t.language,t)}),n.keys().forEach(function(e){var r=n.get(e);e={language:e,type:t,primary:r.some(function(t){return t.cc}),drmInfos:r.map(function(t){return t.drmInfos}).reduce(k,[]),streams:r.map(function(t){return t.streams}).reduce(k,[])},i.push(e)})})}}),i}function wn(t){var e;return e=0+(t.Ga?1:0),e+=t.Y?1:0,(e+=t.Ha?1:0)?(1!=e&&(t.Ga&&(t.Y=null),t.Ha=null),!0):"text"==t.contentType||"application"==t.contentType}function En(t,e,i,n){return e=_i(e,[i]),e=M(e,t.c.retryParameters),e.method=n,t.a.request(0,e).then(function(t){if("HEAD"==n){if(!t.headers||!t.headers.date)return 0;t=t.headers.date}else t=q(t.data);return t=Date.parse(t),isNaN(t)?0:t-Date.now()})}function Sn(t,e,i,n){i=i.map(function(t){return{scheme:t.getAttribute("schemeIdUri"),value:t.getAttribute("value")}});var r=t.c.dash.clockSyncUri;return n&&!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),T(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 En(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 En(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":return Promise.reject();default:return Promise.reject()}}.bind(t))["catch"](function(){return 0})}function Tn(t,e){return rs[ae(t,e)]?"text":t.split("/")[0]}function kn(t,e){var i=q(t),n=[],r=new DOMParser,s=null;try{s=r.parseFromString(i,"text/xml")}catch(a){throw new S(2,2005)}if(s){var o,u;if(!(i=s.getElementsByTagName("tt")[0]))throw new S(2,2006);for(r=i.getAttribute("ttp:frameRate"),s=i.getAttribute("ttp:subFrameRate"),o=i.getAttribute("ttp:frameRateMultiplier"),u=i.getAttribute("ttp:tickRate"),r=new Pn(r,s,o,u),s=kn.b(i.getElementsByTagName("styling")[0]),o=kn.b(i.getElementsByTagName("layout")[0]),i=kn.b(i.getElementsByTagName("body")[0]),u=0;u<i.length;u++){var h=kn.c(i[u],e,r,s,o);h&&n.push(h)}}return n}function Pn(t,e,i,n){this.frameRate=Number(t)||30,this.b=Number(e)||1,this.a=Number(n),this.a||(this.a=t?this.frameRate*this.b:1),i&&(t=/^(\d+) (\d+)$/g.exec(i))&&(this.frameRate*=t[1]/t[2])}function An(t,e){var i=new Mi(new DataView(t)),n=Vi(1835295092,i);if(-1!=n)return kn(Ui(i,n-8).buffer,e);if(-1!=qi(t,An.S))return[];throw new S(2,2007)}function In(t){this.b=t,this.a=0}function _n(t,e){var i;return e.lastIndex=t.a,i=(i=e.exec(t.b))?{position:i.index,length:i[0].length,Ec:i}:null,t.a!=t.b.length&&i&&i.position==t.a?(t.a+=i.length,i.Ec):null}function Rn(t){return t.a==t.b.length?null:(t=_n(t,/[^ \t\n]*/gm))?t[0]:null}function Nn(t,e,i,n,r){if(t=q(t),t=t.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),t=t.split(/\n{2,}/m),!/^WEBVTT($|[ \t\n])/m.test(t[0]))throw new S(2,2e3);n=[];for(var s=1;s<t.length;s++){var a=t[s].split("\n");(a=Nn.c(a,e,i,r))&&n.push(a)}return n}function Cn(t,e,i,n){var r=new Mi(new DataView(t)),s=Vi(1835295092,r);if(-1!=s)return Cn.Aa(Ui(r,s-8).buffer,e,i,n);if(-1!=qi(t,Cn.na))return[];throw new S(2,2008)}function Mn(e){return new Promise(function(i){var n=e.split(":");if(2>n.length||"data"!=n[0])throw new S(1,1004,e);if(n=n.slice(1).join(":").split(","),2>n.length)throw new S(1,1004,e);var r=n[0],n=t.decodeURIComponent(n.slice(1).join(",")),r=r.split(";"),s=null;if(1<r.length&&(s=r[1]),"base64"==s)n=J(n).buffer;else{if(s)throw new S(1,1005,e);n=z(n)}i({uri:e,data:n,headers:{"content-type":r[0]}})})}function xn(t,e){return new Promise(function(i,n){var r=new XMLHttpRequest;r.open(e.method,t,!0),r.responseType="arraybuffer",r.timeout=e.retryParameters.timeout,r.withCredentials=e.allowCrossSiteCredentials,r.onload=function(e){if(e=e.target,200<=e.status&&299>=e.status){var r=e.getAllResponseHeaders().split("\r\n").reduce(function(t,e){var i=e.split(": ");return t[i[0].toLowerCase()]=i.slice(1).join(": "),t},{});e.responseURL&&(t=e.responseURL),i({uri:t,data:e.response,headers:r})}else{r=null;try{r=G(e.response)}catch(s){}n(new S(1,1001,t,e.status,r))}},r.onerror=function(){n(new S(1,1002,t))},r.ontimeout=function(){n(new S(1,1003,t))};for(var s in e.headers)r.setRequestHeader(s,e.headers[s]);r.send(e.body)})}function Dn(){this.a=null,this.c=[],this.b={}}function On(t,e,i){return Un(t,e,"readwrite",function(t){return t.put(i)})}function Ln(t,e){var i=[];return Un(t,"segment","readwrite",function(t){return t.openCursor()},function(t){if(t){if(e(t.value)){var n=t["delete"](),r=new R;n.onsuccess=r.resolve,n.onerror=Bn.bind(null,n,r),i.push(r)}t["continue"]()}}).then(function(){return Promise.all(i)}).then(function(){return i.length})}function jn(t,e){var i=0;return Un(t,e,"readonly",function(t){return t.openCursor(null,"prev")},function(t){t&&(i=t.key+1)}).then(function(){return i})}function Un(t,e,i,n,r){i=t.a.transaction([e],i);var s=n(i.objectStore(e)),a=new R;r&&(s.onsuccess=function(t){r(t.target.result)}),s.onerror=Bn.bind(null,s,a);var o={transaction:i,I:a};t.c.push(o);var u=function(){this.c.splice(this.c.indexOf(o),1)}.bind(t);return i.oncomplete=function(){u(),a.resolve(s.result)},i.onerror=function(t){u(),Bn(s,a,t)},a}function Bn(t,e,i){"AbortError"==t.error.name?e.reject(new S(9,9002)):e.reject(new S(9,9001,t.error)),i.preventDefault()}function Fn(t){return{offlineUri:"offline:"+t.key,originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,tracks:t.periods[0].streams.map(function(t){return{id:t.id,active:!1,type:t.contentType,bandwidth:0,language:t.language,kind:t.kind||null,width:t.width,height:t.height,frameRate:t.frameRate,codecs:t.codecs}}),appMetadata:t.appMetadata}}function Kn(){}function Vn(t){var e=new Bt(null,0);e.za(t.duration);var i=t.drmInfo?[t.drmInfo]:[];return{presentationTimeline:e,minBufferTime:10,offlineSessionIds:t.sessionIds,periods:t.periods.map(function(t){return{startTime:t.startTime,streamSets:t.streams.map(function(n){var r=n.segments.map(function(t,e){return new Ut(e,t.startTime,t.endTime,function(){
-return[t.uri]},0,null)});return e.Fa(t.startTime,r),r=new Gi(r),{language:n.language,type:n.contentType,primary:n.primary,drmInfos:i,streams:[{id:n.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:r.find.bind(r),getSegmentReference:r.get.bind(r),initSegmentReference:n.initSegmentUri?new jt(function(){return[n.initSegmentUri]},0,null):null,presentationTimeOffset:n.presentationTimeOffset,mimeType:n.mimeType,codecs:n.codecs,bandwidth:0,width:n.width||void 0,height:n.height||void 0,kind:n.kind,encrypted:n.encrypted,keyId:n.keyId,allowedByApplication:!0,allowedByKeySystem:!0}]}})}})}}function qn(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=new Dn;return n.init(ks).then(function(){return n.get("segment",i)}).then(function(e){return n.o().then(function(){if(!e)throw new S(9,9003,i);return{uri:t,data:e.data,headers:{}}})})}return Promise.reject(new S(1,9004,t))}function Hn(t,e,i){this.b={},this.i=i,this.m=t,this.l=e,this.j=this.a=null,this.f=this.h=this.g=this.c=0}function Gn(t,e,i,n,r){t.b[e]=t.b[e]||[],t.b[e].push({uris:i.a(),L:i.L,D:i.D,ib:n,Da:r})}function zn(t,e){t.c=0,t.g=0,t.h=0,t.f=0,F(t.b).forEach(function(t){t.forEach(function(t){null!=t.D?this.c+=t.D-t.L+1:this.h+=t.ib}.bind(this))}.bind(t)),t.a=e,t.a.size=t.c;var i=F(t.b).map(function(t){var e=0,i=function(){if(!this.i)return Promise.reject(new S(9,9002));if(e>=t.length)return Promise.resolve();var n=t[e++];return $n(this,n).then(i)}.bind(this);return i()}.bind(t));return t.b={},t.j=Promise.all(i)}function $n(t,e){var i=M(e.uris,t.l);(e.L||null!=e.D)&&(i.headers.Range="bytes="+e.L+"-"+(null==e.D?"":e.D));var n;return t.m.request(1,i).then(function(t){return this.a?(n=t.data.byteLength,e.Da(t.data)):Promise.reject(new S(9,9002))}.bind(t)).then(function(){if(!this.a)return Promise.reject(new S(9,9002));null==e.D?(this.a.size+=n,this.f+=e.ib):this.g+=n;var t=(this.g+this.f)/(this.c+this.h),i=Fn(this.a);this.i.progressCallback(i,t)}.bind(t))}function Yn(t){this.a=new Dn,this.c=t,this.j=Jn(this),this.h=null,this.v=!1,this.i=null,this.l=[],this.f=-1,this.m=0,this.b=null,this.g=new Hn(t.i,t.getConfiguration().streaming.retryParameters,this.j)}function Wn(){return!!t.indexedDB}function Xn(t,e,i,n){function r(){}var s,a,o,u=t.c.i,h=t.c.getConfiguration();return bt(e,u,h.manifest.retryParameters,n).then(function(t){return ir(this),o=new t,o.configure(h.manifest),o.start(e,u,this.s.bind(this),i)}.bind(t)).then(function(t){return ir(this),s=t,a=new et(u,i,r),a.configure(h.drm),a.init(s,!0)}.bind(t)).then(function(){return ir(this),tr(s)}.bind(t)).then(function(){return ir(this),rt(a)}.bind(t)).then(function(){return ir(this),o.stop()}.bind(t)).then(function(){return ir(this),{manifest:s,Sb:a}}.bind(t))["catch"](function(t){if(o)return o.stop().then(function(){throw t});throw t})}function Jn(t){return{trackSelectionCallback:t.A.bind(t),progressCallback:function(t,e){if(t||e)return null}}}function Zn(t){return t.a.a?Promise.resolve():t.a.init(ks)}function Qn(t){var e=t.h?t.h.o():Promise.resolve();return t.h=null,t.b=null,t.v=!1,t.i=null,t.l=[],t.f=-1,e}function tr(t){return t=t.periods.map(function(t){return t.streamSets}).reduce(k,[]).map(function(t){return t.streams}).reduce(k,[]),Promise.all(t.map(function(t){return t.createSegmentIndex()}))}function er(t,e,i,n){for(var r=[],s=t.b.presentationTimeline.ra(),a=s,o=n.findSegmentPosition(s),u=null!=o?n.getSegmentReference(o):null;u;){var h=t.a.b.segment++;Gn(t.g,i.type,u,(u.endTime-u.startTime)*n.bandwidth/8,function(t,e,i,n){return e={key:t,data:n,manifestKey:this.f,streamNumber:i,segmentNumber:e},this.l.push(t),On(this.a,"segment",e)}.bind(t,h,u.position,n.id)),r.push({startTime:u.startTime,endTime:u.endTime,uri:"offline:"+t.f+"/"+n.id+"/"+h}),a=u.endTime+e.startTime,u=n.getSegmentReference(++o)}return t.m=Math.max(t.m,a-s),e=null,n.initSegmentReference&&(h=t.a.b.segment++,e="offline:"+t.f+"/"+n.id+"/"+h,Gn(t.g,i.type,n.initSegmentReference,0,function(t,e){var i={key:h,data:e,manifestKey:this.f,streamNumber:t,segmentNumber:-1};return this.l.push(h),On(this.a,"segment",i)}.bind(t,n.id))),{id:n.id,primary:i.primary,presentationTimeOffset:n.presentationTimeOffset||0,contentType:i.type,mimeType:n.mimeType,codecs:n.codecs,frameRate:n.frameRate,kind:n.kind,language:i.language,width:n.width||null,height:n.height||null,initSegmentUri:e,encrypted:n.encrypted,keyId:n.keyId,segments:r}}function ir(t){if(!t.c)throw new S(9,9002)}function nr(t){Ps.push(t)}function rr(t){var e=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),e=new Event(e,t);t.target.dispatchEvent(e)}function sr(t){for(this.c=[],this.b=[],this.a=[],t=new Mi(new DataView(t.buffer));xi(t);){var e=Vi(1886614376,t);if(-1==e)break;var i=t.a-8,n=Di(t);if(1<n)Bi(t,e-(t.a-i));else{Bi(t,3);var r=Q(Ui(t,16)),s=[];if(0<n)for(var n=Li(t),a=0;a<n;++a){var o=Q(Ui(t,16));s.push(o)}n=Li(t),Bi(t,n),this.b.push.apply(this.b,s),this.c.push(r),this.a.push({start:i,end:t.a-1}),t.a!=i+e&&Bi(t,e-(t.a-i))}}}function ar(t,e){try{var i=new or(t,e);return Promise.resolve(i)}catch(n){return Promise.reject(n)}}function or(t,e){this.keySystem=t;for(var i=!1,n=0;n<e.length;++n){var r=e[n],s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:r.initDataTypes,sessionTypes:["temporary"],label:r.label},a=!1;if(r.audioCapabilities)for(var o=0;o<r.audioCapabilities.length;++o){var u=r.audioCapabilities[o];if(u.contentType){var a=!0,h=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,h)&&(s.audioCapabilities.push(u),i=!0)}}if(r.videoCapabilities)for(o=0;o<r.videoCapabilities.length;++o)u=r.videoCapabilities[o],u.contentType&&(a=!0,h=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,h)&&(s.videoCapabilities.push(u),i=!0));if(a||(i=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==r.persistentState&&(s.persistentState="required",s.sessionTypes=["persistent-license"]),i)return void(this.a=s)}throw i=Error("Unsupported keySystem"),i.name="NotSupportedError",i.code=DOMException.NOT_SUPPORTED_ERR,i}function ur(t){var e=this.mediaKeys;return e&&e!=t&&cr(e,null),delete this.mediaKeys,(this.mediaKeys=t)?cr(t,this):Promise.resolve()}function hr(t){this.a=new MSMediaKeys(t),this.b=new O}function cr(t,e){function i(){e.msSetMediaKeys(n.a),e.removeEventListener("loadedmetadata",i)}if(j(t.b),!e)return Promise.resolve();L(t.b,e,"msneedkey",fr);var n=t;try{return 1<=e.readyState?e.msSetMediaKeys(t.a):e.addEventListener("loadedmetadata",i),Promise.resolve()}catch(r){return Promise.reject(r)}}function lr(t){je.call(this),this.c=null,this.g=t,this.b=this.a=null,this.f=new O,this.sessionId="",this.expiration=NaN,this.closed=new R,this.keyStatuses=new mr}function fr(t){var e=document.createEvent("CustomEvent");if(e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="cenc",t=t.initData){var i=new sr(t);if(!(1>=i.a.length)){for(var n=[],r=0;r<i.a.length;r++)n.push(t.subarray(i.a[r].start,i.a[r].end+1));for(r=dr,t=[],i=0;i<n.length;++i){for(var s=!1,a=0;a<t.length&&!(s=r?r(n[i],t[a]):n[i]===t[a]);++a);s||t.push(n[i])}for(r=n=0;r<t.length;r++)n+=t[r].length;for(n=new Uint8Array(n),r=i=0;r<t.length;r++)n.set(t[r],i),i+=t[r].length;t=n}}e.initData=t,this.dispatchEvent(e)}function dr(t,e){return tt(t,e)}function pr(t,e){t.keyStatuses.eb(e),t.dispatchEvent(new Le("keystatuseschange"))}function mr(){this.size=0,this.a=void 0}function yr(){return Promise.reject(Error("The key system specified is not supported."))}function br(t){return t?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve()}function gr(){throw new TypeError("Illegal constructor.")}function vr(){throw new TypeError("Illegal constructor.")}function wr(e){Is=e,_s=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=Sr,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Tr,t.MediaKeys=Pr,t.MediaKeySystemAccess=kr}function Er(t){var e=Is;return e?e+t.charAt(0).toUpperCase()+t.slice(1):t}function Sr(t,e){try{var i=new kr(t,e);return Promise.resolve(i)}catch(n){return Promise.reject(n)}}function Tr(t){var e=this.mediaKeys;return e&&e!=t&&Ar(e,null),delete this.mediaKeys,(this.mediaKeys=t)&&Ar(t,this),Promise.resolve()}function kr(t,e){this.a=this.keySystem=t;var i=!0;"org.w3.clearkey"==t&&(this.a="webkit-org.w3.clearkey",i=!1);var n,r=!1;n=document.getElementsByTagName("video"),n=n.length?n[0]:document.createElement("video");for(var s=0;s<e.length;++s){var a=e[s],o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:a.initDataTypes,sessionTypes:["temporary"],label:a.label},u=!1;if(a.audioCapabilities)for(var h=0;h<a.audioCapabilities.length;++h){var c=a.audioCapabilities[h];if(c.contentType){var u=!0,l=c.contentType.split(";")[0];n.canPlayType(l,this.a)&&(o.audioCapabilities.push(c),r=!0)}}if(a.videoCapabilities)for(h=0;h<a.videoCapabilities.length;++h)c=a.videoCapabilities[h],c.contentType&&(u=!0,n.canPlayType(c.contentType,this.a)&&(o.videoCapabilities.push(c),r=!0));if(u||(r=n.canPlayType("video/mp4",this.a)||n.canPlayType("video/webm",this.a)),"required"==a.persistentState&&(i?(o.persistentState="required",o.sessionTypes=["persistent-license"]):r=!1),r)return void(this.b=o)}throw i="Unsupported keySystem","org.w3.clearkey"!=t&&"com.widevine.alpha"!=t||(i="None of the requested configurations were supported."),i=Error(i),i.name="NotSupportedError",i.code=DOMException.NOT_SUPPORTED_ERR,i}function Pr(t){this.h=t,this.b=null,this.a=new O,this.c=[],this.f={}}function Ar(t,e){t.b=e,j(t.a);var i=Is;e&&(L(t.a,e,i+"needkey",t.tc.bind(t)),L(t.a,e,i+"keymessage",t.sc.bind(t)),L(t.a,e,i+"keyadded",t.qc.bind(t)),L(t.a,e,i+"keyerror",t.rc.bind(t)))}function Ir(t,e){var i=t.f[e];return i?i:(i=t.c.shift())?(i.sessionId=e,t.f[e]=i):null}function _r(t,e,i){je.call(this),this.f=t,this.i=!1,this.a=this.b=null,this.c=e,this.g=i,this.sessionId="",this.expiration=NaN,this.closed=new R,this.keyStatuses=new Cr}function Rr(t,e,i){if(t.i)return Promise.reject(Error("The session is already initialized."));t.i=!0;var n;try{if("persistent-license"==t.g)if(i)n=new Uint8Array(z("LOAD_SESSION|"+i));else{var r=z("PERSISTENT|"),s=new Uint8Array(r.byteLength+e.byteLength);s.set(new Uint8Array(r),0),s.set(new Uint8Array(e),r.byteLength),n=s}else n=new Uint8Array(e)}catch(a){return Promise.reject(a)}t.b=new R;var o=Er("generateKeyRequest");try{t.f[o](t.c,n)}catch(a){if("InvalidStateError"!=a.name)return t.b=null,Promise.reject(a);setTimeout(function(){try{this.f[o](this.c,n)}catch(t){this.b.reject(t),this.b=null}}.bind(t),10)}return t.b}function Nr(t,e){t.keyStatuses.eb(e),t.dispatchEvent(new Le("keystatuseschange"))}function Cr(){this.size=0,this.a=void 0}function Mr(){var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.abort=function(){},e}}function xr(){var t=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var e=0,i=0;i<this.sourceBuffers.length;++i)var n=this.sourceBuffers[i],n=n.buffered.end(n.buffered.length-1),e=Math.max(e,n);if(!isNaN(this.duration)&&e<this.duration)for(this.ob=!0,i=0;i<this.sourceBuffers.length;++i)n=this.sourceBuffers[i],n.kb=!1;return t.apply(this,arguments)};var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,arguments);return t.h=this,t.addEventListener("updateend",Dr,!1),this.a||(this.addEventListener("sourceclose",Or,!1),this.a=!0),t}}function Dr(t){var e=t.target,i=e.h;if(i.ob){for(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.kb=!0,t=0;t<i.sourceBuffers.length;++t)if(0==i.sourceBuffers[t].kb)return;i.ob=!1}}function Or(t){t=t.target;for(var e=0;e<t.sourceBuffers.length;++e)t.sourceBuffers[e].removeEventListener("updateend",Dr,!1);t.removeEventListener("sourceclose",Or,!1)}function Lr(t){if(this.c=[],this.b=[],this.ia=Rs,t)try{t(this.W.bind(this),this.a.bind(this))}catch(e){this.a(e)}}function jr(t){var e=new Lr;return e.W(t),e}function Ur(t){var e=new Lr;return e.a(t),e}function Br(t){function e(t,e,i){t.ia==Rs&&(r[e]=i,n++,n==r.length&&t.W(r))}var i=new Lr;if(!t.length)return i.W([]),i;for(var n=0,r=Array(t.length),s=i.a.bind(i),a=0;a<t.length;++a)t[a]&&t[a].then?t[a].then(e.bind(null,i,a),s):e(i,a,t[a]);return i}function Fr(t){for(var e=new Lr,i=e.W.bind(e),n=e.a.bind(e),r=0;r<t.length;++r)t[r]&&t[r].then?t[r].then(i,n):i(t[r]);return e}function Kr(t,e,i){Cs.push(function(){if(i&&"function"==typeof i){try{var t=i(this.Oa)}catch(n){return void e.a(n)}var r;try{r=t&&t.then}catch(n){return void e.a(n)}t instanceof Lr?t==e?e.a(new TypeError("Chaining cycle detected")):t.then(e.W.bind(e),e.a.bind(e)):r?Vr(t,r,e):e.W(t)}else 1==this.ia?e.W(this.Oa):e.a(this.Oa)}.bind(t)),null==Ns&&(Ns=Hr(qr))}function Vr(t,e,i){try{var n=!1;e.call(t,function(t){if(!n){n=!0;var e;try{e=t&&t.then}catch(r){return void i.a(r)}e?Vr(t,e,i):i.W(t)}},i.a.bind(i))}catch(r){i.a(r)}}function qr(){for(;Cs.length;){null!=Ns&&(Gr(Ns),Ns=null);var t=Cs;Cs=[];for(var e=0;e<t.length;++e)t[e]()}}function Hr(){return 0}function Gr(){}function zr(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}var $r,Yr=this;Yr.ed=!0,a.prototype.setDefaultEstimate=function(t){this.b=t},a.prototype.getBandwidthEstimate=function(){return 128e3>this.a?this.b:Math.min(s(this.c),s(this.f))},e("shaka.abr.SimpleAbrManager",h),h.prototype.stop=function(){this.g=null,this.f=!1,this.h={},this.a={},this.c=null},h.prototype.stop=h.prototype.stop,h.prototype.init=function(t){this.g=t},h.prototype.init=h.prototype.init,h.prototype.chooseStreams=function(t){for(var e in t)this.h[e]=t[e];if(e={},"audio"in t){var i=c(this);i?(e.audio=i,this.a.audio=i):delete this.a.audio}return"video"in t&&((i=l(this))?(e.video=i,this.a.video=i):delete this.a.video),"text"in t&&(e.text=t.text.streams[0]),this.c=Date.now(),e},h.prototype.chooseStreams=h.prototype.chooseStreams,h.prototype.enable=function(){this.f=!0},h.prototype.enable=h.prototype.enable,h.prototype.disable=function(){this.f=!1},h.prototype.disable=h.prototype.disable,h.prototype.segmentDownloaded=function(t,e,i){var n=this.b;if(e-=t,16e3>i||(t=8e3*i/e,e/=1e3,n.a+=i,r(n.c,e,t),r(n.f,e,t)),null!=this.c&&this.f)t:{if(this.i){if(8e3>Date.now()-this.c)break t}else{if(!(128e3<=this.b.a))break t;this.i=!0}i={},(n=c(this))&&(i.audio=n,this.a.audio=n),(n=l(this))&&(i.video=n,this.a.video=n),this.c=Date.now(),this.b.getBandwidthEstimate(),this.g(i)}},h.prototype.segmentDownloaded=h.prototype.segmentDownloaded,h.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate()},h.prototype.getBandwidthEstimate=h.prototype.getBandwidthEstimate,h.prototype.setDefaultEstimate=function(t){this.b.setDefaultEstimate(t)},h.prototype.setDefaultEstimate=h.prototype.setDefaultEstimate;var Wr=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;$r=d.prototype,$r.R="",$r.ka="",$r.T="",$r.wa=null,$r.O="",$r.ca="",$r.toString=function(){var t=[],e=this.R;if(e&&t.push(g(e,Xr,!0),":"),e=this.T){t.push("//");var i=this.ka;i&&t.push(g(i,Xr,!0),"@"),t.push(encodeURIComponent(e).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e=this.wa,null!=e&&t.push(":",String(e))}return(e=this.O)&&(this.T&&"/"!=e.charAt(0)&&t.push("/"),t.push(g(e,"/"==e.charAt(0)?Zr:Jr,!0))),(e=this.a.toString())&&t.push("?",e),(e=this.ca)&&t.push("#",g(e,ts)),t.join("")},$r.resolve=function(t){var e=new d(this);"data"===e.R&&(e=new d);var i=!!t.R;i?p(e,t.R):i=!!t.ka,i?e.ka=t.ka:i=!!t.T,i?e.T=t.T:i=null!=t.wa;var n=t.O;if(i)m(e,t.wa);else if(i=!!t.O){if("/"!=n.charAt(0))if(this.T&&!this.O)n="/"+n;else{var r=e.O.lastIndexOf("/");-1!=r&&(n=e.O.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("/"),s=[],a=0;a<n.length;){var o=n[a++];"."==o?r&&a==n.length&&s.push(""):".."==o?((1<s.length||1==s.length&&""!=s[0])&&s.pop(),r&&a==n.length&&s.push("")):(s.push(o),r=!0)}n=s.join("/")}}return i?e.O=n:i=""!==t.a.toString(),i?y(e,E(t.a)):i=!!t.ca,i&&(e.ca=t.ca),e};var Xr=/[#\/\?@]/g,Jr=/[\#\?:]/g,Zr=/[\#\?]/g,Qr=/[\#\?@]/g,ts=/#/g;w.prototype.a=null,w.prototype.c=null,w.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var t,e=[];for(t in this.a)for(var i=encodeURIComponent(t),n=this.a[t],r=0;r<n.length;r++){var s=i;""!==n[r]&&(s+="="+encodeURIComponent(n[r])),e.push(s)}return this.b=e.join("&")},e("shaka.util.Error",S),S.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},S.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},S.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_TTML:2006,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,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,INDEXED_DB_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},e("shaka.util.IDestroyable",_),_.prototype.o=function(){},_.prototype.destroy=_.prototype.o,e("shaka.net.NetworkingEngine",N),N.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2};var es={};N.registerScheme=function(t,e){es[t]=e},N.unregisterScheme=function(t){delete es[t]},N.prototype.zc=function(t){this.b.push(t)},N.prototype.registerRequestFilter=N.prototype.zc,N.prototype.$c=function(t){var e=this.b;t=e.indexOf(t),0<=t&&e.splice(t,1)},N.prototype.unregisterRequestFilter=N.prototype.$c,N.prototype.Pb=function(){this.b=[]},N.prototype.clearAllRequestFilters=N.prototype.Pb,N.prototype.zb=function(t){this.c.push(t)},N.prototype.registerResponseFilter=N.prototype.zb,N.prototype.Kb=function(t){var e=this.c;t=e.indexOf(t),0<=t&&e.splice(t,1)},N.prototype.unregisterResponseFilter=N.prototype.Kb,N.prototype.Qb=function(){this.c=[]},N.prototype.clearAllResponseFilters=N.prototype.Qb,N.prototype.o=function(){this.f=!0,this.b=[],this.c=[];for(var t=[],e=0;e<this.a.length;++e)t.push(this.a[e]["catch"](P));return Promise.all(t)},N.prototype.destroy=N.prototype.o,N.prototype.request=function(t,e){if(this.f)return Promise.reject();for(var i=Date.now(),n=this.b,r=0;r<n.length;r++)try{n[r](t,e)}catch(s){return Promise.reject(s)}for(var r=e.retryParameters||{},n=r.maxAttempts||1,a=r.backoffFactor||2,o=null==r.baseDelay?1e3:r.baseDelay,u=this.h(t,e,0),r=1;r<n;r++)u=u["catch"](this.i.bind(this,t,e,o,r%e.uris.length)),o*=a;return this.a.push(u),u.then(function(e){this.a.splice(this.a.indexOf(u),1);var n=Date.now();return this.g&&1==t&&this.g(i,n,e.data.byteLength),e}.bind(this))["catch"](function(t){return this.a.splice(this.a.indexOf(u),1),Promise.reject(t)}.bind(this))},N.prototype.request=N.prototype.request,N.prototype.h=function(t,e,i){if(this.f)return Promise.reject();var n=new d(e.uris[i]),r=n.R;return r||(r=location.protocol,r=r.slice(0,-1),p(n,r),e.uris[i]=n.toString()),(r=es[r])?r(e.uris[i],e).then(function(e){for(var i=this.c,n=0;n<i.length;n++)i[n](t,e);return e}.bind(this)):Promise.reject(new S(1,1e3,n))},N.prototype.i=function(e,i,n,r){var s=new R,a=i.retryParameters||{};return t.setTimeout(s.resolve,n*(1+(2*Math.random()-1)*(null==a.fuzzFactor?.5:a.fuzzFactor))),s.then(this.h.bind(this,e,i,r))},$r=D.prototype,$r.push=function(t,e){this.a.hasOwnProperty(t)?this.a[t].push(e):this.a[t]=[e]},$r.set=function(t,e){this.a[t]=e},$r.has=function(t){return this.a.hasOwnProperty(t)},$r.get=function(t){return(t=this.a[t])?t.slice():null},$r.remove=function(t,e){var i=this.a[t];if(i)for(var n=0;n<i.length;++n)i[n]==e&&(i.splice(n,1),--n)},$r.keys=function(){var t,e=[];for(t in this.a)e.push(t);return e},O.prototype.o=function(){return j(this),this.a=null,Promise.resolve()},O.prototype.ja=function(t,e){for(var i=this.a.get(e)||[],n=0;n<i.length;++n){var r=i[n];r.target==t&&(r.ja(),this.a.remove(e,r))}},U.prototype.ja=function(){this.target&&(this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null)},Y.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},$r=et.prototype,$r.o=function(){this.c=!0;var t=this.a.map(function(t){return t.ya.close()["catch"](P),t.ya.closed});return this.j.reject(),this.f&&t.push(this.f.o()),this.l&&t.push(this.l.setMediaKeys(null)["catch"](P)),this.v&&this.v.cancel(),this.f=this.l=this.g=this.m=this.b=this.v=null,this.a=[],this.s=[],this.h=this.i=this.G=null,Promise.all(t)},$r.configure=function(t){this.i=t},$r.init=function(t,e){var i={},n=[];return this.C=e,this.s=t.offlineSessionIds,at(this,t,e||0<t.offlineSessionIds.length,i,n),n.length?ot(this,i,n):(this.A=!0,Promise.resolve())},$r.keySystem=function(){return this.b?this.b.keySystem:""},$r.ec=function(t){for(var e=new Uint8Array(t.initData),i=0;i<this.a.length;++i)if(tt(e,this.a[i].initData))return;dt(this,t.initDataType,e)},$r.wb=function(t){var e=t.target,i=M([this.b.licenseServerUri],this.i.retryParameters);i.body=t.message,i.method="POST","com.microsoft.playready"==this.b.keySystem&&pt(i),this.G.request(2,i).then(function(t){return this.c?Promise.reject():e.update(t.data)}.bind(this),function(t){return this.c?Promise.resolve():void this.h(new S(6,6007,t))}.bind(this))["catch"](function(t){return this.c?Promise.resolve():void this.h(new S(6,6008,t.message))}.bind(this))},$r.rb=function(t){t=t.target;var e;for(e=0;e<this.a.length&&this.a[e].ya!=t;++e);if(e!=this.a.length){var i=t.keyStatuses,n=!1;i.forEach||(i=[]),i.forEach(function(t,i){if("string"==typeof i){var r=i;i=t,t=r}if("com.microsoft.playready"==this.b.keySystem&&16==i.byteLength){var r=new DataView(i),s=r.getUint32(0,!0),a=r.getUint16(4,!0),o=r.getUint16(6,!0);r.setUint32(0,s,!1),r.setUint16(4,a,!1),r.setUint16(6,o,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==t&&(t="usable"),"status-pending"!=t&&(this.a[e].loaded=!0,this.a.every(function(t){return t.loaded})&&this.j.resolve()),"expired"==t&&(n=!0),r=Q(new Uint8Array(i)),this.w[r]=t}.bind(this)),i=t.expiration-Date.now(),(0>i||n&&1e3>i)&&(this.a.splice(e,1),t.close()),W(this.v)}},$r.yc=function(){V(this.w,function(t,e){return"expired"==e})&&this.h(new S(6,6014)),this.J(this.w)};var is={},ns={};e("shaka.media.ManifestParser.registerParserByExtension",function(t,e){ns[t]=e}),e("shaka.media.ManifestParser.registerParserByMime",function(t,e){is[t]=e});var rs={};e("shaka.media.TextEngine.registerParser",function(t,e){rs[t]=e}),e("shaka.media.TextEngine.unregisterParser",function(t){delete rs[t]}),e("shaka.media.TextEngine.makeCue",vt);var ss=t.VTTCue||t.TextTrackCue;gt.prototype.o=function(){return this.c&&St(this,function(){return!0}),this.c=this.h=null,Promise.resolve()},gt.prototype.remove=function(t,e){return Promise.resolve().then(function(){this.c&&(St(this,function(i){return!(i.startTime>=e||i.endTime<=t)}),null==this.b||e<=this.b||t>=this.a||(t<=this.b&&e>=this.a?this.b=this.a=null:t<=this.b&&e<this.a?this.b=e:t>this.b&&e>=this.a&&(this.a=t)))}.bind(this))},$r=Pt.prototype,$r.o=function(){this.i=!0;var t,e=[];for(t in this.a){var i=this.a[t],n=i[0];for(this.a[t]=i.slice(0,1),n&&e.push(n.p["catch"](P)),n=1;n<i.length;++n)i[n].p["catch"](P),i[n].p.reject()}return this.b&&e.push(this.b.o()),Promise.all(e).then(function(){this.g.o(),this.b=this.j=this.h=this.f=this.g=null,this.c={},this.a={}}.bind(this))},$r.init=function(t,e){for(var i in t){var n=t[i];"text"==i?this.b=new gt(this.j,n,e):(n=this.h.addSourceBuffer(n),L(this.g,n,"error",this.Uc.bind(this,i)),L(this.g,n,"updateend",this.va.bind(this,i)),this.c[i]=n,this.a[i]=[])}},$r.remove=function(t,e,i){return"text"==t?this.b.remove(e,i):Dt(this,t,this.Bb.bind(this,t,e,i))},$r.endOfStream=function(t){return Ot(this,function(){t?this.h.endOfStream(t):this.h.endOfStream()}.bind(this))},$r.za=function(t){return Ot(this,function(){this.h.duration=t}.bind(this))},$r.da=function(){return this.h.duration},$r.Tc=function(t,e){this.c[t].appendBuffer(e)},$r.Bb=function(t,e,i){i<=e?this.va(t):this.c[t].remove(e,i)},$r.Lb=function(t){var e=this.c[t].appendWindowEnd;this.c[t].abort(),this.c[t].appendWindowEnd=e,this.va(t)},$r.Ub=function(t){this.f.currentTime-=.001,this.va(t)},$r.Jc=function(t,e){this.c[t].timestampOffset=e,this.va(t)},$r.Hc=function(t,e){this.c[t].appendWindowEnd=e+.04,this.va(t)},$r.Uc=function(t){this.a[t][0].p.reject(new S(3,3014,this.f.error?this.f.error.code:0))},$r.va=function(t){var e=this.a[t][0];e&&(e.p.resolve(),Lt(this,t))},e("shaka.media.InitSegmentReference",jt),e("shaka.media.SegmentReference",Ut),e("shaka.media.PresentationTimeline",Bt),Bt.prototype.da=function(){return this.a},Bt.prototype.getDuration=Bt.prototype.da,Bt.prototype.za=function(t){this.a=t},Bt.prototype.setDuration=Bt.prototype.za,Bt.prototype.Fb=function(t){this.g=t},Bt.prototype.setClockOffset=Bt.prototype.Fb,Bt.prototype.Ib=function(t){this.h=t},Bt.prototype.setStatic=Bt.prototype.Ib,Bt.prototype.Xb=function(){return this.c},Bt.prototype.getSegmentAvailabilityDuration=Bt.prototype.Xb,Bt.prototype.Hb=function(t){this.c=t},Bt.prototype.setSegmentAvailabilityDuration=Bt.prototype.Hb,Bt.prototype.Fa=function(t,e){e.length&&(this.b=e.reduce(function(t,e){return Math.max(t,e.endTime-e.startTime)},this.b),t||(this.f=Math.max(this.f,e[0].startTime)))},Bt.prototype.notifySegments=Bt.prototype.Fa,Bt.prototype.Ya=function(t){this.b=Math.max(this.b,t)},Bt.prototype.notifyMaxSegmentDuration=Bt.prototype.Ya,Bt.prototype.U=function(){return 1/0==this.a&&!this.h},Bt.prototype.isLive=Bt.prototype.U,Bt.prototype.fa=function(){return 1/0!=this.a&&!this.h},Bt.prototype.isInProgress=Bt.prototype.fa,Bt.prototype.ra=function(){return Math.max(Math.min(this.f,this.ea()),this.sa())},Bt.prototype.getEarliestStart=Bt.prototype.ra,Bt.prototype.sa=function(){return 1/0==this.c?0:Math.max(0,this.ea()-this.c-this.i)},Bt.prototype.getSegmentAvailabilityStart=Bt.prototype.sa,Bt.prototype.ea=function(){return this.U()||this.fa()?Math.min(Math.max(0,(Date.now()+this.g)/1e3-this.b-this.j),this.a):this.a},Bt.prototype.getSegmentAvailabilityEnd=Bt.prototype.ea,Bt.prototype.Ua=function(){return Math.max(0,this.ea()-(this.U()||this.fa()?this.i:0))},Bt.prototype.getSeekRangeEnd=Bt.prototype.Ua,$r=Ft.prototype,$r.o=function(){var e=this.b.o();return this.b=null,Gt(this),null!=this.f&&(t.clearInterval(this.f),this.f=null),this.m=this.l=this.c=this.a=null,e},$r.pc=function(){this.i=null,Ht(this);var t=kt(this.a.buffered,this.a.currentTime),e=Tt(this.a.buffered)>=this.a.duration-.05||this.a.ended;this.h?(e||t>=this.j)&&qt(this,!1):!e&&.5>t&&qt(this,!0)},$r.Ta=function(){return this.g},$r.lc=function(){this.a.playbackRate!=(this.h||0>this.g?0:this.g)&&zt(this,this.a.playbackRate)},$r.sb=function(){this.b.ja(this.a,"loadedmetadata");var t=Vt(this);.001>Math.abs(this.a.currentTime-t)?(L(this.b,this.a,"seeking",this.ub.bind(this)),L(this.b,this.a,"playing",this.tb.bind(this))):(L(this.b,this.a,"seeking",this.nc.bind(this)),this.a.currentTime=t)},$r.nc=function(){this.b.ja(this.a,"seeking"),L(this.b,this.a,"seeking",this.ub.bind(this)),L(this.b,this.a,"playing",this.tb.bind(this))},$r.ub=function(){var t=this.a.currentTime,e=$t(this,t);.001<Math.abs(e-t)?Yt(this,t,e):this.m()},$r.tb=function(){var t=this.a.currentTime,e=$t(this,t);.001<Math.abs(e-t)&&Yt(this,t,e)};var as=1,os=2,us={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};oe.prototype.o=function(){for(var t in this.b)Me(this.b[t]);return this.h=this.b=this.l=this.g=this.A=this.w=this.j=this.v=this.G=this.C=this.a=this.S=this.c=this.m=null,this.f=!0,Promise.resolve()},oe.prototype.configure=function(t){this.h=t,this.m.j=this.i*Math.max(this.a.minBufferTime||0,this.h.rebufferingGoal)},oe.prototype.init=function(){var t=this.G(this.a.periods[Ie(this,Kt(this.m))]);return B(t)?Promise.reject(new S(5,5005)):fe(this,t).then(function(){this.w&&this.w()}.bind(this))},oe.prototype.X=function(t){if(!this.f&&!t.ga&&null!=t.$&&!t.aa)if(t.$=null,t.la)Ne(this,t,t.Pa);else{try{var e=ye(this,t);null!=e&&Ce(this,t,e)}catch(i){return void this.j(i)}e=F(this.b),Pe(this,t),e.every(function(t){return t.endOfStream})&&this.c.endOfStream()}},xe.prototype.then=function(t){
-return this.a=this.a.then(t).then(function(t){return this.c?(this.g(),Promise.reject(this.i)):Promise.resolve(t)}.bind(this)),this},xe.prototype.cancel=function(t){return this.b?Promise.resolve():(this.c=!0,this.i=t,this.h)},Le.prototype.preventDefault=function(){},Le.prototype.stopImmediatePropagation=function(){this.a=!0},Le.prototype.stopPropagation=function(){},e("shaka.util.FakeEventTarget",je),je.prototype.addEventListener=function(t,e){this.Aa.push(t,e)},je.prototype.addEventListener=je.prototype.addEventListener,je.prototype.removeEventListener=function(t,e){this.Aa.remove(t,e)},je.prototype.removeEventListener=je.prototype.removeEventListener,je.prototype.dispatchEvent=function(t){for(var e=this.Aa.get(t.type)||[],i=0;i<e.length;++i){t.target=this.S,t.currentTarget=this.S;var n=e[i];try{n.handleEvent?n.handleEvent(t):n.call(this,t)}catch(r){}if(t.a)break}return t.defaultPrevented},je.prototype.dispatchEvent=je.prototype.dispatchEvent,i(Ue),e("shaka.Player",Ue),Ue.prototype.o=function(){this.A=!0;var t=Promise.resolve();return this.l&&(t=this.l.cancel(new S(7,7e3))),t.then(function(){var t=Promise.all([Ke(this),this.w?this.w.o():null,this.i?this.i.o():null]);return this.a=this.i=this.Ja=this.w=this.s=this.f=null,t}.bind(this))},Ue.prototype.destroy=Ue.prototype.o,Ue.version="v2.0.2";var hs={};Ue.registerSupportPlugin=function(t,e){hs[t]=e},Ue.isBrowserSupported=function(){return!!(t.Promise&&t.Uint8Array&&Array.prototype.forEach&&t.MediaSource&&t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)},Ue.probeSupport=function(){return mt().then(function(t){var e=yt(),i=At();t={manifest:e,media:i,drm:t};for(var n in hs)t[n]=hs[n]();return t})},Ue.prototype.load=function(t,e,i){var n=this.hb(),r=new xe;return this.l=r,this.dispatchEvent(new Le("loading")),De(r.then(function(){return n}).then(function(){return bt(t,this.i,this.a.manifest.retryParameters,i)}.bind(this)).then(function(e){return this.m=new e,this.m.configure(this.a.manifest),this.m.start(t,this.i,this.Na.bind(this),this.Z.bind(this),this.Lc.bind(this))}.bind(this)).then(function(e){if(0==e.periods.length)throw new S(4,4014);return this.c=e,this.na=t,this.g=new et(this.i,this.Z.bind(this),this.Mc.bind(this)),this.g.configure(this.a.drm),this.g.init(e,!1)}.bind(this)).then(function(){return this.c.periods.forEach(this.Na.bind(this)),this.X=Date.now()/1e3,Promise.all([it(this.g,this.f),this.oa])}.bind(this)).then(function(){return this.j=new Ft(this.f,this.c.presentationTimeline,1*Math.max(this.c.minBufferTime||0,this.a.streaming.rebufferingGoal),e||null,this.Jb.bind(this),this.Nc.bind(this)),this.G=new Pt(this.f,this.h,this.s),this.b=new oe(this.j,this.G,this.i,this.c,this.Kc.bind(this),this.Nb.bind(this),this.Z.bind(this)),this.b.configure(this.a.streaming),this.b.init()}.bind(this)).then(function(){this.c.periods.forEach(this.Na.bind(this)),We(this),Ye(this),this.a.abr.manager.init(this.fb.bind(this)),this.l=null}.bind(this)))["catch"](function(t){return this.l==r&&(this.l=null,this.dispatchEvent(new Le("unloading"))),Promise.reject(t)}.bind(this))},Ue.prototype.load=Ue.prototype.load,Ue.prototype.configure=function(t){t.abr&&t.abr.manager&&t.abr.manager!=this.a.abr.manager&&(this.a.abr.manager.stop(),t.abr.manager.init(this.fb.bind(this))),Oe(this.a,t,qe(this),Ve(),""),Fe(this)},Ue.prototype.configure=Ue.prototype.configure,Ue.prototype.getConfiguration=function(){var t=qe(this);return Oe(t,this.a,qe(this),Ve(),""),t},Ue.prototype.getConfiguration=Ue.prototype.getConfiguration,Ue.prototype.Dc=function(){var t=qe(this);t.abr&&t.abr.manager&&t.abr.manager!=this.a.abr.manager&&(this.a.abr.manager.stop(),t.abr.manager.init(this.fb.bind(this))),this.a=qe(this),Fe(this)},Ue.prototype.resetConfiguration=Ue.prototype.Dc,Ue.prototype.nb=function(){return this.i},Ue.prototype.getNetworkingEngine=Ue.prototype.nb,Ue.prototype.Vb=function(){return this.na},Ue.prototype.getManifestUri=Ue.prototype.Vb,Ue.prototype.U=function(){return!!this.c&&this.c.presentationTimeline.U()},Ue.prototype.isLive=Ue.prototype.U,Ue.prototype.fa=function(){return!!this.c&&this.c.presentationTimeline.fa()},Ue.prototype.isInProgress=Ue.prototype.fa,Ue.prototype.Fc=function(){var t=0,e=0;return this.c&&(e=this.c.presentationTimeline,t=e.sa(),e=e.Ua()),{start:t,end:e}},Ue.prototype.seekRange=Ue.prototype.Fc,Ue.prototype.keySystem=function(){return this.g?this.g.keySystem():""},Ue.prototype.keySystem=Ue.prototype.keySystem,Ue.prototype.drmInfo=function(){return this.g?this.g.b:null},Ue.prototype.drmInfo=Ue.prototype.drmInfo,Ue.prototype.Zb=function(){return this.Ca},Ue.prototype.isBuffering=Ue.prototype.Zb,Ue.prototype.hb=function(){if(this.A)return Promise.resolve();if(this.dispatchEvent(new Le("unloading")),this.l){var t=new S(7,7e3);return this.l.cancel(t).then(this.Cb.bind(this))}return this.Cb()},Ue.prototype.unload=Ue.prototype.hb,Ue.prototype.Ta=function(){return this.j?this.j.Ta():0},Ue.prototype.getPlaybackRate=Ue.prototype.Ta,Ue.prototype.Zc=function(t){this.j&&zt(this.j,t)},Ue.prototype.trickPlay=Ue.prototype.Zc,Ue.prototype.Ob=function(){this.j&&zt(this.j,1)},Ue.prototype.cancelTrickPlay=Ue.prototype.Ob,Ue.prototype.getTracks=function(){if(!this.b)return[];var t=he(this.b);return te(ue(this.b),t).filter(function(t){return 0>this.ma.indexOf(t.id)}.bind(this))},Ue.prototype.getTracks=Ue.prototype.getTracks,Ue.prototype.Gc=function(t,e){if(this.b){var i=ee(ue(this.b),t);if(i){var n=i.stream;n.allowedByApplication&&n.allowedByKeySystem&&(this.C.push({timestamp:Date.now()/1e3,id:n.id,type:t.type,fromAdaptation:!1}),i={},i[t.type]=n,"text"!=t.type&&(n=he(this.b).text,this.configure({abr:{enabled:!1}}),i.text=n),He(this,i,e))}}},Ue.prototype.selectTrack=Ue.prototype.Gc,Ue.prototype.bc=function(){return"showing"==this.s.mode},Ue.prototype.isTextTrackVisible=Ue.prototype.bc,Ue.prototype.Ic=function(t){this.s.mode=t?"showing":"hidden",Xe(this)},Ue.prototype.setTextTrackVisibility=Ue.prototype.Ic,Ue.prototype.getStats=function(){Ge(this);var t={},e={},i=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};return this.b&&(e=he(this.b),t=e.video||{},e=e.audio||{}),{width:t.width||0,height:t.height||0,streamBandwidth:t.bandwidth+e.bandwidth||0,decodedFrames:Number(i.totalVideoFrames),droppedFrames:Number(i.droppedVideoFrames),estimatedBandwidth:this.a.abr.manager.getBandwidthEstimate(),playTime:this.pa,bufferingTime:this.J,switchHistory:this.C.slice(0)}},Ue.prototype.getStats=Ue.prototype.getStats,Ue.prototype.addTextTrack=function(t,e,i,n,r){if(!this.b)return Promise.reject();for(var s,a=ue(this.b),o=0;o<this.c.periods.length;o++)if(this.c.periods[o]==a){if(o==this.c.periods.length-1){if(s=this.c.presentationTimeline.da()-a.startTime,1/0==s)return Promise.reject()}else s=this.c.periods[o+1].startTime-a.startTime;break}var u={id:this.Qa++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1!=e?null:new Ut(1,0,s,function(){return[t]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:n,codecs:r||"",bandwidth:0,kind:i,encrypted:!1,keyId:null,language:e,allowedByApplication:!0,allowedByKeySystem:!0};return n={language:e,type:"text",primary:!1,drmInfos:[],streams:[u]},this.ma.push(u.id),a.streamSets.push(n),ce(this.b,u).then(function(){if(!this.A)return this.ma.splice(this.ma.indexOf(u.id),1),$e(this,a),We(this),{id:u.id,active:!1,type:"text",bandwidth:0,language:e,kind:i,width:null,height:null}}.bind(this))},Ue.prototype.addTextTrack=Ue.prototype.addTextTrack,Ue.prototype.Gb=function(t,e){this.Ba.width=t,this.Ba.height=e},Ue.prototype.setMaxHardwareResolution=Ue.prototype.Gb,$r=Ue.prototype,$r.Cb=function(){return this.m?Ke(this).then(function(){this.A||(this.Jb(!1),this.oa=Be(this))}.bind(this)):Promise.resolve()},$r.Na=function(t){var e=this.b?he(this.b):{};Qt(this.g,e,t),e=t.streamSets.some(ie),Zt(t,this.a.restrictions,this.Ba)&&!this.l&&We(this),t=!t.streamSets.some(ie),e?t&&this.Z(new S(4,4012)):this.Z(new S(4,4011))},$r.Oc=function(t,e,i){this.a.abr.manager.segmentDownloaded(t,e,i)},$r.Jb=function(t){Ge(this),this.Ca=t,this.dispatchEvent(new Le("buffering",{buffering:t}))},$r.Nc=function(){if(this.b){var t,e=this.b;for(t in e.b){var i=e.b[t];i.aa||0<_t(e.c,t,Kt(e.m))||i.la||(i.ga?i.la=!0:null==It(e.c,t)?null==i.$&&Ce(e,i,0):(Me(i),Ne(e,i,!1)))}}},$r.Kc=function(t){this.qa=!0,this.a.abr.manager.disable(),t=ne(t,this.a),t=ze(this,t,!0);for(var e in this.v)t[e]=this.v[e].stream;this.v={};for(e in t)this.C.push({timestamp:Date.now()/1e3,id:t[e].id,type:e,fromAdaptation:!0});return this.l||We(this),t},$r.Nb=function(){this.qa=!1,this.a.abr.enabled&&this.a.abr.manager.enable();for(var t in this.v){var e=this.v[t];le(this.b,t,e.stream,e.Rb)}this.v={}},$r.fb=function(t,e){var i,n=he(this.b);for(i in t){var r=t[i];n[i]!=r?this.C.push({timestamp:Date.now()/1e3,id:r.id,type:i,fromAdaptation:!0}):delete t[i]}if(!B(t)&&this.b){for(i in t)le(this.b,i,t[i],e||!1);Ye(this)}},$r.Z=function(t){this.dispatchEvent(new Le("error",{detail:t}))},$r.Lc=function(t){this.dispatchEvent(t)},$r.oc=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.Z(new S(3,3016,t,e))}}},$r.Mc=function(t){var e=["output-restricted","internal-error"],i=ue(this.b),n=!1;i.streamSets.forEach(function(i){i.streams.forEach(function(i){var r=i.allowedByKeySystem;i.keyId&&i.keyId in t&&(i.allowedByKeySystem=0>e.indexOf(t[i.keyId])),r!=i.allowedByKeySystem&&(n=!0)})}),$e(this,i),n&&We(this)};var cs="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),ls="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),fs=["loop","playbackRate"],ds=["pause","play"],ps=["adaptation","buffering","error","texttrackvisibility","trackschanged"],ms="getConfiguration getManifestUri getPlaybackRate getTracks getStats isBuffering isLive isTextTrackVisible seekRange".split(" "),ys=[["getConfiguration","configure"]],bs=[["isTextTrackVisible","setTextTrackVisibility"]],gs="configure resetConfiguration trickPlay cancelTrickPlay selectTrack setTextTrackVisibility addTextTrack".split(" "),vs=["load","unload"];$r=ti.prototype,$r.o=function(){return ei(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null),this.A=this.w=this.l=null,this.f=this.j=this.g=!1,this.h=this.c=this.b=this.a=this.i=null,Promise.resolve()},$r.N=function(){return this.f},$r.ab=function(){return this.v},$r.init=function(){if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){delete t.__onGCastApiAvailable,this.g=!0,this.l();var e=new chrome.cast.SessionRequest(this.C),e=new chrome.cast.ApiConfig(e,this.fc.bind(this),this.mc.bind(this),"origin_scoped");chrome.cast.initialize(e,function(){},function(){})}else t.__onGCastApiAvailable=function(t){t&&this.init()}.bind(this)},$r.cb=function(t){this.i=t,this.f&&ii(this,{type:"appData",appData:this.i})},$r.cast=function(t){return this.g?this.j?this.f?Promise.reject(new S(8,8002)):(this.h=new R,chrome.cast.requestSession(this.Za.bind(this,t),this.pb.bind(this)),this.h):Promise.reject(new S(8,8001)):Promise.reject(new S(8,8e3))},$r.get=function(t,e){if("video"==t){if(0<=ds.indexOf(e))return this.Ab.bind(this,t,e)}else if("player"==t){if(0<=gs.indexOf(e))return this.Ab.bind(this,t,e);if(0<=vs.indexOf(e))return this.Bc.bind(this,t,e);if(0<=ms.indexOf(e))return this.xb.bind(this,t,e)}return this.xb(t,e)},$r.set=function(t,e,i){this.b[t][e]=i,ii(this,{type:"set",targetName:t,property:e,value:i})},$r.Za=function(t,e){this.a=e,this.a.addUpdateListener(this.qb.bind(this)),this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.gc.bind(this)),this.qb(),ii(this,{type:"init",initState:t,appData:this.i}),this.h.resolve()},$r.pb=function(t){var e=8003;switch(t.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}this.h.reject(new S(8,e,t))},$r.xb=function(t,e){return this.b[t][e]},$r.Ab=function(t,e){ii(this,{type:"call",targetName:t,methodName:e,args:Array.prototype.slice.call(arguments,2)})},$r.Bc=function(t,e){var i=Array.prototype.slice.call(arguments,2),n=new R,r=this.m.toString();return this.m++,this.c[r]=n,ii(this,{type:"asyncCall",targetName:t,methodName:e,args:i,id:r}),n},$r.fc=function(t){var e=this.s();this.h=new R,this.Za(e,t)},$r.mc=function(t){this.j="available"==t,this.l()},$r.qb=function(){var t=!!this.a&&"connected"==this.a.status;if(this.f&&!t){this.A();for(var e in this.b)this.b[e]={};ei(this)}this.v=(this.f=t)?this.a.receiver.friendlyName:"",this.l()},$r.gc=function(t,e){var i=Ze(e);switch(i.type){case"event":var n=i.targetName,r=i.event;this.w(n,new Le(r.type,r));break;case"update":r=i.update;for(n in r){var s,i=this.b[n]||{};for(s in r[n])i[s]=r[n][s]}break;case"asyncComplete":if(n=i.id,s=i.error,i=this.c[n],delete this.c[n],i)if(s){n=new S(s.category,s.code);for(r in s)n[r]=s[r];i.reject(n)}else i.resolve()}},i(ni),e("shaka.cast.CastProxy",ni),ni.prototype.o=function(){var t=[this.i?this.i.o():null,this.b?this.b.o():null,this.a?this.a.o():null];return this.a=this.i=this.j=this.l=this.b=this.c=null,Promise.all(t)},ni.prototype.destroy=ni.prototype.o,ni.prototype.Yb=function(){return this.l},ni.prototype.getVideo=ni.prototype.Yb,ni.prototype.Wb=function(){return this.j},ni.prototype.getPlayer=ni.prototype.Wb,ni.prototype.Mb=function(){return!!this.a&&(this.a.g&&this.a.j)},ni.prototype.canCast=ni.prototype.Mb,ni.prototype.N=function(){return!!this.a&&this.a.N()},ni.prototype.isCasting=ni.prototype.N,ni.prototype.ab=function(){return this.a?this.a.ab():""},ni.prototype.receiverName=ni.prototype.ab,ni.prototype.cast=function(){var t=this.mb();return this.a.cast(t).then(function(){return this.b.hb()}.bind(this))},ni.prototype.cast=ni.prototype.cast,ni.prototype.cb=function(t){this.a.cb(t)},ni.prototype.setAppData=ni.prototype.cb,ni.prototype.Xc=function(){var t=this.a;if(t.f){var e=t.s();chrome.cast.requestSession(t.Za.bind(t,e),t.pb.bind(t))}},ni.prototype.suggestDisconnect=ni.prototype.Xc,$r=ni.prototype,$r.mb=function(){var t={video:{},player:{},playerAfterLoad:{},manifest:this.b.na,startTime:null};return this.c.pause(),fs.forEach(function(e){t.video[e]=this.c[e]}.bind(this)),this.c.ended||(t.startTime=this.c.currentTime),ys.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.player[i]=e}.bind(this)),bs.forEach(function(e){var i=e[1];e=this.b[e[0]](),t.playerAfterLoad[i]=e}.bind(this)),t},$r.Pc=function(){this.dispatchEvent(new Le("caststatuschanged"))},$r.Rc=function(){ys.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this));var t=this.a.get("player","getManifestUri")(),e=this.a.get("video","ended"),i=Promise.resolve(),n=this.c.autoplay,r=null;e||(r=this.a.get("video","currentTime")),t&&(this.c.autoplay=!1,i=this.b.load(t,r),i["catch"](function(t){this.b.dispatchEvent(new Le("error",{detail:t}))}.bind(this)));var s={};fs.forEach(function(t){s[t]=this.a.get("video",t)}.bind(this)),i.then(function(){fs.forEach(function(t){this.c[t]=s[t]}.bind(this)),bs.forEach(function(t){var e=t[1];t=this.a.get("player",t[0])(),this.b[e](t)}.bind(this)),this.c.autoplay=n,t&&this.c.play()}.bind(this))},$r.bd=function(t){if("addEventListener"==t)return this.g.addEventListener.bind(this.g);if("removeEventListener"==t)return this.g.removeEventListener.bind(this.g);if(this.a.N()&&!Object.keys(this.a.b.video).length){var e=this.c[t];if("function"!=typeof e)return e}return this.a.N()?this.a.get("video",t):(e=this.c[t],"function"==typeof e&&(e=e.bind(this.c)),e)},$r.dd=function(t,e){this.a.N()?this.a.set("video",t,e):this.c[t]=e},$r.cd=function(t){this.a.N()||this.g.dispatchEvent(new Le(t.type,t))},$r.wc=function(t){return"addEventListener"==t?this.f.addEventListener.bind(this.f):"removeEventListener"==t?this.f.removeEventListener.bind(this.f):"getNetworkingEngine"==t?this.b.nb.bind(this.b):this.a.N()&&!Object.keys(this.a.b.video).length&&0<=ms.indexOf(t)||!this.a.N()?(t=this.b[t],t.bind(this.b)):this.a.get("player",t)},$r.xc=function(t){this.a.N()||this.f.dispatchEvent(t)},$r.Qc=function(t,e){this.a.N()&&("video"==t?this.g.dispatchEvent(e):"player"==t&&this.f.dispatchEvent(e))},i(si),e("shaka.cast.CastReceiver",si),si.prototype.$b=function(){return this.i},si.prototype.isConnected=si.prototype.$b,si.prototype.ac=function(){return this.c},si.prototype.isIdle=si.prototype.ac,si.prototype.o=function(){var e=this.a?this.a.o():Promise.resolve();return null!=this.f&&t.clearTimeout(this.f),this.l=this.j=this.a=this.b=null,this.i=!1,this.c=!0,this.f=this.g=null,e.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},si.prototype.destroy=si.prototype.o,$r=si.prototype,$r.vb=function(){this.i=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length,oi(this)},$r.yb=function(t,e){this.$a(),hi(this,{type:"event",targetName:t,event:e})},$r.$a=function(){null!=this.f&&t.clearTimeout(this.f),this.f=t.setTimeout(this.$a.bind(this),500);var e={video:{},player:{}};ls.forEach(function(t){e.video[t]=this.b[t]}.bind(this)),ms.forEach(function(t){e.player[t]=this.a[t]()}.bind(this));var i=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();i&&(e.video.volume=i.level,e.video.muted=i.muted),hi(this,{type:"update",update:e})},$r.Tb=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&hi(this,{type:"update",update:{video:{volume:t.level,muted:t.muted}}}),hi(this,{type:"event",targetName:"video",event:{type:"volumechange"}})},$r.hc=function(t){var e=Ze(t.data);switch(e.type){case"init":ui(this,e.initState,e.appData),this.$a();break;case"appData":this.l(e.appData);break;case"set":var i=e.targetName,n=e.property,r=e.value;if("video"==i){if(e=cast.receiver.CastReceiverManager.getInstance(),"volume"==n){e.setSystemVolumeLevel(r);break}if("muted"==n){e.setSystemVolumeMuted(r);break}}this.j[i][n]=r;break;case"call":i=e.targetName,n=e.methodName,r=e.args,i=this.j[i],i[n].apply(i,r);break;case"asyncCall":i=e.targetName,n=e.methodName,r=e.args,e=e.id,t=t.senderId,i=this.j[i],i[n].apply(i,r).then(this.Eb.bind(this,t,e,null),this.Eb.bind(this,t,e))}},$r.Eb=function(t,e,i){hi(this,{type:"asyncComplete",id:e,error:i},t)};var ws={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Es=1/15,Ss=1;e("shaka.media.SegmentIndex",Gi),Gi.prototype.o=function(){return this.a=null,Promise.resolve()},Gi.prototype.destroy=Gi.prototype.o,Gi.prototype.find=function(t){for(var e=this.a.length-1;0<=e;--e){var i=this.a[e];if(t>=i.startTime&&t<i.endTime)return i.position}return null},Gi.prototype.find=Gi.prototype.find,Gi.prototype.get=function(t){return this.a.length?(t-=this.a[0].position,0>t||t>=this.a.length?null:this.a[t]):null},Gi.prototype.get=Gi.prototype.get,Gi.prototype.Xa=function(t){for(var e=[],i=0,n=0;i<this.a.length&&n<t.length;){var r=this.a[i],s=t[n];r.startTime<s.startTime?(e.push(r),i++):(r.startTime>s.startTime||(.1<Math.abs(r.endTime-s.endTime)?e.push(s):e.push(r),i++),n++)}for(;i<this.a.length;)e.push(this.a[i++]);if(e.length)for(i=e[e.length-1].position+1;n<t.length;)s=t[n++],s=new Ut((i++),s.startTime,s.endTime,s.a,s.L,s.D),e.push(s);else e=t;this.a=e},Gi.prototype.merge=Gi.prototype.Xa,Gi.prototype.Sa=function(t){for(var e=0;e<this.a.length&&!(this.a[e].endTime>t);++e);this.a.splice(0,e)},Gi.prototype.evict=Gi.prototype.Sa;var Ts;e("shaka.dash.DashParser",dn),$r=dn.prototype,$r.configure=function(t){this.c=t},$r.start=function(t,e,i,n,r){return this.h=[t],this.a=e,this.j=i,this.l=n,this.m=r,pn(this).then(function(){return this.a&&bn(this,0),this.b}.bind(this))},$r.stop=function(){return this.a&&this.a.Kb(this.Ka),this.c=this.m=this.l=this.j=this.a=null,this.h=[],this.b=null,this.g=[],this.i={},null!=this.f&&(t.clearTimeout(this.f),this.f=null),Promise.resolve()},$r.uc=function(t,e){t.P=gn(e,t.K,null);var i=!1,n=li(e,"Role"),r=void 0;"text"==t.P.contentType&&(r="subtitle");for(var s=0;s<n.length;s++){var a=n[s].getAttribute("schemeIdUri");if(null==a||"urn:mpeg:dash:role:2011"==a)switch(a=n[s].getAttribute("value")){case"main":i=!0;break;case"caption":case"subtitle":r=a}}var n=!!ci(e,"InbandEventStream"),o=[];li(e,"SupplementalProperty").forEach(function(t){var e=t.getAttribute("schemeIdUri");("urn:mpeg:dash:adaptation-set-switching:2016"==e||"http://dashif.org/guidelines/AdaptationSetSwitching"==e||"http://dashif.org/descriptor/AdaptationSetSwitching"==e)&&(t=t.getAttribute("value"))&&o.push.apply(o,t.split(","))});var u=null;if(li(e,"EssentialProperty").forEach(function(t){"http://dashif.org/guidelines/trickmode"==t.getAttribute("schemeIdUri")&&(u=t.getAttribute("value"))}),null!=u)return null;if(s=li(e,"ContentProtection"),s=Ei(s,this.c.dash.customScheme),a=Jt(e.getAttribute("lang")||"und"),r=li(e,"Representation").map(this.vc.bind(this,t,s,r,a)).filter(function(t){return!!t}),!r.length)throw new S(4,4003);return t.P.contentType||(t.P.contentType=Tn(r[0].mimeType,r[0].codecs)),{id:t.P.id||"__fake__"+this.v++,contentType:t.P.contentType,language:a,cc:i,streams:r,drmInfos:s.drmInfos,Yc:o,ba:n}},$r.vc=function(t,e,i,n,r){if(t.u=gn(r,t.P,null),!wn(t.u))return null;t.bandwidth=di(r,"bandwidth",gi)||void 0;var s;if(s=this.Cc.bind(this),t.u.Ga)s=tn(t,s);else if(t.u.Y)s=rn(t,this.i);else if(t.u.Ha)s=un(t,s,this.i,!!this.b);else{var a=t.u.M,o=t.H.duration||0;s={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(t){return 0<=t&&t<o?1:null},getSegmentReference:function(t){return 1!=t?null:new Ut(1,0,o,function(){return a},0,null)},initSegmentReference:null,presentationTimeOffset:0}}return r=li(r,"ContentProtection"),r=Si(r,this.c.dash.customScheme,e),{id:this.v++,createSegmentIndex:s.createSegmentIndex,findSegmentPosition:s.findSegmentPosition,getSegmentReference:s.getSegmentReference,initSegmentReference:s.initSegmentReference,presentationTimeOffset:s.presentationTimeOffset,mimeType:t.u.mimeType,codecs:t.u.codecs,frameRate:t.u.frameRate,bandwidth:t.bandwidth,width:t.u.width,height:t.u.height,kind:i,encrypted:0<e.drmInfos.length,keyId:r,language:n,allowedByApplication:!0,allowedByKeySystem:!0}},$r.Sc=function(){this.f=null;var t=Date.now();pn(this).then(function(){this.a&&bn(this,(Date.now()-t)/1e3)}.bind(this))["catch"](function(t){this.l(t),this.a&&bn(this,0)}.bind(this))},$r.Cc=function(t,e,i){return t=M(t,this.c.retryParameters),null!=e&&(t.headers.Range="bytes="+e+"-"+(null!=i?i:"")),this.a.request(1,t).then(function(t){return t.data})},$r.Ka=function(t,e){if(1==t){var i=new Mi(new DataView(e.data)),n=Vi(1701671783,i);if(-1!=n){var r=i.a-8+n;if(Bi(i,4),n=Fi(i),"urn:mpeg:dash:event:2012"==n)pn(this);else{var s=Fi(i),a=Li(i),o=Li(i),u=Li(i),h=Li(i),i=Ui(i,r-i.a);this.m(new Le("emsg",{detail:{ld:n,value:s,Ia:a,kd:o,hd:u,id:h,jd:i}}))}}}},ns.mpd=dn,is["application/dash+xml"]=dn,e("shaka.media.TtmlTextParser",kn),kn.m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,kn.v=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,kn.s=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,kn.w=/^(\d*\.?\d*)f$/,kn.C=/^(\d*\.?\d*)t$/,kn.A=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,kn.l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,kn.Ja={left:"start",center:"center",right:"end",start:"start",end:"end"},kn.Qa={left:"line-left",center:"center",right:"line-right"},kn.b=function(t){var e=[];if(!t)return e;for(var i=t.childNodes,n=0;n<i.length;n++){var r="span"==i[n].nodeName&&"p"==t.nodeName;i[n].nodeType!=Node.ELEMENT_NODE||"br"==i[n].nodeName||r||(r=kn.b(i[n]),e=e.concat(r))}return e.length||e.push(t),e},kn.g=function(t){t=t.childNodes;for(var e=0;e<t.length;e++)"br"==t[e].nodeName&&0<e?t[e-1].textContent+="\n":0<t[e].childNodes.length&&kn.g(t[e])},kn.c=function(t,e,i,n,r){if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&""==t.textContent)return null;kn.g(t);var s=kn.a(t.getAttribute("begin"),i),a=kn.a(t.getAttribute("end"),i);i=kn.a(t.getAttribute("dur"),i);var o=t.textContent;if(null==a&&null!=i&&(a=s+i),null==s||null==a)throw new S(2,2001);return(e=vt(s+e,a+e,o))?(r=kn.i(t,"region",r),kn.oa(e,t,r,n),e):null},kn.oa=function(t,e,i,n){var r,s=kn.f(e,i,n,"tts:extent");s&&(r=kn.l.exec(s))&&(t.size=Number(r[1])),r=kn.f(e,i,n,"tts:writingMode"),s=!0,"tb"==r||"tblr"==r?t.vertical="lr":"tbrl"==r?t.vertical="rl":s=!1,(r=kn.f(e,i,n,"tts:origin"))&&(r=kn.l.exec(r))&&(s?(t.position=Number(r[2]),t.line=Number(r[1])):(t.position=Number(r[1]),t.line=Number(r[2])),t.snapToLines=!1),(e=kn.f(e,i,n,"tts:textAlign"))&&(t.align=e,"center"==e&&("center"!=t.align&&(t.align="middle"),t.position="auto"),t.positionAlign=kn.Qa[e],t.lineAlign=kn.Ja[e])},kn.f=function(t,e,i,n){for(var r=kn.b(e),s=0;s<r.length;s++){var a=r[s].getAttribute(n);if(a)return a}return r=kn.i,(t=r(e,"style",i)||r(t,"style",i))?t.getAttribute(n):null},kn.i=function(t,e,i){if(!t||1>i.length)return null;var n=null;if(t=kn.pa(t,e))for(e=0;e<i.length;e++)if(i[e].getAttribute("xml:id")==t){n=i[e];break}return n},kn.pa=function(t,e){for(var i=null;t&&!(i=t.getAttribute(e));){var n=t.parentNode;if(!(n instanceof Element))break;t=n}return i},kn.a=function(t,e){var i=null;return kn.m.test(t)?i=kn.qa(e,t):kn.v.test(t)?i=kn.h(kn.v,t):kn.s.test(t)?i=kn.h(kn.s,t):kn.w.test(t)?i=kn.Ba(e,t):kn.C.test(t)?i=kn.Ca(e,t):kn.A.test(t)&&(i=kn.h(kn.A,t)),i},kn.Ba=function(t,e){var i=kn.w.exec(e);return Number(i[1])/t.frameRate},kn.Ca=function(t,e){var i=kn.C.exec(e);return Number(i[1])/t.a},kn.qa=function(t,e){var i=kn.m.exec(e),n=Number(i[1]),r=Number(i[2]),s=Number(i[3]),a=Number(i[4]),a=a+(Number(i[5])||0)/t.b,s=s+a/t.frameRate;return s+60*r+3600*n},kn.h=function(t,e){var i=t.exec(e);return i&&""!=i[0]?(Number(i[4])||0)/1e3+(Number(i[3])||0)+60*(Number(i[2])||0)+3600*(Number(i[1])||0):null},rs["application/ttml+xml"]=kn,e("shaka.media.Mp4TtmlParser",An),An.S=1937010800,rs['application/mp4; codecs="stpp"']=An,e("shaka.media.VttTextParser",Nn),Nn.c=function(t,e,i,n){if(1==t.length&&!t[0]||/^NOTE($|[ \t])/.test(t[0]))return null;var r=null;0>t[0].indexOf("-->")&&(r=t[0],t.splice(0,1));var s=new In(t[0]),a=Nn.a(s),o=_n(s,/[ \t]+--\x3e[ \t]+/g),u=Nn.a(s);if(null==a||!o||null==u)throw new S(2,2001);if(a+=e,u+=e,n&&(a+=i,u+=i),t=vt(a,u,t.slice(1).join("\n").trim()),!t)return null;for(_n(s,/[ \t]+/gm),e=Rn(s);e;)Nn.j(t,e),_n(s,/[ \t]+/gm),e=Rn(s);return null!=r&&(t.id=r),t},Nn.j=function(t,e){var i;(i=/^align:(start|middle|center|end|left|right)$/.exec(e))?(t.align=i[1],"center"==i[1]&&"center"!=t.align&&(t.position="auto",t.align="middle")):(i=/^vertical:(lr|rl)$/.exec(e))?t.vertical=i[1]:(i=/^size:(\d{1,2}|100)%$/.exec(e))?t.size=Number(i[1]):(i=/^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(e))?(t.position=Number(i[1]),i[2]&&(t.positionAlign=i[2])):(i=/^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(e))?(t.snapToLines=!1,t.line=Number(i[1]),i[2]&&(t.lineAlign=i[2])):(i=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(e))&&(t.snapToLines=!0,t.line=Number(i[1]),i[2]&&(t.lineAlign=i[2]))},Nn.a=function(t){if(t=_n(t,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g),!t)return null;var e=Number(t[2]),i=Number(t[3]);return 59<e||59<i?null:Number(t[4])/1e3+i+60*e+3600*(Number(t[1])||0)},rs["text/vtt"]=Nn,rs['text/vtt; codecs="vtt"']=Nn,e("shaka.media.Mp4VttParser",Cn),Cn.Aa=function(t,e,i,n){for(t=new Mi(new DataView(t)),i+=e,n+=e,e=[];xi(t);){var r=Vi(Cn.ma,t);if(-1==r)break;(r=Cn.c(Ui(t,r-8).buffer,i,n))&&e.push(r)}return e},Cn.c=function(t,e,i){t=new Mi(new DataView(t));for(var n,r,s;xi(t);){var a=Li(t),o=Li(t),u=q(Ui(t,a-8).buffer);switch(1==a&&ji(t),o){case Cn.J:n=u;break;case Cn.G:s=u;break;case Cn.X:r=u}}if(!n)throw new S(2,2008);if(e=vt(e,i,n),!e)return null;if(s&&(e.id=s),r)for(r=new In(r),s=Rn(r);s;)Nn.j(e,s),_n(r,/[ \t]+/gm),s=Rn(r);return e},Cn.na=2004251764,Cn.ma=1987343459,Cn.J=1885436268,Cn.G=1768187247,Cn.X=1937011815,rs['application/mp4; codecs="wvtt"']=Cn,e("shaka.net.DataUriPlugin",Mn),es.data=Mn,e("shaka.net.HttpPlugin",xn),es.http=xn,es.https=xn,$r=Dn.prototype,$r.init=function(e){if(!t.indexedDB)return Promise.reject(new S(9,9e3));var i=t.indexedDB.open("shaka_offline_db",1),n=new R;return i.onupgradeneeded=function(t){t=t.target.result;for(var i in e)t.createObjectStore(i,{keyPath:e[i]})},i.onsuccess=function(t){this.a=t.target.result,n.resolve()}.bind(this),i.onerror=Bn.bind(null,i,n),n.then(function(){var t=Object.keys(e);return Promise.all(t.map(function(t){return jn(this,t).then(function(e){this.b[t]=e}.bind(this))}.bind(this)))}.bind(this))},$r.o=function(){return Promise.all(this.c.map(function(t){try{t.transaction.abort()}catch(e){}return t.I["catch"](P)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))},$r.get=function(t,e){return Un(this,t,"readonly",function(t){return t.get(e)})},$r.forEach=function(t,e){return Un(this,t,"readonly",function(t){return t.openCursor()},function(t){t&&(e(t.value),t["continue"]())})},$r.remove=function(t,e){return Un(this,t,"readwrite",function(t){return t["delete"](e)})};var ks={manifest:"key",segment:"key"};e("shaka.offline.OfflineManifestParser",Kn),Kn.prototype.configure=function(){},Kn.prototype.start=function(t){var e=/^offline:([0-9]+)$/.exec(t);if(!e)return Promise.reject(new S(1,9004,t));var i=Number(e[1]),n=new Dn;return n.init(ks).then(function(){return n.get("manifest",i)}).then(function(t){if(!t)throw new S(9,9003,i);return Vn(t)}).then(function(t){return n.o().then(function(){return t})},function(t){return n.o().then(function(){throw t})})},Kn.prototype.stop=function(){return Promise.resolve()},is["application/x-offline-manifest"]=Kn,e("shaka.offline.OfflineScheme",qn),es.offline=qn,Hn.prototype.o=function(){var t=this.j||Promise.resolve();return this.b={},this.j=this.a=this.l=this.m=this.i=null,t},e("shaka.offline.Storage",Yn),Yn.support=Wn,Yn.prototype.o=function(){var t=this.l,e=this.a,i=this.g?this.g.o()["catch"](function(){}).then(function(){return Promise.all(t.map(function(t){return e.remove("segment",t)}))}).then(function(){return e.o()}):Promise.resolve();return this.j=this.c=this.g=this.a=null,i},Yn.prototype.destroy=Yn.prototype.o,Yn.prototype.configure=function(t){Oe(this.j,t,Jn(this),{},"")},Yn.prototype.configure=Yn.prototype.configure,Yn.prototype.Vc=function(t,e,i){function n(t){s=t}if(this.v)return Promise.reject(new S(9,9006));this.v=!0;var r,s=null;return Zn(this).then(function(){return ir(this),Xn(this,t,n,i)}.bind(this)).then(function(i){if(ir(this),this.b=i.manifest,this.h=i.Sb,this.b.presentationTimeline.U()||this.b.presentationTimeline.fa())throw new S(9,9005,t);this.b.periods.forEach(this.s.bind(this)),this.f=this.a.b.manifest++,this.m=0,i=this.b.periods.map(this.w.bind(this));var n=this.h.b,s=st(this.h);if(n){if(!s.length)throw new S(9,9007,t);n.initData=[]}return r={key:this.f,originalManifestUri:t,duration:this.m,size:0,periods:i,sessionIds:s,drmInfo:n,appMetadata:e},zn(this.g,r)}.bind(this)).then(function(){if(ir(this),s)throw s;return On(this.a,"manifest",r)}.bind(this)).then(function(){return Qn(this)}.bind(this)).then(function(){return Fn(r)}.bind(this))["catch"](function(t){return Qn(this)["catch"](P).then(function(){throw t})}.bind(this))},Yn.prototype.store=Yn.prototype.Vc,Yn.prototype.remove=function(t){function e(t){6013!=t.code&&(a=t)}var i=t.offlineUri,n=/^offline:([0-9]+)$/.exec(i);if(!n)return Promise.reject(new S(9,9004,i));var r,s,a=null,o=Number(n[1]);return Zn(this).then(function(){return ir(this),this.a.get("manifest",o)}.bind(this)).then(function(t){if(ir(this),!t)throw new S(9,9003,i);return r=t,t=Vn(r),s=new et(this.c.i,e,function(){}),s.configure(this.c.getConfiguration().drm),s.init(t,!0)}.bind(this)).then(function(){return nt(s,r.sessionIds)}.bind(this)).then(function(){return s.o()}.bind(this)).then(function(){
-if(ir(this),a)throw a;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(k,[])}).reduce(k,[]),i=0,n=e.length,s=this.j.progressCallback;return Ln(this.a,function(r){return r=e.indexOf(r.key),0<=r&&(s(t,i/n),i++),0<=r}.bind(this))}.bind(this)).then(function(){return ir(this),this.j.progressCallback(t,1),this.a.remove("manifest",o)}.bind(this))},Yn.prototype.remove=Yn.prototype.remove,Yn.prototype.list=function(){var t=[];return Zn(this).then(function(){return ir(this),this.a.forEach("manifest",function(e){t.push(Fn(e))})}.bind(this)).then(function(){return t})},Yn.prototype.list=Yn.prototype.list,Yn.prototype.A=function(t){var e=[],i=t.filter(function(t){return"video"==t.type&&480>=t.height});i.sort(function(t,e){return e.bandwidth-t.bandwidth}),i.length&&e.push(i[0]);for(var n=Jt(this.c.getConfiguration().preferredAudioLanguage),i=[0,as,os],r=t.filter(function(t){return"audio"==t.type}),i=i.map(function(t){return r.filter(function(e){return e=Jt(e.language),Xt(t,n,e)})}),s=r,a=0;a<i.length;a++)i[a].length&&(s=i[a]);s.sort(function(t,e){return t.bandwidth-e.bandwidth}),s.length&&e.push(s[Math.floor(s.length/2)]);var i=Jt(this.c.getConfiguration().preferredTextLanguage),o=Xt.bind(null,os,i);return e.push.apply(e,t.filter(function(t){var e=Jt(t.language);return"text"==t.type&&o(e)})),e},Yn.prototype.s=function(t){function e(t,e,i){return e=e.filter(function(t){return t.type==i}),0==e.length?null:ee(t,e[0]).stream}var i={};this.i&&(i={video:e(this.b.periods[0],this.i,"video"),audio:e(this.b.periods[0],this.i,"audio")}),Qt(this.h,i,t),Zt(t,this.c.getConfiguration().restrictions,{width:1/0,height:1/0})},Yn.prototype.w=function(t){var e=te(t,null),e=this.j.trackSelectionCallback(e);this.i||(this.i=e,this.b.periods.forEach(this.s.bind(this)));for(var i=e.length-1;0<i;--i){for(var n=!1,r=i-1;0<=r;--r)if(e[i].type==e[r].type&&e[i].kind==e[r].kind&&e[i].language==e[r].language){n=!0;break}if(n)break}return e=e.map(function(e){return e=ee(t,e),er(this,t,e.Wc,e.stream)}.bind(this)),{startTime:t.startTime,streams:e}},hs.offline=Wn,e("shaka.polyfill.installAll",function(){for(var t=0;t<Ps.length;++t)Ps[t]()});var Ps=[];e("shaka.polyfill.register",nr),nr(function(){if(t.Document){var e=Element.prototype;e.requestFullscreen=e.requestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullscreen,e=Document.prototype,e.exitFullscreen=e.exitFullscreen||e.mozCancelFullScreen||e.msExitFullscreen||e.webkitExitFullscreen,"fullscreenElement"in document||Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),document.addEventListener("webkitfullscreenchange",rr),document.addEventListener("webkitfullscreenerror",rr),document.addEventListener("mozfullscreenchange",rr),document.addEventListener("mozfullscreenerror",rr),document.addEventListener("MSFullscreenChange",rr),document.addEventListener("MSFullscreenError",rr)}}),or.prototype.createMediaKeys=function(){var t=new hr(this.keySystem);return Promise.resolve(t)},or.prototype.getConfiguration=function(){return this.a},hr.prototype.createSession=function(t){if("temporary"!=(t||"temporary"))throw new TypeError("Session type "+t+" is unsupported on this platform.");return new lr(this.a)},hr.prototype.setServerCertificate=function(){return Promise.reject(Error("setServerCertificate not supported on this platform."))},i(lr),$r=lr.prototype,$r.generateRequest=function(t,e){this.a=new R;try{this.c=this.g.createSession("video/mp4",new Uint8Array(e),null),L(this.f,this.c,"mskeymessage",this.kc.bind(this)),L(this.f,this.c,"mskeyadded",this.ic.bind(this)),L(this.f,this.c,"mskeyerror",this.jc.bind(this)),pr(this,"status-pending")}catch(i){this.a.reject(i)}return this.a},$r.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},$r.update=function(t){this.b=new R;try{this.c.update(new Uint8Array(t))}catch(e){this.b.reject(e)}return this.b},$r.close=function(){try{this.c.close(),this.closed.resolve(),j(this.f)}catch(t){this.closed.reject(t)}return this.closed},$r.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},$r.kc=function(t){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new Le("message",{messageType:void 0==this.keyStatuses.Va()?"licenserequest":"licenserenewal",message:t.message.buffer}))},$r.ic=function(){this.a?(pr(this,"usable"),this.a.resolve(),this.a=null):this.b&&(pr(this,"usable"),this.b.resolve(),this.b=null)},$r.jc=function(){var t=Error("EME PatchedMediaKeysMs key error");if(t.errorCode=this.c.error,this.a)this.a.reject(t),this.a=null;else if(this.b)this.b.reject(t),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:pr(this,"output-not-allowed");default:pr(this,"internal-error")}};var As;$r=mr.prototype,$r.eb=function(t){this.size=void 0==t?0:1,this.a=t},$r.Va=function(){return this.a},$r.forEach=function(t){this.a&&t(this.a,As)},$r.get=function(t){if(this.has(t))return this.a},$r.has=function(t){var e=As;return!(!this.a||!tt(new Uint8Array(t),new Uint8Array(e)))},$r.keys=function(){},gr.prototype.createSession=function(){},gr.prototype.setServerCertificate=function(){},vr.prototype.getConfiguration=function(){},vr.prototype.createMediaKeys=function(){};var Is="";kr.prototype.createMediaKeys=function(){var t=new Pr(this.a);return Promise.resolve(t)},kr.prototype.getConfiguration=function(){return this.b},$r=Pr.prototype,$r.createSession=function(t){var e=t||"temporary";if("temporary"!=e&&"persistent-license"!=e)throw new TypeError("Session type "+t+" is unsupported on this platform.");return t=this.b||document.createElement("video"),t.src||(t.src="about:blank"),e=new _r(t,this.h,e),this.c.push(e),e},$r.setServerCertificate=function(){return Promise.reject(Error("setServerCertificate not supported on this platform."))},$r.tc=function(t){var e=document.createEvent("CustomEvent");e.initCustomEvent("encrypted",!1,!1,null),e.initDataType="webm",e.initData=t.initData,this.b.dispatchEvent(e)},$r.sc=function(t){var e=Ir(this,t.sessionId);e&&(t=new Le("message",{messageType:void 0==e.keyStatuses.Va()?"licenserequest":"licenserenewal",message:t.message}),e.b&&(e.b.resolve(),e.b=null),e.dispatchEvent(t))},$r.qc=function(t){(t=Ir(this,t.sessionId))&&(Nr(t,"usable"),t.a&&t.a.resolve(),t.a=null)},$r.rc=function(t){var e=Ir(this,t.sessionId);if(e){var i=Error("EME v0.1b key error");i.errorCode=t.errorCode,i.errorCode.systemCode=t.systemCode,!t.sessionId&&e.b?(i.method="generateRequest",45==t.systemCode&&(i.message="Unsupported session type."),e.b.reject(i),e.b=null):t.sessionId&&e.a?(i.method="update",e.a.reject(i),e.a=null):(i=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Nr(e,"output-restricted"):1==i?Nr(e,"expired"):Nr(e,"internal-error"))}},i(_r),$r=_r.prototype,$r.gb=function(t,e){if(this.a)this.a.then(this.gb.bind(this,t,e))["catch"](this.gb.bind(this,t,e));else{this.a=t;var i,n;"webkit-org.w3.clearkey"==this.c?(i=q(e),n=JSON.parse(i),"oct"!=n.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),i=J(n.keys[0].k),n=J(n.keys[0].kid)):(i=new Uint8Array(e),n=null);var r=Er("addKey");try{this.f[r](this.c,i,n,this.sessionId)}catch(s){this.a.reject(s),this.a=null}}},$r.generateRequest=function(t,e){return Rr(this,e,null)},$r.load=function(t){return"persistent-license"==this.g?Rr(this,null,t):Promise.reject(Error("Not a persistent session."))},$r.update=function(t){var e=new R;return this.gb(e,t),e},$r.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var t=Er("cancelKeyRequest");try{this.f[t](this.c,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},$r.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var _s;$r=Cr.prototype,$r.eb=function(t){this.size=void 0==t?0:1,this.a=t},$r.Va=function(){return this.a},$r.forEach=function(t){this.a&&t(this.a,_s)},$r.get=function(t){if(this.has(t))return this.a},$r.has=function(t){var e=_s;return!(!this.a||!tt(new Uint8Array(t),new Uint8Array(e)))},$r.keys=function(){},nr(function(){!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?wr("webkit"):HTMLMediaElement.prototype.generateKeyRequest?wr(""):t.MSMediaKeys?(As=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ur,t.MediaKeys=hr,t.MediaKeySystemAccess=or,navigator.requestMediaKeySystemAccess=ar):(navigator.requestMediaKeySystemAccess=yr,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=br,t.MediaKeys=gr,t.MediaKeySystemAccess=vr))}),nr(function(){if(t.MediaSource){var e=navigator.vendor,i=navigator.appVersion;!e||!i||0>e.indexOf("Apple")||(0<=i.indexOf("Version/8")?t.MediaSource=null:0<=i.indexOf("Version/9")?Mr():0<=i.indexOf("Version/10")&&(Mr(),xr()))}});var Rs=0;Lr.prototype.then=function(t,e){var i=new Lr;switch(this.ia){case 1:Kr(this,i,t);break;case 2:Kr(this,i,e);break;case Rs:this.c.push({I:i,Da:t}),this.b.push({I:i,Da:e})}return i},Lr.prototype["catch"]=function(t){return this.then(void 0,t)},Lr.prototype.W=function(t){if(this.ia==Rs){for(this.Oa=t,this.ia=1,t=0;t<this.c.length;++t)Kr(this,this.c[t].I,this.c[t].Da);this.c=[],this.b=[]}},Lr.prototype.a=function(t){if(this.ia==Rs){for(this.Oa=t,this.ia=2,t=0;t<this.b.length;++t)Kr(this,this.b[t].I,this.b[t].Da);this.c=[],this.b=[]}};var Ns=null,Cs=[];nr(function(e){t.setImmediate?(Hr=function(e){return t.setImmediate(e)},Gr=function(e){return t.clearImmediate(e)}):(Hr=function(e){return t.setTimeout(e,0)},Gr=function(e){return t.clearTimeout(e)}),t.Promise&&!e||(t.Promise=Lr,t.Promise.resolve=jr,t.Promise.reject=Ur,t.Promise.all=Br,t.Promise.race=Fr,t.Promise.prototype.then=Lr.prototype.then,t.Promise.prototype["catch"]=Lr.prototype["catch"])}),nr(function(){if(t.HTMLVideoElement){var e=HTMLVideoElement.prototype;!e.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in e&&(e.getVideoPlaybackQuality=zr)}})}).call(r,this),"undefined"!=typeof t&&t.exports?t.exports=r.shaka:(n=function(){return r.shaka}.call(e,i,e,t),!(void 0!==n&&(t.exports=n)))}()},function(e,i){e.exports=t}])}); \ No newline at end of file
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory(require("Clappr"));
+ else if(typeof define === 'function' && define.amd)
+ define(["Clappr"], factory);
+ else if(typeof exports === 'object')
+ exports["DashShakaPlayback"] = factory(require("Clappr"));
+ else
+ root["DashShakaPlayback"] = factory(root["Clappr"]);
+})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();var _get=function get(_x2,_x3,_x4){var _again=true;_function: while(_again) {var object=_x2,property=_x3,receiver=_x4;_again = false;if(object === null)object = Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc === undefined){var parent=Object.getPrototypeOf(object);if(parent === null){return undefined;}else {_x2 = parent;_x3 = property;_x4 = receiver;_again = true;desc = parent = undefined;continue _function;}}else if('value' in desc){return desc.value;}else {var getter=desc.get;if(getter === undefined){return undefined;}return getter.call(receiver);}}};function _interopRequireDefault(obj){return obj && obj.__esModule?obj:{'default':obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass,superClass){if(typeof superClass !== 'function' && superClass !== null){throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__ = superClass;}var _clappr=__webpack_require__(1);var _shakaPlayer=__webpack_require__(2);var _shakaPlayer2=_interopRequireDefault(_shakaPlayer);var SEND_STATS_AT=30 * 1000;var AUTO=-1;var SHAKA_READY='shaka:ready';var DashShakaPlayback=(function(_HTML5Video){_inherits(DashShakaPlayback,_HTML5Video);_createClass(DashShakaPlayback,[{key:'name',get:function get(){return 'dash_shaka_playback';}},{key:'shakaVersion',get:function get(){return _shakaPlayer2['default'].player.Player.version;}},{key:'levels',get:function get(){return this._levels;}},{key:'currentLevel',set:function set(id){var _this=this;this._currentLevelId = id;var isAuto=this._currentLevelId === AUTO;this._player.configure({abr:{enable:!isAuto}});this.trigger(_clappr.Events.PLAYBACK_LEVEL_SWITCH_START);if(!isAuto){this.selectTrack(this.videoTracks.filter(function(t){return t.id === _this._currentLevelId;})[0]);}this.trigger(_clappr.Events.PLAYBACK_LEVEL_SWITCH_END);},get:function get(){return this._currentLevelId || AUTO;}}]);function DashShakaPlayback(options){_classCallCheck(this,DashShakaPlayback);_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'constructor',this).call(this,options);this._levels = [];options.autoPlay && this.play();}_createClass(DashShakaPlayback,[{key:'play',value:function play(){!this._player && this._setup();if(!this.isReady){this.once(SHAKA_READY,this.play);return;}this._src = this.el.src;_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'play',this).call(this);} // skipping setup `setupSrc` on tag video
+ },{key:'setupSrc',value:function setupSrc(){} // skipping ready event on video tag in favor of ready on shaka
+ },{key:'_ready',value:function _ready(){}},{key:'error', // skipping error handling on video tag in favor of error on shaka
+ value:function error(event){_clappr.Log.error('an error was raised by the video tag',event,this.el.error);}},{key:'isHighDefinitionInUse',value:function isHighDefinitionInUse(){return !!this.highDefinition;}},{key:'stop',value:function stop(){var _this2=this;clearInterval(this.sendStatsId);this._sendStats();this._player.unload().then(function(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'stop',_this2).call(_this2);_this2._player = null;_this2._isShakaReadyState = false;})['catch'](function(){_clappr.Log.error('shaka could not be unloaded');});}},{key:'getPlaybackType',value:function getPlaybackType(){return (this._player && this._player.isLive()?'live':'vod') || '';}},{key:'selectTrack',value:function selectTrack(track){this._player.selectTrack(track);this._onAdaptation();}},{key:'destroy',value:function destroy(){var _this3=this;clearInterval(this.sendStatsId);if(this._player){this._destroy();}else {this._player.destroy().then(function(){return _this3._destroy();})['catch'](function(){_this3._destroy();_clappr.Log.error('shaka could not be destroyed');});}}},{key:'_setup',value:function _setup(){var _this4=this;this._isShakaReadyState = false;this._player = this._createPlayer();this._options.shakaConfiguration && this._player.configure(this._options.shakaConfiguration);this._options.shakaOnBeforeLoad && this._options.shakaOnBeforeLoad(this._player);var playerLoaded=this._player.load(this._options.src);playerLoaded.then(function(){return _this4._loaded();})['catch'](function(e){return _this4._setupError(e);});}},{key:'_createPlayer',value:function _createPlayer(){var _this5=this;var player=new _shakaPlayer2['default'].Player(this.el);player.addEventListener('error',function(type,shakaError){return _this5._error(type,shakaError);});player.addEventListener('adaptation',function(){return _this5._onAdaptation();});player.addEventListener('buffering',function(e){return _this5._onBuffering(e);});return player;}},{key:'_onBuffering',value:function _onBuffering(e){var event=e.buffering?_clappr.Events.PLAYBACK_BUFFERING:_clappr.Events.PLAYBACK_BUFFERFULL;this.trigger(event);}},{key:'_loaded',value:function _loaded(){this._isShakaReadyState = true;this.trigger(SHAKA_READY);this._shakaReady();this._startToSendStats();this._fillLevels();}},{key:'_fillLevels',value:function _fillLevels(){if(this._levels.length === 0){this._levels = this.videoTracks.map(function(videoTrack){return {id:videoTrack.id,label:videoTrack.height + 'p'};}).reverse();this.trigger(_clappr.Events.PLAYBACK_LEVELS_AVAILABLE,this.levels);}}},{key:'_startToSendStats',value:function _startToSendStats(){var _this6=this;this.sendStatsId = setInterval(function(){return _this6._sendStats();},SEND_STATS_AT);}},{key:'_sendStats',value:function _sendStats(){this.trigger(_clappr.Events.PLAYBACK_STATS_ADD,this._player.getStats());}},{key:'_setupError',value:function _setupError(e){this._error('error',{detail:e.detail});}},{key:'_error',value:function _error(type,shakaError){_clappr.Log.error('an error was raised support=',DashShakaPlayback.support);_clappr.Log.error('an error was raised by shaka player',shakaError.detail);this.trigger(_clappr.Events.PLAYBACK_ERROR,shakaError.detail,this.name);}},{key:'_onAdaptation',value:function _onAdaptation(){var activeVideo=this.videoTracks.filter(function(t){return t.active === true;})[0];this._fillLevels();_clappr.Log.debug('an adaptation has happened:',activeVideo);this.highDefinition = activeVideo.height >= 720;this.trigger(_clappr.Events.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition);this.trigger(_clappr.Events.PLAYBACK_BITRATE,{bandwidth:activeVideo.bandwidth,width:activeVideo.width,height:activeVideo.height,level:activeVideo.id});}},{key:'_destroy',value:function _destroy(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'destroy',this).call(this);this._isShakaReadyState = false;_clappr.Log.debug('shaka was destroyed');}},{key:'_shakaReady',value:function _shakaReady(){_get(Object.getPrototypeOf(DashShakaPlayback.prototype),'_ready',this).call(this);}},{key:'isReady',get:function get(){return this._isShakaReadyState;}},{key:'textTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'text';});}},{key:'audioTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'audio';});}},{key:'videoTracks',get:function get(){return this._player && this._player.getTracks().filter(function(t){return t.type === 'video';});}}]);return DashShakaPlayback;})(_clappr.HTML5Video);exports['default'] = DashShakaPlayback;DashShakaPlayback.canPlay = function(resource){var mimeType=arguments.length <= 1 || arguments[1] === undefined?'':arguments[1];_shakaPlayer2['default'].polyfill.installAll();var browserSupported=_shakaPlayer2['default'].Player.isBrowserSupported();var resourceParts=resource.split('?')[0].match(/.*\.(.*)$/) || [];return browserSupported && ('mpd' === resourceParts[1] || mimeType.indexOf('application/dash+xml') > -1);};module.exports = exports['default'];
+
+/***/ },
+/* 1 */
+/***/ function(module, exports) {
+
+ module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
+
+/***/ },
+/* 2 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_RESULT__;"use strict";(function(){var g={};(function(window){var k,aa=this;aa.ed = !0;function m(a,b){var c=a.split("."),d=aa;c[0] in d || !d.execScript || d.execScript("var " + c[0]);for(var e;c.length && (e = c.shift());) c.length || void 0 === b?d[e]?d = d[e]:d = d[e] = {}:d[e] = b;}function ba(a){var b=p;function c(){}c.prototype = b.prototype;a.md = b.prototype;a.prototype = new c();a.prototype.constructor = a;a.fd = function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2));};}; /*
+
+ Copyright 2016 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */function ca(a){this.c = Math.exp(Math.log(.5) / a);this.b = this.a = 0;}function da(a,b,c){var d=Math.pow(a.c,b);c = c * (1 - d) + d * a.a;isNaN(c) || (a.a = c,a.b += b);}function ea(a){return a.a / (1 - Math.pow(a.c,a.b));};function fa(){this.c = new ca(2);this.f = new ca(5);this.a = 0;this.b = 5E5;}fa.prototype.setDefaultEstimate = function(a){this.b = a;};fa.prototype.getBandwidthEstimate = function(){return 128E3 > this.a?this.b:Math.min(ea(this.c),ea(this.f));};function ga(){}function ha(){};function q(){this.g = null;this.f = !1;this.b = new fa();this.h = {};this.a = {};this.i = !1;this.c = null;}m("shaka.abr.SimpleAbrManager",q);q.prototype.stop = function(){this.g = null;this.f = !1;this.h = {};this.a = {};this.c = null;};q.prototype.stop = q.prototype.stop;q.prototype.init = function(a){this.g = a;};q.prototype.init = q.prototype.init;q.prototype.chooseStreams = function(a){for(var b in a) this.h[b] = a[b];b = {};if("audio" in a){var c=ia(this);c?(b.audio = c,this.a.audio = c):delete this.a.audio;}"video" in a && ((c = ja(this))?(b.video = c,this.a.video = c):delete this.a.video);"text" in a && (b.text = a.text.streams[0]);this.c = Date.now();return b;};q.prototype.chooseStreams = q.prototype.chooseStreams;q.prototype.enable = function(){this.f = !0;};q.prototype.enable = q.prototype.enable;q.prototype.disable = function(){this.f = !1;};q.prototype.disable = q.prototype.disable;q.prototype.segmentDownloaded = function(a,b,c){var d=this.b;b -= a;16E3 > c || (a = 8E3 * c / b,b /= 1E3,d.a += c,da(d.c,b,a),da(d.f,b,a));if(null != this.c && this.f)a: {if(!this.i){if(!(128E3 <= this.b.a))break a;this.i = !0;}else if(8E3 > Date.now() - this.c)break a;c = {};if(d = ia(this))c.audio = d,this.a.audio = d;if(d = ja(this))c.video = d,this.a.video = d;this.c = Date.now();this.b.getBandwidthEstimate();this.g(c);}};q.prototype.segmentDownloaded = q.prototype.segmentDownloaded;q.prototype.getBandwidthEstimate = function(){return this.b.getBandwidthEstimate();};q.prototype.getBandwidthEstimate = q.prototype.getBandwidthEstimate;q.prototype.setDefaultEstimate = function(a){this.b.setDefaultEstimate(a);};q.prototype.setDefaultEstimate = q.prototype.setDefaultEstimate;function ia(a){a = a.h.audio;if(!a)return null;a = ka(a);return a[Math.floor(a.length / 2)];}function ja(a){var b=a.h.video;if(!b)return null;var b=ka(b),c=a.a.audio,c=c && c.bandwidth || 0;a = a.b.getBandwidthEstimate();for(var d=b[0],e=0;e < b.length;++e) {var f=b[e];if(f.bandwidth){var g=((e + 1 < b.length?b[e + 1]:{bandwidth:Infinity}).bandwidth + c) / .85;a >= (f.bandwidth + c) / .95 && a <= g && (d = f);}}return d;}function ka(a){return a.streams.slice(0).filter(function(a){return a.allowedByApplication && a.allowedByKeySystem;}).sort(function(a,c){return a.bandwidth - c.bandwidth;});};function t(a,b){var c=b || {},d;for(d in c) this[d] = c[d];this.defaultPrevented = this.cancelable = this.bubbles = !1;this.timeStamp = window.performance && window.performance.now?window.performance.now():Date.now();this.type = a;this.isTrusted = !1;this.target = this.currentTarget = null;this.a = !1;}t.prototype.preventDefault = function(){};t.prototype.stopImmediatePropagation = function(){this.a = !0;};t.prototype.stopPropagation = function(){};var la="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),ma="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),na=["loop","playbackRate"],oa=["pause","play"],pa="adaptation buffering emsg error loading unloading texttrackvisibility trackschanged".split(" "),qa="drmInfo getConfiguration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTracks getStats isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),ra=[["getConfiguration","configure"]],sa=[["isTextTrackVisible","setTextTrackVisibility"]],ta="addTextTrack cancelTrickPlay configure resetConfiguration selectTrack setTextTrackVisibility trickPlay".split(" "),ua=["load","unload"];function va(a){return JSON.stringify(a,function(a,c){if("manager" != a && "function" != typeof c){if(c instanceof Event || c instanceof t){var b={},e;for(e in c) {var f=c[e];f && "object" == typeof f || e in Event || (b[e] = f);}return b;}if(c instanceof TimeRanges)for(b = {__type__:"TimeRanges",length:c.length,start:[],end:[]},e = 0;e < c.length;++e) b.start.push(c.start(e)),b.end.push(c.end(e));else b = "number" == typeof c?isNaN(c)?"NaN":isFinite(c)?c:0 > c?"-Infinity":"Infinity":c;return b;}});}function wa(a){return JSON.parse(a,function(a,c){return "NaN" == c?NaN:"-Infinity" == c?-Infinity:"Infinity" == c?Infinity:c && "object" == typeof c && "TimeRanges" == c.__type__?xa(c):c;});}function xa(a){return {length:a.length,start:function start(b){return a.start[b];},end:function end(b){return a.end[b];}};};function w(a,b,c){this.category = a;this.code = b;this.data = Array.prototype.slice.call(arguments,2);}m("shaka.util.Error",w);w.prototype.toString = function(){return "shaka.util.Error " + JSON.stringify(this,null," ");};w.Category = {NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9};w.Code = {UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_TTML:2006,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,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,INDEXED_DB_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};function ya(){}m("shaka.util.IDestroyable",ya);ya.prototype.o = function(){};ya.prototype.destroy = ya.prototype.o;function x(){var a,b,c=new Promise(function(c,e){a = c;b = e;});c.resolve = a;c.reject = b;return c;};function za(a,b,c,d,e){this.C = a;this.l = b;this.w = c;this.A = d;this.s = e;this.f = this.j = this.g = !1;this.v = "";this.a = this.i = null;this.b = {video:{},player:{}};this.m = 0;this.c = {};this.h = null;}k = za.prototype;k.o = function(){Aa(this);this.a && (this.a.stop(function(){},function(){}),this.a = null);this.A = this.w = this.l = null;this.f = this.j = this.g = !1;this.h = this.c = this.b = this.a = this.i = null;return Promise.resolve();};k.N = function(){return this.f;};k.ab = function(){return this.v;};k.init = function(){if(window.chrome && chrome.cast && chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.g = !0;this.l();var a=new chrome.cast.SessionRequest(this.C),a=new chrome.cast.ApiConfig(a,this.fc.bind(this),this.mc.bind(this),"origin_scoped");chrome.cast.initialize(a,function(){},function(){});}else window.__onGCastApiAvailable = (function(a){a && this.init();}).bind(this);};k.cb = function(a){this.i = a;this.f && Ba(this,{type:"appData",appData:this.i});};k.cast = function(a){if(!this.g)return Promise.reject(new w(8,8E3));if(!this.j)return Promise.reject(new w(8,8001));if(this.f)return Promise.reject(new w(8,8002));this.h = new x();chrome.cast.requestSession(this.Za.bind(this,a),this.qb.bind(this));return this.h;};k.get = function(a,b){if("video" == a){if(0 <= oa.indexOf(b))return this.Bb.bind(this,a,b);}else if("player" == a){if(0 <= ta.indexOf(b))return this.Bb.bind(this,a,b);if(0 <= ua.indexOf(b))return this.Bc.bind(this,a,b);if(0 <= qa.indexOf(b))return this.yb.bind(this,a,b);}return this.yb(a,b);};k.set = function(a,b,c){this.b[a][b] = c;Ba(this,{type:"set",targetName:a,property:b,value:c});};k.Za = function(a,b){this.a = b;this.a.addUpdateListener(this.rb.bind(this));this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.gc.bind(this));this.rb();Ba(this,{type:"init",initState:a,appData:this.i});this.h.resolve();};k.qb = function(a){var b=8003;switch(a.code){case "cancel":b = 8004;break;case "timeout":b = 8005;break;case "receiver_unavailable":b = 8006;}this.h.reject(new w(8,b,a));};k.yb = function(a,b){return this.b[a][b];};k.Bb = function(a,b){Ba(this,{type:"call",targetName:a,methodName:b,args:Array.prototype.slice.call(arguments,2)});};k.Bc = function(a,b){var c=Array.prototype.slice.call(arguments,2),d=new x(),e=this.m.toString();this.m++;this.c[e] = d;Ba(this,{type:"asyncCall",targetName:a,methodName:b,args:c,id:e});return d;};k.fc = function(a){var b=this.s();this.h = new x();this.Za(b,a);};k.mc = function(a){this.j = "available" == a;this.l();};k.rb = function(){var a=this.a?"connected" == this.a.status:!1;if(this.f && !a){this.A();for(var b in this.b) this.b[b] = {};Aa(this);}this.v = (this.f = a)?this.a.receiver.friendlyName:"";this.l();};function Aa(a){for(var b in a.c) {var c=a.c[b];delete a.c[b];c.reject(new w(7,7E3));}}k.gc = function(a,b){var c=wa(b);switch(c.type){case "event":var d=c.targetName,e=c.event;this.w(d,new t(e.type,e));break;case "update":e = c.update;for(d in e) {var c=this.b[d] || {},f;for(f in e[d]) c[f] = e[d][f];}break;case "asyncComplete":if((d = c.id,f = c.error,c = this.c[d],delete this.c[d],c))if(f){d = new w(f.category,f.code);for(e in f) d[e] = f[e];c.reject(d);}else c.resolve();}};function Ba(a,b){var c=va(b);a.a.sendMessage("urn:x-cast:com.google.shaka.v2",c,function(){},ga);};function Ca(){this.a = {};}k = Ca.prototype;k.push = function(a,b){this.a.hasOwnProperty(a)?this.a[a].push(b):this.a[a] = [b];};k.set = function(a,b){this.a[a] = b;};k.has = function(a){return this.a.hasOwnProperty(a);};k.get = function(a){return (a = this.a[a])?a.slice():null;};k.remove = function(a,b){var c=this.a[a];if(c)for(var d=0;d < c.length;++d) c[d] == b && (c.splice(d,1),--d);};k.keys = function(){var a=[],b;for(b in this.a) a.push(b);return a;};function y(){this.a = new Ca();}y.prototype.o = function(){Da(this);this.a = null;return Promise.resolve();};function z(a,b,c,d){b = new Ea(b,c,d);a.a.push(c,b);}y.prototype.ja = function(a,b){for(var c=this.a.get(b) || [],d=0;d < c.length;++d) {var e=c[d];e.target == a && (e.ja(),this.a.remove(b,e));}};function Da(a){var b=a.a,c=[],d;for(d in b.a) c.push.apply(c,b.a[d]);for(b = 0;b < c.length;++b) c[b].ja();a.a.a = {};}function Ea(a,b,c){this.target = a;this.type = b;this.a = c;this.target.addEventListener(b,c,!1);}Ea.prototype.ja = function(){this.target && (this.target.removeEventListener(this.type,this.a,!1),this.a = this.target = null);};function p(){this.Ba = new Ca();this.X = this;}m("shaka.util.FakeEventTarget",p);p.prototype.addEventListener = function(a,b){this.Ba.push(a,b);};p.prototype.addEventListener = p.prototype.addEventListener;p.prototype.removeEventListener = function(a,b){this.Ba.remove(a,b);};p.prototype.removeEventListener = p.prototype.removeEventListener;p.prototype.dispatchEvent = function(a){for(var b=this.Ba.get(a.type) || [],c=0;c < b.length;++c) {a.target = this.X;a.currentTarget = this.X;var d=b[c];try{d.handleEvent?d.handleEvent(a):d.call(this,a);}catch(e) {}if(a.a)break;}return a.defaultPrevented;};p.prototype.dispatchEvent = p.prototype.dispatchEvent;function A(a,b,c){p.call(this);this.c = a;this.b = b;this.i = this.f = this.g = this.j = this.l = null;this.a = new za(c,this.Pc.bind(this),this.Qc.bind(this),this.Rc.bind(this),this.nb.bind(this));Fa(this);}ba(A);m("shaka.cast.CastProxy",A);A.prototype.o = function(){var a=[this.i?this.i.o():null,this.b?this.b.o():null,this.a?this.a.o():null];this.a = this.i = this.j = this.l = this.b = this.c = null;return Promise.all(a);};A.prototype.destroy = A.prototype.o;A.prototype.Yb = function(){return this.l;};A.prototype.getVideo = A.prototype.Yb;A.prototype.Wb = function(){return this.j;};A.prototype.getPlayer = A.prototype.Wb;A.prototype.Mb = function(){return this.a?this.a.g && this.a.j:!1;};A.prototype.canCast = A.prototype.Mb;A.prototype.N = function(){return this.a?this.a.N():!1;};A.prototype.isCasting = A.prototype.N;A.prototype.ab = function(){return this.a?this.a.ab():"";};A.prototype.receiverName = A.prototype.ab;A.prototype.cast = function(){var a=this.nb();return this.a.cast(a).then((function(){return this.b.ib();}).bind(this));};A.prototype.cast = A.prototype.cast;A.prototype.cb = function(a){this.a.cb(a);};A.prototype.setAppData = A.prototype.cb;A.prototype.Xc = function(){var a=this.a;if(a.f){var b=a.s();chrome.cast.requestSession(a.Za.bind(a,b),a.qb.bind(a));}};A.prototype.suggestDisconnect = A.prototype.Xc;function Fa(a){a.a.init();a.i = new y();la.forEach((function(a){z(this.i,this.c,a,this.cd.bind(this));}).bind(a));pa.forEach((function(a){z(this.i,this.b,a,this.xc.bind(this));}).bind(a));a.l = {};for(var b in a.c) Object.defineProperty(a.l,b,{configurable:!1,enumerable:!0,get:a.bd.bind(a,b),set:a.dd.bind(a,b)});a.j = {};for(b in a.b) Object.defineProperty(a.j,b,{configurable:!1,enumerable:!0,get:a.wc.bind(a,b)});a.g = new p();a.g.X = a.l;a.f = new p();a.f.X = a.j;}k = A.prototype;k.nb = function(){var a={video:{},player:{},playerAfterLoad:{},manifest:this.b.oa,startTime:null};this.c.pause();na.forEach((function(b){a.video[b] = this.c[b];}).bind(this));this.c.ended || (a.startTime = this.c.currentTime);ra.forEach((function(b){var c=b[1];b = this.b[b[0]]();a.player[c] = b;}).bind(this));sa.forEach((function(b){var c=b[1];b = this.b[b[0]]();a.playerAfterLoad[c] = b;}).bind(this));return a;};k.Pc = function(){this.dispatchEvent(new t("caststatuschanged"));};k.Rc = function(){ra.forEach((function(a){var b=a[1];a = this.a.get("player",a[0])();this.b[b](a);}).bind(this));var a=this.a.get("player","getManifestUri")(),b=this.a.get("video","ended"),c=Promise.resolve(),d=this.c.autoplay,e=null;b || (e = this.a.get("video","currentTime"));a && (this.c.autoplay = !1,c = this.b.load(a,e),c["catch"]((function(a){this.b.dispatchEvent(new t("error",{detail:a}));}).bind(this)));var f={};na.forEach((function(a){f[a] = this.a.get("video",a);}).bind(this));c.then((function(){na.forEach((function(a){this.c[a] = f[a];}).bind(this));sa.forEach((function(a){var b=a[1];a = this.a.get("player",a[0])();this.b[b](a);}).bind(this));this.c.autoplay = d;a && this.c.play();}).bind(this));};k.bd = function(a){if("addEventListener" == a)return this.g.addEventListener.bind(this.g);if("removeEventListener" == a)return this.g.removeEventListener.bind(this.g);if(this.a.N() && !Object.keys(this.a.b.video).length){var b=this.c[a];if("function" != typeof b)return b;}return this.a.N()?this.a.get("video",a):(b = this.c[a],"function" == typeof b && (b = b.bind(this.c)),b);};k.dd = function(a,b){this.a.N()?this.a.set("video",a,b):this.c[a] = b;};k.cd = function(a){this.a.N() || this.g.dispatchEvent(new t(a.type,a));};k.wc = function(a){return "addEventListener" == a?this.f.addEventListener.bind(this.f):"removeEventListener" == a?this.f.removeEventListener.bind(this.f):"getNetworkingEngine" == a?this.b.ob.bind(this.b):this.a.N() && !Object.keys(this.a.b.video).length && 0 <= qa.indexOf(a) || !this.a.N()?(a = this.b[a],a.bind(this.b)):this.a.get("player",a);};k.xc = function(a){this.a.N() || this.f.dispatchEvent(a);};k.Qc = function(a,b){this.a.N() && ("video" == a?this.g.dispatchEvent(b):"player" == a && this.f.dispatchEvent(b));};function B(a,b,c){p.call(this);this.b = a;this.a = b;this.j = {video:a,player:b};this.l = c || function(){};this.i = !1;this.c = !0;this.f = this.g = null;Ga(this);}ba(B);m("shaka.cast.CastReceiver",B);B.prototype.$b = function(){return this.i;};B.prototype.isConnected = B.prototype.$b;B.prototype.ac = function(){return this.c;};B.prototype.isIdle = B.prototype.ac;B.prototype.o = function(){var a=this.a?this.a.o():Promise.resolve();null != this.f && window.clearTimeout(this.f);this.l = this.j = this.a = this.b = null;this.i = !1;this.c = !0;this.f = this.g = null;return a.then(function(){cast.receiver.CastReceiverManager.getInstance().stop();});};B.prototype.destroy = B.prototype.o;function Ga(a){var b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected = a.wb.bind(a);b.onSenderDisconnected = a.wb.bind(a);b.onSystemVolumeChanged = a.Tb.bind(a);a.g = b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");a.g.onMessage = a.hc.bind(a);b.start();la.forEach((function(a){this.b.addEventListener(a,this.zb.bind(this,"video"));}).bind(a));pa.forEach((function(a){this.a.addEventListener(a,this.zb.bind(this,"player"));}).bind(a));cast.__platform__ && cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?a.a.eb(3840,2160):a.a.eb(1920,1080);a.a.addEventListener("loading",(function(){this.c = !1;Ha(this);}).bind(a));a.b.addEventListener("playing",(function(){this.c = !1;Ha(this);}).bind(a));a.a.addEventListener("unloading",(function(){this.c = !0;Ha(this);}).bind(a));a.b.addEventListener("ended",(function(){window.setTimeout((function(){this.b && this.b.ended && (this.c = !0,Ha(this));}).bind(this),5E3);}).bind(a));}k = B.prototype;k.wb = function(){this.i = !!cast.receiver.CastReceiverManager.getInstance().getSenders().length;Ha(this);};function Ha(a){Promise.resolve().then((function(){this.dispatchEvent(new t("caststatuschanged"));}).bind(a));}function Ia(a,b,c){for(var d in b.player) a.a[d](b.player[d]);a.l(c);c = Promise.resolve();var e=a.b.autoplay;b.manifest && (a.b.autoplay = !1,c = a.a.load(b.manifest,b.startTime),c["catch"]((function(a){this.a.dispatchEvent(new t("error",{detail:a}));}).bind(a)));c.then((function(){for(var a in b.video) {var c=b.video[a];this.b[a] = c;}for(a in b.playerAfterLoad) c = b.playerAfterLoad[a],this.a[a](c);this.b.autoplay = e;b.manifest && this.b.play();}).bind(a));}k.zb = function(a,b){this.$a();Ja(this,{type:"event",targetName:a,event:b});};k.$a = function(){null != this.f && window.clearTimeout(this.f);this.f = window.setTimeout(this.$a.bind(this),500);var a={video:{},player:{}};ma.forEach((function(b){a.video[b] = this.b[b];}).bind(this));qa.forEach((function(b){a.player[b] = this.a[b]();}).bind(this));var b=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();b && (a.video.volume = b.level,a.video.muted = b.muted);Ja(this,{type:"update",update:a});};k.Tb = function(){var a=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();a && Ja(this,{type:"update",update:{video:{volume:a.level,muted:a.muted}}});Ja(this,{type:"event",targetName:"video",event:{type:"volumechange"}});};k.hc = function(a){var b=wa(a.data);switch(b.type){case "init":Ia(this,b.initState,b.appData);this.$a();break;case "appData":this.l(b.appData);break;case "set":var c=b.targetName,d=b.property,e=b.value;if("video" == c)if((b = cast.receiver.CastReceiverManager.getInstance(),"volume" == d)){b.setSystemVolumeLevel(e);break;}else if("muted" == d){b.setSystemVolumeMuted(e);break;}this.j[c][d] = e;break;case "call":c = b.targetName;d = b.methodName;e = b.args;c = this.j[c];c[d].apply(c,e);break;case "asyncCall":c = b.targetName,d = b.methodName,e = b.args,b = b.id,a = a.senderId,c = this.j[c],c[d].apply(c,e).then(this.Eb.bind(this,a,b,null),this.Eb.bind(this,a,b));}};k.Eb = function(a,b,c){Ja(this,{type:"asyncComplete",id:b,error:c},a);};function Ja(a,b,c){a.i && (b = va(b),c?a.g.getCastChannel(c).send(b):a.g.broadcast(b));};function Ka(a,b){return a.reduce((function(a,b,e){return b["catch"](a.bind(null,e));}).bind(null,b),Promise.reject());}function C(a,b){return a.concat(b);}function D(){}function La(a){return null != a;}function Ma(a){return function(b){return b != a;};};function Na(a){return !a || !Object.keys(a).length;}function F(a){return Object.keys(a).map(function(b){return a[b];});}function Oa(a,b){return Object.keys(a).reduce(function(c,d){c[d] = b(a[d],d);return c;},{});}function Pa(a,b){return Object.keys(a).every(function(c){return b(c,a[c]);});};function Qa(a){return window.btoa(String.fromCharCode.apply(null,a)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=*$/,"");}function Ra(a){a = window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c < a.length;++c) b[c] = a.charCodeAt(c);return b;}function Sa(a){for(var b=new Uint8Array(a.length / 2),c=0;c < a.length;c += 2) b[c / 2] = window.parseInt(a.substr(c,2),16);return b;}function Ta(a){for(var b="",c=0;c < a.length;++c) {var d=a[c].toString(16);1 == d.length && (d = "0" + d);b += d;}return b;}function Ua(a,b){if(!a && !b)return !0;if(!a || !b || a.length != b.length)return !1;for(var c=0;c < a.length;++c) if(a[c] != b[c])return !1;return !0;};function Va(a,b){var c=G(a,b);return 1 != c.length?null:c[0];}function G(a,b){return Array.prototype.filter.call(a.childNodes,function(a){return a.tagName == b;});}function Wa(a){var b=a.firstChild;return b && b.nodeType == Node.TEXT_NODE?a.textContent.trim():null;}function I(a,b,c,d){var e=null;a = a.getAttribute(b);null != a && (e = c(a));return null == e?void 0 !== d?d:null:e;}function Xa(a){if(!a)return null;a = Date.parse(a);return isNaN(a)?null:Math.floor(a / 1E3);}function J(a){if(!a)return null;a = /^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!a)return null;a = 31536E3 * Number(a[1] || null) + 2592E3 * Number(a[2] || null) + 86400 * Number(a[3] || null) + 3600 * Number(a[4] || null) + 60 * Number(a[5] || null) + Number(a[6] || null);return isFinite(a)?a:null;}function Ya(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a = Number(b[1]);if(!isFinite(a))return null;b = Number(b[2]);return isFinite(b)?{start:a,end:b}:null;}function Za(a){a = Number(a);return a % 1?null:a;}function $a(a){a = Number(a);return !(a % 1) && 0 < a?a:null;}function ab(a){a = Number(a);return !(a % 1) && 0 <= a?a:null;}function bb(a){var b;a = (b = a.match(/^(\d+)\/(\d+)$/))?Number(b[1] / b[2]):Number(a);return isNaN(a)?null:a;};var db={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};function eb(a,b){var c=fb(a),d=null,e=c.filter(function(a){return "urn:mpeg:dash:mp4protection:2011" == a.Db?(d = a.init || d,!1):!0;}),f=c.map(function(a){return a.keyId;}).filter(La),g=null;if(0 < f.length && (g = f[0],f.some(Ma(g))))throw new w(4,4010);f = [];0 < e.length?(f = gb(d,b,e),f.length || (f = [hb("",d)])):0 < c.length && (f = F(db).map(function(a){return hb(a,d);}));return {kb:g,gd:d,drmInfos:f,mb:!0};}function ib(a,b,c){var d=eb(a,b);if(c.mb){a = 1 == c.drmInfos.length && !c.drmInfos[0].keySystem;b = !d.drmInfos.length;if(!c.drmInfos.length || a && !b)c.drmInfos = d.drmInfos;c.mb = !1;}else if(0 < d.drmInfos.length && (c.drmInfos = c.drmInfos.filter(function(a){return d.drmInfos.some(function(b){return b.keySystem == a.keySystem;});}),!c.drmInfos.length))throw new w(4,4008);return d.kb || c.kb;}function hb(a,b){return {keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b || [],keyIds:[]};}function gb(a,b,c){return c.map(function(c){var d=db[c.Db];return d?[hb(d,c.init || a)]:b(c.node) || [];}).reduce(C,[]);}function fb(a){return a.map(function(a){var b=a.getAttribute("schemeIdUri"),d=a.getAttribute("cenc:default_KID"),e=G(a,"cenc:pssh").map(Wa);if(!b)return null;b = b.toLowerCase();if(d && (d = d.replace(/-/g,"").toLowerCase(),0 <= d.indexOf(" ")))throw new w(4,4009);var f=[];try{f = e.map(function(a){return {initDataType:"cenc",initData:Ra(a)};});}catch(g) {throw new w(4,4007);}return {node:a,Db:b,keyId:d,init:0 < f.length?f:null};}).filter(La);};var jb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function kb(a){var b;a instanceof kb?(lb(this,a.S),this.ka = a.ka,this.U = a.U,mb(this,a.xa),this.O = a.O,nb(this,ob(a.a)),this.ca = a.ca):a && (b = String(a).match(jb))?(lb(this,b[1] || "",!0),this.ka = pb(b[2] || ""),this.U = pb(b[3] || "",!0),mb(this,b[4]),this.O = pb(b[5] || "",!0),nb(this,b[6] || "",!0),this.ca = pb(b[7] || "")):this.a = new qb(null);}k = kb.prototype;k.S = "";k.ka = "";k.U = "";k.xa = null;k.O = "";k.ca = "";k.toString = function(){var a=[],b=this.S;b && a.push(rb(b,sb,!0),":");if(b = this.U){a.push("//");var c=this.ka;c && a.push(rb(c,sb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b = this.xa;null != b && a.push(":",String(b));}if(b = this.O)this.U && "/" != b.charAt(0) && a.push("/"),a.push(rb(b,"/" == b.charAt(0)?tb:ub,!0));(b = this.a.toString()) && a.push("?",b);(b = this.ca) && a.push("#",rb(b,vb));return a.join("");};k.resolve = function(a){var b=new kb(this);"data" === b.S && (b = new kb());var c=!!a.S;c?lb(b,a.S):c = !!a.ka;c?b.ka = a.ka:c = !!a.U;c?b.U = a.U:c = null != a.xa;var d=a.O;if(c)mb(b,a.xa);else if(c = !!a.O){if("/" != d.charAt(0))if(this.U && !this.O)d = "/" + d;else {var e=b.O.lastIndexOf("/");-1 != e && (d = b.O.substr(0,e + 1) + d);}if(".." == d || "." == d)d = "";else if(-1 != d.indexOf("./") || -1 != d.indexOf("/.")){for(var e=!d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;g < d.length;) {var h=d[g++];"." == h?e && g == d.length && f.push(""):".." == h?((1 < f.length || 1 == f.length && "" != f[0]) && f.pop(),e && g == d.length && f.push("")):(f.push(h),e = !0);}d = f.join("/");}}c?b.O = d:c = "" !== a.a.toString();c?nb(b,ob(a.a)):c = !!a.ca;c && (b.ca = a.ca);return b;};function lb(a,b,c){a.S = c?pb(b,!0):b;a.S && (a.S = a.S.replace(/:$/,""));}function mb(a,b){if(b){b = Number(b);if(isNaN(b) || 0 > b)throw Error("Bad port number " + b);a.xa = b;}else a.xa = null;}function nb(a,b,c){b instanceof qb?a.a = b:(c || (b = rb(b,wb)),a.a = new qb(b));}function pb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):"";}function rb(a,b,c){return "string" == typeof a?(a = encodeURI(a).replace(b,xb),c && (a = a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null;}function xb(a){a = a.charCodeAt(0);return "%" + (a >> 4 & 15).toString(16) + (a & 15).toString(16);}var sb=/[#\/\?@]/g,ub=/[\#\?:]/g,tb=/[\#\?]/g,wb=/[\#\?@]/g,vb=/#/g;function qb(a){this.b = a || null;}qb.prototype.a = null;qb.prototype.c = null;qb.prototype.toString = function(){if(this.b)return this.b;if(!this.a)return "";var a=[],b;for(b in this.a) for(var c=encodeURIComponent(b),d=this.a[b],e=0;e < d.length;e++) {var f=c;"" !== d[e] && (f += "=" + encodeURIComponent(d[e]));a.push(f);}return this.b = a.join("&");};function ob(a){var b=new qb();b.b = a.b;if(a.a){var c={},d;for(d in a.a) c[d] = a.a[d].concat();b.a = c;b.c = a.c;}return b;};function yb(a,b,c){this.a = a;this.L = b;this.D = c;}m("shaka.media.InitSegmentReference",yb);function K(a,b,c,d,e,f){this.position = a;this.startTime = b;this.endTime = c;this.a = d;this.L = e;this.D = f;}m("shaka.media.SegmentReference",K);var zb=1 / 15;function Ab(a,b,c,d,e){null !== e && (e = Math.round(e));var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(a,b,c){if("$$" == a)return "$";var d=f[b];if(null == d)return a;"RepresentationID" == b && c && (c = void 0);a = d.toString();c = window.parseInt(c,10) || 1;return Array(Math.max(0,c - a.length) + 1).join("0") + a;});}function Bb(a,b,c){if(c.length){var d=c[0];d.startTime <= zb && (c[0] = new K(d.position,0,d.endTime,d.a,d.L,d.D));a || (a = c[c.length - 1],a.startTime > b || (c[c.length - 1] = new K(a.position,a.startTime,b,a.a,a.L,a.D)));}}function L(a,b){if(!b.length)return a;var c=b.map(function(a){return new kb(a);});return a.map(function(a){return new kb(a);}).map(function(a){return c.map(a.resolve.bind(a));}).reduce(C,[]).map(function(a){return a.toString();});}function Cb(a,b){var c=M(a,b,"timescale"),d=1;c && (d = $a(c) || 1);c = M(a,b,"duration");(c = $a(c || "")) && (c /= d);var e=M(a,b,"startNumber"),f=M(a,b,"presentationTimeOffset"),g=ab(e || "");if(null == e || null == g)g = 1;var h=Db(a,b,"SegmentTimeline"),e=null;if(h){for(var e=d,l=Number(f),n=a.H.duration || Infinity,h=G(h,"S"),u=[],r=0,E=0;E < h.length;++E) {var v=h[E],H=I(v,"t",ab),cb=I(v,"d",ab),v=I(v,"r",Za);null != H && (H -= l);if(!cb)break;H = null != H?H:r;v = v || 0;if(0 > v)if(E + 1 < h.length){v = I(h[E + 1],"t",ab);if(null == v)break;else if(H >= v)break;v = Math.ceil((v - H) / cb) - 1;}else {if(Infinity == n)break;else if(H / e >= n)break;v = Math.ceil((n * e - H) / cb) - 1;}0 < u.length && H != r && (u[u.length - 1].end = H / e);for(var Yc=0;Yc <= v;++Yc) r = H + cb,u.push({start:H / e,end:r / e}),H = r;}e = u;}return {Ja:d,F:c,ha:g,presentationTimeOffset:Number(f) / d || 0,B:e};}function M(a,b,c){return [b(a.u),b(a.P),b(a.K)].filter(La).map(function(a){return a.getAttribute(c);}).reduce(function(a,b){return a || b;});}function Db(a,b,c){return [b(a.u),b(a.P),b(a.K)].filter(La).map(function(a){return Va(a,c);}).reduce(function(a,b){return a || b;});};function Eb(a){if(!a)return "";a = new Uint8Array(a);239 == a[0] && 187 == a[1] && 191 == a[2] && (a = a.subarray(3));a = escape(Fb(a));try{return decodeURIComponent(a);}catch(b) {throw new w(2,2004);}}function Gb(a,b){if(!a)return "";if(a.byteLength % 2)throw new w(2,2004);var c;if(a instanceof ArrayBuffer)c = a;else {var d=new Uint8Array(a.byteLength);d.set(new Uint8Array(a));c = d.buffer;}var d=a.byteLength / 2,e=new Uint16Array(d);c = new DataView(c);for(var f=0;f < d;f++) e[f] = c.getUint16(2 * f,b);return Fb(e);}function Hb(a){var b=new Uint8Array(a);if(239 == b[0] && 187 == b[1] && 191 == b[2])return Eb(b);if(254 == b[0] && 255 == b[1])return Gb(b.subarray(2),!1);if(255 == b[0] && 254 == b[1])return Gb(b.subarray(2),!0);var c=(function(a,b){return a.byteLength <= b || 32 <= a[b] && 126 >= a[b];}).bind(null,b);if(b[0] || b[2]){if(!b[1] && !b[3])return Gb(a,!0);if(c(0) && c(1) && c(2) && c(3))return Eb(a);}else return Gb(a,!1);throw new w(2,2003);}function Ib(a){a = unescape(encodeURIComponent(a));for(var b=new Uint8Array(a.length),c=0;c < a.length;++c) b[c] = a.charCodeAt(c);return b.buffer;}function Fb(a){for(var b="",c=0;c < a.length;c += 16E3) b += String.fromCharCode.apply(null,a.subarray(c,c + 16E3));return b;};function Jb(a){this.b = a;this.c = 0 == Kb;this.a = 0;}var Kb=1;function Lb(a){return a.a < a.b.byteLength;}function Mb(a){try{var b=a.b.getUint8(a.a);}catch(c) {Nb();}a.a += 1;return b;}function Ob(a){try{var b=a.b.getUint16(a.a,a.c);}catch(c) {Nb();}a.a += 2;return b;}function N(a){try{var b=a.b.getUint32(a.a,a.c);}catch(c) {Nb();}a.a += 4;return b;}function Pb(a){var b,c;try{a.c?(b = a.b.getUint32(a.a,!0),c = a.b.getUint32(a.a + 4,!0)):(c = a.b.getUint32(a.a,!1),b = a.b.getUint32(a.a + 4,!1));}catch(d) {Nb();}if(2097151 < c)throw new w(3,3001);a.a += 8;return c * Math.pow(2,32) + b;}function Qb(a,b){a.a + b > a.b.byteLength && Nb();var c=a.b.buffer.slice(a.a,a.a + b);a.a += b;return new Uint8Array(c);}function O(a,b){a.a + b > a.b.byteLength && Nb();a.a += b;}function Rb(a){var b=a.a;try{for(;Lb(a) && a.b.getUint8(a.a);) a.a += 1;}catch(c) {Nb();}b = a.b.buffer.slice(b,a.a);a.a += 1;return Eb(b);}function Nb(){throw new w(3,3E3);};function Sb(a,b){for(;Lb(b);) {var c=b.a,d=N(b),e=N(b);1 == d?d = Pb(b):d || (d = b.b.byteLength - c);if(e == a)return d;O(b,d - (b.a - c));}return -1;}function Tb(a,b){for(var c=new Jb(new DataView(a)),d=[[1836019574,0],[1953653099,0],[1835297121,0],[1835626086,0],[1937007212,0],[1937011556,8],[b,0]],e=-1,f=0;f < d.length;f++) {var g=d[f][1],e=Sb(d[f][0],c);if(-1 == e)return -1;O(c,g);}return e;};function Ub(a,b,c,d){var e=[];a = new Jb(new DataView(a));var f=Sb(1936286840,a);if(-1 == f)throw new w(3,3004);var g=Mb(a);O(a,3);O(a,4);var h=N(a);if(!h)throw new w(3,3005);var l,n;g?(l = Pb(a),n = Pb(a)):(l = N(a),n = N(a));O(a,2);g = Ob(a);d = l - d;b = b + f + n;for(f = 0;f < g;f++) {l = N(a);n = (l & 2147483648) >>> 31;l &= 2147483647;var u=N(a);O(a,4);if(1 == n)throw new w(3,3006);e.push(new K(e.length,d / h,(d + u) / h,function(){return c;},b,b + l - 1));d += u;b += l;}return e;};function P(a){this.a = a;}m("shaka.media.SegmentIndex",P);P.prototype.o = function(){this.a = null;return Promise.resolve();};P.prototype.destroy = P.prototype.o;P.prototype.find = function(a){for(var b=this.a.length - 1;0 <= b;--b) {var c=this.a[b];if(a >= c.startTime && a < c.endTime)return c.position;}return null;};P.prototype.find = P.prototype.find;P.prototype.get = function(a){if(!this.a.length)return null;a -= this.a[0].position;return 0 > a || a >= this.a.length?null:this.a[a];};P.prototype.get = P.prototype.get;P.prototype.Xa = function(a){for(var b=[],c=0,d=0;c < this.a.length && d < a.length;) {var e=this.a[c],f=a[d];e.startTime < f.startTime?(b.push(e),c++):(e.startTime > f.startTime || (.1 < Math.abs(e.endTime - f.endTime)?b.push(f):b.push(e),c++),d++);}for(;c < this.a.length;) b.push(this.a[c++]);if(b.length)for(c = b[b.length - 1].position + 1;d < a.length;) f = a[d++],f = new K(c++,f.startTime,f.endTime,f.a,f.L,f.D),b.push(f);else b = a;this.a = b;};P.prototype.merge = P.prototype.Xa;P.prototype.Sa = function(a){for(var b=0;b < this.a.length && !(this.a[b].endTime > a);++b);this.a.splice(0,b);};P.prototype.evict = P.prototype.Sa;function Vb(a){this.b = a;this.a = new Jb(a);Wb || (Wb = [new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])]);}var Wb;function Xb(a){var b;b = Yb(a);if(7 < b.length)throw new w(3,3002);for(var c=0,d=0;d < b.length;d++) c = 256 * c + b[d];b = c;c = Yb(a);a: {for(d = 0;d < Wb.length;d++) if(Ua(c,Wb[d])){d = !0;break a;}d = !1;}if(d)c = a.b.byteLength - a.a.a;else {if(8 == c.length && c[1] & 224)throw new w(3,3001);for(var d=c[0] & (1 << 8 - c.length) - 1,e=1;e < c.length;e++) d = 256 * d + c[e];c = d;}c = a.a.a + c <= a.b.byteLength?c:a.b.byteLength - a.a.a;d = new DataView(a.b.buffer,a.b.byteOffset + a.a.a,c);O(a.a,c);return new Zb(b,d);}function Yb(a){var b=Mb(a.a),c;for(c = 1;8 >= c && !(b & 1 << 8 - c);c++);if(8 < c)throw new w(3,3002);var d=new Uint8Array(c);d[0] = b;for(b = 1;b < c;b++) d[b] = Mb(a.a);return d;}function Zb(a,b){this.id = a;this.a = b;}function $b(a){if(8 < a.a.byteLength)throw new w(3,3002);if(8 == a.a.byteLength && a.a.getUint8(0) & 224)throw new w(3,3001);for(var b=0,c=0;c < a.a.byteLength;c++) var d=a.a.getUint8(c),b=256 * b + d;return b;};function ac(a,b,c,d,e,f){function g(){return e;}var h=[];a = new Vb(a.a);for(var l=-1,n=-1;Lb(a.a);) {var u=Xb(a);if(187 == u.id){var r=bc(u);r && (u = c * (r.ad - f),r = b + r.Ac,0 <= l && h.push(new K(h.length,l,u,g,n,r - 1)),l = u,n = r);}}0 <= l && h.push(new K(h.length,l,d,g,n,null));return h;}function bc(a){var b=new Vb(a.a);a = Xb(b);if(179 != a.id)throw new w(3,3013);a = $b(a);b = Xb(b);if(183 != b.id)throw new w(3,3012);for(var b=new Vb(b.a),c=0;Lb(b.a);) {var d=Xb(b);if(241 == d.id){c = $b(d);break;}}return {ad:a,Ac:c};};function cc(a,b){var c=Db(a,b,"Initialization");if(!c)return null;var d=a.u.M,e=c.getAttribute("sourceURL");e && (d = L(a.u.M,[e]));var e=0,f=null;if(c = I(c,"range",Ya))e = c.start,f = c.end;return new yb(function(){return d;},e,f);}function dc(a,b){var c=M(a,ec,"presentationTimeOffset"),d=cc(a,ec),e;e = Number(c);var f=a.u.contentType,g=a.u.mimeType.split("/")[1];if("text" != f && "mp4" != g && "webm" != g)throw new w(4,4006);if("webm" == g && !d)throw new w(4,4005);var f=Db(a,ec,"RepresentationIndex"),h=M(a,ec,"indexRange"),l=a.u.M,h=Ya(h || "");if(f){var n=f.getAttribute("sourceURL");n && (l = L(a.u.M,[n]));h = I(f,"range",Ya,h);}if(!h)throw new w(4,4002);e = fc(a,b,d,l,h.start,h.end,g,e);return {createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:d,presentationTimeOffset:Number(c) || 0};}function fc(a,b,c,d,e,f,g,h){var l=a.presentationTimeline,n=a.H.start,u=a.H.duration,r=b,E=null;return {createSegmentIndex:function createSegmentIndex(){var b=[r(d,e,f),"webm" == g?r(c.a(),c.L,c.D):null];r = null;return Promise.all(b).then(function(b){var c,f,r=b[0];b = b[1] || null;if("mp4" == g)r = Ub(r,e,d,h);else {b = new Vb(new DataView(b));if(440786851 != Xb(b).id)throw new w(3,3008);f = Xb(b);if(408125543 != f.id)throw new w(3,3009);b = f.a.byteOffset;f = new Vb(f.a);for(c = null;Lb(f.a);) {var v=Xb(f);if(357149030 == v.id){c = v;break;}}if(!c)throw new w(3,3010);c = new Vb(c.a);v = 1E6;for(f = null;Lb(c.a);) {var H=Xb(c);if(2807729 == H.id)v = $b(H);else if(17545 == H.id)if((f = H,4 == f.a.byteLength))f = f.a.getFloat32(0);else if(8 == f.a.byteLength)f = f.a.getFloat64(0);else throw new w(3,3003);}if(null == f)throw new w(3,3011);c = v /= 1E9;f *= v;r = Xb(new Vb(new DataView(r)));if(475249515 != r.id)throw new w(3,3007);r = ac(r,b,c,f,d,h);}Bb(a.Ra,u,r);l.Ga(n,r);E = new P(r);});},findSegmentPosition:function findSegmentPosition(a){return E.find(a);},getSegmentReference:function getSegmentReference(a){return E.get(a);}};}function ec(a){return a.Ha;};function gc(a,b){var c=cc(a,hc),d;d = ic(a);var e=Cb(a,hc),f=e.ha;f || (f = 1);var g=0;e.F?g = e.F * (f - 1) - e.presentationTimeOffset:e.B && 0 < e.B.length && (g = e.B[0].start);d = {F:e.F,startTime:g,ha:f,presentationTimeOffset:e.presentationTimeOffset,B:e.B,va:d};if(!d.F && !d.B && 1 < d.va.length)throw new w(4,4002);if(!d.F && !a.H.duration && !d.B && 1 == d.va.length)throw new w(4,4002);if(d.B && !d.B.length)throw new w(4,4002);f = e = null;a.K.id && a.u.id && (f = a.K.id + "," + a.u.id,e = b[f]);g = jc(a.H.duration,d.ha,a.u.M,d);Bb(a.Ra,a.H.duration,g);e?(e.Xa(g),e.Sa(a.presentationTimeline.ta() - a.H.start)):(a.presentationTimeline.Ga(a.H.start,g),e = new P(g),f && (b[f] = e));return {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:c,presentationTimeOffset:d.presentationTimeOffset};}function hc(a){return a.Z;}function jc(a,b,c,d){var e=d.va.length;d.B && d.B.length != d.va.length && (e = Math.min(d.B.length,d.va.length));for(var f=[],g=d.startTime,h=0;h < e;h++) {var l=d.va[h],n=L(c,[l.dc]),u;u = null != d.F?g + d.F:d.B?d.B[h].end:g + a;f.push(new K(h + b,g,u,(function(a){return a;}).bind(null,n),l.start,l.end));g = u;}return f;}function ic(a){return [a.u.Z,a.P.Z,a.K.Z].filter(La).map(function(a){return G(a,"SegmentURL");}).reduce(function(a,c){return 0 < a.length?a:c;}).map(function(a){var b=a.getAttribute("media");a = I(a,"mediaRange",Ya,{start:0,end:null});return {dc:b,start:a.start,end:a.end};});};function kc(a,b,c,d){var e=lc(a),f;f = Cb(a,mc);var g=M(a,mc,"media"),h=M(a,mc,"index");f = {F:f.F,Ja:f.Ja,ha:f.ha,presentationTimeOffset:f.presentationTimeOffset,B:f.B,Wa:g,Fa:h};g = 0 + (f.Fa?1:0);g += f.B?1:0;g += f.F?1:0;if(!g)throw new w(4,4002);1 != g && (f.Fa && (f.B = null),f.F = null);if(!f.Fa && !f.Wa)throw new w(4,4002);if(f.Fa){c = a.u.mimeType.split("/")[1];if("mp4" != c && "webm" != c)throw new w(4,4006);if("webm" == c && !e)throw new w(4,4005);d = Ab(f.Fa,a.u.id,null,a.bandwidth || null,null);d = L(a.u.M,[d]);a = fc(a,b,e,d,0,null,c,f.presentationTimeOffset);}else f.F?(d || a.presentationTimeline.Ya(f.F),a = nc(a,f)):(d = b = null,a.K.id && a.u.id && (d = a.K.id + "," + a.u.id,b = c[d]),g = oc(a,f),Bb(a.Ra,a.H.duration,g),b?(b.Xa(g),b.Sa(a.presentationTimeline.ta() - a.H.start)):(a.presentationTimeline.Ga(a.H.start,g),b = new P(g),d && (c[d] = b)),a = {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b)});return {createSegmentIndex:a.createSegmentIndex,findSegmentPosition:a.findSegmentPosition,getSegmentReference:a.getSegmentReference,initSegmentReference:e,presentationTimeOffset:f.presentationTimeOffset};}function mc(a){return a.Ia;}function nc(a,b){var c=a.H.duration,d=b.F,e=b.ha,f=b.Ja,g=b.Wa,h=a.bandwidth || null,l=a.u.id,n=a.u.M;return {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(a){return 0 > a || c && a >= c?null:Math.floor(a / d);},getSegmentReference:function getSegmentReference(a){var b=a * d;return new K(a,b,b + d,function(){var c=Ab(g,l,a + e,h,b * f);return L(n,[c]);},0,null);}};}function oc(a,b){for(var c=[],d=0;d < b.B.length;d++) {var e=b.B[d].start,f=d + b.ha;c.push(new K(f,e,b.B[d].end,(function(a,b,c,d,e,f){a = Ab(a,b,e,c,f);return L(d,[a]).map(function(a){return a.toString();});}).bind(null,b.Wa,a.u.id,a.bandwidth || null,a.u.M,f,(e + b.presentationTimeOffset) * b.Ja),0,null));}return c;}function lc(a){var b=M(a,mc,"initialization");if(!b)return null;var c=a.u.id,d=a.bandwidth || null,e=a.u.M;return new yb(function(){var a=Ab(b,c,null,d,null);return L(e,[a]);},0,null);};function Q(a){this.f = !1;this.a = [];this.b = [];this.c = [];this.g = a || null;}m("shaka.net.NetworkingEngine",Q);Q.RequestType = {MANIFEST:0,SEGMENT:1,LICENSE:2};var pc={};Q.registerScheme = function(a,b){pc[a] = b;};Q.unregisterScheme = function(a){delete pc[a];};Q.prototype.zc = function(a){this.b.push(a);};Q.prototype.registerRequestFilter = Q.prototype.zc;Q.prototype.$c = function(a){var b=this.b;a = b.indexOf(a);0 <= a && b.splice(a,1);};Q.prototype.unregisterRequestFilter = Q.prototype.$c;Q.prototype.Pb = function(){this.b = [];};Q.prototype.clearAllRequestFilters = Q.prototype.Pb;Q.prototype.Ab = function(a){this.c.push(a);};Q.prototype.registerResponseFilter = Q.prototype.Ab;Q.prototype.Jb = function(a){var b=this.c;a = b.indexOf(a);0 <= a && b.splice(a,1);};Q.prototype.unregisterResponseFilter = Q.prototype.Jb;Q.prototype.Qb = function(){this.c = [];};Q.prototype.clearAllResponseFilters = Q.prototype.Qb;function qc(){return {maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0};}function rc(a,b){return {uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b};}Q.prototype.o = function(){this.f = !0;this.b = [];this.c = [];for(var a=[],b=0;b < this.a.length;++b) a.push(this.a[b]["catch"](D));return Promise.all(a);};Q.prototype.destroy = Q.prototype.o;Q.prototype.request = function(a,b){if(this.f)return Promise.reject();for(var c=Date.now(),d=this.b,e=0;e < d.length;e++) try{d[e](a,b);}catch(l) {return Promise.reject(l);}for(var e=b.retryParameters || {},d=e.maxAttempts || 1,f=e.backoffFactor || 2,g=null == e.baseDelay?1E3:e.baseDelay,h=this.h(a,b,0),e=1;e < d;e++) h = h["catch"](this.i.bind(this,a,b,g,e % b.uris.length)),g *= f;this.a.push(h);return h.then((function(b){0 <= this.a.indexOf(h) && this.a.splice(this.a.indexOf(h),1);var d=Date.now();this.g && 1 == a && this.g(c,d,b.data.byteLength);return b;}).bind(this))["catch"]((function(a){0 <= this.a.indexOf(h) && this.a.splice(this.a.indexOf(h),1);return Promise.reject(a);}).bind(this));};Q.prototype.request = Q.prototype.request;Q.prototype.h = function(a,b,c){if(this.f)return Promise.reject();var d=new kb(b.uris[c]),e=d.S;e || (e = location.protocol,e = e.slice(0,-1),lb(d,e),b.uris[c] = d.toString());return (e = pc[e])?e(b.uris[c],b).then((function(b){for(var c=this.c,d=0;d < c.length;d++) c[d](a,b);return b;}).bind(this)):Promise.reject(new w(1,1E3,d));};Q.prototype.i = function(a,b,c,d){var e=new x(),f=b.retryParameters || {};window.setTimeout(e.resolve,c * (1 + (2 * Math.random() - 1) * (null == f.fuzzFactor?.5:f.fuzzFactor)));return e.then(this.h.bind(this,a,b,d));};var sc={},tc={};m("shaka.media.ManifestParser.registerParserByExtension",function(a,b){tc[a] = b;});m("shaka.media.ManifestParser.registerParserByMime",function(a,b){sc[a] = b;});function uc(){var a={},b;for(b in sc) a[b] = !0;for(b in tc) a[b] = !0;["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(b){a[b] = !!sc[b];});["mpd","m3u8","ism"].forEach(function(b){a[b] = !!tc[b];});return a;}function vc(a,b,c,d){var e=d;e || (d = new kb(a).O.split("/").pop().split("."),1 < d.length && (d = d.pop().toLowerCase(),e = tc[d]));if(e)return Promise.resolve(e);c = rc([a],c);c.method = "HEAD";return b.request(0,c).then(function(b){(b = b.headers["content-type"]) && (b = b.toLowerCase());return (e = sc[b])?e:Promise.reject(new w(4,4E3,a));},function(a){return Promise.reject(a);});};function R(a,b){this.j = a;this.i = b;this.c = this.a = Infinity;this.b = 1;this.g = this.f = 0;this.h = !0;}m("shaka.media.PresentationTimeline",R);R.prototype.da = function(){return this.a;};R.prototype.getDuration = R.prototype.da;R.prototype.Aa = function(a){this.a = a;};R.prototype.setDuration = R.prototype.Aa;R.prototype.Fb = function(a){this.g = a;};R.prototype.setClockOffset = R.prototype.Fb;R.prototype.Hb = function(a){this.h = a;};R.prototype.setStatic = R.prototype.Hb;R.prototype.Xb = function(){return this.c;};R.prototype.getSegmentAvailabilityDuration = R.prototype.Xb;R.prototype.Gb = function(a){this.c = a;};R.prototype.setSegmentAvailabilityDuration = R.prototype.Gb;R.prototype.Ga = function(a,b){b.length && (this.b = b.reduce(function(a,b){return Math.max(a,b.endTime - b.startTime);},this.b),a || (this.f = Math.max(this.f,b[0].startTime)));};R.prototype.notifySegments = R.prototype.Ga;R.prototype.Ya = function(a){this.b = Math.max(this.b,a);};R.prototype.notifyMaxSegmentDuration = R.prototype.Ya;R.prototype.R = function(){return Infinity == this.a && !this.h;};R.prototype.isLive = R.prototype.R;R.prototype.ea = function(){return Infinity != this.a && !this.h;};R.prototype.isInProgress = R.prototype.ea;R.prototype.sa = function(){return Math.max(Math.min(this.f,this.Y()),this.ta());};R.prototype.getEarliestStart = R.prototype.sa;R.prototype.ta = function(){return Infinity == this.c?0:Math.max(0,this.Y() - this.c - this.i);};R.prototype.getSegmentAvailabilityStart = R.prototype.ta;R.prototype.Y = function(){return this.R() || this.ea()?Math.min(Math.max(0,(Date.now() + this.g) / 1E3 - this.b - this.j),this.a):this.a;};R.prototype.getSegmentAvailabilityEnd = R.prototype.Y;R.prototype.Ua = function(){return Math.max(0,this.Y() - (this.R() || this.ea()?this.i:0));};R.prototype.getSeekRangeEnd = R.prototype.Ua;function wc(a,b,c){this.h = S[b];this.c = a;this.g = 0;this.f = Infinity;this.a = this.b = null;this.i = c;}var S={};m("shaka.media.TextEngine.registerParser",function(a,b){S[a] = b;});m("shaka.media.TextEngine.unregisterParser",function(a){delete S[a];});function xc(a,b,c){return a >= b?null:new VTTCue(a,b,c);}m("shaka.media.TextEngine.makeCue",xc);wc.prototype.o = function(){this.c && yc(this,function(){return !0;});this.c = this.h = null;return Promise.resolve();};function zc(a,b,c,d){var e=a.g;return Promise.resolve().then((function(){if(this.c){var a=this.h(b,e,c,d,this.i);if(null != c && null != d){for(var g=0;g < a.length && !(a[g].startTime >= this.f);++g) this.c.addCue(a[g]);null == this.b && (this.b = c);this.a = Math.min(d,this.f);}}}).bind(a));}wc.prototype.remove = function(a,b){return Promise.resolve().then((function(){this.c && (yc(this,function(c){return c.startTime >= b || c.endTime <= a?!1:!0;}),null == this.b || b <= this.b || a >= this.a || (a <= this.b && b >= this.a?this.b = this.a = null:a <= this.b && b < this.a?this.b = b:a > this.b && b >= this.a && (this.a = a)));}).bind(this));};function Ac(a,b){return null == a.a || a.a < b || b < a.b?0:a.a - b;}function yc(a,b){for(var c=a.c.cues,d=[],e=0;e < c.length;++e) b(c[e]) && d.push(c[e]);for(e = 0;e < d.length;++e) a.c.removeCue(d[e]);};function Bc(a,b,c){return c == b || a >= Cc && c == b.split("-")[0] || a >= Dc && c.split("-")[0] == b.split("-")[0]?!0:!1;}var Cc=1,Dc=2;function Ec(a){a = a.toLowerCase().split("-");var b=Fc[a[0]];b && (a[0] = b);return a.join("-");}var Fc={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};function Gc(a,b,c){for(var d=0;d < a.length;++d) if(c(a[d],b))return d;return -1;};function Hc(a){this.a = null;this.b = (function(){this.a = null;a();}).bind(this);}Hc.prototype.cancel = function(){null != this.a && (clearTimeout(this.a),this.a = null);};function Ic(a){a.cancel();a.a = setTimeout(a.b,100);};function Jc(a,b,c){this.l = this.g = this.s = null;this.A = !1;this.b = null;this.f = new y();this.a = [];this.m = [];this.j = new x();this.G = a;this.i = null;this.h = (function(a){this.j.reject(a);b(a);}).bind(this);this.w = {};this.J = c;this.v = new Hc(this.yc.bind(this));this.C = this.c = !1;this.j["catch"](function(){});}k = Jc.prototype;k.o = function(){this.c = !0;var a=this.a.map(function(a){a.za.close()["catch"](D);return a.za.closed;});this.j.reject();this.f && a.push(this.f.o());this.l && a.push(this.l.setMediaKeys(null)["catch"](D));this.v && this.v.cancel();this.f = this.l = this.g = this.s = this.b = this.v = null;this.a = [];this.m = [];this.h = this.i = this.G = null;return Promise.all(a);};k.configure = function(a){this.i = a;};k.init = function(a,b){var c={},d=[];this.C = b;this.m = a.offlineSessionIds;Kc(this,a,b || 0 < a.offlineSessionIds.length,c,d);return d.length?Lc(this,c,d):(this.A = !0,Promise.resolve());};function Mc(a,b){if(!a.g)return z(a.f,b,"encrypted",(function(){this.f.ja(b,"encrypted");this.h(new w(6,6010));}).bind(a)),Promise.resolve();a.l = b;var c=a.l.setMediaKeys(a.g),c=c["catch"](function(a){return Promise.reject(new w(6,6003,a.message));}),d=null;a.b.serverCertificate && (d = a.g.setServerCertificate(a.b.serverCertificate),d = d["catch"](function(a){return Promise.reject(new w(6,6004,a.message));}));return Promise.all([c,d]).then((function(){if(this.c)return Promise.reject();Nc(this);this.b.initData.length || this.m.length || z(this.f,this.l,"encrypted",this.ec.bind(this));}).bind(a))["catch"]((function(a){return this.c?Promise.resolve():Promise.reject(a);}).bind(a));}function Oc(a,b){return Promise.all(b.map((function(a){return Pc(this,a).then(function(a){if(a)return a.remove();});}).bind(a)));}function Nc(a){var b=a.b?a.b.initData:[];b.forEach((function(a){Qc(this,a.initDataType,a.initData);}).bind(a));a.m.forEach((function(a){Pc(this,a);}).bind(a));b.length || a.m.length || a.j.resolve();return a.j;}k.keySystem = function(){return this.b?this.b.keySystem:"";};function Rc(a){return a.a.map(function(a){return a.za.sessionId;});}function Kc(a,b,c,d,e){var f=Sc(a);b.periods.forEach((function(a){a.streamSets.forEach((function(a){"text" != a.type && (f && (a.drmInfos = [f]),a.drmInfos.forEach((function(b){Tc(this,b);var f=d[b.keySystem];f || (f = {audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:c?"required":"optional",sessionTypes:[c?"persistent-license":"temporary"],label:b.keySystem,drmInfos:[]},d[b.keySystem] = f,e.push(b.keySystem));f.drmInfos.push(b);b.distinctiveIdentifierRequired && (f.distinctiveIdentifier = "required");b.persistentStateRequired && (f.persistentState = "required");var g="video" == a.type?f.videoCapabilities:f.audioCapabilities,h=("video" == a.type?b.videoRobustness:b.audioRobustness) || "";a.streams.forEach((function(a){var c=a.mimeType;a.codecs && (c += '; codecs="' + a.codecs + '"');a.keyId && b.keyIds.push(a.keyId);g.push({robustness:h,contentType:c});}).bind(this));}).bind(this)));}).bind(this));}).bind(a));}function Lc(a,b,c){if(1 == c.length && "" == c[0])return Promise.reject(new w(6,6E3));var d=new x(),e=d;[!0,!1].forEach((function(a){c.forEach((function(c){var d=b[c];d.drmInfos.some(function(a){return !!a.licenseServerUri;}) == a && (d.audioCapabilities.length || delete d.audioCapabilities,d.videoCapabilities.length || delete d.videoCapabilities,e = e["catch"]((function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(c,[d]);}).bind(this)));}).bind(this));}).bind(a));e = e["catch"](function(){return Promise.reject(new w(6,6001));});e = e.then((function(a){if(this.c)return Promise.reject();var c=0 <= navigator.userAgent.indexOf("Edge/"),d=a.getConfiguration();this.s = (d.audioCapabilities || []).concat(d.videoCapabilities || []).map(function(a){return a.contentType;});c && (this.s = null);c = b[a.keySystem];Uc(this,a.keySystem,c,c.drmInfos);return this.b.licenseServerUri?a.createMediaKeys():Promise.reject(new w(6,6012));}).bind(a)).then((function(a){if(this.c)return Promise.reject();this.g = a;this.A = !0;}).bind(a))["catch"]((function(a){if(this.c)return Promise.resolve();this.s = this.b = null;return a instanceof w?Promise.reject(a):Promise.reject(new w(6,6002,a.message));}).bind(a));d.reject();return e;}function Tc(a,b){var c=b.keySystem;if(c){if(!b.licenseServerUri){var d=a.i.servers[c];d && (b.licenseServerUri = d);}b.keyIds || (b.keyIds = []);if(c = a.i.advanced[c])b.distinctiveIdentifierRequired || (b.distinctiveIdentifierRequired = c.distinctiveIdentifierRequired),b.persistentStateRequired || (b.persistentStateRequired = c.persistentStateRequired),b.videoRobustness || (b.videoRobustness = c.videoRobustness),b.audioRobustness || (b.audioRobustness = c.audioRobustness),b.serverCertificate || (b.serverCertificate = c.serverCertificate);}}function Sc(a){if(Na(a.i.clearKeys))return null;var b=[],c=[],d;for(d in a.i.clearKeys) {var e=a.i.clearKeys[d],f=Sa(d),e=Sa(e),f={kty:"oct",kid:Qa(f),k:Qa(e)};b.push(f);c.push(f.kid);}a = JSON.stringify({keys:b});c = JSON.stringify({kids:c});c = [{initData:new Uint8Array(Ib(c)),initDataType:"keyids"}];return {keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64," + window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:c,keyIds:[]};}function Uc(a,b,c,d){var e=[],f=[],g=[],h=[];Vc(d,e,f,g,h);a.b = {keySystem:b,licenseServerUri:e[0],distinctiveIdentifierRequired:"required" == c.distinctiveIdentifier,persistentStateRequired:"required" == c.persistentState,audioRobustness:c.audioCapabilities?c.audioCapabilities[0].robustness:"",videoRobustness:c.videoCapabilities?c.videoCapabilities[0].robustness:"",serverCertificate:f[0],initData:g,keyIds:h};}function Vc(a,b,c,d,e){function f(a,b){return a.initDataType == b.initDataType && Ua(a.initData,b.initData);}a.forEach(function(a){-1 == b.indexOf(a.licenseServerUri) && b.push(a.licenseServerUri);a.serverCertificate && -1 == Gc(c,a.serverCertificate,Ua) && c.push(a.serverCertificate);a.initData && a.initData.forEach(function(a){-1 == Gc(d,a,f) && d.push(a);});if(a.keyIds)for(var g=0;g < a.keyIds.length;++g) -1 == e.indexOf(a.keyIds[g]) && e.push(a.keyIds[g]);});}k.ec = function(a){for(var b=new Uint8Array(a.initData),c=0;c < this.a.length;++c) if(Ua(b,this.a[c].initData))return;Qc(this,a.initDataType,b);};function Pc(a,b){var c;try{c = a.g.createSession("persistent-license");}catch(f) {var d=new w(6,6005,f.message);a.h(d);return Promise.reject(d);}z(a.f,c,"message",a.xb.bind(a));z(a.f,c,"keystatuseschange",a.sb.bind(a));var e={initData:null,za:c,loaded:!1};a.a.push(e);return c.load(b).then((function(a){if(!this.c){if(a)return e.loaded = !0,this.a.every(function(a){return a.loaded;}) && this.j.resolve(),c;this.a.splice(this.a.indexOf(e),1);this.h(new w(6,6013));}}).bind(a),(function(a){this.c || (this.a.splice(this.a.indexOf(e),1),this.h(new w(6,6005,a.message)));}).bind(a));}function Qc(a,b,c){var d;try{d = a.C?a.g.createSession("persistent-license"):a.g.createSession();}catch(e) {a.h(new w(6,6005,e.message));return;}z(a.f,d,"message",a.xb.bind(a));z(a.f,d,"keystatuseschange",a.sb.bind(a));a.a.push({initData:c,za:d,loaded:!1});d.generateRequest(b,c.buffer)["catch"]((function(a){if(!this.c){for(var b=0;b < this.a.length;++b) if(this.a[b].za == d){this.a.splice(b,1);break;}this.h(new w(6,6006,a.message));}}).bind(a));}k.xb = function(a){var b=a.target,c=rc([this.b.licenseServerUri],this.i.retryParameters);c.body = a.message;c.method = "POST";"com.microsoft.playready" == this.b.keySystem && Wc(c);this.G.request(2,c).then((function(a){return this.c?Promise.reject():b.update(a.data);}).bind(this),(function(a){if(this.c)return Promise.resolve();this.h(new w(6,6007,a));}).bind(this))["catch"]((function(a){if(this.c)return Promise.resolve();this.h(new w(6,6008,a.message));}).bind(this));};function Wc(a){for(var b=Gb(a.body,!0),b=new DOMParser().parseFromString(b,"application/xml"),c=b.getElementsByTagName("HttpHeader"),d=0;d < c.length;++d) a.headers[c[d].querySelector("name").textContent] = c[d].querySelector("value").textContent;a.body = Ra(b.querySelector("Challenge").textContent).buffer;}k.sb = function(a){a = a.target;var b;for(b = 0;b < this.a.length && this.a[b].za != a;++b);if(b != this.a.length){var c=a.keyStatuses,d=!1;c.forEach || (c = []);c.forEach((function(a,c){if("string" == typeof c){var e=c;c = a;a = e;}if("com.microsoft.playready" == this.b.keySystem && 16 == c.byteLength){var e=new DataView(c),f=e.getUint32(0,!0),l=e.getUint16(4,!0),n=e.getUint16(6,!0);e.setUint32(0,f,!1);e.setUint16(4,l,!1);e.setUint16(6,n,!1);}"com.microsoft.playready" == this.b.keySystem && "status-pending" == a && (a = "usable");"status-pending" != a && (this.a[b].loaded = !0,this.a.every(function(a){return a.loaded;}) && this.j.resolve());"expired" == a && (d = !0);e = Ta(new Uint8Array(c));this.w[e] = a;}).bind(this));c = a.expiration - Date.now();if(0 > c || d && 1E3 > c)this.a.splice(b,1),a.close();Ic(this.v);}};k.yc = function(){Pa(this.w,function(a,b){return "expired" == b;}) && this.h(new w(6,6014));this.J(this.w);};function Xc(){var a=[],b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],c=[{videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:b}],d={};"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(b){var e=navigator.requestMediaKeySystemAccess(b,c).then(function(a){return a.createMediaKeys();}).then(function(a){var c=!1;try{a.createSession("persistent-license"),c = !0;}catch(l) {}d[b] = {persistentState:c};},function(){d[b] = null;});a.push(e);});return Promise.all(a).then(function(){return d;});};function Zc(a){return !a || 1 == a.length && 1E-6 > a.end(0) - a.start(0)?null:a.length?a.end(a.length - 1):null;}function $c(a,b){var c=0;if(!a || 1 == a.length && 1E-6 > a.end(0) - a.start(0))return c;var d=!1,e=1E-4;b || (e = .25);for(var f=0;f < a.length;++f) if(b + e >= a.start(f) && b < a.end(f))c += a.end(f) - b,d = !0;else if(d && .04 >= a.start(f) - a.end(f - 1))c += a.end(f) - a.start(f),c += a.start(f) - a.end(f - 1);else if(0 < f && b + e < a.start(f) && b + e >= a.end(f - 1))if(.04 >= a.start(f) - b)c += a.end(f) - b,d = !0;else break;else d = !1;return c;};function ad(a,b,c){this.f = a;this.h = b;this.j = c;this.c = {};this.b = null;this.a = {};this.g = new y();this.i = !1;}function bd(){var a={};'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hvc1.1.6.L93.90",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(b){a[b] = !!S[b] || MediaSource.isTypeSupported(b);var c=b.split(";")[0];a[c] = a[c] || a[b];});return a;}k = ad.prototype;k.o = function(){this.i = !0;var a=[],b;for(b in this.a) {var c=this.a[b],d=c[0];this.a[b] = c.slice(0,1);d && a.push(d.p["catch"](D));for(d = 1;d < c.length;++d) c[d].p["catch"](D),c[d].p.reject();}this.b && a.push(this.b.o());return Promise.all(a).then((function(){this.g.o();this.b = this.j = this.h = this.f = this.g = null;this.c = {};this.a = {};}).bind(this));};k.init = function(a,b){for(var c in a) {var d=a[c];"text" == c?this.b = new wc(this.j,d,b):(d = this.h.addSourceBuffer(d),z(this.g,d,"error",this.Uc.bind(this,c)),z(this.g,d,"updateend",this.wa.bind(this,c)),this.c[c] = d,this.a[c] = []);}};function cd(a,b){var c;"text" == b?c = a.b.b:(c = dd(a,b),c = !c || 1 == c.length && 1E-6 > c.end(0) - c.start(0)?null:1 == c.length && 0 > c.start(0)?0:c.length?c.start(0):null);return c;}function fd(a,b,c){"text" == b?(b = Ac(a.b,c),b || (b = Ac(a.b,c + .1)) && (b += .1)):(a = dd(a,b),b = $c(a,c),b || (b = $c(a,c + .1)) && (b += .1));return b;}function dd(a,b){try{return a.c[b].buffered;}catch(c) {return null;}}function gd(a,b,c,d,e){return "text" == b?zc(a.b,c,d,e):hd(a,b,a.Tc.bind(a,b,c));}k.remove = function(a,b,c){return "text" == a?this.b.remove(b,c):hd(this,a,this.Cb.bind(this,a,b,c));};function id(a,b){return "text" == b?a.b.remove(0,Infinity):hd(a,b,a.Cb.bind(a,b,0,a.h.duration));}function jd(a,b,c){return "text" == b?(a.b.g = c,Promise.resolve()):hd(a,b,a.Jc.bind(a,b,c));}function kd(a,b,c){return "text" == b?(a.b.f = c,Promise.resolve()):Promise.all([hd(a,b,a.Lb.bind(a,b)),hd(a,b,a.Hc.bind(a,b,c))]);}k.endOfStream = function(a){return ld(this,(function(){a?this.h.endOfStream(a):this.h.endOfStream();}).bind(this));};k.Aa = function(a){return ld(this,(function(){this.h.duration = a;}).bind(this));};k.da = function(){return this.h.duration;};k.Tc = function(a,b){this.c[a].appendBuffer(b);};k.Cb = function(a,b,c){c <= b?this.wa(a):this.c[a].remove(b,c);};k.Lb = function(a){var b=this.c[a].appendWindowEnd;this.c[a].abort();this.c[a].appendWindowEnd = b;this.wa(a);};k.Ub = function(a){this.f.currentTime -= .001;this.wa(a);};k.Jc = function(a,b){this.c[a].timestampOffset = b;this.wa(a);};k.Hc = function(a,b){this.c[a].appendWindowEnd = b + .04;this.wa(a);};k.Uc = function(a){this.a[a][0].p.reject(new w(3,3014,this.f.error?this.f.error.code:0));};k.wa = function(a){var b=this.a[a][0];b && (b.p.resolve(),md(this,a));};function hd(a,b,c){if(a.i)return Promise.reject();c = {start:c,p:new x()};a.a[b].push(c);if(1 == a.a[b].length)try{c.start();}catch(d) {"QuotaExceededError" == d.name?c.p.reject(new w(3,3017,b)):c.p.reject(new w(3,3015,d)),md(a,b);}return c.p;}function ld(a,b){if(a.i)return Promise.reject();var c=[],d;for(d in a.c) {var e=new x(),f={start:(function(a){a.resolve();}).bind(null,e),p:e};a.a[d].push(f);c.push(e);1 == a.a[d].length && f.start();}return Promise.all(c).then((function(){var a,c;try{b();}catch(l) {c = Promise.reject(new w(3,3015,l));}for(a in this.c) md(this,a);return c;}).bind(a),(function(){return Promise.reject();}).bind(a));}function md(a,b){a.a[b].shift();var c=a.a[b][0];if(c)try{c.start();}catch(d) {c.p.reject(new w(3,3015,d)),md(a,b);}};function nd(a,b,c){var d=!1;a.streamSets.forEach(function(a){a.streams.forEach(function(e){var f=e.allowedByApplication;e.allowedByApplication = !0;if("video" == a.type){if(e.width < b.minWidth || e.width > b.maxWidth || e.width > c.width || e.height < b.minHeight || e.height > b.maxHeight || e.height > c.height || e.width * e.height < b.minPixels || e.width * e.height > b.maxPixels || e.bandwidth < b.minVideoBandwidth || e.bandwidth > b.maxVideoBandwidth)e.allowedByApplication = !1;}else "audio" == a.type && (e.bandwidth < b.minAudioBandwidth || e.bandwidth > b.maxAudioBandwidth) && (e.allowedByApplication = !1);f != e.allowedByApplication && (d = !0);});});return d;}function od(a,b,c){var d="",e=null;a && a.A && (d = a.keySystem(),e = a.s);for(a = 0;a < c.streamSets.length;++a) {var f=c.streamSets[a];if(d && f.drmInfos.length && !f.drmInfos.some(function(a){return a.keySystem == d;}))c.streamSets.splice(a,1),--a;else {for(var g=b[f.type],h=0;h < f.streams.length;++h) {var l=f.streams[h],n=pd(l.mimeType,l.codecs);S[n] || MediaSource.isTypeSupported(n)?e && l.encrypted && 0 > e.indexOf(n)?(f.streams.splice(h,1),--h):!g || l.mimeType == g.mimeType && l.codecs.split(".")[0] == g.codecs.split(".")[0] || (f.streams.splice(h,1),--h):(f.streams.splice(h,1),--h);}f.streams.length || (c.streamSets.splice(a,1),--a);}}}function qd(a,b){return a.streamSets.map(function(a){var c=b?b[a.type]:null;return a.streams.filter(function(a){return a.allowedByApplication && a.allowedByKeySystem;}).map(function(b){return {id:b.id,active:c == b,type:a.type,bandwidth:b.bandwidth,language:a.language,kind:b.kind || null,width:b.width || null,height:b.height || null,frameRate:b.frameRate || void 0,codecs:b.codecs || null};});}).reduce(C,[]);}function rd(a,b){for(var c=0;c < a.streamSets.length;c++) for(var d=a.streamSets[c],e=0;e < d.streams.length;e++) {var f=d.streams[e];if(f.id == b.id)return {stream:f,Wc:d};}return null;}function sd(a){return a.streams.some(function(a){return a.allowedByApplication && a.allowedByKeySystem;});}function td(a,b,c){var d={};a.streamSets.forEach(function(a){!sd(a) || a.type in d || (d[a.type] = a);});var e=0;a.streamSets.forEach(function(a){if(sd(a) && "video" == a.type){var b=ud(a);b > e?(e = b,d.video = a):b == e && vd(a) < vd(d.video) && (d.video = a);}});a.streamSets.forEach(function(a){sd(a) && a.primary && (d[a.type].primary?vd(a) < vd(d[a.type]) && (d[a.type] = a):d[a.type] = a);});[Dc,Cc,0].forEach(function(e){a.streamSets.forEach(function(a){if(sd(a)){var f;"audio" == a.type?f = b.preferredAudioLanguage:"text" == a.type && (f = b.preferredTextLanguage);if(f){f = Ec(f);var g=Ec(a.language);Bc(e,f,g) && (a.language == d[a.type].language?vd(a) < vd(d[a.type]) && (d[a.type] = a):d[a.type] = a,c && (c[a.type] = !0));}}});});return d;}function vd(a){var b=0;if(!a || 1 > a.streams.length)return b;a.streams.forEach(function(a){b += a.bandwidth;});return b / a.streams.length;}function ud(a){var b=0;if(!a)return b;a.streams.forEach(function(a){a.height > b && (b = a.height);});return b;}function pd(a,b){var c=a;b && (c += '; codecs="' + b + '"');return c;};function wd(){this.m = this.l = this.j = this.c = this.a = null;this.h = [];this.b = null;this.g = [];this.v = 1;this.i = {};this.s = 0;this.f = null;this.La = this.La.bind(this);}m("shaka.dash.DashParser",wd);k = wd.prototype;k.configure = function(a){this.c = a;};k.start = function(a,b,c,d,e){this.h = [a];this.a = b;this.j = c;this.l = d;this.m = e;return xd(this).then((function(){this.a && yd(this,0);return this.b;}).bind(this));};k.stop = function(){this.a && this.a.Jb(this.La);this.c = this.m = this.l = this.j = this.a = null;this.h = [];this.b = null;this.g = [];this.i = {};null != this.f && (window.clearTimeout(this.f),this.f = null);return Promise.resolve();};function xd(a){return a.a.request(0,rc(a.h,a.c.retryParameters)).then((function(a){if(this.a)return zd(this,a.data,a.uri);}).bind(a));}function zd(a,b,c){var d=Eb(b),e=new DOMParser(),f=null;b = null;try{f = e.parseFromString(d,"text/xml");}catch(E) {}f && "MPD" == f.documentElement.tagName && (b = f.documentElement);if(!b)throw new w(4,4001);c = [c];d = G(b,"Location").map(Wa).filter(La);0 < d.length && (c = a.h = d);d = G(b,"BaseURL").map(Wa);c = L(c,d);var g=I(b,"minBufferTime",J);a.s = I(b,"minimumUpdatePeriod",J,-1);var h=I(b,"availabilityStartTime",Xa),d=I(b,"timeShiftBufferDepth",J),l=I(b,"suggestedPresentationDelay",J),e=I(b,"maxSegmentDuration",J),f=b.getAttribute("type") || "static",n;if(a.b)n = a.b.presentationTimeline;else {var u=Math.max(10,1.5 * g);n = new R(h,null != l?l:u);}var h=Ad(a,{Ra:"static" != f,presentationTimeline:n,K:null,H:null,P:null,u:null,bandwidth:void 0},c,b),l=h.duration,r=h.periods;n.Hb("static" == f);n.Aa(l || Infinity);n.Gb(null != d?d:Infinity);n.Ya(e || 1);if(a.b)return Promise.resolve();b = G(b,"UTCTiming");d = n.R();h.ba && a.a.Ab(a.La);return Bd(a,c,b,d).then((function(a){this.a && (n.Fb(a),this.b = {presentationTimeline:n,periods:r,offlineSessionIds:[],minBufferTime:g || 0});}).bind(a));}function Ad(a,b,c,d){var e=I(d,"mediaPresentationDuration",J),f=!1,g=[],h=0;d = G(d,"Period");for(var l=0;l < d.length;l++) {var n=d[l],h=I(n,"start",J,h),u=I(n,"duration",J);if(null == u)if(l + 1 != d.length){var r=I(d[l + 1],"start",J);null != r && (u = r - h);}else null != e && (u = e - h);var n={start:h,duration:u,node:n,ba:!1},E=a,v=b,r=n;v.K = Cd(r.node,null,c);v.H = r;v.K.id || (v.K.id = "__shaka_period_" + r.start);E = G(r.node,"AdaptationSet").map(E.uc.bind(E,v)).filter(La);if(!E.length)throw new w(4,4004);for(v = 0;v < E.length;v++) E[v].ba && (r.ba = !0);E = Dd(E);r = {startTime:r.start,streamSets:E};g.push(r);f = f || n.ba;n = b.K.id;a.g.every(Ma(n)) && (a.j(r),a.g.push(n),a.b && a.b.periods.push(r));if(null == u){h = null;break;}h += u;}return null != e?{periods:g,duration:e,ba:f}:{periods:g,duration:h,ba:f};}k.uc = function(a,b){a.P = Cd(b,a.K,null);var c=!1,d=G(b,"Role"),e=void 0;"text" == a.P.contentType && (e = "subtitle");for(var f=0;f < d.length;f++) {var g=d[f].getAttribute("schemeIdUri");if(null == g || "urn:mpeg:dash:role:2011" == g)switch((g = d[f].getAttribute("value"),g)){case "main":c = !0;break;case "caption":case "subtitle":e = g;}}var d=!!Va(b,"InbandEventStream"),h=[];G(b,"SupplementalProperty").forEach(function(a){var b=a.getAttribute("schemeIdUri");("urn:mpeg:dash:adaptation-set-switching:2016" == b || "http://dashif.org/guidelines/AdaptationSetSwitching" == b || "http://dashif.org/descriptor/AdaptationSetSwitching" == b) && (a = a.getAttribute("value")) && h.push.apply(h,a.split(","));});var l=null,n=!1;G(b,"EssentialProperty").forEach(function(a){"http://dashif.org/guidelines/trickmode" == a.getAttribute("schemeIdUri")?l = a.getAttribute("value"):n = !0;});if(null != l || n)return null;f = G(b,"ContentProtection");f = eb(f,this.c.dash.customScheme);g = Ec(b.getAttribute("lang") || "und");e = G(b,"Representation").map(this.vc.bind(this,a,f,e,g)).filter(function(a){return !!a;});if(!e.length)throw new w(4,4003);a.P.contentType || (a.P.contentType = Ed(e[0].mimeType,e[0].codecs));return {id:a.P.id || "__fake__" + this.v++,contentType:a.P.contentType,language:g,cc:c,streams:e,drmInfos:f.drmInfos,Yc:h,ba:d};};k.vc = function(a,b,c,d,e){a.u = Cd(e,a.P,null);if(!Fd(a.u))return null;a.bandwidth = I(e,"bandwidth",$a) || void 0;var f;f = this.Cc.bind(this);if(a.u.Ha)f = dc(a,f);else if(a.u.Z)f = gc(a,this.i);else if(a.u.Ia)f = kc(a,f,this.i,!!this.b);else {var g=a.u.M,h=a.H.duration || 0;f = {createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(a){return 0 <= a && a < h?1:null;},getSegmentReference:function getSegmentReference(a){return 1 != a?null:new K(1,0,h,function(){return g;},0,null);},initSegmentReference:null,presentationTimeOffset:0};}e = G(e,"ContentProtection");e = ib(e,this.c.dash.customScheme,b);return {id:this.v++,createSegmentIndex:f.createSegmentIndex,findSegmentPosition:f.findSegmentPosition,getSegmentReference:f.getSegmentReference,initSegmentReference:f.initSegmentReference,presentationTimeOffset:f.presentationTimeOffset,mimeType:a.u.mimeType,codecs:a.u.codecs,frameRate:a.u.frameRate,bandwidth:a.bandwidth,width:a.u.width,height:a.u.height,kind:c,encrypted:0 < b.drmInfos.length,keyId:e,language:d,allowedByApplication:!0,allowedByKeySystem:!0};};k.Sc = function(){this.f = null;var a=Date.now();xd(this).then((function(){this.a && yd(this,(Date.now() - a) / 1E3);}).bind(this))["catch"]((function(a){this.l(a);this.a && yd(this,0);}).bind(this));};function yd(a,b){0 > a.s || (a.f = window.setTimeout(a.Sc.bind(a),1E3 * Math.max(Math.max(3,a.s) - b,0)));}function Cd(a,b,c){b = b || {contentType:"",mimeType:"",codecs:"",frameRate:void 0};c = c || b.M;var d=G(a,"BaseURL").map(Wa),e=a.getAttribute("contentType") || b.contentType,f=a.getAttribute("mimeType") || b.mimeType,g=a.getAttribute("codecs") || b.codecs,h=I(a,"frameRate",bb) || b.frameRate;e || (e = Ed(f,g));return {M:L(c,d),Ha:Va(a,"SegmentBase") || b.Ha,Z:Va(a,"SegmentList") || b.Z,Ia:Va(a,"SegmentTemplate") || b.Ia,width:I(a,"width",ab) || b.width,height:I(a,"height",ab) || b.height,contentType:e,mimeType:f,codecs:g,frameRate:h,id:a.getAttribute("id")};}function Dd(a){var b={};a.forEach(function(a){b[a.id] = [a];});a.forEach(function(a){var c=b[a.id];a.Yc.forEach(function(a){(a = b[a]) && a != c && (c.push.apply(c,a),a.forEach(function(a){b[a.id] = c;}));});});var c=[],d=[];F(b).forEach(function(a){if(!(0 <= d.indexOf(a))){d.push(a);var b=new Ca();a.forEach(function(a){b.push(a.contentType || "",a);});b.keys().forEach(function(a){var d=new Ca();b.get(a).forEach(function(a){d.push(a.language,a);});d.keys().forEach(function(b){var e=d.get(b);b = {language:b,type:a,primary:e.some(function(a){return a.cc;}),drmInfos:e.map(function(a){return a.drmInfos;}).reduce(C,[]),streams:e.map(function(a){return a.streams;}).reduce(C,[])};c.push(b);});});}});return c;}function Fd(a){var b;b = 0 + (a.Ha?1:0);b += a.Z?1:0;b += a.Ia?1:0;if(!b)return "text" == a.contentType || "application" == a.contentType?!0:!1;1 != b && (a.Ha && (a.Z = null),a.Ia = null);return !0;}function Gd(a,b,c,d){b = L(b,[c]);b = rc(b,a.c.retryParameters);b.method = d;return a.a.request(0,b).then(function(a){if("HEAD" == d){if(!a.headers || !a.headers.date)return 0;a = a.headers.date;}else a = Eb(a.data);a = Date.parse(a);return isNaN(a)?0:a - Date.now();});}function Bd(a,b,c,d){c = c.map(function(a){return {scheme:a.getAttribute("schemeIdUri"),value:a.getAttribute("value")};});var e=a.c.dash.clockSyncUri;d && !c.length && e && c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e});return Ka(c,(function(a){var c=a.value;switch(a.scheme){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return Gd(this,b,c,"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 Gd(this,b,c,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return a = Date.parse(c),isNaN(a)?0:a - Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return Promise.reject();default:return Promise.reject();}}).bind(a))["catch"](function(){return 0;});}k.Cc = function(a,b,c){a = rc(a,this.c.retryParameters);null != b && (a.headers.Range = "bytes=" + b + "-" + (null != c?c:""));return this.a.request(1,a).then(function(a){return a.data;});};k.La = function(a,b){if(1 == a){var c=new Jb(new DataView(b.data)),d=Sb(1701671783,c);if(-1 != d){var e=c.a - 8 + d;O(c,4);d = Rb(c);if("urn:mpeg:dash:event:2012" == d)xd(this);else {var f=Rb(c),g=N(c),h=N(c),l=N(c),n=N(c),c=Qb(c,e - c.a);this.m(new t("emsg",{detail:{ld:d,value:f,Ja:g,kd:h,hd:l,id:n,jd:c}}));}}}};function Ed(a,b){return S[pd(a,b)]?"text":a.split("/")[0];}tc.mpd = wd;sc["application/dash+xml"] = wd;function T(a,b){var c=Eb(a),d=[],e=new DOMParser(),f=null;try{f = e.parseFromString(c,"text/xml");}catch(n) {throw new w(2,2005);}if(f){var g,h;if(c = f.getElementsByTagName("tt")[0])e = c.getAttribute("ttp:frameRate"),f = c.getAttribute("ttp:subFrameRate"),g = c.getAttribute("ttp:frameRateMultiplier"),h = c.getAttribute("ttp:tickRate");else throw new w(2,2006);e = new Hd(e,f,g,h);f = T.b(c.getElementsByTagName("styling")[0]);g = T.b(c.getElementsByTagName("layout")[0]);c = T.b(c.getElementsByTagName("body")[0]);for(h = 0;h < c.length;h++) {var l=T.c(c[h],b,e,f,g);l && d.push(l);}}return d;}m("shaka.media.TtmlTextParser",T);T.m = /^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/;T.v = /^(?:(\d{2,}):)?(\d{2}):(\d{2})$/;T.s = /^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/;T.w = /^(\d*\.?\d*)f$/;T.C = /^(\d*\.?\d*)t$/;T.A = /^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;T.l = /^(\d{1,2}|100)% (\d{1,2}|100)%$/;T.Da = {left:"start",center:"center",right:"end",start:"start",end:"end"};T.Ka = {left:"line-left",center:"center",right:"line-right"};T.b = function(a){var b=[];if(!a)return b;for(var c=a.childNodes,d=0;d < c.length;d++) {var e="span" == c[d].nodeName && "p" == a.nodeName;c[d].nodeType != Node.ELEMENT_NODE || "br" == c[d].nodeName || e || (e = T.b(c[d]),b = b.concat(e));}b.length || b.push(a);return b;};T.g = function(a){a = a.childNodes;for(var b=0;b < a.length;b++) "br" == a[b].nodeName && 0 < b?a[b - 1].textContent += "\n":0 < a[b].childNodes.length && T.g(a[b]);};T.c = function(a,b,c,d,e){if(!a.hasAttribute("begin") && !a.hasAttribute("end") && /^\s*$/.test(a.textContent))return null;T.g(a);var f=T.a(a.getAttribute("begin"),c),g=T.a(a.getAttribute("end"),c);c = T.a(a.getAttribute("dur"),c);var h=a.textContent;null == g && null != c && (g = f + c);if(null == f || null == g)throw new w(2,2001);b = xc(f + b,g + b,h);if(!b)return null;e = T.i(a,"region",e);T.oa(b,a,e,d);return b;};T.oa = function(a,b,c,d){var e,f=T.f(b,c,d,"tts:extent");f && (e = T.l.exec(f)) && (a.size = Number(e[1]));e = T.f(b,c,d,"tts:writingMode");f = !0;"tb" == e || "tblr" == e?a.vertical = "lr":"tbrl" == e?a.vertical = "rl":f = !1;if(e = T.f(b,c,d,"tts:origin"))if(e = T.l.exec(e))f?(a.position = Number(e[2]),a.line = Number(e[1])):(a.position = Number(e[1]),a.line = Number(e[2])),a.snapToLines = !1;if(b = T.f(b,c,d,"tts:textAlign"))a.align = b,"center" == b && ("center" != a.align && (a.align = "middle"),a.position = "auto"),a.positionAlign = T.Ka[b],a.lineAlign = T.Da[b];};T.f = function(a,b,c,d){for(var e=T.b(b),f=0;f < e.length;f++) {var g=e[f].getAttribute(d);if(g)return g;}e = T.i;return (a = e(b,"style",c) || e(a,"style",c))?a.getAttribute(d):null;};T.i = function(a,b,c){if(!a || 1 > c.length)return null;var d=null;if(a = T.pa(a,b))for(b = 0;b < c.length;b++) if(c[b].getAttribute("xml:id") == a){d = c[b];break;}return d;};T.pa = function(a,b){for(var c=null;a && !(c = a.getAttribute(b));) {var d=a.parentNode;if(d instanceof Element)a = d;else break;}return c;};T.a = function(a,b){var c=null;T.m.test(a)?c = T.qa(b,a):T.v.test(a)?c = T.h(T.v,a):T.s.test(a)?c = T.h(T.s,a):T.w.test(a)?c = T.Ba(b,a):T.C.test(a)?c = T.Ca(b,a):T.A.test(a) && (c = T.h(T.A,a));return c;};T.Ba = function(a,b){var c=T.w.exec(b);return Number(c[1]) / a.frameRate;};T.Ca = function(a,b){var c=T.C.exec(b);return Number(c[1]) / a.a;};T.qa = function(a,b){var c=T.m.exec(b),d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]),g=g + (Number(c[5]) || 0) / a.b,f=f + g / a.frameRate;return f + 60 * e + 3600 * d;};T.h = function(a,b){var c=a.exec(b);return c && "" != c[0]?(Number(c[4]) || 0) / 1E3 + (Number(c[3]) || 0) + 60 * (Number(c[2]) || 0) + 3600 * (Number(c[1]) || 0):null;};function Hd(a,b,c,d){this.frameRate = Number(a) || 30;this.b = Number(b) || 1;this.a = Number(d);this.a || (this.a = a?this.frameRate * this.b:1);c && (a = /^(\d+) (\d+)$/g.exec(c)) && (this.frameRate *= a[1] / a[2]);}S["application/ttml+xml"] = T;function Id(a,b){var c=new Jb(new DataView(a)),d=Sb(1835295092,c);if(-1 != d)return T(Qb(c,d - 8).buffer,b);if(-1 != Tb(a,Id.T))return [];throw new w(2,2007);}m("shaka.media.Mp4TtmlParser",Id);Id.T = 1937010800;S['application/mp4; codecs="stpp"'] = Id;function Jd(a){this.b = a;this.a = 0;}function Kd(a,b){var c;b.lastIndex = a.a;c = (c = b.exec(a.b))?{position:c.index,length:c[0].length,Ec:c}:null;if(a.a == a.b.length || !c || c.position != a.a)return null;a.a += c.length;return c.Ec;}function Ld(a){return a.a == a.b.length?null:(a = Kd(a,/[^ \t\n]*/gm))?a[0]:null;};function U(a,b,c,d,e){a = Eb(a);a = a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");a = a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(a[0]))throw new w(2,2E3);d = [];for(var f=1;f < a.length;f++) {var g=a[f].split("\n");(g = U.c(g,b,c,e)) && d.push(g);}return d;}m("shaka.media.VttTextParser",U);U.c = function(a,b,c,d){if(1 == a.length && !a[0] || /^NOTE($|[ \t])/.test(a[0]))return null;var e=null;0 > a[0].indexOf("--\x3e") && (e = a[0],a.splice(0,1));var f=new Jd(a[0]),g=U.a(f),h=Kd(f,/[ \t]+--\x3e[ \t]+/g),l=U.a(f);if(null == g || !h || null == l)throw new w(2,2001);g += b;l += b;d && (g += c,l += c);a = xc(g,l,a.slice(1).join("\n").trim());if(!a)return null;Kd(f,/[ \t]+/gm);for(b = Ld(f);b;) U.j(a,b),Kd(f,/[ \t]+/gm),b = Ld(f);null != e && (a.id = e);return a;};U.j = function(a,b){var c;if(c = /^align:(start|middle|center|end|left|right)$/.exec(b))a.align = c[1],"center" == c[1] && "center" != a.align && (a.position = "auto",a.align = "middle");else if(c = /^vertical:(lr|rl)$/.exec(b))a.vertical = c[1];else if(c = /^size:(\d{1,2}|100)%$/.exec(b))a.size = Number(c[1]);else if(c = /^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position = Number(c[1]),c[2] && (a.positionAlign = c[2]);else if(c = /^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(b))a.snapToLines = !1,a.line = Number(c[1]),c[2] && (a.lineAlign = c[2]);else if(c = /^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.snapToLines = !0,a.line = Number(c[1]),c[2] && (a.lineAlign = c[2]);};U.a = function(a){a = Kd(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g);if(!a)return null;var b=Number(a[2]),c=Number(a[3]);return 59 < b || 59 < c?null:Number(a[4]) / 1E3 + c + 60 * b + 3600 * (Number(a[1]) || 0);};S["text/vtt"] = U;S['text/vtt; codecs="vtt"'] = U;function V(a,b,c,d){var e=new Jb(new DataView(a)),f=Sb(1835295092,e);if(-1 != f)return V.ra(Qb(e,f - 8).buffer,b,c,d);if(-1 != Tb(a,V.na))return [];throw new w(2,2008);}m("shaka.media.Mp4VttParser",V);V.ra = function(a,b,c,d){a = new Jb(new DataView(a));c += b;d += b;for(b = [];Lb(a);) {var e=Sb(V.ma,a);if(-1 == e)break;(e = V.c(Qb(a,e - 8).buffer,c,d)) && b.push(e);}return b;};V.c = function(a,b,c){a = new Jb(new DataView(a));for(var d,e,f;Lb(a);) {var g=N(a),h=N(a),l=Eb(Qb(a,g - 8).buffer);1 == g && Pb(a);switch(h){case V.J:d = l;break;case V.G:f = l;break;case V.X:e = l;}}if(!d)throw new w(2,2008);b = xc(b,c,d);if(!b)return null;f && (b.id = f);if(e)for(e = new Jd(e),f = Ld(e);f;) U.j(b,f),Kd(e,/[ \t]+/gm),f = Ld(e);return b;};V.na = 2004251764;V.ma = 1987343459;V.J = 1885436268;V.G = 1768187247;V.X = 1937011815;S['application/mp4; codecs="wvtt"'] = V;function Md(a,b,c,d,e,f){this.a = a;this.c = b;this.j = c;this.s = d;this.l = e;this.m = f;this.b = new y();this.h = !1;this.g = 1;this.i = this.f = null;0 < a.readyState?this.tb():z(this.b,a,"loadedmetadata",this.tb.bind(this));z(this.b,a,"ratechange",this.lc.bind(this));Nd(this);}k = Md.prototype;k.o = function(){var a=this.b.o();this.b = null;Od(this);null != this.f && (window.clearInterval(this.f),this.f = null);this.m = this.l = this.c = this.a = null;return a;};function Pd(a){return 0 < a.a.readyState?Qd(a,a.a.currentTime):Rd(a);}function Rd(a){return a.s?Qd(a,a.s):Infinity > a.c.da()?a.c.sa():Math.max(a.c.Ua(),a.c.sa());}function Sd(a,b){b != a.h && (a.h = b,Td(a,a.g),a.l(b));}function Nd(a){Od(a);a.i = window.setTimeout(a.pc.bind(a),250);}function Od(a){a.i && (window.clearTimeout(a.i),a.i = null);}k.pc = function(){this.i = null;Nd(this);var a=$c(this.a.buffered,this.a.currentTime),b=Zc(this.a.buffered) >= (this.c.R()?this.c.Y() - .1:this.a.duration - .1) || this.a.ended;this.h?(b || a >= this.j) && Sd(this,!1):!b && .5 > a && Sd(this,!0);};k.Ta = function(){return this.g;};function Td(a,b){null != a.f && (window.clearInterval(a.f),a.f = null);a.g = b;a.a.playbackRate = a.h || 0 > b?0:b;!a.h && 0 > b && (a.f = window.setInterval((function(){this.a.currentTime += b / 4;}).bind(a),250));}k.lc = function(){this.a.playbackRate != (this.h || 0 > this.g?0:this.g) && Td(this,this.a.playbackRate);};k.tb = function(){this.b.ja(this.a,"loadedmetadata");var a=Rd(this);.001 > Math.abs(this.a.currentTime - a)?(z(this.b,this.a,"seeking",this.vb.bind(this)),z(this.b,this.a,"playing",this.ub.bind(this))):(z(this.b,this.a,"seeking",this.nc.bind(this)),this.a.currentTime = a);};k.nc = function(){this.b.ja(this.a,"seeking");z(this.b,this.a,"seeking",this.vb.bind(this));z(this.b,this.a,"playing",this.ub.bind(this));};k.vb = function(){var a=this.a.currentTime,b=Ud(this,a);.001 < Math.abs(b - a)?Vd(this,a,b):this.m();};k.ub = function(){var a=this.a.currentTime,b=Ud(this,a);.001 < Math.abs(b - a) && Vd(this,a,b);};function Ud(a,b){var c=a.c,d=c.sa(),e=c.Y();if(!c.R() || Infinity == c.c)return b < d?d:b > e?e:b;c = d + 1;d = c + a.j;return b >= d && b <= e || $c(a.a.buffered,b) && b >= c && b <= e?b:b > e?e:e < d && b >= c && b <= e?b:Math.min(d + 2,e);}function Vd(a,b,c){a.a.currentTime = c;var d=0,e=(function(){!this.a || 10 <= d++ || this.a.currentTime != b || (this.a.currentTime = c,setTimeout(e,100));}).bind(a);setTimeout(e,100);}function Qd(a,b){var c=a.c.sa();if(b < c)return c;c = a.c.Y();return b > c?c:b;};function Wd(a,b,c,d,e,f,g,h,l){this.m = a;this.f = b;this.T = c;this.a = d;this.G = e;this.v = f;this.j = g;this.w = h || null;this.A = l || null;this.h = null;this.i = 1;this.C = Promise.resolve();this.g = [];this.l = {};this.b = {};this.c = this.s = this.J = !1;}Wd.prototype.o = function(){for(var a in this.b) Xd(this.b[a]);this.h = this.b = this.l = this.g = this.A = this.w = this.j = this.v = this.G = this.C = this.a = this.T = this.f = this.m = null;this.c = !0;return Promise.resolve();};Wd.prototype.configure = function(a){this.h = a;this.m.j = this.i * Math.max(this.a.minBufferTime || 0,this.h.rebufferingGoal);};Wd.prototype.init = function(){var a=this.G(this.a.periods[Yd(this,Pd(this.m))]);return Na(a)?Promise.reject(new w(5,5005)):Zd(this,a).then((function(){this.w && this.w();}).bind(this));};function $d(a){return a.a.periods[Yd(a,Pd(a.m))];}function ae(a){return Oa(a.b,function(a){return a.stream;});}function be(a,b){var c={};c.text = b;return Zd(a,c);}function ce(a,b,c,d){var e=a.b[b];!e && "text" == b && a.h.ignoreTextStreamFailures?be(a,c):e && (b = a.g[de(a,c)]) && b.ya && (b = a.l[c.id]) && b.ya && e.stream != c && (e.stream = c,e.Ma = !0,d && (e.aa?e.Qa = !0:e.fa?(e.la = !0,e.Qa = !0):(Xd(e),ee(a,e,!0))));}function Zd(a,b){var c=Yd(a,Pd(a.m)),d=Oa(b,function(a){return pd(a.mimeType,a.codecs);});a.f.init(d,a.h.useRelativeCueTimestamps);fe(a);d = F(b);return ge(a,d).then((function(){if(!this.c)for(var a in b) {var d=b[a];this.b[a] || (this.b[a] = {stream:d,type:a,ua:null,V:null,Ma:!0,Na:c,endOfStream:!1,fa:!1,$:null,la:!1,Qa:!1,aa:!1,bb:!1},he(this,this.b[a],0));}}).bind(a));}function ie(a,b){var c=a.g[b];if(c)return c.I;c = {I:new x(),ya:!1};a.g[b] = c;var d=a.a.periods[b].streamSets.map(function(a){return a.streams;}).reduce(C,[]);a.C = a.C.then((function(){if(!this.c)return ge(this,d);}).bind(a)).then((function(){this.c || (this.g[b].I.resolve(),this.g[b].ya = !0);}).bind(a))["catch"]((function(a){this.c || (this.g[b].I.reject(),delete this.g[b],this.j(a));}).bind(a));return c.I;}function ge(a,b){for(var c=[],d=0;d < b.length;++d) {var e=b[d],f=a.l[e.id];f?c.push(f.I):(a.l[e.id] = {I:new x(),ya:!1},c.push(e.createSegmentIndex()));}return Promise.all(c).then((function(){if(!this.c)for(var a=0;a < b.length;++a) {var c=this.l[b[a].id];c.ya || (c.I.resolve(),c.ya = !0);}}).bind(a))["catch"]((function(a){if(!this.c)return this.l[e.id].I.reject(),delete this.l[e.id],Promise.reject(a);}).bind(a));}function fe(a){var b=a.a.presentationTimeline.da();Infinity > b?a.f.Aa(b):a.f.Aa(Math.pow(2,32));}Wd.prototype.X = function(a){if(!this.c && !a.fa && null != a.$ && !a.aa)if((a.$ = null,a.la))ee(this,a,a.Qa);else {try{var b=je(this,a);null != b && he(this,a,b);}catch(c) {this.j(c);return;}b = F(this.b);ke(this,a);b.every(function(a){return a.endOfStream;}) && this.f.endOfStream();}};function je(a,b){var c=Pd(a.m),d,e;e = a.f;var f=b.type;e = "text" == f?e.b.a:Zc(dd(e,f));var f=b.ua && b.V?a.a.periods[de(a,b.ua)].startTime + b.V.endTime:c,g=de(a,b.stream),h=Yd(a,f),l=a.a.periods[h];g != h?d = null:d = le(a,b,c,e,h);if((d?l.startTime + d.startTime - c:fd(a.f,b.type,c)) >= Math.max(a.i * Math.max(a.a.minBufferTime || 0,a.h.rebufferingGoal),a.i * a.h.bufferingGoal))return .5;if(f >= a.a.presentationTimeline.da())return b.endOfStream = !0,null;b.endOfStream = !1;if(h != g)return b.Na = h,null;d = le(a,b,c,e,g);if(!d)return 1;me(a,b,c,g,d);return null;}function le(a,b,c,d,e){if(b.V && b.stream == b.ua)return c = b.V.position + 1,ne(a,b,e,c);c = b.V?b.stream.findSegmentPosition(Math.max(0,a.a.periods[de(a,b.ua)].startTime + b.V.endTime - a.a.periods[e].startTime)):b.stream.findSegmentPosition(Math.max(0,(d || c) - a.a.periods[e].startTime));if(null == c)return null;var f=null;null == d && (f = ne(a,b,e,Math.max(0,c - 1)));return f || ne(a,b,e,c);}function ne(a,b,c,d){c = a.a.periods[c];b = b.stream.getSegmentReference(d);if(!b)return null;a = a.a.presentationTimeline;d = a.Y();return c.startTime + b.endTime < a.ta() || c.startTime + b.startTime > d?null:b;}function me(a,b,c,d,e){var f=a.a.periods[d],g=b.stream,h=a.a.periods[d + 1],l=null,l=h?h.startTime:a.a.presentationTimeline.da();d = oe(a,b,d,l);b.fa = !0;b.Ma = !1;h = pe(a,e);Promise.all([d,h]).then((function(a){if(!this.c && !this.s)return qe(this,b,c,f,g,e,a[1]);}).bind(a)).then((function(){this.c || this.s || (b.fa = !1,b.bb = !1,he(this,b,0),re(this,g));}).bind(a))["catch"]((function(a){this.c || this.s || (b.fa = !1,1001 == a.code || 1002 == a.code || 1003 == a.code?"text" == b.type && this.h.ignoreTextStreamFailures && 1001 == a.code?delete this.b.text:(this.j(a),he(this,b,4)):3017 == a.code?se(this,b,a):"text" == b.type && this.h.ignoreTextStreamFailures?delete this.b.text:this.j(a));}).bind(a));}function se(a,b,c){if(!F(a.b).some(function(a){return a != b && a.bb;})){var d=Math.round(100 * a.i);if(20 < d)a.i -= .2;else if(4 < d)a.i -= .04;else {a.s = !0;a.j(c);return;}b.bb = !0;}he(a,b,4);}function oe(a,b,c,d){if(!b.Ma)return Promise.resolve();c = jd(a.f,b.type,a.a.periods[c].startTime - b.stream.presentationTimeOffset);d = null != d?kd(a.f,b.type,d):Promise.resolve();if(!b.stream.initSegmentReference)return Promise.all([c,d]);a = pe(a,b.stream.initSegmentReference).then((function(a){if(!this.c)return gd(this.f,b.type,a,null,null);}).bind(a))["catch"](function(a){b.Ma = !0;return Promise.reject(a);});return Promise.all([c,d,a]);}function qe(a,b,c,d,e,f,g){return te(a,b,c).then((function(){if(!this.c)return gd(this.f,b.type,g,f.startTime + d.startTime,f.endTime + d.startTime);}).bind(a)).then((function(){if(!this.c)return b.ua = e,b.V = f,Promise.resolve();}).bind(a));}function te(a,b,c){var d=cd(a.f,b.type);if(null == d)return Promise.resolve();c = c - d - a.h.bufferBehind;return 0 >= c?Promise.resolve():a.f.remove(b.type,d,d + c).then((function(){}).bind(a));}function re(a,b){if(!a.J && (a.J = F(a.b).every(function(a){return "text" == a.type?!0:!a.la && !a.aa && a.V;}),a.J)){var c=de(a,b);a.g[c] || ie(a,c).then((function(){this.v();}).bind(a))["catch"](D);for(c = 0;c < a.a.periods.length;++c) ie(a,c)["catch"](D);a.A && a.A();}}function ke(a,b){if(b.Na != de(a,b.stream)){var c=b.Na,d=F(a.b);d.every(function(a){return a.Na == c;}) && d.every(ue) && ie(a,c).then((function(){if(!this.c){var a=this.G(this.a.periods[c]),b;for(b in this.b) if(!a[b]){this.j(new w(5,5005));return;}for(b in a) if(!(this.b[b] || "text" == b && this.h.ignoreTextStreamFailures)){this.j(new w(5,5005));return;}for(b in this.b) {ce(this,b,a[b],!1);var d=this.b[b];ue(d) && he(this,d,0);}this.v();}}).bind(a))["catch"](D);}}function ue(a){return !a.fa && null == a.$ && !a.la && !a.aa;}function Yd(a,b){for(var c=a.a.periods.length - 1;0 < c;--c) if(b >= a.a.periods[c].startTime)return c;return 0;}function de(a,b){for(var c=0;c < a.a.periods.length;++c) for(var d=a.a.periods[c],e=0;e < d.streamSets.length;++e) if(0 <= d.streamSets[e].streams.indexOf(b))return c;return -1;}function pe(a,b){var c=rc(b.a(),a.h.retryParameters);if(b.L || null != b.D){var d="bytes=" + b.L + "-";null != b.D && (d += b.D);c.headers.Range = d;}return a.T.request(1,c).then(function(a){return a.data;});}function ee(a,b,c){b.la = !1;b.Qa = !1;b.aa = !0;id(a.f,b.type).then((function(){if(!this.c && c){var a=this.f,e=b.type;return "text" == e?Promise.resolve():hd(a,e,a.Ub.bind(a,e));}}).bind(a)).then((function(){this.c || (b.ua = null,b.V = null,b.aa = !1,he(this,b,0));}).bind(a));}function he(a,b,c){b.$ = window.setTimeout(a.X.bind(a,b),1E3 * c);}function Xd(a){null != a.$ && (window.clearTimeout(a.$),a.$ = null);};function ve(a){return new Promise(function(b){var c=a.split(":");if(2 > c.length || "data" != c[0])throw new w(1,1004,a);c = c.slice(1).join(":").split(",");if(2 > c.length)throw new w(1,1004,a);var d=c[0],c=window.decodeURIComponent(c.slice(1).join(",")),d=d.split(";"),e=null;1 < d.length && (e = d[1]);if("base64" == e)c = Ra(c).buffer;else {if(e)throw new w(1,1005,a);c = Ib(c);}b({uri:a,data:c,headers:{"content-type":d[0]}});});}m("shaka.net.DataUriPlugin",ve);pc.data = ve;function we(a,b){return new Promise(function(c,d){var e=new XMLHttpRequest();e.open(b.method,a,!0);e.responseType = "arraybuffer";e.timeout = b.retryParameters.timeout;e.withCredentials = b.allowCrossSiteCredentials;e.onload = function(b){b = b.target;if(200 <= b.status && 299 >= b.status && 202 != b.status){var e=b.getAllResponseHeaders().split("\r\n").reduce(function(a,b){var c=b.split(": ");a[c[0].toLowerCase()] = c.slice(1).join(": ");return a;},{});b.responseURL && (a = b.responseURL);c({uri:a,data:b.response,headers:e});}else {e = null;try{e = Hb(b.response);}catch(l) {}d(new w(1,1001,a,b.status,e));}};e.onerror = function(){d(new w(1,1002,a));};e.ontimeout = function(){d(new w(1,1003,a));};for(var f in b.headers) e.setRequestHeader(f,b.headers[f]);e.send(b.body);});}m("shaka.net.HttpPlugin",we);pc.http = we;pc.https = we;function xe(){this.a = null;this.c = [];this.b = {};}k = xe.prototype;k.init = function(a){if(!window.indexedDB)return Promise.reject(new w(9,9E3));var b=window.indexedDB.open("shaka_offline_db",1),c=new x();b.onupgradeneeded = function(b){b = b.target.result;for(var c in a) b.createObjectStore(c,{keyPath:a[c]});};b.onsuccess = (function(a){this.a = a.target.result;c.resolve();}).bind(this);b.onerror = ye.bind(null,b,c);return c.then((function(){var b=Object.keys(a);return Promise.all(b.map((function(a){return ze(this,a).then((function(b){this.b[a] = b;}).bind(this));}).bind(this)));}).bind(this));};k.o = function(){return Promise.all(this.c.map(function(a){try{a.transaction.abort();}catch(b) {}return a.I["catch"](D);})).then((function(){this.a && (this.a.close(),this.a = null);}).bind(this));};k.get = function(a,b){return Ae(this,a,"readonly",function(a){return a.get(b);});};k.forEach = function(a,b){return Ae(this,a,"readonly",function(a){return a.openCursor();},function(a){a && (b(a.value),a["continue"]());});};function Be(a,b,c){return Ae(a,b,"readwrite",function(a){return a.put(c);});}k.remove = function(a,b){return Ae(this,a,"readwrite",function(a){return a["delete"](b);});};function Ce(a,b){var c=[];return Ae(a,"segment","readwrite",function(a){return a.openCursor();},function(a){if(a){if(b(a.value)){var d=a["delete"](),f=new x();d.onsuccess = f.resolve;d.onerror = ye.bind(null,d,f);c.push(f);}a["continue"]();}}).then(function(){return Promise.all(c);}).then(function(){return c.length;});}function ze(a,b){var c=0;return Ae(a,b,"readonly",function(a){return a.openCursor(null,"prev");},function(a){a && (c = a.key + 1);}).then(function(){return c;});}function Ae(a,b,c,d,e){c = a.a.transaction([b],c);var f=d(c.objectStore(b)),g=new x();e && (f.onsuccess = function(a){e(a.target.result);});f.onerror = ye.bind(null,f,g);var h={transaction:c,I:g};a.c.push(h);var l=(function(){this.c.splice(this.c.indexOf(h),1);}).bind(a);c.oncomplete = function(){l();g.resolve(f.result);};c.onerror = function(a){l();ye(f,g,a);};return g;}function ye(a,b,c){"AbortError" == a.error.name?b.reject(new w(9,9002)):b.reject(new w(9,9001,a.error));c.preventDefault();};var De={manifest:"key",segment:"key"};function Ee(a){return {offlineUri:"offline:" + a.key,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,tracks:a.periods[0].streams.map(function(a){return {id:a.id,active:!1,type:a.contentType,bandwidth:0,language:a.language,kind:a.kind || null,width:a.width,height:a.height,frameRate:a.frameRate,codecs:a.codecs};}),appMetadata:a.appMetadata};};function Fe(a,b,c){this.b = {};this.i = c;this.m = a;this.l = b;this.j = this.a = null;this.f = this.h = this.g = this.c = 0;}Fe.prototype.o = function(){var a=this.j || Promise.resolve();this.b = {};this.j = this.a = this.l = this.m = this.i = null;return a;};function Ge(a,b,c,d,e){a.b[b] = a.b[b] || [];a.b[b].push({uris:c.a(),L:c.L,D:c.D,jb:d,Ea:e});}function He(a,b){a.c = 0;a.g = 0;a.h = 0;a.f = 0;F(a.b).forEach((function(a){a.forEach((function(a){null != a.D?this.c += a.D - a.L + 1:this.h += a.jb;}).bind(this));}).bind(a));a.a = b;a.a.size = a.c;var c=F(a.b).map((function(a){var b=0,c=(function(){if(!this.i)return Promise.reject(new w(9,9002));if(b >= a.length)return Promise.resolve();var d=a[b++];return Ie(this,d).then(c);}).bind(this);return c();}).bind(a));a.b = {};return a.j = Promise.all(c);}function Ie(a,b){var c=rc(b.uris,a.l);if(b.L || null != b.D)c.headers.Range = "bytes=" + b.L + "-" + (null == b.D?"":b.D);var d;return a.m.request(1,c).then((function(a){if(!this.a)return Promise.reject(new w(9,9002));d = a.data.byteLength;return b.Ea(a.data);}).bind(a)).then((function(){if(!this.a)return Promise.reject(new w(9,9002));null == b.D?(this.a.size += d,this.f += b.jb):this.g += d;var a=(this.g + this.f) / (this.c + this.h),c=Ee(this.a);this.i.progressCallback(c,a);}).bind(a));};function Je(){}m("shaka.offline.OfflineManifestParser",Je);Je.prototype.configure = function(){};Je.prototype.start = function(a){var b=/^offline:([0-9]+)$/.exec(a);if(!b)return Promise.reject(new w(1,9004,a));var c=Number(b[1]),d=new xe();return d.init(De).then(function(){return d.get("manifest",c);}).then(function(a){if(!a)throw new w(9,9003,c);return Ke(a);}).then(function(a){return d.o().then(function(){return a;});},function(a){return d.o().then(function(){throw a;});});};Je.prototype.stop = function(){return Promise.resolve();};function Ke(a){var b=new R(null,0);b.Aa(a.duration);var c=a.drmInfo?[a.drmInfo]:[];return {presentationTimeline:b,minBufferTime:10,offlineSessionIds:a.sessionIds,periods:a.periods.map(function(a){return {startTime:a.startTime,streamSets:a.streams.map(function(d){var e=d.segments.map(function(a,b){return new K(b,a.startTime,a.endTime,function(){return [a.uri];},0,null);});b.Ga(a.startTime,e);e = new P(e);return {language:d.language,type:d.contentType,primary:d.primary,drmInfos:c,streams:[{id:d.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:d.initSegmentUri?new yb(function(){return [d.initSegmentUri];},0,null):null,presentationTimeOffset:d.presentationTimeOffset,mimeType:d.mimeType,codecs:d.codecs,bandwidth:0,width:d.width || void 0,height:d.height || void 0,kind:d.kind,encrypted:d.encrypted,keyId:d.keyId,allowedByApplication:!0,allowedByKeySystem:!0}]};})};})};}sc["application/x-offline-manifest"] = Je;function Le(a){if(/^offline:([0-9]+)$/.exec(a)){var b={uri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(b);}if(b = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a)){var c=Number(b[1]),d=new xe();return d.init(De).then(function(){return d.get("segment",c);}).then(function(b){return d.o().then(function(){if(!b)throw new w(9,9003,c);return {uri:a,data:b.data,headers:{}};});});}return Promise.reject(new w(1,9004,a));}m("shaka.offline.OfflineScheme",Le);pc.offline = Le;function Me(){this.a = Promise.resolve();this.c = this.b = this.f = !1;this.h = new Promise((function(a){this.g = a;}).bind(this));}Me.prototype.then = function(a){this.a = this.a.then(a).then((function(a){return this.c?(this.g(),Promise.reject(this.i)):Promise.resolve(a);}).bind(this));return this;};function Ne(a){a.f || (a.a = a.a.then((function(a){this.b = !0;return Promise.resolve(a);}).bind(a),(function(a){this.b = !0;return Promise.reject(a);}).bind(a)));a.f = !0;return a.a;}Me.prototype.cancel = function(a){if(this.b)return Promise.resolve();this.c = !0;this.i = a;return this.h;};function Oe(a,b,c,d,e){var f=(e in d),g;for(g in b) {var h=e + "." + g,l=f?d[e]:c[g],n=!!({".abr.manager":!0})[h];if(f || g in a)void 0 === b[g]?void 0 === l || f?delete a[g]:a[g] = l:n?a[g] = b[g]:"object" == typeof a[g] && "object" == typeof b[g]?Oe(a[g],b[g],l,d,h):typeof b[g] == typeof l && (a[g] = b[g]);}};function W(a,b){p.call(this);this.A = !1;this.f = a;this.s = null;this.w = new y();this.Ka = new q();this.oa = this.c = this.m = this.b = this.j = this.pa = this.G = this.h = this.g = this.i = null;this.Kb = 1E9;this.na = [];this.Da = !1;this.ra = !0;this.J = this.l = null;this.v = {};this.a = Pe(this);this.Ca = {width:Infinity,height:Infinity};this.C = [];this.ma = this.T = this.qa = 0;b && b(this);this.i = new Q(this.Oc.bind(this));this.pa = Qe(this);for(var c=0;c < this.f.textTracks.length;++c) {var d=this.f.textTracks[c];d.mode = "disabled";"Shaka Player TextTrack" == d.label && (this.s = d);}this.s || (this.s = this.f.addTextTrack("subtitles","Shaka Player TextTrack"));this.s.mode = "hidden";z(this.w,this.f,"error",this.oc.bind(this));}ba(W);m("shaka.Player",W);W.prototype.o = function(){this.A = !0;var a=Promise.resolve();this.l && (a = this.l.cancel(new w(7,7E3)));return a.then((function(){var a=Promise.all([this.J,Re(this),this.w?this.w.o():null,this.i?this.i.o():null]);this.a = this.i = this.Ka = this.w = this.s = this.f = null;return a;}).bind(this));};W.prototype.destroy = W.prototype.o;W.version = "v2.0.3-16-g91ba1f3";var Se={};W.registerSupportPlugin = function(a,b){Se[a] = b;};W.isBrowserSupported = function(){return !!window.Promise && !!window.Uint8Array && !!Array.prototype.forEach && !!window.MediaSource && !!window.MediaKeys && !!window.navigator && !!window.navigator.requestMediaKeySystemAccess && !!window.MediaKeySystemAccess && !!window.MediaKeySystemAccess.prototype.getConfiguration;};W.probeSupport = function(){return Xc().then(function(a){var b=uc(),c=bd();a = {manifest:b,media:c,drm:a};for(var d in Se) a[d] = Se[d]();return a;});};W.prototype.load = function(a,b,c){var d=this.ib(),e=new Me();this.l = e;this.dispatchEvent(new t("loading"));return Ne(e.then(function(){return d;}).then((function(){return vc(a,this.i,this.a.manifest.retryParameters,c);}).bind(this)).then((function(b){this.m = new b();this.m.configure(this.a.manifest);return this.m.start(a,this.i,this.Oa.bind(this),this.ga.bind(this),this.Lc.bind(this));}).bind(this)).then((function(b){if(0 == b.periods.length)throw new w(4,4014);this.c = b;this.oa = a;this.g = new Jc(this.i,this.ga.bind(this),this.Mc.bind(this));this.g.configure(this.a.drm);return this.g.init(b,!1);}).bind(this)).then((function(){this.c.periods.forEach(this.Oa.bind(this));this.ma = Date.now() / 1E3;return Promise.all([Mc(this.g,this.f),this.pa]);}).bind(this)).then((function(){this.j = new Md(this.f,this.c.presentationTimeline,1 * Math.max(this.c.minBufferTime || 0,this.a.streaming.rebufferingGoal),b || null,this.Ib.bind(this),this.Nc.bind(this));this.G = new ad(this.f,this.h,this.s);this.b = new Wd(this.j,this.G,this.i,this.c,this.Kc.bind(this),this.Nb.bind(this),this.ga.bind(this));this.b.configure(this.a.streaming);return this.b.init();}).bind(this)).then((function(){this.c.periods.forEach(this.Oa.bind(this));Te(this);Ue(this);this.a.abr.manager.init(this.gb.bind(this));this.l = null;}).bind(this)))["catch"]((function(a){this.l == e && (this.l = null,this.dispatchEvent(new t("unloading")));return Promise.reject(a);}).bind(this));};W.prototype.load = W.prototype.load;function Qe(a){a.h = new MediaSource();var b=new x();z(a.w,a.h,"sourceopen",b.resolve);a.f.src = window.URL.createObjectURL(a.h);return b;}W.prototype.configure = function(a){a.abr && a.abr.manager && a.abr.manager != this.a.abr.manager && (this.a.abr.manager.stop(),a.abr.manager.init(this.gb.bind(this)));Oe(this.a,a,Pe(this),Ve(),"");We(this);};W.prototype.configure = W.prototype.configure;function We(a){a.m && a.m.configure(a.a.manifest);a.g && a.g.configure(a.a.drm);if(a.b){a.b.configure(a.a.streaming);try{a.c.periods.forEach(a.Oa.bind(a));}catch(b) {a.ga(b);}Xe(a,$d(a.b));}a.a.abr.enabled && !a.ra?a.a.abr.manager.enable():a.a.abr.manager.disable();a.a.abr.manager.setDefaultEstimate(a.a.abr.defaultBandwidthEstimate);}W.prototype.getConfiguration = function(){var a=Pe(this);Oe(a,this.a,Pe(this),Ve(),"");return a;};W.prototype.getConfiguration = W.prototype.getConfiguration;W.prototype.Dc = function(){var a=Pe(this);a.abr && a.abr.manager && a.abr.manager != this.a.abr.manager && (this.a.abr.manager.stop(),a.abr.manager.init(this.gb.bind(this)));this.a = Pe(this);We(this);};W.prototype.resetConfiguration = W.prototype.Dc;W.prototype.ob = function(){return this.i;};W.prototype.getNetworkingEngine = W.prototype.ob;W.prototype.Vb = function(){return this.oa;};W.prototype.getManifestUri = W.prototype.Vb;W.prototype.R = function(){return this.c?this.c.presentationTimeline.R():!1;};W.prototype.isLive = W.prototype.R;W.prototype.ea = function(){return this.c?this.c.presentationTimeline.ea():!1;};W.prototype.isInProgress = W.prototype.ea;W.prototype.Fc = function(){var a=0,b=0;this.c && (b = this.c.presentationTimeline,a = b.ta(),b = b.Ua());return {start:a,end:b};};W.prototype.seekRange = W.prototype.Fc;W.prototype.keySystem = function(){return this.g?this.g.keySystem():"";};W.prototype.keySystem = W.prototype.keySystem;W.prototype.drmInfo = function(){return this.g?this.g.b:null;};W.prototype.drmInfo = W.prototype.drmInfo;W.prototype.Zb = function(){return this.Da;};W.prototype.isBuffering = W.prototype.Zb;W.prototype.ib = function(){if(this.A)return Promise.resolve();this.dispatchEvent(new t("unloading"));var a=Promise.resolve();this.l && (a = new w(7,7E3),a = this.l.cancel(a));return a.then((function(){this.J || (this.J = Ye(this).then((function(){this.J = null;}).bind(this)));return this.J;}).bind(this));};W.prototype.unload = W.prototype.ib;W.prototype.Ta = function(){return this.j?this.j.Ta():0;};W.prototype.getPlaybackRate = W.prototype.Ta;W.prototype.Zc = function(a){this.j && Td(this.j,a);};W.prototype.trickPlay = W.prototype.Zc;W.prototype.Ob = function(){this.j && Td(this.j,1);};W.prototype.cancelTrickPlay = W.prototype.Ob;W.prototype.getTracks = function(){if(!this.b)return [];var a=ae(this.b);return qd($d(this.b),a).filter((function(a){return 0 > this.na.indexOf(a.id);}).bind(this));};W.prototype.getTracks = W.prototype.getTracks;W.prototype.Gc = function(a,b){if(this.b){var c=rd($d(this.b),a);if(c){var d=c.stream;d.allowedByApplication && d.allowedByKeySystem && (this.C.push({timestamp:Date.now() / 1E3,id:d.id,type:a.type,fromAdaptation:!1}),c = {},c[a.type] = d,"text" != a.type && (d = ae(this.b).text,this.configure({abr:{enabled:!1}}),d && (c.text = d)),Ze(this,c,b));}}};W.prototype.selectTrack = W.prototype.Gc;W.prototype.bc = function(){return "showing" == this.s.mode;};W.prototype.isTextTrackVisible = W.prototype.bc;W.prototype.Ic = function(a){this.s.mode = a?"showing":"hidden";$e(this);};W.prototype.setTextTrackVisibility = W.prototype.Ic;W.prototype.getStats = function(){af(this);var a={},b={},c=this.f && this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};this.b && (b = ae(this.b),a = b.video || {},b = b.audio || {});return {width:a.width || 0,height:a.height || 0,streamBandwidth:a.bandwidth + b.bandwidth || 0,decodedFrames:Number(c.totalVideoFrames),droppedFrames:Number(c.droppedVideoFrames),estimatedBandwidth:this.a.abr.manager.getBandwidthEstimate(),playTime:this.qa,bufferingTime:this.T,switchHistory:this.C.slice(0)};};W.prototype.getStats = W.prototype.getStats;W.prototype.addTextTrack = function(a,b,c,d,e){if(!this.b)return Promise.reject();for(var f=$d(this.b),g,h=0;h < this.c.periods.length;h++) if(this.c.periods[h] == f){if(h == this.c.periods.length - 1){if((g = this.c.presentationTimeline.da() - f.startTime,Infinity == g))return Promise.reject();}else g = this.c.periods[h + 1].startTime - f.startTime;break;}var l={id:this.Kb++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function findSegmentPosition(){return 1;},getSegmentReference:function getSegmentReference(b){return 1 != b?null:new K(1,0,g,function(){return [a];},0,null);},initSegmentReference:null,presentationTimeOffset:0,mimeType:d,codecs:e || "",bandwidth:0,kind:c,encrypted:!1,keyId:null,language:b,allowedByApplication:!0,allowedByKeySystem:!0};d = {language:b,type:"text",primary:!1,drmInfos:[],streams:[l]};this.na.push(l.id);f.streamSets.push(d);return be(this.b,l).then((function(){if(!this.A)return this.na.splice(this.na.indexOf(l.id),1),Xe(this,f),Te(this),{id:l.id,active:!1,type:"text",bandwidth:0,language:b,kind:c,width:null,height:null};}).bind(this));};W.prototype.addTextTrack = W.prototype.addTextTrack;W.prototype.eb = function(a,b){this.Ca.width = a;this.Ca.height = b;};W.prototype.setMaxHardwareResolution = W.prototype.eb;function Re(a){a.w && a.w.ja(a.h,"sourceopen");a.f && (a.f.removeAttribute("src"),a.f.load());var b=Promise.all([a.a?a.a.abr.manager.stop():null,a.g?a.g.o():null,a.G?a.G.o():null,a.j?a.j.o():null,a.b?a.b.o():null,a.m?a.m.stop():null]);a.g = null;a.G = null;a.j = null;a.b = null;a.m = null;a.c = null;a.oa = null;a.pa = null;a.h = null;a.v = {};a.C = [];a.qa = 0;a.T = 0;return b;}function Ye(a){return a.m?Re(a).then((function(){this.A || (this.Ib(!1),this.pa = Qe(this));}).bind(a)):Promise.resolve();}function Ve(){return {".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:null}};}function Pe(a){return {drm:{retryParameters:qc(),servers:{},clearKeys:{},advanced:{}},manifest:{retryParameters:qc(),dash:{customScheme:function customScheme(a){if(a)return null;},clockSyncUri:""}},streaming:{retryParameters:qc(),rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,useRelativeCueTimestamps:!1},abr:{manager:a.Ka,enabled:!0,defaultBandwidthEstimate:5E5},preferredAudioLanguage:"",preferredTextLanguage:"",restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minAudioBandwidth:0,maxAudioBandwidth:Infinity,minVideoBandwidth:0,maxVideoBandwidth:Infinity}};}k = W.prototype;k.Oa = function(a){var b=this.b?ae(this.b):{};od(this.g,b,a);b = a.streamSets.some(sd);nd(a,this.a.restrictions,this.Ca) && !this.l && Te(this);a = !a.streamSets.some(sd);if(!b)throw new w(4,4011);if(a)throw new w(4,4012);};function Ze(a,b,c){for(var d in b) {var e=b[d],f=c || !1;"text" == d && (f = !0);a.ra?a.v[d] = {stream:e,Rb:f}:ce(a.b,d,e,f);}}function af(a){if(a.c){var b=Date.now() / 1E3;a.Da?a.T += b - a.ma:a.qa += b - a.ma;a.ma = b;}}k.Oc = function(a,b,c){this.a.abr.manager.segmentDownloaded(a,b,c);};k.Ib = function(a){af(this);this.Da = a;this.dispatchEvent(new t("buffering",{buffering:a}));};k.Nc = function(){if(this.b){var a=this.b,b;for(b in a.b) {var c=a.b[b];c.aa || 0 < fd(a.f,b,Pd(a.m)) || c.la || (c.fa?c.la = !0:null == cd(a.f,b)?null == c.$ && he(a,c,0):(Xd(c),ee(a,c,!1)));}}};function bf(a,b,c){if(!F(b).some(sd))return a.ga(new w(4,4012)),{};var d={};if(c)["video","audio","text"].forEach(function(a){a in b && (d[a] = b[a]);});else {c = ae(a.b);for(var e in c) {var f=c[e];f.allowedByApplication && f.allowedByKeySystem && b[e].language == f.language || (d[e] = b[e]);}}if(Na(d))return {};ha(Object.keys(d));var g=a.a.abr.manager.chooseStreams(d);return Pa(d,function(a){return !!g[a];})?g:(a.ga(new w(4,4012)),{});}function Xe(a,b){var c={audio:!1,text:!1},d=td(b,a.a,c),e=bf(a,d),f;for(f in e) a.C.push({timestamp:Date.now() / 1E3,id:e[f].id,type:f,fromAdaptation:!0});Ze(a,e,!0);Ue(a);d.text && d.audio && c.text && d.text.language != d.audio.language && (a.s.mode = "showing",$e(a));}k.Kc = function(a){this.ra = !0;this.a.abr.manager.disable();a = td(a,this.a);a = bf(this,a,!0);for(var b in this.v) a[b] = this.v[b].stream;this.v = {};for(b in a) this.C.push({timestamp:Date.now() / 1E3,id:a[b].id,type:b,fromAdaptation:!0});this.l || Te(this);return a;};k.Nb = function(){this.ra = !1;this.a.abr.enabled && this.a.abr.manager.enable();for(var a in this.v) {var b=this.v[a];ce(this.b,a,b.stream,b.Rb);}this.v = {};};k.gb = function(a,b){var c=ae(this.b),d;for(d in a) {var e=a[d];c[d] != e?this.C.push({timestamp:Date.now() / 1E3,id:e.id,type:d,fromAdaptation:!0}):delete a[d];}if(!Na(a) && this.b){for(d in a) ce(this.b,d,a[d],b || !1);Ue(this);}};function Ue(a){Promise.resolve().then((function(){this.A || this.dispatchEvent(new t("adaptation"));}).bind(a));}function Te(a){Promise.resolve().then((function(){this.A || this.dispatchEvent(new t("trackschanged"));}).bind(a));}function $e(a){a.dispatchEvent(new t("texttrackvisibility"));}k.ga = function(a){this.dispatchEvent(new t("error",{detail:a}));};k.Lc = function(a){this.dispatchEvent(a);};k.oc = function(){if(this.f.error){var a=this.f.error.code;if(1 != a){var b=this.f.error.msExtendedCode;b && (0 > b && (b += Math.pow(2,32)),b = b.toString(16));this.ga(new w(3,3016,a,b));}}};k.Mc = function(a){var b=["output-restricted","internal-error"],c=$d(this.b),d=!1;c.streamSets.forEach(function(c){c.streams.forEach(function(c){var e=c.allowedByKeySystem;c.keyId && c.keyId in a && (c.allowedByKeySystem = 0 > b.indexOf(a[c.keyId]));e != c.allowedByKeySystem && (d = !0);});});Xe(this,c);d && Te(this);};function X(a){this.a = new xe();this.c = a;this.j = cf(this);this.h = null;this.v = !1;this.i = null;this.l = [];this.f = -1;this.m = 0;this.b = null;this.g = new Fe(a.i,a.getConfiguration().streaming.retryParameters,this.j);}m("shaka.offline.Storage",X);function df(){return !!window.indexedDB;}X.support = df;X.prototype.o = function(){var a=this.l,b=this.a,c=this.g?this.g.o()["catch"](function(){}).then(function(){return Promise.all(a.map(function(a){return b.remove("segment",a);}));}).then(function(){return b.o();}):Promise.resolve();this.j = this.c = this.g = this.a = null;return c;};X.prototype.destroy = X.prototype.o;X.prototype.configure = function(a){Oe(this.j,a,cf(this),{},"");};X.prototype.configure = X.prototype.configure;X.prototype.Vc = function(a,b,c){function d(a){f = a;}if(this.v)return Promise.reject(new w(9,9006));this.v = !0;var e,f=null;return ef(this).then((function(){Y(this);return ff(this,a,d,c);}).bind(this)).then((function(c){Y(this);this.b = c.manifest;this.h = c.Sb;if(this.b.presentationTimeline.R() || this.b.presentationTimeline.ea())throw new w(9,9005,a);this.b.periods.forEach(this.s.bind(this));this.f = this.a.b.manifest++;this.m = 0;c = this.b.periods.map(this.w.bind(this));var d=this.h.b,f=Rc(this.h);if(d){if(!f.length)throw new w(9,9007,a);d.initData = [];}e = {key:this.f,originalManifestUri:a,duration:this.m,size:0,periods:c,sessionIds:f,drmInfo:d,appMetadata:b};return He(this.g,e);}).bind(this)).then((function(){Y(this);if(f)throw f;return Be(this.a,"manifest",e);}).bind(this)).then((function(){return gf(this);}).bind(this)).then((function(){return Ee(e);}).bind(this))["catch"]((function(a){return gf(this)["catch"](D).then(function(){throw a;});}).bind(this));};X.prototype.store = X.prototype.Vc;X.prototype.remove = function(a){function b(a){6013 != a.code && (e = a);}var c=a.offlineUri,d=/^offline:([0-9]+)$/.exec(c);if(!d)return Promise.reject(new w(9,9004,c));var e=null,f,g,h=Number(d[1]);return ef(this).then((function(){Y(this);return this.a.get("manifest",h);}).bind(this)).then((function(a){Y(this);if(!a)throw new w(9,9003,c);f = a;a = Ke(f);g = new Jc(this.c.i,b,function(){});g.configure(this.c.getConfiguration().drm);return g.init(a,!0);}).bind(this)).then((function(){return Oc(g,f.sessionIds);}).bind(this)).then((function(){return g.o();}).bind(this)).then((function(){Y(this);if(e)throw e;var b=f.periods.map(function(a){return a.streams.map(function(a){var b=a.segments.map(function(a){a = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.uri);return Number(a[1]);});a.initSegmentUri && (a = /^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.initSegmentUri),b.push(Number(a[1])));return b;}).reduce(C,[]);}).reduce(C,[]),c=0,d=b.length,g=this.j.progressCallback;return Ce(this.a,(function(e){e = b.indexOf(e.key);0 <= e && (g(a,c / d),c++);return 0 <= e;}).bind(this));}).bind(this)).then((function(){Y(this);this.j.progressCallback(a,1);return this.a.remove("manifest",h);}).bind(this));};X.prototype.remove = X.prototype.remove;X.prototype.list = function(){var a=[];return ef(this).then((function(){Y(this);return this.a.forEach("manifest",function(b){a.push(Ee(b));});}).bind(this)).then(function(){return a;});};X.prototype.list = X.prototype.list;function ff(a,b,c,d){function e(){}var f=a.c.i,g=a.c.getConfiguration(),h,l,n;return vc(b,f,g.manifest.retryParameters,d).then((function(a){Y(this);n = new a();n.configure(g.manifest);return n.start(b,f,this.s.bind(this),c);}).bind(a)).then((function(a){Y(this);h = a;l = new Jc(f,c,e);l.configure(g.drm);return l.init(h,!0);}).bind(a)).then((function(){Y(this);return hf(h);}).bind(a)).then((function(){Y(this);return Nc(l);}).bind(a)).then((function(){Y(this);return n.stop();}).bind(a)).then((function(){Y(this);return {manifest:h,Sb:l};}).bind(a))["catch"](function(a){if(n)return n.stop().then(function(){throw a;});throw a;});}X.prototype.A = function(a){var b=[],c=a.filter(function(a){return "video" == a.type && 480 >= a.height;});c.sort(function(a,b){return b.bandwidth - a.bandwidth;});c.length && b.push(c[0]);for(var d=Ec(this.c.getConfiguration().preferredAudioLanguage),c=[0,Cc,Dc],e=a.filter(function(a){return "audio" == a.type;}),c=c.map(function(a){return e.filter(function(b){b = Ec(b.language);return Bc(a,d,b);});}),f=e,g=0;g < c.length;g++) c[g].length && (f = c[g]);f.sort(function(a,b){return a.bandwidth - b.bandwidth;});f.length && b.push(f[Math.floor(f.length / 2)]);var c=Ec(this.c.getConfiguration().preferredTextLanguage),h=Bc.bind(null,Dc,c);b.push.apply(b,a.filter(function(a){var b=Ec(a.language);return "text" == a.type && h(b);}));return b;};function cf(a){return {trackSelectionCallback:a.A.bind(a),progressCallback:function progressCallback(a,c){if(a || c)return null;}};}function ef(a){return a.a.a?Promise.resolve():a.a.init(De);}X.prototype.s = function(a){function b(a,b,c){b = b.filter(function(a){return a.type == c;});return 0 == b.length?null:rd(a,b[0]).stream;}var c={};this.i && (c = {video:b(this.b.periods[0],this.i,"video"),audio:b(this.b.periods[0],this.i,"audio")});od(this.h,c,a);nd(a,this.c.getConfiguration().restrictions,{width:Infinity,height:Infinity});};function gf(a){var b=a.h?a.h.o():Promise.resolve();a.h = null;a.b = null;a.v = !1;a.i = null;a.l = [];a.f = -1;return b;}function hf(a){a = a.periods.map(function(a){return a.streamSets;}).reduce(C,[]).map(function(a){return a.streams;}).reduce(C,[]);return Promise.all(a.map(function(a){return a.createSegmentIndex();}));}X.prototype.w = function(a){var b=qd(a,null),b=this.j.trackSelectionCallback(b);this.i || (this.i = b,this.b.periods.forEach(this.s.bind(this)));for(var c=b.length - 1;0 < c;--c) {for(var d=!1,e=c - 1;0 <= e;--e) if(b[c].type == b[e].type && b[c].kind == b[e].kind && b[c].language == b[e].language){d = !0;break;}if(d)break;}b = b.map((function(b){b = rd(a,b);return jf(this,a,b.Wc,b.stream);}).bind(this));return {startTime:a.startTime,streams:b};};function jf(a,b,c,d){for(var e=[],f=a.b.presentationTimeline.sa(),g=f,h=d.findSegmentPosition(f),l=null != h?d.getSegmentReference(h):null;l;) {var n=a.a.b.segment++;Ge(a.g,c.type,l,(l.endTime - l.startTime) * d.bandwidth / 8,(function(a,b,c,d){b = {key:a,data:d,manifestKey:this.f,streamNumber:c,segmentNumber:b};this.l.push(a);return Be(this.a,"segment",b);}).bind(a,n,l.position,d.id));e.push({startTime:l.startTime,endTime:l.endTime,uri:"offline:" + a.f + "/" + d.id + "/" + n});g = l.endTime + b.startTime;l = d.getSegmentReference(++h);}a.m = Math.max(a.m,g - f);b = null;d.initSegmentReference && (n = a.a.b.segment++,b = "offline:" + a.f + "/" + d.id + "/" + n,Ge(a.g,c.type,d.initSegmentReference,0,(function(a,b){var c={key:n,data:b,manifestKey:this.f,streamNumber:a,segmentNumber:-1};this.l.push(n);return Be(this.a,"segment",c);}).bind(a,d.id)));return {id:d.id,primary:c.primary,presentationTimeOffset:d.presentationTimeOffset || 0,contentType:c.type,mimeType:d.mimeType,codecs:d.codecs,frameRate:d.frameRate,kind:d.kind,language:c.language,width:d.width || null,height:d.height || null,initSegmentUri:b,encrypted:d.encrypted,keyId:d.keyId,segments:e};}function Y(a){if(!a.c)throw new w(9,9002);}Se.offline = df;m("shaka.polyfill.installAll",function(){for(var a=0;a < kf.length;++a) kf[a]();});var kf=[];function lf(a){kf.push(a);}m("shaka.polyfill.register",lf);function mf(a){var b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),b=new Event(b,a);a.target.dispatchEvent(b);}lf(function(){if(window.Document){var a=Element.prototype;a.requestFullscreen = a.requestFullscreen || a.mozRequestFullScreen || a.msRequestFullscreen || a.webkitRequestFullscreen;a = Document.prototype;a.exitFullscreen = a.exitFullscreen || a.mozCancelFullScreen || a.msExitFullscreen || a.webkitExitFullscreen;"fullscreenElement" in document || Object.defineProperty(document,"fullscreenElement",{get:function get(){return document.mozFullScreenElement || document.msFullscreenElement || document.webkitFullscreenElement;}});document.addEventListener("webkitfullscreenchange",mf);document.addEventListener("webkitfullscreenerror",mf);document.addEventListener("mozfullscreenchange",mf);document.addEventListener("mozfullscreenerror",mf);document.addEventListener("MSFullscreenChange",mf);document.addEventListener("MSFullscreenError",mf);}});function nf(a){this.c = [];this.b = [];this.a = [];for(a = new Jb(new DataView(a.buffer));Lb(a);) {var b=Sb(1886614376,a);if(-1 == b)break;var c=a.a - 8,d=Mb(a);if(1 < d)O(a,b - (a.a - c));else {O(a,3);var e=Ta(Qb(a,16)),f=[];if(0 < d)for(var d=N(a),g=0;g < d;++g) {var h=Ta(Qb(a,16));f.push(h);}d = N(a);O(a,d);this.b.push.apply(this.b,f);this.c.push(e);this.a.push({start:c,end:a.a - 1});a.a != c + b && O(a,b - (a.a - c));}}};function of(a,b){try{var c=new pf(a,b);return Promise.resolve(c);}catch(d) {return Promise.reject(d);}}function pf(a,b){this.keySystem = a;for(var c=!1,d=0;d < b.length;++d) {var e=b[d],f={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label},g=!1;if(e.audioCapabilities)for(var h=0;h < e.audioCapabilities.length;++h) {var l=e.audioCapabilities[h];if(l.contentType){var g=!0,n=l.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,n) && (f.audioCapabilities.push(l),c = !0);}}if(e.videoCapabilities)for(h = 0;h < e.videoCapabilities.length;++h) l = e.videoCapabilities[h],l.contentType && (g = !0,n = l.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,n) && (f.videoCapabilities.push(l),c = !0));g || (c = MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));"required" == e.persistentState && (f.persistentState = "required",f.sessionTypes = ["persistent-license"]);if(c){this.a = f;return;}}c = Error("Unsupported keySystem");c.name = "NotSupportedError";c.code = DOMException.NOT_SUPPORTED_ERR;throw c;}pf.prototype.createMediaKeys = function(){var a=new qf(this.keySystem);return Promise.resolve(a);};pf.prototype.getConfiguration = function(){return this.a;};function rf(a){var b=this.mediaKeys;b && b != a && sf(b,null);delete this.mediaKeys;return (this.mediaKeys = a)?sf(a,this):Promise.resolve();}function qf(a){this.a = new MSMediaKeys(a);this.b = new y();}qf.prototype.createSession = function(a){if("temporary" != (a || "temporary"))throw new TypeError("Session type " + a + " is unsupported on this platform.");return new tf(this.a);};qf.prototype.setServerCertificate = function(){return Promise.reject(Error("setServerCertificate not supported on this platform."));};function sf(a,b){function c(){b.msSetMediaKeys(d.a);b.removeEventListener("loadedmetadata",c);}Da(a.b);if(!b)return Promise.resolve();z(a.b,b,"msneedkey",uf);var d=a;try{return 1 <= b.readyState?b.msSetMediaKeys(a.a):b.addEventListener("loadedmetadata",c),Promise.resolve();}catch(e) {return Promise.reject(e);}}function tf(a){p.call(this);this.c = null;this.g = a;this.b = this.a = null;this.f = new y();this.sessionId = "";this.expiration = NaN;this.closed = new x();this.keyStatuses = new vf();}ba(tf);k = tf.prototype;k.generateRequest = function(a,b){this.a = new x();try{this.c = this.g.createSession("video/mp4",new Uint8Array(b),null),z(this.f,this.c,"mskeymessage",this.kc.bind(this)),z(this.f,this.c,"mskeyadded",this.ic.bind(this)),z(this.f,this.c,"mskeyerror",this.jc.bind(this)),wf(this,"status-pending");}catch(c) {this.a.reject(c);}return this.a;};k.load = function(){return Promise.reject(Error("MediaKeySession.load not yet supported"));};k.update = function(a){this.b = new x();try{this.c.update(new Uint8Array(a));}catch(b) {this.b.reject(b);}return this.b;};k.close = function(){try{this.c.close(),this.closed.resolve(),Da(this.f);}catch(a) {this.closed.reject(a);}return this.closed;};k.remove = function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"));};function uf(a){var b=document.createEvent("CustomEvent");b.initCustomEvent("encrypted",!1,!1,null);b.initDataType = "cenc";if(a = a.initData){var c=new nf(a);if(!(1 >= c.a.length)){for(var d=[],e=0;e < c.a.length;e++) d.push(a.subarray(c.a[e].start,c.a[e].end + 1));e = xf;a = [];for(c = 0;c < d.length;++c) {for(var f=!1,g=0;g < a.length && !(f = e?e(d[c],a[g]):d[c] === a[g]);++g);f || a.push(d[c]);}for(e = d = 0;e < a.length;e++) d += a[e].length;d = new Uint8Array(d);for(e = c = 0;e < a.length;e++) d.set(a[e],c),c += a[e].length;a = d;}}b.initData = a;this.dispatchEvent(b);}function xf(a,b){return Ua(a,b);}k.kc = function(a){this.a && (this.a.resolve(),this.a = null);this.dispatchEvent(new t("message",{messageType:void 0 == this.keyStatuses.Va()?"licenserequest":"licenserenewal",message:a.message.buffer}));};k.ic = function(){this.a?(wf(this,"usable"),this.a.resolve(),this.a = null):this.b && (wf(this,"usable"),this.b.resolve(),this.b = null);};k.jc = function(){var a=Error("EME PatchedMediaKeysMs key error");a.errorCode = this.c.error;if(this.a)this.a.reject(a),this.a = null;else if(this.b)this.b.reject(a),this.b = null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:wf(this,"output-not-allowed");default:wf(this,"internal-error");}};function wf(a,b){a.keyStatuses.fb(b);a.dispatchEvent(new t("keystatuseschange"));}function vf(){this.size = 0;this.a = void 0;}var yf;k = vf.prototype;k.fb = function(a){this.size = void 0 == a?0:1;this.a = a;};k.Va = function(){return this.a;};k.forEach = function(a){this.a && a(this.a,yf);};k.get = function(a){if(this.has(a))return this.a;};k.has = function(a){var b=yf;return this.a && Ua(new Uint8Array(a),new Uint8Array(b))?!0:!1;};k.keys = function(){};function zf(){return Promise.reject(Error("The key system specified is not supported."));}function Af(a){return a?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve();}function Bf(){throw new TypeError("Illegal constructor.");}Bf.prototype.createSession = function(){};Bf.prototype.setServerCertificate = function(){};function Cf(){throw new TypeError("Illegal constructor.");}Cf.prototype.getConfiguration = function(){};Cf.prototype.createMediaKeys = function(){};var Df="";function Ef(a){Df = a;Ff = new Uint8Array([0]).buffer;navigator.requestMediaKeySystemAccess = Gf;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys = null;HTMLMediaElement.prototype.setMediaKeys = Hf;window.MediaKeys = If;window.MediaKeySystemAccess = Jf;}function Kf(a){var b=Df;return b?b + a.charAt(0).toUpperCase() + a.slice(1):a;}function Gf(a,b){try{var c=new Jf(a,b);return Promise.resolve(c);}catch(d) {return Promise.reject(d);}}function Hf(a){var b=this.mediaKeys;b && b != a && Lf(b,null);delete this.mediaKeys;(this.mediaKeys = a) && Lf(a,this);return Promise.resolve();}function Jf(a,b){this.a = this.keySystem = a;var c=!0;"org.w3.clearkey" == a && (this.a = "webkit-org.w3.clearkey",c = !1);var d=!1,e;e = document.getElementsByTagName("video");e = e.length?e[0]:document.createElement("video");for(var f=0;f < b.length;++f) {var g=b[f],h={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:g.initDataTypes,sessionTypes:["temporary"],label:g.label},l=!1;if(g.audioCapabilities)for(var n=0;n < g.audioCapabilities.length;++n) {var u=g.audioCapabilities[n];if(u.contentType){var l=!0,r=u.contentType.split(";")[0];e.canPlayType(r,this.a) && (h.audioCapabilities.push(u),d = !0);}}if(g.videoCapabilities)for(n = 0;n < g.videoCapabilities.length;++n) u = g.videoCapabilities[n],u.contentType && (l = !0,e.canPlayType(u.contentType,this.a) && (h.videoCapabilities.push(u),d = !0));l || (d = e.canPlayType("video/mp4",this.a) || e.canPlayType("video/webm",this.a));"required" == g.persistentState && (c?(h.persistentState = "required",h.sessionTypes = ["persistent-license"]):d = !1);if(d){this.b = h;return;}}c = "Unsupported keySystem";if("org.w3.clearkey" == a || "com.widevine.alpha" == a)c = "None of the requested configurations were supported.";c = Error(c);c.name = "NotSupportedError";c.code = DOMException.NOT_SUPPORTED_ERR;throw c;}Jf.prototype.createMediaKeys = function(){var a=new If(this.a);return Promise.resolve(a);};Jf.prototype.getConfiguration = function(){return this.b;};function If(a){this.h = a;this.b = null;this.a = new y();this.c = [];this.f = {};}function Lf(a,b){a.b = b;Da(a.a);var c=Df;b && (z(a.a,b,c + "needkey",a.tc.bind(a)),z(a.a,b,c + "keymessage",a.sc.bind(a)),z(a.a,b,c + "keyadded",a.qc.bind(a)),z(a.a,b,c + "keyerror",a.rc.bind(a)));}k = If.prototype;k.createSession = function(a){var b=a || "temporary";if("temporary" != b && "persistent-license" != b)throw new TypeError("Session type " + a + " is unsupported on this platform.");a = this.b || document.createElement("video");a.src || (a.src = "about:blank");b = new Mf(a,this.h,b);this.c.push(b);return b;};k.setServerCertificate = function(){return Promise.reject(Error("setServerCertificate not supported on this platform."));};k.tc = function(a){var b=document.createEvent("CustomEvent");b.initCustomEvent("encrypted",!1,!1,null);b.initDataType = "webm";b.initData = a.initData;this.b.dispatchEvent(b);};k.sc = function(a){var b=Nf(this,a.sessionId);b && (a = new t("message",{messageType:void 0 == b.keyStatuses.Va()?"licenserequest":"licenserenewal",message:a.message}),b.b && (b.b.resolve(),b.b = null),b.dispatchEvent(a));};k.qc = function(a){if(a = Nf(this,a.sessionId))Of(a,"usable"),a.a && a.a.resolve(),a.a = null;};k.rc = function(a){var b=Nf(this,a.sessionId);if(b){var c=Error("EME v0.1b key error");c.errorCode = a.errorCode;c.errorCode.systemCode = a.systemCode;!a.sessionId && b.b?(c.method = "generateRequest",45 == a.systemCode && (c.message = "Unsupported session type."),b.b.reject(c),b.b = null):a.sessionId && b.a?(c.method = "update",b.a.reject(c),b.a = null):(c = a.systemCode,a.errorCode.code == MediaKeyError.MEDIA_KEYERR_OUTPUT?Of(b,"output-restricted"):1 == c?Of(b,"expired"):Of(b,"internal-error"));}};function Nf(a,b){var c=a.f[b];return c?c:(c = a.c.shift())?(c.sessionId = b,a.f[b] = c):null;}function Mf(a,b,c){p.call(this);this.f = a;this.i = !1;this.a = this.b = null;this.c = b;this.g = c;this.sessionId = "";this.expiration = NaN;this.closed = new x();this.keyStatuses = new Pf();}ba(Mf);function Qf(a,b,c){if(a.i)return Promise.reject(Error("The session is already initialized."));a.i = !0;var d;try{if("persistent-license" == a.g)if(c)d = new Uint8Array(Ib("LOAD_SESSION|" + c));else {var e=Ib("PERSISTENT|"),f=new Uint8Array(e.byteLength + b.byteLength);f.set(new Uint8Array(e),0);f.set(new Uint8Array(b),e.byteLength);d = f;}else d = new Uint8Array(b);}catch(h) {return Promise.reject(h);}a.b = new x();var g=Kf("generateKeyRequest");try{a.f[g](a.c,d);}catch(h) {if("InvalidStateError" != h.name)return a.b = null,Promise.reject(h);setTimeout((function(){try{this.f[g](this.c,d);}catch(l) {this.b.reject(l),this.b = null;}}).bind(a),10);}return a.b;}k = Mf.prototype;k.hb = function(a,b){if(this.a)this.a.then(this.hb.bind(this,a,b))["catch"](this.hb.bind(this,a,b));else {this.a = a;var c,d;"webkit-org.w3.clearkey" == this.c?(c = Eb(b),d = JSON.parse(c),"oct" != d.keys[0].kty && (this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a = null),c = Ra(d.keys[0].k),d = Ra(d.keys[0].kid)):(c = new Uint8Array(b),d = null);var e=Kf("addKey");try{this.f[e](this.c,c,d,this.sessionId);}catch(f) {this.a.reject(f),this.a = null;}}};function Of(a,b){a.keyStatuses.fb(b);a.dispatchEvent(new t("keystatuseschange"));}k.generateRequest = function(a,b){return Qf(this,b,null);};k.load = function(a){return "persistent-license" == this.g?Qf(this,null,a):Promise.reject(Error("Not a persistent session."));};k.update = function(a){var b=new x();this.hb(b,a);return b;};k.close = function(){if("persistent-license" != this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=Kf("cancelKeyRequest");try{this.f[a](this.c,this.sessionId);}catch(b) {}}this.closed.resolve();return this.closed;};k.remove = function(){return "persistent-license" != this.g?Promise.reject(Error("Not a persistent session.")):this.close();};function Pf(){this.size = 0;this.a = void 0;}var Ff;k = Pf.prototype;k.fb = function(a){this.size = void 0 == a?0:1;this.a = a;};k.Va = function(){return this.a;};k.forEach = function(a){this.a && a(this.a,Ff);};k.get = function(a){if(this.has(a))return this.a;};k.has = function(a){var b=Ff;return this.a && Ua(new Uint8Array(a),new Uint8Array(b))?!0:!1;};k.keys = function(){};lf(function(){!window.HTMLVideoElement || navigator.requestMediaKeySystemAccess && MediaKeySystemAccess.prototype.getConfiguration || (HTMLMediaElement.prototype.webkitGenerateKeyRequest?Ef("webkit"):HTMLMediaElement.prototype.generateKeyRequest?Ef(""):window.MSMediaKeys?(yf = new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys = null,HTMLMediaElement.prototype.setMediaKeys = rf,window.MediaKeys = qf,window.MediaKeySystemAccess = pf,navigator.requestMediaKeySystemAccess = of):(navigator.requestMediaKeySystemAccess = zf,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys = null,HTMLMediaElement.prototype.setMediaKeys = Af,window.MediaKeys = Bf,window.MediaKeySystemAccess = Cf));});function Rf(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer = function(){var b=a.apply(this,arguments);b.abort = function(){};return b;};}function Sf(){var a=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream = function(){for(var b=0,d=0;d < this.sourceBuffers.length;++d) var e=this.sourceBuffers[d],e=e.buffered.end(e.buffered.length - 1),b=Math.max(b,e);if(!isNaN(this.duration) && b < this.duration)for(this.pb = !0,d = 0;d < this.sourceBuffers.length;++d) e = this.sourceBuffers[d],e.lb = !1;return a.apply(this,arguments);};var b=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer = function(){var a=b.apply(this,arguments);a.h = this;a.addEventListener("updateend",Tf,!1);this.a || (this.addEventListener("sourceclose",Uf,!1),this.a = !0);return a;};}function Tf(a){var b=a.target,c=b.h;if(c.pb){a.preventDefault();a.stopPropagation();a.stopImmediatePropagation();b.lb = !0;for(a = 0;a < c.sourceBuffers.length;++a) if(0 == c.sourceBuffers[a].lb)return;c.pb = !1;}}function Uf(a){a = a.target;for(var b=0;b < a.sourceBuffers.length;++b) a.sourceBuffers[b].removeEventListener("updateend",Tf,!1);a.removeEventListener("sourceclose",Uf,!1);}lf(function(){if(window.MediaSource){var a=navigator.vendor,b=navigator.appVersion;!a || !b || 0 > a.indexOf("Apple") || (0 <= b.indexOf("Version/8")?window.MediaSource = null:0 <= b.indexOf("Version/9")?Rf():0 <= b.indexOf("Version/10") && (Rf(),Sf()));}});function Z(a){this.c = [];this.b = [];this.ia = Vf;if(a)try{a(this.W.bind(this),this.a.bind(this));}catch(b) {this.a(b);}}var Vf=0;function Wf(a){var b=new Z();b.W(void 0);return b.then(function(){return a;});}function Xf(a){var b=new Z();b.a(a);return b;}function Yf(a){function b(a,b,c){a.ia == Vf && (e[b] = c,d++,d == e.length && a.W(e));}var c=new Z();if(!a.length)return c.W([]),c;for(var d=0,e=Array(a.length),f=c.a.bind(c),g=0;g < a.length;++g) a[g] && a[g].then?a[g].then(b.bind(null,c,g),f):b(c,g,a[g]);return c;}function Zf(a){for(var b=new Z(),c=b.W.bind(b),d=b.a.bind(b),e=0;e < a.length;++e) a[e] && a[e].then?a[e].then(c,d):c(a[e]);return b;}Z.prototype.then = function(a,b){var c=new Z();switch(this.ia){case 1:$f(this,c,a);break;case 2:$f(this,c,b);break;case Vf:this.c.push({I:c,Ea:a}),this.b.push({I:c,Ea:b});}return c;};Z.prototype["catch"] = function(a){return this.then(void 0,a);};Z.prototype.W = function(a){if(this.ia == Vf){this.Pa = a;this.ia = 1;for(a = 0;a < this.c.length;++a) $f(this,this.c[a].I,this.c[a].Ea);this.c = [];this.b = [];}};Z.prototype.a = function(a){if(this.ia == Vf){this.Pa = a;this.ia = 2;for(a = 0;a < this.b.length;++a) $f(this,this.b[a].I,this.b[a].Ea);this.c = [];this.b = [];}};function $f(a,b,c){ag.push((function(){if(c && "function" == typeof c){try{var a=c(this.Pa);}catch(f) {b.a(f);return;}var e;try{e = a && a.then;}catch(f) {b.a(f);return;}a instanceof Z?a == b?b.a(new TypeError("Chaining cycle detected")):a.then(b.W.bind(b),b.a.bind(b)):e?bg(a,e,b):b.W(a);}else 1 == this.ia?b.W(this.Pa):b.a(this.Pa);}).bind(a));null == cg && (cg = dg(eg));}function bg(a,b,c){try{var d=!1;b.call(a,function(a){if(!d){d = !0;var b;try{b = a && a.then;}catch(g) {c.a(g);return;}b?bg(a,b,c):c.W(a);}},c.a.bind(c));}catch(e) {c.a(e);}}function eg(){for(;ag.length;) {null != cg && (fg(cg),cg = null);var a=ag;ag = [];for(var b=0;b < a.length;++b) a[b]();}}function dg(){return 0;}function fg(){}var cg=null,ag=[];lf(function(a){window.setImmediate?(dg = function(a){return window.setImmediate(a);},fg = function(a){return window.clearImmediate(a);}):(dg = function(a){return window.setTimeout(a,0);},fg = function(a){return window.clearTimeout(a);});if(!window.Promise || a)window.Promise = Z,window.Promise.resolve = Wf,window.Promise.reject = Xf,window.Promise.all = Yf,window.Promise.race = Zf,window.Promise.prototype.then = Z.prototype.then,window.Promise.prototype["catch"] = Z.prototype["catch"];});function gg(){return {droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0};}lf(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality && "webkitDroppedFrameCount" in a && (a.getVideoPlaybackQuality = gg);}});function hg(a,b,c){return new window.TextTrackCue(a,b,c);}function ig(a,b,c){return new window.TextTrackCue(a + "-" + b + "-" + c,a,b,c);}lf(function(){if(!window.VTTCue && window.TextTrackCue){var a=TextTrackCue.length;if(3 == a)window.VTTCue = hg;else if(6 == a)window.VTTCue = ig;else {var b;try{b = !!hg(1,2,"");}catch(c) {b = !1;}b && (window.VTTCue = hg);}}});}).call(g,this);if(typeof module != "undefined" && module.exports)module.exports = g.shaka;else if(true)!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return g.shaka;}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else this.shaka = g.shaka;})();
+
+/***/ }
+/******/ ])
+});
+; \ No newline at end of file
diff --git a/model/Room.php b/model/Room.php
index ecab17e..f5eedbd 100644
--- a/model/Room.php
+++ b/model/Room.php
@@ -163,8 +163,12 @@ class Room
return $this->getConference()->get('ROOMS.'.$this->getSlug().'.DASH');
}
+ public function getHLSPlaylistUrl() {
+ return proto().'://cdn.c3voc.de/hls/'.rawurlencode($this->getSlug().'_'.$this->getStream()).'/master.m3u8';
+ }
+
public function getDashManifestUrl() {
- return proto().'://dekan.cch.c3voc.de/dash/'.rawurlencode($this->getStream()).'/manifest.mpd';
+ return proto().'://cdn.c3voc.de/dash/'.rawurlencode($this->getSlug().'_'.$this->getStream()).'/manifest.mpd';
}
public function getDashTech() {
diff --git a/template/assemblies/player/dash.phtml b/template/assemblies/player/dash.phtml
index 8a70d25..7048006 100644
--- a/template/assemblies/player/dash.phtml
+++ b/template/assemblies/player/dash.phtml
@@ -1,4 +1,3 @@
-<script type="text/javascript" src="<?=h($assets)?>clapprio/clappr.min.js"></script>
<script type="text/javascript" src="<?=h($assets)?>clapprio/dash-shaka-playback.js"></script>
<script type="text/javascript" src="<?=h($assets)?>clapprio/level-selector.min.js"></script>
<script type="text/javascript" src="<?=h($assets)?>clapprio/audio-selector.min.js"></script>
@@ -12,21 +11,22 @@
interference with the new dash-player.
-->
<script type="text/javascript">
+ var nativeHLS = document.createElement('video').canPlayType('application/vnd.apple.mpegURL') != "";
var player = new Clappr.Player({
- // source: "http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd",
- source: '<?=h($room->getDashManifestUrl())?>',
+ source: nativeHLS ? '<?=h($room->getHLSPlaylistUrl())?>' : '<?=h($room->getDashManifestUrl())?>',
width: "100%",
plugins: [DashShakaPlayback, LevelSelector, AudioSelector],
shakaConfiguration: {
- preferredAudioLanguage: 'de-DE',
- streaming: {
- rebufferingGoal: 15
- }
+ abr: {
+ defaultBandwidthEstimate: 600000
+ },
},
autoPlay: true,
parentId: '#player'
});
</script>
+
+
<style type="text/css">
#player > [data-player] {
padding-bottom: 56.25%;
diff --git a/template/assemblies/switcher/dash.phtml b/template/assemblies/switcher/dash.phtml
index 164af12..63b8381 100644
--- a/template/assemblies/switcher/dash.phtml
+++ b/template/assemblies/switcher/dash.phtml
@@ -22,6 +22,14 @@
</a>
</div>
+ <div class="btn-group" role="group">
+ <div class="btn btn-primary" disabled>HLS</div>
+ <a href="<?=h($room->GetHLSPlaylistUrl())?>" target="_blank" class="btn btn-default">
+ <span class="fa fa-flask"></span>
+ Playlist
+ </a>
+ </div>
+
</div>
</div>
</div>