From b320db1d586500d0cb8f783238be0bac68fe3355 Mon Sep 17 00:00:00 2001 From: Leandro Moreira Date: Tue, 28 Jun 2016 17:26:16 -0300 Subject: [PATCH] bump to 1.0.16 --- dash-shaka-playback.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dash-shaka-playback.js b/dash-shaka-playback.js index 4149189..b56c9ec 100644 --- a/dash-shaka-playback.js +++ b/dash-shaka-playback.js @@ -1,4 +1,4 @@ -!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=720,this.trigger(h.Events.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(h.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,width:t.size.width,height:t.size.height,level:t.size.number}),this._levels.length>0&&this.trigger(h.Events.PLAYBACK_LEVEL_SWITCH_END))}},{key:"_destroy",value:function(){o(Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,h.Log.debug("shaka was destroyed")}},{key:"_ready",value:function(){this._isShakaReadyState=!0,o(Object.getPrototypeOf(e.prototype),"_ready",this).call(this)}},{key:"isReady",get:function(){return this._isShakaReadyState}}]),e}(h.HTML5Video);e["default"]=p,p.canPlay=function(t){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];if(l["default"].polyfill.installAll(),!l["default"].player.Player.isBrowserSupported())return h.Log.debug("This browser does not support this video"),!1;var i=t.split("?")[0].match(/.*\.(.*)$/)||[];return"mpd"===i[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=Wr;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,e){function i(){}i.prototype=e.prototype,t.Zb=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.Yb=function(t,i,n){return e.prototype[i].apply(t,Array.prototype.slice.call(arguments,2))}}function n(t,e){this.id=t,this.lang=e||"unknown",this.enabled=this.active=!1}function r(){this.minBandwidth=this.maxBandwidth=this.maxWidth=this.minHeight=this.maxHeight=null}function s(t,e,i,n){this.id=t,this.bandwidth=e||0,this.width=i||0,this.height=n||0,this.active=!1}function a(t,e){var i=t.width*t.height,n=e.width*e.height;return in?1:t.bandwidthe.bandwidth?1:0}function o(t,e,i){this.id=t,this.bandwidth=e||0,this.lang=i||"unknown",this.active=!1}function h(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i.destroy=h.prototype.destroy,i}function u(t,e){return e.bind(t)}function l(t){return Object.keys(t).map(function(e){return t[e]})}function c(t,e){return d(t,e,"boolean")}function f(t,e){var i=d(t,e,"number");if(null==i)return null;if(isNaN(i)||i==Number.NEGATIVE_INFINITY||i==Number.POSITIVE_INFINITY)throw new RangeError("'"+e+"' must be finite.");if(0>i)throw new RangeError("'"+e+"' must be >= 0");return i}function p(t,e){return d(t,e,"string")}function d(t,e,i){if(t=t[e],null==t)return null;if(typeof t!=i)throw new TypeError("'"+e+"' must be a "+i+".");return t}function y(t,e,i){if(t=t[e],null==t)return null;if(!(t instanceof i))throw new TypeError("'"+e+"' must be an instance of "+i.name+".");return t}function b(t){return t.split("").reduce(function(t,e,i){return t+(i&&0==i%4?" "+e:e)})}function v(t,e){for(var i=[],n=0;n=e&&!(i&1<<8-e);e++);if(8=Qr&&i==e.split("-")[0]||t>=Zr&&i.split("-")[0]==e.split("-")[0]}function H(t){t=t.toLowerCase().split("-");var e=ts[t[0]];return e&&(t[0]=e),t.join("-")}function z(t){this.ya=new _,this.v=t}function G(t,e){e.currentTarget=t;for(var i=t.ya.get(e.type)||[],n=0;nt.b.byteLength)throw new RangeError("DataViewReader: Read past end of DataView.");var e=new Uint8Array(t.b.buffer,t.a,16);return t.a+=16,e}function tt(t,e){if(t.a+e>t.b.byteLength)throw new RangeError("DataViewReader: Skip past end of DataView.");t.a+=e}function et(){this.g=new h,this.f=!1,this.a=null,this.b=[],this.c=null}function it(t,e){if(t.f)throw Error("Cannot append to a running task!");t.b.push(e)}function nt(t,e){var i,n=t.b[0](e);n?(i=n[0],t.c=n[1]):(i=Promise.resolve(),t.c=null),i.then(u(t,function(t){this.a?(this.b=[],this.c=null,rt(this)):(this.b.shift(),this.b.length?nt(this,t):(this.g.resolve(t),this.c=null))}))["catch"](u(t,function(t){this.b=[],this.c=null,this.a?rt(this):this.g.reject(t)}))}function rt(e){var i=Error("Task aborted.");i.type="aborted",e.g.reject(i),t.setTimeout(function(){this.a.resolve(),this.a=null}.bind(e),5)}function st(){this.a=new _}function at(t,e,i,n){e=new ht(e,i,n),t.a.push(i,e)}function ot(t){for(var e=M(t.a),i=0;i=r&&e<=s)return i.end(n)-e}return 0}function St(t,e,i,n){if(t.a)return t=Error("Cannot fetch ("+t.v+"): previous operation not complete."),t.type="stream",Promise.reject(t);t.a=new et,i!=t.c.timestampOffset&&(t.c.timestampOffset=i),"idb"!=e.url.b[0].P||t.g||(t.g=new gt,it(t.a,function(){return[lt(this.g)]}.bind(t))),n&&it(t.a,function(){return[It(this,n),this.h.bind(this)]}.bind(t)),it(t.a,function(){var t=e.a?e.a-e.b:1,i=new Le;return i.a=3,i.h=1e3*t,i.c=1e3*this.s,i.i=this.g,[ze(e.url,i,this.l),Ve.prototype.g.bind(e.url)]}.bind(t)),it(t.a,u(t,function(t){return this.l.getBandwidth(),[It(this,t),this.h.bind(this)]}));var r=0==t.c.buffered.length&&0==t.b.length,s=null;return it(t.a,function(){if(0==this.c.buffered.length){var t=Error("Failed to buffer segment ("+this.v+").");return t.type="stream",[Promise.reject(t)]}r&&(t=e.b,s=this.c.buffered.start(0)-t),t=$e(this.b,e.b),0<=t?this.b.splice(t+1,0,e):this.b.push(e)}.bind(t)),Mt(t).then(function(){return Promise.resolve(s)}.bind(t))}function jt(t){return t.a?(t=Error("Cannot clear ("+t.v+"): previous operation not complete."),t.type="stream",Promise.reject(t)):(t.a=new et,it(t.a,function(){var t;t:if(0==this.c.buffered.length)t=Promise.resolve();else{try{this.c.remove(0,this.i.duration)}catch(e){t=Promise.reject(e);break t}this.b=[],t=this.f=new h}return[t,this.h.bind(this)]}.bind(t)),Mt(t))}function At(t,e){if(t.a){var i=Error("Cannot clearAfter ("+t.v+"): previous operation not complete.");return i.type="stream",Promise.reject(i)}return t.a=new et,it(t.a,function(){return[Nt(this,e),this.h.bind(this)]}.bind(t)),Mt(t)}function _t(t){return t.a?(t=t.a,t.a?t=t.a:t.f?(t.c&&t.c(),t.a=new h,t=t.a):(t.f=!0,t=Promise.resolve())):t=Promise.resolve(),t}function Mt(t){return t.a.start(),t.a.g.then(u(t,function(){this.a=null}))["catch"](u(t,function(t){return this.a=null,Promise.reject(t)}))}function It(t,e){try{t.c.appendBuffer(e)}catch(i){return Promise.reject(i)}return t.f=new h,t.f}function Nt(t,e){if(0==t.c.buffered.length)return Promise.resolve();var i=$e(t.b,e);if(-1==i||i==t.b.length-1)return Promise.resolve();try{t.c.remove(t.b[i+1].b,t.i.duration)}catch(n){return Promise.reject(n)}return t.b=t.b.slice(0,i+1),t.f=new h,t.f}function Rt(t){var e=console[t];e?e.bind||(console[t]=function(){e.apply(console,arguments)}):console[t]=function(){}}function Ct(){this.fontSize="100%",this.fontColor=rs,this.fontOpacity=as,this.backgroundColor=ss,this.backgroundOpacity=as,this.fontEdge=os}function Dt(t){var e=[];e.push("font-size: "+t.fontSize),e.push("color: "+xt(t.fontColor,t.fontOpacity)),e.push("background-color: "+xt(t.backgroundColor,t.backgroundOpacity));for(var i=[],n=0;n=i.a.length)t=e;else{var n=[];for(t=0;te)throw Error("Bad port number "+e);t.ia=e}else t.ia=null}function Ie(t,e,i){e instanceof De?t.a=e:(i||(e=Re(e,ms)),t.a=new De(e))}function Ne(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function Re(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,Ce),i&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ce(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function De(t){this.b=t||null}function xe(t,e,i){if(!t.a&&(t.a={},t.c=0,t.b))for(var n=t.b.split("&"),r=0;r=720,this.trigger(h.Events.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(h.Events.PLAYBACK_BITRATE,{bandwidth:t.bandwidth,width:t.size.width,height:t.size.height,level:t.size.number}),this._levels.length>0&&this.trigger(h.Events.PLAYBACK_LEVEL_SWITCH_END))}},{key:"_destroy",value:function(){o(Object.getPrototypeOf(e.prototype),"destroy",this).call(this),this._isShakaReadyState=!1,h.Log.debug("shaka was destroyed")}},{key:"_ready",value:function(){o(Object.getPrototypeOf(e.prototype),"_ready",this).call(this)}},{key:"isReady",get:function(){return this._isShakaReadyState}}]),e}(h.HTML5Video);e["default"]=p,p.canPlay=function(t){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];if(l["default"].polyfill.installAll(),!l["default"].player.Player.isBrowserSupported())return h.Log.debug("This browser does not support this video"),!1;var i=t.split("?")[0].match(/.*\.(.*)$/)||[];return"mpd"===i[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=Wr;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,e){function i(){}i.prototype=e.prototype,t.Zb=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.Yb=function(t,i,n){return e.prototype[i].apply(t,Array.prototype.slice.call(arguments,2))}}function n(t,e){this.id=t,this.lang=e||"unknown",this.enabled=this.active=!1}function r(){this.minBandwidth=this.maxBandwidth=this.maxWidth=this.minHeight=this.maxHeight=null}function s(t,e,i,n){this.id=t,this.bandwidth=e||0,this.width=i||0,this.height=n||0,this.active=!1}function a(t,e){var i=t.width*t.height,n=e.width*e.height;return in?1:t.bandwidthe.bandwidth?1:0}function o(t,e,i){this.id=t,this.bandwidth=e||0,this.lang=i||"unknown",this.active=!1}function h(){var t,e,i=new Promise(function(i,n){t=i,e=n});return i.resolve=t,i.reject=e,i.destroy=h.prototype.destroy,i}function u(t,e){return e.bind(t)}function l(t){return Object.keys(t).map(function(e){return t[e]})}function c(t,e){return d(t,e,"boolean")}function f(t,e){var i=d(t,e,"number");if(null==i)return null;if(isNaN(i)||i==Number.NEGATIVE_INFINITY||i==Number.POSITIVE_INFINITY)throw new RangeError("'"+e+"' must be finite.");if(0>i)throw new RangeError("'"+e+"' must be >= 0");return i}function p(t,e){return d(t,e,"string")}function d(t,e,i){if(t=t[e],null==t)return null;if(typeof t!=i)throw new TypeError("'"+e+"' must be a "+i+".");return t}function y(t,e,i){if(t=t[e],null==t)return null;if(!(t instanceof i))throw new TypeError("'"+e+"' must be an instance of "+i.name+".");return t}function b(t){return t.split("").reduce(function(t,e,i){return t+(i&&0==i%4?" "+e:e)})}function v(t,e){for(var i=[],n=0;n=e&&!(i&1<<8-e);e++);if(8=Qr&&i==e.split("-")[0]||t>=Zr&&i.split("-")[0]==e.split("-")[0]}function H(t){t=t.toLowerCase().split("-");var e=ts[t[0]];return e&&(t[0]=e),t.join("-")}function z(t){this.ya=new _,this.v=t}function G(t,e){e.currentTarget=t;for(var i=t.ya.get(e.type)||[],n=0;nt.b.byteLength)throw new RangeError("DataViewReader: Read past end of DataView.");var e=new Uint8Array(t.b.buffer,t.a,16);return t.a+=16,e}function tt(t,e){if(t.a+e>t.b.byteLength)throw new RangeError("DataViewReader: Skip past end of DataView.");t.a+=e}function et(){this.g=new h,this.f=!1,this.a=null,this.b=[],this.c=null}function it(t,e){if(t.f)throw Error("Cannot append to a running task!");t.b.push(e)}function nt(t,e){var i,n=t.b[0](e);n?(i=n[0],t.c=n[1]):(i=Promise.resolve(),t.c=null),i.then(u(t,function(t){this.a?(this.b=[],this.c=null,rt(this)):(this.b.shift(),this.b.length?nt(this,t):(this.g.resolve(t),this.c=null))}))["catch"](u(t,function(t){this.b=[],this.c=null,this.a?rt(this):this.g.reject(t)}))}function rt(e){var i=Error("Task aborted.");i.type="aborted",e.g.reject(i),t.setTimeout(function(){this.a.resolve(),this.a=null}.bind(e),5)}function st(){this.a=new _}function at(t,e,i,n){e=new ht(e,i,n),t.a.push(i,e)}function ot(t){for(var e=M(t.a),i=0;i=r&&e<=s)return i.end(n)-e}return 0}function St(t,e,i,n){if(t.a)return t=Error("Cannot fetch ("+t.v+"): previous operation not complete."),t.type="stream",Promise.reject(t);t.a=new et,i!=t.c.timestampOffset&&(t.c.timestampOffset=i),"idb"!=e.url.b[0].P||t.g||(t.g=new gt,it(t.a,function(){return[lt(this.g)]}.bind(t))),n&&it(t.a,function(){return[It(this,n),this.h.bind(this)]}.bind(t)),it(t.a,function(){var t=e.a?e.a-e.b:1,i=new Le;return i.a=3,i.h=1e3*t,i.c=1e3*this.s,i.i=this.g,[ze(e.url,i,this.l),Ve.prototype.g.bind(e.url)]}.bind(t)),it(t.a,u(t,function(t){return this.l.getBandwidth(),[It(this,t),this.h.bind(this)]}));var r=0==t.c.buffered.length&&0==t.b.length,s=null;return it(t.a,function(){if(0==this.c.buffered.length){var t=Error("Failed to buffer segment ("+this.v+").");return t.type="stream",[Promise.reject(t)]}r&&(t=e.b,s=this.c.buffered.start(0)-t),t=$e(this.b,e.b),0<=t?this.b.splice(t+1,0,e):this.b.push(e)}.bind(t)),Mt(t).then(function(){return Promise.resolve(s)}.bind(t))}function jt(t){return t.a?(t=Error("Cannot clear ("+t.v+"): previous operation not complete."),t.type="stream",Promise.reject(t)):(t.a=new et,it(t.a,function(){var t;t:if(0==this.c.buffered.length)t=Promise.resolve();else{try{this.c.remove(0,this.i.duration)}catch(e){t=Promise.reject(e);break t}this.b=[],t=this.f=new h}return[t,this.h.bind(this)]}.bind(t)),Mt(t))}function At(t,e){if(t.a){var i=Error("Cannot clearAfter ("+t.v+"): previous operation not complete.");return i.type="stream",Promise.reject(i)}return t.a=new et,it(t.a,function(){return[Nt(this,e),this.h.bind(this)]}.bind(t)),Mt(t)}function _t(t){return t.a?(t=t.a,t.a?t=t.a:t.f?(t.c&&t.c(),t.a=new h,t=t.a):(t.f=!0,t=Promise.resolve())):t=Promise.resolve(),t}function Mt(t){return t.a.start(),t.a.g.then(u(t,function(){this.a=null}))["catch"](u(t,function(t){return this.a=null,Promise.reject(t)}))}function It(t,e){try{t.c.appendBuffer(e)}catch(i){return Promise.reject(i)}return t.f=new h,t.f}function Nt(t,e){if(0==t.c.buffered.length)return Promise.resolve();var i=$e(t.b,e);if(-1==i||i==t.b.length-1)return Promise.resolve();try{t.c.remove(t.b[i+1].b,t.i.duration)}catch(n){return Promise.reject(n)}return t.b=t.b.slice(0,i+1),t.f=new h,t.f}function Rt(t){var e=console[t];e?e.bind||(console[t]=function(){e.apply(console,arguments)}):console[t]=function(){}}function Ct(){this.fontSize="100%",this.fontColor=rs,this.fontOpacity=as,this.backgroundColor=ss,this.backgroundOpacity=as,this.fontEdge=os}function Dt(t){var e=[];e.push("font-size: "+t.fontSize),e.push("color: "+xt(t.fontColor,t.fontOpacity)),e.push("background-color: "+xt(t.backgroundColor,t.backgroundOpacity));for(var i=[],n=0;n=i.a.length)t=e;else{var n=[];for(t=0;te)throw Error("Bad port number "+e);t.ia=e}else t.ia=null}function Ie(t,e,i){e instanceof De?t.a=e:(i||(e=Re(e,ms)),t.a=new De(e))}function Ne(t,e){return t?e?decodeURI(t):decodeURIComponent(t):""}function Re(t,e,i){return"string"==typeof t?(t=encodeURI(t).replace(e,Ce),i&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ce(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}function De(t){this.b=t||null}function xe(t,e,i){if(!t.a&&(t.a={},t.c=0,t.b))for(var n=t.b.split("&"),r=0;r=n.b&&(null==n.a||e=ei(e).b);++n);t.o[n].bei(e).b||ei(e),i=t.o.slice(0,n))}t.o=i.concat(e.o)}}function ni(t){this.b=t,this.a=null}function ri(t){this.b=t,this.a=null}function si(){this.C=Es++,this.id=this.H=this.I=null,this.c=0,this.height=this.width=this.bandwidth=null,this.b=this.a="",this.f=[],this.N=!1,this.J=!0}function ai(t){var e=t.a||"";return t.b&&(e+='; codecs="'+t.b+'"'),e}function oi(){this.C=ks++,this.id=null,this.contentType=this.lang="",this.b=!1,this.m=[],this.a=[]}function hi(t){for(var e=[],i=0;i=this.f.length&&this.g.resolve()}))["catch"](u(t,function(t){t=F(t),this.dispatchEvent(t)}))}}function Di(t){var e=null;if(t.b.ha())try{e=t.i.createSession("persistent-license")}catch(i){throw Error("Persistent licenses are not supported by this key system or platform.")}else e=t.i.createSession();return at(t.l,e,"message",t.G.bind(t)),at(t.l,e,"keystatuseschange",t.F.bind(t)),e}function xi(t,e,i,n){n=Oi(i,n),ji(new Si(n.url,n.body,n.method,i.i,n.headers,t.w)).then(u(t,function(t){return i.l&&(t=i.l(t)),e.update(t)})).then(u(t,function(){var t=q({type:"sessionReady",detail:e});this.dispatchEvent(t),this.s++,this.s>=this.f.length&&this.g.resolve()}))["catch"](u(t,function(t){t.La=e,t=F(t),this.dispatchEvent(t)}))}function Oi(e,i){var n={url:e.h,body:i.slice(0),method:"POST",headers:{}};if("com.microsoft.playready"===e.a){for(var r=String.fromCharCode.apply(null,new Uint16Array(n.body)),r=(new DOMParser).parseFromString(r,"application/xml"),s=r.getElementsByTagName("name"),a=r.getElementsByTagName("value"),o=0;on?1:0}function Yi(t){this.a=t}function Wi(t){function e(t,e){return t.concat(e)}var i=t.a.map(function(t){return t.a}).reduce(e,[]).map(function(t){return t.m}).reduce(e,[]);return t=i.map(function(t){return t.I.create()}),Promise.all(t).then(function(t){for(var e={},n=0;n=(s.bandwidth+i)/.95&&t<=o&&(n=s,n.active)))break}return n}function en(t,e,i){z.call(this,null),this.f=t,this.c=e,this.b=x(i),this.a=null}function nn(t,e,i){z.call(this,null),this.a=t,this.Z=e,this.i=new st,this.g=new MediaSource,this.f=null,this.da=0,this.b=new _,this.G=i,this.G.initialize(e,this),this.L=!1,this.K="en",this.fa=!1,this.U=null,this.B=new h,this.h=new r,this.D=null,this.Va=1,this.c={},this.ea=new h,this.Ta=0,this.Ua=15,this.w=null,this.Ra=this.Sa=!1,this.s={},this.$=this.Y=this.V=null,this.F={}}function rn(e,i){if(null!=e.a.f){var n=Math.max(e.a.f,3),n=Math.max(n-i,0);e.V=t.setTimeout(e.gb.bind(e,!1),1e3*n)}}function sn(t,e){var i=e.a.split("/")[0],n=t.c[i];if(n&&n.oa()==e){var r=t.b.get(e.a.split("/")[0]).map(function(t){return t.m}).reduce(function(t,e){return t.concat(e)},[]).filter(function(t){return t.N&&t.J});if(0==r.length)return i=Error("All usable streams have been removed from the manifest."),i.type="app",i=F(i),void t.dispatchEvent(i);t.s[i].Pa==e&&delete t.s[i],n.ra(r[0],!0),e.destroy()}e.destroy()}function an(t){if(t.h){for(var e=!1,i=0;it.h.maxWidth&&(o.J=!1),t.h.maxHeight&&o.height>t.h.maxHeight&&(o.J=!1),t.h.minHeight&&o.heightt.h.maxBandwidth&&(o.J=!1),t.h.minBandwidth&&o.bandwidth=i;++i)for(var n=0;n=i.start?n=t.$:t.a.b?(n=i.end,t.Sa=!0):n=i.start,at(t.i,t.f,"seeking",t.Gb.bind(t)),t.f.currentTime!=n&&(t.f.currentTime=n,t.D=n),vn(t,i.start,i.end),i=[];for(var r in t.c){n=t.c[r],i.push(n.sb(t.ea)),at(t.i,n,"ended",t.Hb.bind(t));var s=e[r];Ei(t.U,s),n.ra(s,!1)}Promise.all(i).then(t.tb.bind(t))["catch"](u(t,function(t){"destroy"!=t.type&&(t=F(t),this.dispatchEvent(t))})),t.Na(t.fa)}function yn(t,e,i){(e=wn(t,e))&&(bn(t,e),vn(t,e.start,e.end)),0!=i&&(i=t.f.currentTime+i,t.f.currentTime=i,t.D=i),t.Sa&&e&&(t.f.currentTime=e.end),t.f.playbackRate=t.Va,t.a.b&&null!=t.a.f&&rn(t,0),Tn(t),t.ea.resolve()}function bn(t,e){if(t.a.b)isNaN(t.g.duration)&&(t.g.duration=e.end+2592e3);else if(isNaN(t.g.duration)||e.end>t.g.duration){t.g.duration=e.end;for(var i=0;i=i-.01)return!1;if(e=0,t.a.b){e=.5;for(var r in t.c)if(!t.c[r].kb(i+e)){e=t.a.c;break}}return t.f.currentTime=Math.min(i+e,n),!0}function mn(t){return l(t.c).map(function(t){return t.bb()}).filter(function(t){return null!=t})}function wn(t,e){for(var i=0,n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=0;sn?null:{start:i,end:n,A:r}}function Tn(e){e.a.b&&(e.Y=t.setTimeout(e.Jb.bind(e),1e3))}function En(t){for(var e in t.c)t.c[e].F(t.F)}function kn(t,e){ut.call(this,"readwrite",e),this.j=t,this.b=0}function Pn(t,e,i,n,r){for(var s=[],a=[],o=0,l=0,c=[],f=e.map(function(t){return t.I.create()}),f=Promise.all(f),p=e.map(function(t){return t.H.create()}),p=Promise.all(p),f=Promise.all([f,p]).then(function(t){s=t[0],a=t[1],o=s.reduce(function(t,e){return t+e.length()},0)}),p=0;pt.f)t.c=e;else{var i=t.f-(t.g.c+t.w.start);0>i?t.c=e:it.h;--i)++e;0a&&(a=t[r].a,a=r+1===t.length?Math.ceil((t[0].b+e-s)/a)-1:Math.ceil((t[r+1].b-s)/a)-1),0n)s=null;else{var h=t.i||0,u=t.f||0;s=i.a,s=s.b/s.a;var l=n-(t.c+e.start);0>l?s=null:(u=l-2*s-u,0>u&&(u=0),u=Math.ceil(u/s)*s,l-=s,0>l?s=null:(h=Math.floor(l/s)*s-h,0>h&&(h=0),h=Math.floor(h/s)*s,s={Ya:u/s+1,current:(h>=u?h:u)/s+1}))}if(s&&(a=s.Ya,o=s.current-s.Ya+1),a=wr(r,i,a,o),null==a)throw t=Error("Failed to generate SegmentReferences."),t.type="stream",t;In.call(this,a,t,e,n),this.s=i,this.v=this.b=0e.lang?1:0}),r.prototype.clone=function(){var t=new r;return t.maxHeight=this.maxHeight,t.minHeight=this.minHeight,t.maxWidth=this.maxWidth,t.maxBandwidth=this.maxBandwidth,t.minBandwidth=this.minBandwidth,t},e("shaka.player.VideoTrack.compare",a),e("shaka.player.AudioTrack.compare",function(t,e){return t.lange.lang?1:t.bandwidthe.bandwidth?1:0}),h.prototype.destroy=function(){this["catch"](function(){});var t=Error("Destroyed!");t.type="destroy",this.reject(t)};var Jr={"output-restricted":"The required output protection is not available.","output-not-allowed":"The required output protection is not available.",expired:"The decryption key has expired.","internal-error":"The key system has encountered an unspecified error."};e("shaka.util.Uint8ArrayUtils.toString",g),e("shaka.util.Uint8ArrayUtils.fromString",m),e("shaka.util.Uint8ArrayUtils.toBase64",function(e,i){var n=void 0==i||i,r=t.btoa(g(e)).replace(/\+/g,"-").replace(/\//g,"_");return n?r:r.replace(/=*$/,"")}),e("shaka.util.Uint8ArrayUtils.fromBase64",w),e("shaka.util.Uint8ArrayUtils.fromHex",function(e){for(var i=new Uint8Array(e.length/2),n=0;ne)){t=Math.max(t,50);var i=8e3*e/t,n=t/1e3;this.a.sample(n,i),this.c.sample(n,i),this.dispatchEvent(q({type:"bandwidth"})),this.b=Date.now()}},Y.prototype.getBandwidth=function(){return.5>this.a.a?5e5:Math.min(K(this.a),K(this.c))},Y.prototype.getDataAge=function(){return(Date.now()-this.b)/1e3},Y.prototype.supportsCaching=function(){return!1};var es=0,is=1;et.prototype.start=function(){if(this.f)throw Error("Task already started!");this.f=!0,this.b.unshift(function(){}),nt(this,void 0)},et.prototype.end=function(){this.b.splice(1)},st.prototype.destroy=function(){ot(this),this.a=null},st.prototype.sa=function(t,e){for(var i=this.a.get(e)||[],n=0;n=this.a.status?(this.c.resolve(this.a),Ue(this)):this.h>>31;var h=2147483647&p,d=X(a);if(X(a),1==c){r=null;break t}var y=new Ve(n,i,e,e+h-1);s.push(new We(t/u,(t+d)/u,y)),t+=d,e+=h}r=s}}}}catch(b){if(!(b instanceof RangeError))throw b}return r},Ze.prototype.parse=function(t,e,i,n){var r=null;try{var s,a=new k(e);if(440786851!=P(a).id)s=null;else{var o=P(a);if(408125543!=o.id)s=null;else{var h,u=o.a.byteOffset,l=new k(o.a);for(e=null;J(l.a);){var c=P(l);if(357149030==c.id){e=c;break}}if(e){for(var f=new k(e.a),l=1e6;J(f.a);){var p=P(f);if(2807729==p.id){l=A(p);break}}h=l/1e9}else h=null;s=h?{Qb:u,Ub:h}:null}}if(s){var d=P(new k(t));if(475249515!=d.id)r=null;else{var y=s.Qb,b=s.Ub;t=[];var v=new k(d.a);for(s=d=-1;J(v.a);){var g=P(v);if(187==g.id){var m,w=new k(g.a),T=P(w);if(179!=T.id)m=null;else{var E=A(T),S=P(w);if(183!=S.id)m=null;else{for(var j=new k(S.a),u=0;J(j.a);){var _=P(j);if(241==_.id){u=A(_);break}}m={Wb:E,Pb:u}}}if(m){var M=b*m.Wb,I=y+m.Pb;if(0<=d){var N=new Ve(n,i,s,I-1);t.push(new We(d,M,N))}d=M,s=I}}}0<=d&&(N=new Ve(n,i,s,null),t.push(new We(d,null,N))),r=t}}else r=null}catch(R){if(!(R instanceof RangeError))throw R}return r},ti.prototype.destroy=function(){this.o=null},Yr=ti.prototype,Yr.length=function(){return this.o.length},Yr.A=function(){if(0==this.o.length)throw new RangeError("SegmentIndex: There is no last SegmentReference.");return this.o[this.o.length-1]},Yr.get=function(t){if(0>t||t>=this.o.length)throw new RangeError("SegmentIndex: The specified index is out of range.");return this.o[t]},Yr.la=function(t){return t=$e(this.o,t),0<=t?this.o[t]:null},Yr.Ha=function(t){return ii(this,t),!0},Yr.ka=function(t){var e=t-this.i;return 0==e?0:(this.o=Xe(this.o,e),this.i=t,e)},Yr.Ea=function(){return 0=(this.s?Math.max(this.B,this.L):this.B)?(bi(this),mi(this,1e3/(Math.abs(this.c.playbackRate)||1))):(e=yi(this,i,e))?(e=St(this.a,e,t.c,this.w),this.w=null,this.K&&(this.K=!1,vi(this,t)),this.j=!1,e.then(u(this,function(t){null==this.i&&(this.i=t),this.D&&0this.l&&(this.a.playbackRate=0,this.B(this.a.currentTime,Date.now(),this.l)),this.h&&Vi(this)},Yr.Cb=function(){Ut("playing");var t=Bt("playing");if(!isNaN(t)){var e=this.g;e.playTime+=t/1e3}Ki(this)},Yr.Fb=function(t){this.D=t.start},Yr.qb=function(){if(!this.a.paused){Ut("playing");var t=Bt("playing");if(!isNaN(t)){var e=this.g;e.playTime+=t/1e3,Lt("playing")}}return t=this.g,e=this.a,e.getVideoPlaybackQuality&&(e=e.getVideoPlaybackQuality(),t.decodedFrames=e.totalVideoFrames,t.droppedFrames=e.droppedVideoFrames),this.g},Li.prototype.getStats=Li.prototype.qb,Li.prototype.da=function(){return this.b?this.b.ma():[]},Li.prototype.getVideoTracks=Li.prototype.da,Li.prototype.Y=function(){return this.b?this.b.pa():[]},Li.prototype.getAudioTracks=Li.prototype.Y,Li.prototype.$=function(){return this.b?this.b.Oa():[]},Li.prototype.getTextTracks=Li.prototype.$,Li.prototype.selectVideoTrack=function(t,e){return!!this.b&&this.b.selectVideoTrack(t,void 0==e||e)},Li.prototype.selectVideoTrack=Li.prototype.selectVideoTrack,Li.prototype.M=function(t,e,i){return!!this.b&&this.b.nb(t,void 0==e||e,i)},Li.prototype.selectAudioTrack=Li.prototype.M,Li.prototype.fa=function(t){return!!this.b&&this.b.ob(t,!1)},Li.prototype.selectTextTrack=Li.prototype.fa,Li.prototype.V=function(t){this.b&&this.b.Na(t)},Li.prototype.enableTextTrack=Li.prototype.V,Li.prototype.T=function(t){Ki(this),0<=t?this.a.playbackRate=t:this.a.paused||(this.a.playbackRate=0,this.B(this.a.currentTime,Date.now(),t)),this.l=t},Li.prototype.setPlaybackRate=Li.prototype.T,Li.prototype.K=function(){return this.l},Li.prototype.getPlaybackRate=Li.prototype.K,Li.prototype.R=function(t){this.F=t},Li.prototype.setPlaybackStartTime=Li.prototype.R,Li.prototype.G=function(){return!!this.b&&this.b.mb()},Li.prototype.isLive=Li.prototype.G,Li.prototype.U=function(t){if(t){var e=c(t,"enableAdaptation");null!=e&&(this.c.enableAdaptation=e),e=f(t,"streamBufferSize"),null!=e&&(this.c.streamBufferSize=e),e=f(t,"liveStreamEndTimeout"),null!=e&&(this.c.liveStreamEndTimeout=e),e=f(t,"licenseRequestTimeout"),null!=e&&(this.c.licenseRequestTimeout=e),e=f(t,"mpdRequestTimeout"),null!=e&&(this.c.mpdRequestTimeout=e),e=f(t,"segmentRequestTimeout"),null!=e&&(this.c.segmentRequestTimeout=e),e=p(t,"preferredLanguage"),null!=e&&(this.c.preferredLanguage=e),e=y(t,"restrictions",r),null!=e&&(this.c.restrictions=e.clone()),t=c(t,"disableCacheBustingEvenThoughItMayAffectBandwidthEstimation"),null!=t&&(Ts=!t),this.b&&this.b.T(this.c)}},Li.prototype.configure=Li.prototype.U,Li.prototype.Z=function(){return this.c},Li.prototype.getConfiguration=Li.prototype.Z,Li.prototype.B=function(e,i,n){this.j=null;var r=(Date.now()-i)/1e3*n;this.a.currentTime=i||this.a.currentTime>=i;this.h?(i=this.b.$a(),(e||t>i)&&(Vi(this),this.a.play())):!this.a.paused&&!e&&.5>t&&(this.h=!0,this.a.pause(),this.g.bufferingHistory.push(R()/1e3),Lt("buffering"),this.dispatchEvent(q({type:"bufferingStart"})))}};var Ps={2:"A network failure occured while loading media content.",3:"The browser failed to decode the media content.",4:"The browser does not support the media content."};Yi.prototype.destroy=function(){this.a.destroy(),this.a=null},Yi.prototype.update=function(t){var e=Wi(t),i=Wi(this.a);return Promise.all([e,i]).then(u(this,function(e){var i=e[0];e=e[1];var n=this.a.a;return Hi(n),zi(n),t.f=this.a.f,t.g=this.a.g?this.a.g.clone():null,t.c=this.a.c,n=[],Ji(t,this.a,i,e,n),i=t.a,Hi(i),zi(i),Promise.resolve(n)}))},e("shaka.media.SimpleAbrManager",Zi),Zi.prototype.destroy=function(){this.f.destroy(),this.a=this.b=this.f=null},Zi.prototype.initialize=function(t,e){this.b||this.a||(this.b=t,this.a=e)},Zi.prototype.start=function(){this.b&&this.a&&!this.g&&(this.c=Date.now()+4e3,at(this.f,this.b,"bandwidth",this.v.bind(this)),at(this.f,this.a,"adaptation",this.j.bind(this)),at(this.f,this.a,"trackschanged",this.h.bind(this)),this.g=!0)},Zi.prototype.enable=function(t){this.i=t},Zi.prototype.getInitialVideoTrackId=function(){if(!this.b||!this.a)return null;var t=tn(this);return t?t.id:null},Zi.prototype.selectVideoTrack=function(t,e,i){this.g&&this.a.selectVideoTrack(t.id,e,i)},Zi.prototype.v=function(){Date.now()=this.D-.01&&t<=this.D+.01)return void(this.D=null);this.D=null}var e=wn(this,mn(this));if(e){var i=e.end;if((e=gn(this,t,e.start,i))||(t<=i+.01?e=!1:(this.f.currentTime=i,e=!0)),!e)for(var n in this.c)this.c[n].jb()}},Yr.Hb=function(){if(!this.a.b){for(var t in this.c)if(!this.c[t].Ga())return;this.Za()}},Yr.vb=function(){l(this.c).every(function(t){return t.Ga()})&&(this.w=t.setTimeout(this.Za.bind(this),1e3*this.Ua))},Yr.ub=function(){null!=this.w&&(t.clearTimeout(this.w),this.w=null)},Yr.Sb=function(){var t=this.U,e=this.Z.getBandwidth();t.estimatedBandwidth=e,t.bandwidthHistory.push(new Pi(e))},Yr.Za=function(){this.w=null,this.g.endOfStream()},i(kn,ut),kn.prototype.g=function(t,e,i){var n=new h;t={stream_id:i.qa,mime_type:t.a,codecs:t.b,init_segment:e,references:i.o};var r=dt(this).put(t);return r.onsuccess=function(){n.resolve(i.qa)},r.onerror=function(){n.reject(r.error)},n},kn.prototype.f=function(t,e){for(var i=Promise.resolve(),n=0;nr.indexOf(t.a.split("/")[0]))}),t=h.map(function(t){return t.H.create()}),Promise.all(t)})).then(u(this,function(t){for(var e=h,i=[],n=0;n