Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shaka-player

Package Overview
Dependencies
Maintainers
1
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shaka-player - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

spec/fake_event_spec.js

24

CHANGELOG.md

@@ -0,1 +1,25 @@

## 1.2.3 (2015-04-07)
A roll-up of recent bugfixes.
Bugfixes:
- Fixed consistency of setPlaybackRate(0).
- Fixed support for mp4a.40.5 audio content.
- Improved rewind accuracy.
- Fixed decode of query parameters in content URLs.
- https://github.com/google/shaka-player/pull/40
- Fixed FakeEventTarget for Chrome 43+.
- Removed flaky assertion in EME polyfill.
- Made AbrManager less aggressive.
- Fixed EME spec compatibility and encrypted playback in Chrome 43+.
- https://github.com/google/shaka-player/issues/45
Features:
- Added support for module.exports.
- https://github.com/google/shaka-player/pull/35
Test app features:
- Added a new 4k test asset.
## 1.2.2 (2015-03-11)

@@ -2,0 +26,0 @@

10

externs/mediakeys.js

@@ -31,7 +31,7 @@ /**

/** @typedef {{
* initDataTypes: Array.<string>,
* audioCapabilities: Array.<!MediaKeySystemMediaCapability>,
* videoCapabilities: Array.<!MediaKeySystemMediaCapability>,
* distinctiveIdentifier: string,
* persistentState: string
* initDataTypes: (Array.<string>|undefined),
* audioCapabilities: (Array.<!MediaKeySystemMediaCapability>|undefined),
* videoCapabilities: (Array.<!MediaKeySystemMediaCapability>|undefined),
* distinctiveIdentifier: (string|undefined),
* persistentState: (string|undefined)
* }} */

@@ -38,0 +38,0 @@ var MediaKeySystemConfiguration;

@@ -66,2 +66,4 @@ /**

this.onBandwidth_.bind(this));
this.eventManager_.listen(this.videoSource_, 'adaptation',
this.onAdaptation_.bind(this));
};

@@ -88,3 +90,3 @@

*/
shaka.media.AbrManager.MIN_SWITCH_INTERVAL_ = 8.0;
shaka.media.AbrManager.MIN_SWITCH_INTERVAL_ = 30.0;

@@ -210,3 +212,4 @@

this.nextAdaptationTime_ = now + AbrManager.MIN_SWITCH_INTERVAL_;
// Can't adapt again until we get confirmation of this one.
this.nextAdaptationTime_ = Number.POSITIVE_INFINITY;
};

@@ -216,2 +219,20 @@

/**
* Handles adaptation events.
*
* @param {!Event} event
* @private
*/
shaka.media.AbrManager.prototype.onAdaptation_ = function(event) {
// This check allows us to ignore the initial adaptation events, which would
// otherwise cause us not to honor FIRST_SWITCH_INTERVAL_.
if (this.nextAdaptationTime_ == Number.POSITIVE_INFINITY) {
// Adaptation is complete, so schedule the next adaptation.
var now = Date.now() / 1000.0;
this.nextAdaptationTime_ =
now + shaka.media.AbrManager.MIN_SWITCH_INTERVAL_;
}
};
/**
* Choose a video track based on current bandwidth conditions.

@@ -218,0 +239,0 @@ *

@@ -374,4 +374,2 @@ /**

this.fireAdaptationEvent_(streamInfo);
// Stop updating and abort |sbm_|'s current operation. This will reject

@@ -409,2 +407,3 @@ // |sbm_|'s current promise.

shaka.timer.end('switch logic');
this.fireAdaptationEvent_(streamInfo);
this.switchStreamOrUpdate_();

@@ -411,0 +410,0 @@ })

@@ -132,3 +132,3 @@ /**

*/
goog.define('GIT_VERSION', 'v1.2.2-debug');
goog.define('GIT_VERSION', 'v1.2.3-debug');

@@ -168,3 +168,3 @@

!!document.exitFullscreen &&
document.hasOwnProperty('fullscreenElement') &&
'fullscreenElement' in document &&
// Node.children is used by mpd_parser.js, and body is a Node instance.

@@ -185,9 +185,2 @@ !!document.body.children;

// TODO(story 1922598): Although Chrome reports support for mp4a.40.5, it
// fails to decode some such content. These are low-quality streams anyway,
// so disable support for them until a solution can be found.
if (fullMimeType.indexOf('mp4a.40.5') >= 0) {
return false;
}
if (fullMimeType == 'text/vtt') {

@@ -432,5 +425,5 @@ supported = !!window.VTTCue;

mksc = mediaKeySystemConfigs[keySystem] = {
audioCapabilities: [],
videoCapabilities: [],
initDataTypes: [],
audioCapabilities: undefined,
videoCapabilities: undefined,
initDataTypes: undefined,
distinctiveIdentifier: 'optional',

@@ -447,5 +440,8 @@ persistentState: 'optional'

var capName = cfg.contentType + 'Capabilities';
if (!mksc[capName]) continue; // not a capability we can check for!
if (!(capName in mksc)) continue; // not a capability we can check for!
anythingSpecified = true;
if (!mksc[capName]) {
mksc[capName] = [];
}
mksc[capName].push({ contentType: cfg.fullMimeType });

@@ -511,4 +507,5 @@ }

var capName = contentType + 'Capabilities';
var caps = mksc[capName][0];
if (!caps) continue; // type not found!
var caps = mksc[capName];
if (!caps || !caps.length) continue; // type not found!
caps = caps[0];

@@ -1137,3 +1134,3 @@ // Find which StreamConfigs match the selected MediaKeySystemConfiguration.

* Positive values greater than 1.0 will trigger fast-forward.
* 0.0 is invalid and will be ignored.
* 0.0 is similar to pausing the video.
* Some UAs will not play audio at rates less than 0.25 or 0.5 or greater

@@ -1145,17 +1142,13 @@ * than 4.0 or 5.0, but this behavior is not specified.

shaka.player.Player.prototype.setPlaybackRate = function(rate) {
shaka.asserts.assert(rate != 0);
if (rate == 0) {
return;
}
// Cancel any rewind we might be in the middle of.
this.cancelRewindTimer_();
if (rate > 0) {
if (rate >= 0) {
// Slow-mo or fast-forward are handled natively by the UA.
this.video_.playbackRate = rate;
} else {
// Rewind is not supported by any UA to date (2014), so we fake it.
// Rewind is not supported by any UA to date (2015), so we fake it.
// http://crbug.com/33099
this.video_.playbackRate = 0;
this.onRewindTimer_(rate);
this.onRewindTimer_(this.video_.currentTime, Date.now(), rate);
}

@@ -1191,11 +1184,16 @@ };

* Called on a recurring timer to simulate rewind.
* @param {number} startVideoTime
* @param {number} startWallTime
* @param {number} rate
* @private
*/
shaka.player.Player.prototype.onRewindTimer_ = function(rate) {
shaka.player.Player.prototype.onRewindTimer_ =
function(startVideoTime, startWallTime, rate) {
shaka.asserts.assert(rate < 0);
// For a rate of -1.0, we move the playhead back by 0.1s every 0.1s (100ms).
this.video_.currentTime += 0.1 * rate;
this.rewindTimer_ =
window.setTimeout(this.onRewindTimer_.bind(this, rate), 100);
var offset = ((Date.now() - startWallTime) / 1000) * rate;
this.video_.currentTime = startVideoTime + offset;
var callback = this.onRewindTimer_.bind(
this, startVideoTime, startWallTime, rate);
this.rewindTimer_ = window.setTimeout(callback, 100);
};

@@ -1202,0 +1200,0 @@

@@ -40,5 +40,6 @@ /**

nop.requestMediaKeySystemAccess;
// Work around read-only declarations for these properties by using strings:
// Delete mediaKeys to work around strict mode compatibility issues.
delete HTMLMediaElement.prototype['mediaKeys'];
// Work around read-only declaration for mediaKeys by using a string.
HTMLMediaElement.prototype['mediaKeys'] = null;
HTMLMediaElement.prototype['waitingFor'] = '';
HTMLMediaElement.prototype.setMediaKeys = nop.setMediaKeys;

@@ -45,0 +46,0 @@ // These are not usable, but allow Player.isBrowserSupported to pass.

@@ -47,5 +47,6 @@ /**

v01b.requestMediaKeySystemAccess;
// Work around read-only declarations for these properties by using strings:
// Delete mediaKeys to work around strict mode compatibility issues.
delete HTMLMediaElement.prototype['mediaKeys'];
// Work around read-only declaration for mediaKeys by using a string.
HTMLMediaElement.prototype['mediaKeys'] = null;
HTMLMediaElement.prototype['waitingFor'] = '';
HTMLMediaElement.prototype.setMediaKeys = v01b.setMediaKeys;

@@ -386,3 +387,2 @@ window.MediaKeys = v01b.MediaKeys;

var session = this.findSession_(event.sessionId);
shaka.asserts.assert(session);
if (!session) {

@@ -389,0 +389,0 @@ shaka.log.error('Session not found', event.sessionId);

@@ -108,13 +108,16 @@ /**

shaka.util.FakeEventTarget.prototype.dispatchEvent = function(event) {
// NOTE: These tricks will not work in strict mode.
// Because these are read-only properties, you must delete them first.
delete event.currentTarget;
// Overwrite the Event's properties. Assignment doesn't work in most
// browsers. Object.defineProperties seems to work, although some browsers
// need the original properties deleted first.
delete event.srcElement;
delete event.target;
delete event.currentTarget;
Object.defineProperties(event, {
'srcElement': { 'value': null, 'writable': true },
// target may be set many times if an event is re-dispatched.
'target': { 'value': this, 'writable': true },
// currentTarget will be set many times by recursiveDispatch_().
'currentTarget': { 'value': null, 'writable': true }
});
// event.currentTarget will be set by recursiveDispatch_().
event.srcElement = null; // Must be Element or null, so just use null.
event.target = this;
return this.recursiveDispatch_(event);

@@ -121,0 +124,0 @@ };

@@ -21,3 +21,5 @@ /**

goog.require('shaka.asserts');
/**

@@ -40,5 +42,11 @@ * @namespace shaka.util.FakeEvent

});
// NOTE: This trick will not work in strict mode.
// NOTE: In strict mode, we can't overwrite existing properties, so we only
// set properties on "event" which don't exist yet. If a property does exist
// on "event", we assert that it has the correct value already.
for (var key in dict) {
event[key] = dict[key];
if (key in event) {
shaka.asserts.assert(event[key] == dict[key]);
} else {
event[key] = dict[key];
}
}

@@ -45,0 +53,0 @@ return event;

{
"name": "shaka-player",
"description": "DASH/EME video player library",
"version": "1.2.2",
"version": "1.2.3",
"homepage": "https://github.com/google/shaka-player",

@@ -13,2 +13,3 @@ "author": "Google",

],
"main": "shaka-player.compiled.js",
"repository": {

@@ -15,0 +16,0 @@ "type": "git",

@@ -1,114 +0,115 @@

(function(){var h,aa=this;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=d[e]?d[e]:d[e]={}:d[e]=b}function q(a,b){function c(){}c.prototype=b.prototype;a.kd=b.prototype;a.prototype=new c;a.gd=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};function ba(){this.Y=ca++;this.id=null;this.timestampOffset=this.t=0;this.height=this.width=this.bandwidth=null;this.ea=this.l="";this.Ma=this.Ob=this.Ya=this.D=null;this.enabled=!0}var ca=0;function da(a){var b=a.l||"";a.ea&&(b+='; codecs="'+a.ea+'"');return b}function ea(){this.url=null;this.Pa=0;this.Ta=null}function fa(){this.Y=ga++;this.contentType="";this.j=[];this.Sa=[];this.lang="";this.Va=!1}var ga=0;
fa.prototype.Bb=function(){for(var a=[],b=0;b<this.Sa.length;++b){var c=new ha;c.id=this.Y;c.ha=this.Sa[b];c.contentType=this.contentType;c.la=this.j.length?da(this.j[0]):"";a.push(c)}return a};function ia(){this.duration=this.start=0;this.N=[]}ia.prototype.Bb=function(){for(var a=[],b=0;b<this.N.length;++b)a.push.apply(a,this.N[b].Bb());return a};function ja(){this.t=0;this.J=[]}function ha(){this.id=0;this.ha=null;this.la=this.contentType=""};function ka(a,b){this.id=a;this.lang=b||"unknown";this.enabled=this.active=!1}m("shaka.player.TextTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:0});function la(a,b,c,d){this.id=a;this.bandwidth=b||0;this.width=c||0;this.height=d||0;this.active=!1}function ma(a,b){var c=a.width*a.height,d=b.width*b.height;return c<d?-1:c>d?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0}m("shaka.player.VideoTrack.compare",ma);function na(a,b,c){this.id=a;this.bandwidth=b||0;this.lang=c||"unknown";this.active=!1}m("shaka.player.AudioTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0});function s(){var a,b,c=new Promise(function(c,e){a=c;b=e});c.resolve=a;c.reject=b;return c};function t(a,b){return b.bind(a)};function w(a){var b=new CustomEvent(a.type,{detail:a.detail,bubbles:!!a.bubbles}),c;for(c in a)b[c]=a[c];return b}function x(a){return new CustomEvent("error",{detail:a,bubbles:!0})};function oa(a,b){for(var c={},d=0;d<a.length;++d){var e=b?b(a[d]):a[d].toString();c[e]=a[d]}var d=[],f;for(f in c)d.push(c[f]);return d};function pa(a){return String.fromCharCode.apply(null,a)}m("shaka.util.Uint8ArrayUtils.toString",pa);function y(a){for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}m("shaka.util.Uint8ArrayUtils.fromString",y);m("shaka.util.Uint8ArrayUtils.toBase64",function(a,b){var c=void 0==b?!0:b,d=window.btoa(pa(a)).replace(/\+/g,"-").replace(/\//g,"_");return c?d:d.replace(/=*$/,"")});function qa(a){return y(window.atob(a.replace(/-/g,"+").replace(/_/g,"/")))}
m("shaka.util.Uint8ArrayUtils.fromBase64",qa);m("shaka.util.Uint8ArrayUtils.fromHex",function(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 ra(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}m("shaka.util.Uint8ArrayUtils.toHex",ra);function sa(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 z(a){this.h=a;this.xa=new ta(a,ua)}var va=[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])];z.prototype.ra=function(){return this.xa.ra()};
function A(a){var b;b=wa(a);if(7<b.length)throw new RangeError("EbmlParser: EBML ID must be at most 7 bytes.");for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=wa(a);a:{for(d=0;d<va.length;d++)if(sa(c,va[d])){d=!0;break a}d=!1}if(d)throw new RangeError("EbmlParser: Element cannot contain dynamically sized data.");if(8==c.length&&c[1]&224)throw new RangeError("EbmlParser: Variable sized integer value must be at most 53 bits.");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.xa.f+c<=a.h.byteLength?c:a.h.byteLength-a.xa.f;d=new DataView(a.h.buffer,a.h.byteOffset+a.xa.f,c);B(a.xa,c);return new xa(b,d)}function wa(a){var b=ya(a.xa),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new RangeError("EbmlParser: Variable sized integer must fit within 8 bytes.");var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=ya(a.xa);return d}function xa(a,b){this.id=a;this.h=b}
(function(){var h,aa=this;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=d[e]?d[e]:d[e]={}:d[e]=b}function q(a,b){function c(){}c.prototype=b.prototype;a.ld=b.prototype;a.prototype=new c;a.hd=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};function ba(){this.Y=ca++;this.id=null;this.timestampOffset=this.t=0;this.height=this.width=this.bandwidth=null;this.ea=this.l="";this.Ma=this.Ob=this.Za=this.D=null;this.enabled=!0}var ca=0;function da(a){var b=a.l||"";a.ea&&(b+='; codecs="'+a.ea+'"');return b}function ea(){this.url=null;this.Pa=0;this.Ta=null}function fa(){this.Y=ga++;this.contentType="";this.j=[];this.Sa=[];this.lang="";this.Va=!1}var ga=0;
fa.prototype.Cb=function(){for(var a=[],b=0;b<this.Sa.length;++b){var c=new ha;c.id=this.Y;c.ha=this.Sa[b];c.contentType=this.contentType;c.la=this.j.length?da(this.j[0]):"";a.push(c)}return a};function ia(){this.duration=this.start=0;this.N=[]}ia.prototype.Cb=function(){for(var a=[],b=0;b<this.N.length;++b)a.push.apply(a,this.N[b].Cb());return a};function ja(){this.t=0;this.J=[]}function ha(){this.id=0;this.ha=null;this.la=this.contentType=""};function ka(a,b){this.id=a;this.lang=b||"unknown";this.enabled=this.active=!1}m("shaka.player.TextTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:0});function la(a,b,c,d){this.id=a;this.bandwidth=b||0;this.width=c||0;this.height=d||0;this.active=!1}function ma(a,b){var c=a.width*a.height,d=b.width*b.height;return c<d?-1:c>d?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0}m("shaka.player.VideoTrack.compare",ma);function na(a,b,c){this.id=a;this.bandwidth=b||0;this.lang=c||"unknown";this.active=!1}m("shaka.player.AudioTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0});function s(){var a,b,c=new Promise(function(c,e){a=c;b=e});c.resolve=a;c.reject=b;return c};function t(a,b){return b.bind(a)};function oa(a,b){for(var c={},d=0;d<a.length;++d){var e=b?b(a[d]):a[d].toString();c[e]=a[d]}var d=[],f;for(f in c)d.push(c[f]);return d};function pa(a){return String.fromCharCode.apply(null,a)}m("shaka.util.Uint8ArrayUtils.toString",pa);function v(a){for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}m("shaka.util.Uint8ArrayUtils.fromString",v);m("shaka.util.Uint8ArrayUtils.toBase64",function(a,b){var c=void 0==b?!0:b,d=window.btoa(pa(a)).replace(/\+/g,"-").replace(/\//g,"_");return c?d:d.replace(/=*$/,"")});function qa(a){return v(window.atob(a.replace(/-/g,"+").replace(/_/g,"/")))}
m("shaka.util.Uint8ArrayUtils.fromBase64",qa);m("shaka.util.Uint8ArrayUtils.fromHex",function(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 ra(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}m("shaka.util.Uint8ArrayUtils.toHex",ra);function sa(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 x(a){this.h=a;this.xa=new ta(a,ua)}var va=[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])];x.prototype.ra=function(){return this.xa.ra()};
function y(a){var b;b=wa(a);if(7<b.length)throw new RangeError("EbmlParser: EBML ID must be at most 7 bytes.");for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=wa(a);a:{for(d=0;d<va.length;d++)if(sa(c,va[d])){d=!0;break a}d=!1}if(d)throw new RangeError("EbmlParser: Element cannot contain dynamically sized data.");if(8==c.length&&c[1]&224)throw new RangeError("EbmlParser: Variable sized integer value must be at most 53 bits.");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.xa.f+c<=a.h.byteLength?c:a.h.byteLength-a.xa.f;d=new DataView(a.h.buffer,a.h.byteOffset+a.xa.f,c);z(a.xa,c);return new xa(b,d)}function wa(a){var b=ya(a.xa),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new RangeError("EbmlParser: Variable sized integer must fit within 8 bytes.");var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=ya(a.xa);return d}function xa(a,b){this.id=a;this.h=b}
function za(a){if(8<a.h.byteLength)throw new RangeError("EbmlElement: Unsigned integer has too many bytes.");if(8==a.h.byteLength&&a.h.getUint8(0)&224)throw new RangeError("EbmlParser: Unsigned integer must be at most 53 bits.");for(var b=0,c=0;c<a.h.byteLength;c++)var d=a.h.getUint8(c),b=256*b+d;return b};function Aa(){this.V={}}h=Aa.prototype;h.push=function(a,b){this.V.hasOwnProperty(a)?this.V[a].push(b):this.V[a]=[b]};h.set=function(a,b){this.V[a]=b};h.has=function(a){return this.V.hasOwnProperty(a)};h.get=function(a){return(a=this.V[a])?a.slice():null};h.remove=function(a,b){var c=this.V[a];if(c)for(var d=0;d<c.length;++d)c[d]==b&&(c.splice(d,1),--d)};h.keys=function(){var a=[],b;for(b in this.V)a.push(b);return a};h.clear=function(){this.V={}};function Ba(){this.streamStats=null;this.droppedFrames=this.decodedFrames=NaN;this.bufferingTime=this.playTime=this.estimatedBandwidth=0;this.playbackLatency=NaN;this.bufferingHistory=[];this.bandwidthHistory=[];this.streamHistory=[]}function Ea(a){a.playTime+=Fa("playing")/1E3}function Ga(a,b){var c=new Ha(b);a.streamHistory.push(new Ia(c));if(c.videoHeight||!a.streamStats)a.streamStats=c}
function Ha(a){this.videoWidth=a.width;this.videoHeight=a.height;this.videoMimeType=a.l;this.videoBandwidth=a.bandwidth}function Ia(a){this.timestamp=Date.now()/1E3;this.value=a};function D(a,b,c,d,e,f){this.keySystem=a;this.nc=b;this.$b=c;this.withCredentials=d;this.Ga=[];this.Zb=f;e&&this.Ga.push(e)}m("shaka.player.DrmSchemeInfo",D);function Ja(){this.maxWidth=this.maxHeight=null}function Ka(){return new D("",!1,"",!1,null,null)}D.createUnencrypted=Ka;function La(a,b){var c=new D(a.keySystem,a.nc,a.$b,a.withCredentials,null,a.Zb);c.Ga=oa(a.Ga.concat(b.Ga),function(a){return Array.prototype.join.apply(a.initData)});return c}D.combine=La;D.prototype.key=function(){return JSON.stringify(this)};function Ma(a){this.Ub=Math.exp(Math.log(.5)/a);this.xb=this.zb=0}Ma.prototype.sb=function(a,b){var c=Math.pow(this.Ub,a);this.zb=b*(1-c)+c*this.zb;this.xb+=a};function Na(a){return a.zb/(1-Math.pow(a.Ub,a.xb))};function Oa(a,b,c){Pa(b);Pa(c);return c==b||a>=Qa&&c==b.split("-")[0]||a>=Ra&&c.split("-")[0]==b.split("-")[0]?!0:!1}var Qa=1,Ra=2;function Pa(a){a=a.toLowerCase().split("-");var b=Sa[a[0]];b&&(a[0]=b);return a.join("-")}
var Sa={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",
function Ha(a){this.videoWidth=a.width;this.videoHeight=a.height;this.videoMimeType=a.l;this.videoBandwidth=a.bandwidth}function Ia(a){this.timestamp=Date.now()/1E3;this.value=a};function A(a,b,c,d,e,f){this.keySystem=a;this.nc=b;this.$b=c;this.withCredentials=d;this.Ga=[];this.Zb=f;e&&this.Ga.push(e)}m("shaka.player.DrmSchemeInfo",A);function Ja(){this.maxWidth=this.maxHeight=null}function Ka(){return new A("",!1,"",!1,null,null)}A.createUnencrypted=Ka;function La(a,b){var c=new A(a.keySystem,a.nc,a.$b,a.withCredentials,null,a.Zb);c.Ga=oa(a.Ga.concat(b.Ga),function(a){return Array.prototype.join.apply(a.initData)});return c}A.combine=La;A.prototype.key=function(){return JSON.stringify(this)};function Ma(a){this.Ub=Math.exp(Math.log(.5)/a);this.yb=this.Ab=0}Ma.prototype.tb=function(a,b){var c=Math.pow(this.Ub,a);this.Ab=b*(1-c)+c*this.Ab;this.yb+=a};function Na(a){return a.Ab/(1-Math.pow(a.Ub,a.yb))};function B(a){var b=new CustomEvent(a.type,{detail:a.detail,bubbles:!!a.bubbles}),c;for(c in a)c in b||(b[c]=a[c]);return b}function D(a){return new CustomEvent("error",{detail:a,bubbles:!0})};function Oa(a,b,c){E(b);E(c);return c==b||a>=Pa&&c==b.split("-")[0]||a>=Qa&&c.split("-")[0]==b.split("-")[0]?!0:!1}var Pa=1,Qa=2;function E(a){a=a.toLowerCase().split("-");var b=Ra[a[0]];b&&(a[0]=b);return a.join("-")}
var Ra={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 E(a){this.Fb=new Aa;this.parent=a}E.prototype.addEventListener=function(a,b,c){c||this.Fb.push(a,b)};E.prototype.removeEventListener=function(a,b,c){c||this.Fb.remove(a,b)};E.prototype.dispatchEvent=function(a){delete a.currentTarget;delete a.srcElement;delete a.target;a.srcElement=null;a.target=this;return Ta(this,a)};
function Ta(a,b){b.currentTarget=a;for(var c=a.Fb.get(b.type)||[],d=0;d<c.length;++d){var e=c[d];e.handleEvent?e.handleEvent(b):e.call(a,b)}a.parent&&b.bubbles&&Ta(a.parent,b);return b.defaultPrevented};function Ua(){E.call(this,null);this.Ab=new Ma(3);this.lc=new Ma(10);this.Cc=50;this.uc=5E5;this.Dc=.5;this.Bc=65536}q(Ua,E);Ua.prototype.sb=function(a,b){if(!(b<this.Bc)){a=Math.max(a,this.Cc);var c=8E3*b/a,d=a/1E3;this.Ab.sb(d,c);this.lc.sb(d,c);this.dispatchEvent(w({type:"bandwidth"}))}};function Va(a){return a.Ab.xb<a.Dc?a.uc:Math.min(Na(a.Ab),Na(a.lc))};function ta(a,b){this.h=a;this.Gb=b==Wa;this.f=0}var ua=0,Wa=1;ta.prototype.ra=function(){return this.f<this.h.byteLength};function ya(a){var b=a.h.getUint8(a.f);a.f+=1;return b}function F(a){var b=a.h.getUint32(a.f,a.Gb);a.f+=4;return b}function Xa(a){var b,c;a.Gb?(b=a.h.getUint32(a.f,!0),c=a.h.getUint32(a.f+4,!0)):(c=a.h.getUint32(a.f,!1),b=a.h.getUint32(a.f+4,!1));if(2097151<c)throw new RangeError("DataViewReader: Overflow reading 64-bit value.");a.f+=8;return c*Math.pow(2,32)+b}
function Ya(a){if(a.f+16>a.h.byteLength)throw new RangeError("DataViewReader: Read past end of DataView.");var b=new Uint8Array(a.h.buffer,a.f,16);a.f+=16;return b}function B(a,b){if(a.f+b>a.h.byteLength)throw new RangeError("DataViewReader: Skip past end of DataView.");a.f+=b};function G(){this.Da=new Aa}G.prototype.u=function(){Za(this);this.Da=null};function H(a,b,c,d){b=new $a(b,c,d);a.Da.push(c,b)}G.prototype.$a=function(a,b){for(var c=this.Da.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.$a(),this.Da.remove(b,e))}};function Za(a){var b=a.Da,c=[],d;for(d in b.V)c.push.apply(c,b.V[d]);for(b=0;b<c.length;++b)c[b].$a();a.Da.clear()}function $a(a,b,c){this.target=a;this.type=b;this.ac=c;this.target.addEventListener(b,c,!1)}
$a.prototype.$a=function(){this.target&&(this.target.removeEventListener(this.type,this.ac,!1),this.ac=this.target=null)};function ab(a){this.systemIds=[];this.cencKeyIds=[];a=new ta(new DataView(a.buffer),ua);try{for(;a.ra();){var b=a.f,c=F(a),d=F(a);1==c?c=Xa(a):0==c&&(c=a.h.byteLength-b);if(1886614376!=d)B(a,c-(a.f-b));else{var e=ya(a);if(1<e)B(a,c-(a.f-b));else{B(a,3);var f=ra(Ya(a)),g=[];if(0<e)for(var k=F(a),l=0;l<k;++l){var p=ra(Ya(a));g.push(p)}var n=F(a);B(a,n);this.cencKeyIds.push.apply(this.cencKeyIds,g);this.systemIds.push(f);a.f!=b+c&&B(a,c-(a.f-b))}}}}catch(r){}};function I(a){bb[a]={gb:cb(),end:NaN}}function J(a){if(a=bb[a])a.end=cb()}function Fa(a){return(a=bb[a])&&a.end?a.end-a.gb:NaN}var cb=window.performance?window.performance.now.bind(window.performance):Date.now,bb={};m("shaka.polyfill.VideoPlaybackQuality.install",function(){var a=HTMLVideoElement.prototype;a.getVideoPlaybackQuality||(a.getVideoPlaybackQuality=function(){return"webkitDroppedFrameCount"in this?{corruptedVideoFrames:0,droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,creationTime:null,totalFrameDelay:null}:null})});m("shaka.polyfill.Fullscreen.install",function(){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;document.fullscreenElement||Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}})});function db(){return Promise.reject(Error("The key system specified is not supported."))}function eb(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function fb(){throw new TypeError("Illegal constructor.");}fb.prototype.createSession=function(){};function gb(){throw new TypeError("Illegal constructor.");}gb.prototype.getConfiguration=function(){};gb.prototype.createMediaKeys=function(){};function hb(a,b){try{var c=new ib(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function jb(a){var b=this.mediaKeys;b&&b!=a&&kb(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&kb(a,this);return Promise.resolve()}
function ib(a,b){this.Ia=this.keySystem=a;"org.w3.clearkey"==a&&(this.Ia="webkit-org.w3.clearkey");var c=!1,d;d=document.getElementsByTagName("video");d=d.length?d[0]:document.createElement("video");for(var e=0;e<b.length;++e){var f=b[e],g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes},k=!1;if(f.audioCapabilities)for(var l=0;l<f.audioCapabilities.length;++l){var p=f.audioCapabilities[l];p.contentType&&(k=!0,d.canPlayType(p.contentType.split(";")[0],
this.Ia)&&(g.audioCapabilities.push(p),c=!0))}if(f.videoCapabilities)for(l=0;l<f.videoCapabilities.length;++l)p=f.videoCapabilities[l],p.contentType&&(k=!0,d.canPlayType(p.contentType,this.Ia)&&(g.videoCapabilities.push(p),c=!0));k||(c=d.canPlayType("video/mp4",this.Ia)||d.canPlayType("video/webm",this.Ia));if(c){this.tc=g;return}}throw Error("The key system specified is not supported.");}ib.prototype.createMediaKeys=function(){var a=new lb(this.Ia);return Promise.resolve(a)};
ib.prototype.getConfiguration=function(){return this.tc};function lb(a){this.Ja=a;this.ua=null;this.b=new G;this.cc=[];this.jc={}}function kb(a,b){a.ua=b;Za(a.b);b&&(H(a.b,b,"webkitneedkey",a.Tc.bind(a)),H(a.b,b,"webkitkeymessage",a.Sc.bind(a)),H(a.b,b,"webkitkeyadded",a.Qc.bind(a)),H(a.b,b,"webkitkeyerror",a.Rc.bind(a)))}h=lb.prototype;
h.createSession=function(a){var b=a||"temporary";if("temporary"!=b&&"persistent"!=b)throw new TypeError("Session type "+a+" is unsupported on this platform.");a=new mb(this.ua,this.Ja,b);this.cc.push(a);return a};h.Tc=function(a){a=w({type:"encrypted",initDataType:"webm",initData:a.initData});this.ua.dispatchEvent(a)};
h.Sc=function(a){var b=nb(this,a.sessionId);b&&(a=w({type:"message",messageType:isNaN(b.expiration)?"licenserequest":"licenserenewal",message:a.message}),b.U&&(b.U.resolve(),b.U=null),b.dispatchEvent(a))};h.Qc=function(a){(a=nb(this,a.sessionId))&&a.ready()};h.Rc=function(a){var b=nb(this,a.sessionId);b&&b.handleError(a)};function nb(a,b){var c=a.jc[b];return c?c:(c=a.cc.shift())?(c.sessionId=b,a.jc[b]=c):null}
function mb(a,b,c){E.call(this,null);this.ua=a;this.O=this.U=null;this.Ja=b;this.Aa=c;this.sessionId="";this.expiration=NaN;this.closed=new s;this.keyStatuses=new ob}q(mb,E);h=mb.prototype;h.ready=function(){this.expiration=Number.POSITIVE_INFINITY;pb(this,"usable");this.O&&this.O.resolve();this.O=null};
h.handleError=function(a){var b=Error("EME v0.1b key error");b.errorCode=a.errorCode;b.errorCode.systemCode=a.systemCode;!a.sessionId&&this.U?(b.method="generateRequest",this.U.reject(b),this.U=null):a.sessionId&&this.O?(b.method="update",this.O.reject(b),this.O=null):(b=a.systemCode,a.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?pb(this,"output-not-allowed"):1==b?pb(this,"expired"):pb(this,"internal-error"))};
h.jb=function(a,b,c){if(this.U)this.U.then(this.jb.bind(this,a,b,c)).catch(this.jb.bind(this,a,b,c));else{this.U=a;try{var d;if("persistent"==this.Aa)if(c)d=y("LOAD_SESSION|"+c);else{var e=new Uint8Array(b);d=y("PERSISTENT|"+pa(e))}else d=new Uint8Array(b);this.ua.webkitGenerateKeyRequest(this.Ja,d)}catch(f){this.U.reject(f),this.U=null}}};
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 F(a){this.Gb=new Aa;this.parent=a}F.prototype.addEventListener=function(a,b,c){c||this.Gb.push(a,b)};F.prototype.removeEventListener=function(a,b,c){c||this.Gb.remove(a,b)};F.prototype.dispatchEvent=function(a){delete a.srcElement;delete a.target;delete a.currentTarget;Object.defineProperties(a,{srcElement:{value:null,writable:!0},target:{value:this,writable:!0},currentTarget:{value:null,writable:!0}});return Sa(this,a)};
function Sa(a,b){b.currentTarget=a;for(var c=a.Gb.get(b.type)||[],d=0;d<c.length;++d){var e=c[d];e.handleEvent?e.handleEvent(b):e.call(a,b)}a.parent&&b.bubbles&&Sa(a.parent,b);return b.defaultPrevented};function Ta(){F.call(this,null);this.Bb=new Ma(3);this.lc=new Ma(10);this.Cc=50;this.uc=5E5;this.Dc=.5;this.Bc=65536}q(Ta,F);Ta.prototype.tb=function(a,b){if(!(b<this.Bc)){a=Math.max(a,this.Cc);var c=8E3*b/a,d=a/1E3;this.Bb.tb(d,c);this.lc.tb(d,c);this.dispatchEvent(B({type:"bandwidth"}))}};function Ua(a){return a.Bb.yb<a.Dc?a.uc:Math.min(Na(a.Bb),Na(a.lc))};function ta(a,b){this.h=a;this.Hb=b==Va;this.f=0}var ua=0,Va=1;ta.prototype.ra=function(){return this.f<this.h.byteLength};function ya(a){var b=a.h.getUint8(a.f);a.f+=1;return b}function G(a){var b=a.h.getUint32(a.f,a.Hb);a.f+=4;return b}function Wa(a){var b,c;a.Hb?(b=a.h.getUint32(a.f,!0),c=a.h.getUint32(a.f+4,!0)):(c=a.h.getUint32(a.f,!1),b=a.h.getUint32(a.f+4,!1));if(2097151<c)throw new RangeError("DataViewReader: Overflow reading 64-bit value.");a.f+=8;return c*Math.pow(2,32)+b}
function Xa(a){if(a.f+16>a.h.byteLength)throw new RangeError("DataViewReader: Read past end of DataView.");var b=new Uint8Array(a.h.buffer,a.f,16);a.f+=16;return b}function z(a,b){if(a.f+b>a.h.byteLength)throw new RangeError("DataViewReader: Skip past end of DataView.");a.f+=b};function H(){this.Da=new Aa}H.prototype.u=function(){Ya(this);this.Da=null};function I(a,b,c,d){b=new Za(b,c,d);a.Da.push(c,b)}H.prototype.ab=function(a,b){for(var c=this.Da.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.ab(),this.Da.remove(b,e))}};function Ya(a){var b=a.Da,c=[],d;for(d in b.V)c.push.apply(c,b.V[d]);for(b=0;b<c.length;++b)c[b].ab();a.Da.clear()}function Za(a,b,c){this.target=a;this.type=b;this.ac=c;this.target.addEventListener(b,c,!1)}
Za.prototype.ab=function(){this.target&&(this.target.removeEventListener(this.type,this.ac,!1),this.ac=this.target=null)};function $a(a){this.systemIds=[];this.cencKeyIds=[];a=new ta(new DataView(a.buffer),ua);try{for(;a.ra();){var b=a.f,c=G(a),d=G(a);1==c?c=Wa(a):0==c&&(c=a.h.byteLength-b);if(1886614376!=d)z(a,c-(a.f-b));else{var e=ya(a);if(1<e)z(a,c-(a.f-b));else{z(a,3);var f=ra(Xa(a)),g=[];if(0<e)for(var k=G(a),l=0;l<k;++l){var p=ra(Xa(a));g.push(p)}var n=G(a);z(a,n);this.cencKeyIds.push.apply(this.cencKeyIds,g);this.systemIds.push(f);a.f!=b+c&&z(a,c-(a.f-b))}}}}catch(r){}};function J(a){ab[a]={hb:bb(),end:NaN}}function K(a){if(a=ab[a])a.end=bb()}function Fa(a){return(a=ab[a])&&a.end?a.end-a.hb:NaN}var bb=window.performance?window.performance.now.bind(window.performance):Date.now,ab={};m("shaka.polyfill.VideoPlaybackQuality.install",function(){var a=HTMLVideoElement.prototype;a.getVideoPlaybackQuality||(a.getVideoPlaybackQuality=function(){return"webkitDroppedFrameCount"in this?{corruptedVideoFrames:0,droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,creationTime:null,totalFrameDelay:null}:null})});m("shaka.polyfill.Fullscreen.install",function(){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;document.fullscreenElement||Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}})});function cb(){return Promise.reject(Error("The key system specified is not supported."))}function db(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function eb(){throw new TypeError("Illegal constructor.");}eb.prototype.createSession=function(){};function fb(){throw new TypeError("Illegal constructor.");}fb.prototype.getConfiguration=function(){};fb.prototype.createMediaKeys=function(){};function gb(a,b){try{var c=new hb(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function ib(a){var b=this.mediaKeys;b&&b!=a&&jb(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&jb(a,this);return Promise.resolve()}
function hb(a,b){this.Ia=this.keySystem=a;"org.w3.clearkey"==a&&(this.Ia="webkit-org.w3.clearkey");var c=!1,d;d=document.getElementsByTagName("video");d=d.length?d[0]:document.createElement("video");for(var e=0;e<b.length;++e){var f=b[e],g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes},k=!1;if(f.audioCapabilities)for(var l=0;l<f.audioCapabilities.length;++l){var p=f.audioCapabilities[l];p.contentType&&(k=!0,d.canPlayType(p.contentType.split(";")[0],
this.Ia)&&(g.audioCapabilities.push(p),c=!0))}if(f.videoCapabilities)for(l=0;l<f.videoCapabilities.length;++l)p=f.videoCapabilities[l],p.contentType&&(k=!0,d.canPlayType(p.contentType,this.Ia)&&(g.videoCapabilities.push(p),c=!0));k||(c=d.canPlayType("video/mp4",this.Ia)||d.canPlayType("video/webm",this.Ia));if(c){this.tc=g;return}}throw Error("The key system specified is not supported.");}hb.prototype.createMediaKeys=function(){var a=new kb(this.Ia);return Promise.resolve(a)};
hb.prototype.getConfiguration=function(){return this.tc};function kb(a){this.Ja=a;this.ua=null;this.b=new H;this.cc=[];this.jc={}}function jb(a,b){a.ua=b;Ya(a.b);b&&(I(a.b,b,"webkitneedkey",a.Uc.bind(a)),I(a.b,b,"webkitkeymessage",a.Tc.bind(a)),I(a.b,b,"webkitkeyadded",a.Rc.bind(a)),I(a.b,b,"webkitkeyerror",a.Sc.bind(a)))}h=kb.prototype;
h.createSession=function(a){var b=a||"temporary";if("temporary"!=b&&"persistent"!=b)throw new TypeError("Session type "+a+" is unsupported on this platform.");a=new lb(this.ua,this.Ja,b);this.cc.push(a);return a};h.Uc=function(a){a=B({type:"encrypted",initDataType:"webm",initData:a.initData});this.ua.dispatchEvent(a)};
h.Tc=function(a){var b=mb(this,a.sessionId);b&&(a=B({type:"message",messageType:isNaN(b.expiration)?"licenserequest":"licenserenewal",message:a.message}),b.U&&(b.U.resolve(),b.U=null),b.dispatchEvent(a))};h.Rc=function(a){(a=mb(this,a.sessionId))&&a.ready()};h.Sc=function(a){var b=mb(this,a.sessionId);b&&b.handleError(a)};function mb(a,b){var c=a.jc[b];return c?c:(c=a.cc.shift())?(c.sessionId=b,a.jc[b]=c):null}
function lb(a,b,c){F.call(this,null);this.ua=a;this.O=this.U=null;this.Ja=b;this.Aa=c;this.sessionId="";this.expiration=NaN;this.closed=new s;this.keyStatuses=new nb}q(lb,F);h=lb.prototype;h.ready=function(){this.expiration=Number.POSITIVE_INFINITY;ob(this,"usable");this.O&&this.O.resolve();this.O=null};
h.handleError=function(a){var b=Error("EME v0.1b key error");b.errorCode=a.errorCode;b.errorCode.systemCode=a.systemCode;!a.sessionId&&this.U?(b.method="generateRequest",this.U.reject(b),this.U=null):a.sessionId&&this.O?(b.method="update",this.O.reject(b),this.O=null):(b=a.systemCode,a.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?ob(this,"output-not-allowed"):1==b?ob(this,"expired"):ob(this,"internal-error"))};
h.kb=function(a,b,c){if(this.U)this.U.then(this.kb.bind(this,a,b,c)).catch(this.kb.bind(this,a,b,c));else{this.U=a;try{var d;if("persistent"==this.Aa)if(c)d=v("LOAD_SESSION|"+c);else{var e=new Uint8Array(b);d=v("PERSISTENT|"+pa(e))}else d=new Uint8Array(b);this.ua.webkitGenerateKeyRequest(this.Ja,d)}catch(f){this.U.reject(f),this.U=null}}};
h.Tb=function(a,b){if(this.O)this.O.then(this.Tb.bind(this,a,b)).catch(this.Tb.bind(this,a,b));else{this.O=a;var c,d;if("webkit-org.w3.clearkey"==this.Ja){c=pa(new Uint8Array(b));d=JSON.parse(c);c=d.keys[0].kty;if("A128KW"!=d.keys[0].alg||"oct"!=c)this.O.reject(Error("Response is not a valid JSON Web Key Set.")),this.O=null;c=qa(d.keys[0].k);d=qa(d.keys[0].kid)}else c=new Uint8Array(b),d=null;try{this.ua.webkitAddKey(this.Ja,c,d,this.sessionId)}catch(e){this.O.reject(e),this.O=null}}};
function pb(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.Qa=b;c=w({type:"keystatuseschange"});a.dispatchEvent(c)}h.generateRequest=function(a,b){var c=new s;this.jb(c,b,null);return c};h.load=function(a){if("persistent"==this.Aa){var b=new s;this.jb(b,null,a);return b}return Promise.reject(Error('The session type is not "persistent".'))};h.update=function(a){var b=new s;this.Tb(b,a);return b};
h.close=function(){if("persistent"!=this.Aa){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;this.ua.webkitCancelKeyRequest(this.Ja,this.sessionId)}this.closed.resolve();return this.closed};h.remove=function(){return"persistent"!=this.Aa?Promise.reject(Error("Not a persistent session.")):this.close()};function qb(a){this.qc=a;this.Yb=0}qb.prototype.next=function(){return this.Yb>=this.qc.length?{value:void 0,done:!0}:{value:this.qc[this.Yb++],done:!1}};
function ob(){this.size=0;this.Qa=void 0}var rb=y("FAKE_KEY_ID");ob.prototype.get=function(a){if(this.has(a))return this.Qa};ob.prototype.has=function(a){return this.Qa&&sa(new Uint8Array(a),rb)?!0:!1};ob.prototype.keys=function(){var a=[];this.Qa&&a.push(rb);return new qb(a)};ob.prototype.values=function(){var a=[];this.Qa&&a.push(this.Qa);return new qb(a)};m("shaka.polyfill.MediaKeys.install",function(){Navigator.prototype.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?(Navigator.prototype.requestMediaKeySystemAccess=hb,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.waitingFor="",HTMLMediaElement.prototype.setMediaKeys=jb,window.MediaKeys=lb,window.MediaKeySystemAccess=ib):(Navigator.prototype.requestMediaKeySystemAccess=db,HTMLMediaElement.prototype.mediaKeys=
null,HTMLMediaElement.prototype.waitingFor="",HTMLMediaElement.prototype.setMediaKeys=eb,window.MediaKeys=fb,window.MediaKeySystemAccess=gb))});var sb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function K(a){var b;a instanceof K?(tb(this,a.na),this.Ba=a.Ba,this.ga=a.ga,ub(this,a.La),this.Z=a.Z,vb(this,a.wa.clone()),this.qa=a.qa):a&&(b=String(a).match(sb))?(tb(this,b[1]||"",!0),this.Ba=L(b[2]||""),this.ga=L(b[3]||"",!0),ub(this,b[4]),this.Z=L(b[5]||"",!0),vb(this,b[6]||"",!0),this.qa=L(b[7]||"")):this.wa=new wb(null)}h=K.prototype;h.na="";h.Ba="";h.ga="";h.La=null;h.Z="";h.qa="";
function ob(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.Qa=b;c=B({type:"keystatuseschange"});a.dispatchEvent(c)}h.generateRequest=function(a,b){var c=new s;this.kb(c,b,null);return c};h.load=function(a){if("persistent"==this.Aa){var b=new s;this.kb(b,null,a);return b}return Promise.reject(Error('The session type is not "persistent".'))};h.update=function(a){var b=new s;this.Tb(b,a);return b};
h.close=function(){if("persistent"!=this.Aa){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;this.ua.webkitCancelKeyRequest(this.Ja,this.sessionId)}this.closed.resolve();return this.closed};h.remove=function(){return"persistent"!=this.Aa?Promise.reject(Error("Not a persistent session.")):this.close()};function pb(a){this.qc=a;this.Yb=0}pb.prototype.next=function(){return this.Yb>=this.qc.length?{value:void 0,done:!0}:{value:this.qc[this.Yb++],done:!1}};
function nb(){this.size=0;this.Qa=void 0}var qb=v("FAKE_KEY_ID");nb.prototype.get=function(a){if(this.has(a))return this.Qa};nb.prototype.has=function(a){return this.Qa&&sa(new Uint8Array(a),qb)?!0:!1};nb.prototype.keys=function(){var a=[];this.Qa&&a.push(qb);return new pb(a)};nb.prototype.values=function(){var a=[];this.Qa&&a.push(this.Qa);return new pb(a)};m("shaka.polyfill.MediaKeys.install",function(){Navigator.prototype.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?(Navigator.prototype.requestMediaKeySystemAccess=gb,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ib,window.MediaKeys=kb,window.MediaKeySystemAccess=hb):(Navigator.prototype.requestMediaKeySystemAccess=cb,delete HTMLMediaElement.prototype.mediaKeys,
HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=db,window.MediaKeys=eb,window.MediaKeySystemAccess=fb))});var rb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function L(a){var b;a instanceof L?(sb(this,a.na),this.Ba=a.Ba,this.ga=a.ga,tb(this,a.La),this.Z=a.Z,ub(this,a.wa.clone()),this.qa=a.qa):a&&(b=String(a).match(rb))?(sb(this,b[1]||"",!0),this.Ba=vb(b[2]||""),this.ga=vb(b[3]||"",!0),tb(this,b[4]),this.Z=vb(b[5]||"",!0),ub(this,b[6]||"",!0),this.qa=vb(b[7]||"")):this.wa=new wb(null)}h=L.prototype;h.na="";h.Ba="";h.ga="";h.La=null;h.Z="";h.qa="";
h.toString=function(){var a=[],b=this.na;b&&a.push(xb(b,yb,!0),":");if(b=this.ga){a.push("//");var c=this.Ba;c&&a.push(xb(c,yb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.La;null!=b&&a.push(":",String(b))}if(b=this.Z)this.ga&&"/"!=b.charAt(0)&&a.push("/"),a.push(xb(b,"/"==b.charAt(0)?zb:Ab,!0));(b=this.wa.toString())&&a.push("?",b);(b=this.qa)&&a.push("#",xb(b,Bb));return a.join("")};
h.resolve=function(a){var b=this.clone(),c=!!a.na;c?tb(b,a.na):c=!!a.Ba;c?b.Ba=a.Ba:c=!!a.ga;c?b.ga=a.ga:c=null!=a.La;var d=a.Z;if(c)ub(b,a.La);else if(c=!!a.Z){if("/"!=d.charAt(0))if(this.ga&&!this.Z)d="/"+d;else{var e=b.Z.lastIndexOf("/");-1!=e&&(d=b.Z.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){for(var e=0==d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;g<d.length;){var k=d[g++];"."==k?e&&g==d.length&&f.push(""):".."==k?((1<f.length||1==f.length&&""!=
f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(k),e=!0)}d=f.join("/")}}c?b.Z=d:c=""!==a.wa.toString();c?vb(b,L(a.wa.toString())):c=!!a.qa;c&&(b.qa=a.qa);return b};h.clone=function(){return new K(this)};function tb(a,b,c){a.na=c?L(b,!0):b;a.na&&(a.na=a.na.replace(/:$/,""))}function ub(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.La=b}else a.La=null}function vb(a,b,c){b instanceof wb?a.wa=b:(c||(b=xb(b,Cb)),a.wa=new wb(b))}
function L(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function xb(a,b,c){return"string"==typeof a?(a=encodeURI(a).replace(b,Db),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Db(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var yb=/[#\/\?@]/g,Ab=/[\#\?:]/g,zb=/[\#\?]/g,Cb=/[\#\?@]/g,Bb=/#/g;function wb(a){this.ka=a||null}h=wb.prototype;h.Q=null;h.hb=null;
h.add=function(a,b){if(!this.Q&&(this.Q={},this.hb=0,this.ka))for(var c=this.ka.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null,g=null;0<=e?(f=c[d].substring(0,e),g=c[d].substring(e+1)):f=c[d];f=decodeURIComponent(f.replace(/\+/g," "));g=g||"";this.add(f,decodeURIComponent(g.replace(/\+/g," ")))}this.ka=null;(c=this.Q.hasOwnProperty(a)&&this.Q[a])||(this.Q[a]=c=[]);c.push(b);this.hb++;return this};
h.toString=function(){if(this.ka)return this.ka;if(!this.Q)return"";var a=[],b;for(b in this.Q)for(var c=encodeURIComponent(b),d=this.Q[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.ka=a.join("&")};h.clone=function(){var a=new wb;a.ka=this.ka;if(this.Q){var b={},c;for(c in this.Q)b[c]=this.Q[c].concat();a.Q=b;a.hb=this.hb}return a};function Eb(a,b,c,d,e,f){this.index=a;this.startTime=b;this.endTime=c;this.Pa=d;this.Ta=e;this.url=f};function Fb(a){this.Uc=a};function Gb(a){this.Ka=a}Gb.prototype.parse=function(a,b,c){a=null;try{a=this.Lb(b,c)}catch(d){if(!(d instanceof RangeError))throw d;}return a};
Gb.prototype.Lb=function(a,b){var c=new ta(a,ua),d=[],e=F(c);if(1936286840!=F(c))return null;1==e&&(e=Xa(c));var f=ya(c);B(c,3);B(c,4);var g=F(c);if(0==g)return null;var k,l;0==f?(k=F(c),l=F(c)):(k=Xa(c),l=Xa(c));B(c,2);f=c.h.getUint16(c.f,c.Gb);c.f+=2;e=b+e+l;for(l=0;l<f;l++){var p=F(c),n=(p&2147483648)>>>31,p=p&2147483647,r=F(c);F(c);if(1==n)return null;d.push(new Eb(l,k/g,(k+r)/g,e,e+p-1,this.Ka));k+=r;e+=p}return d};function Hb(a){this.Ka=a}Hb.prototype.parse=function(a,b){var c=null;try{c=this.Lb(a,b)}catch(d){if(!(d instanceof RangeError))throw d;}return c};
Hb.prototype.Lb=function(a,b){var c;var d=new z(a);if(440786851!=A(d).id)c=null;else if(c=A(d),408125543!=c.id)c=null;else{d=c.h.byteOffset;c=new z(c.h);for(var e=null;c.ra();){var f=A(c);if(357149030==f.id){e=f;break}}if(e){c=new z(e.h);for(e=1E6;c.ra();)if(f=A(c),2807729==f.id){e=za(f);break}c=e/1E9}else c=null;c=c?{Zc:d,dd:c}:null}if(!c)return null;e=A(new z(b));if(475249515!=e.id)return null;d=c.Zc;c=c.dd;for(var e=new z(e.h),f=[],g=-1,k=-1,l=0;e.ra();){var p=A(e);if(187==p.id){var n;n=new z(p.h);
p=A(n);if(179!=p.id)n=null;else if(p=za(p),n=A(n),183!=n.id)n=null;else{n=new z(n.h);for(var r=0;n.ra();){var v=A(n);if(241==v.id){r=za(v);break}}n={ed:p,Vc:r}}n&&(p=c*n.ed,n=d+n.Vc,0<=g&&(f.push(new Eb(l,g,p,k,n-1,this.Ka)),++l),g=p,k=n)}}0<=g&&f.push(new Eb(l,g,null,k,null,this.Ka));return f};function Ib(a){this.i=a}function Jb(a,b){return 0>b||b>=a.i.length?null:a.i[b]}function Kb(a,b,c){var d=Lb(a,b);if(0>d)return null;for(var e=[];d<a.i.length;d++){e.push(a.i[d]);var f=a.i[d].endTime;if(!f||f>b+c)break}return new Fb(e)}function Lb(a,b){for(var c=0;c<a.i.length;c++)if(a.i[c].startTime>b)return c?c-1:0;return a.i.length-1};function N(a){this.url=a;this.o=new Mb;this.Xa=this.mc=this.Vb=0;this.n=null;this.v=new s;this.pa=null}function Mb(){this.body=null;this.bc=1;this.rc=1E3;this.Xc=2;this.Yc=.5;this.Wc=0;this.method="GET";this.responseType="arraybuffer";this.Nb={};this.withCredentials=!1}function Nb(a){Ob(a);a.o.body=null;a.v=null;a.pa=null}function Ob(a){a.n&&(a.n.onload=null,a.n.onerror=null);a.n=null}
N.prototype.tb=function(){if(this.n)return this.v;if(0==this.url.lastIndexOf("data:",0)){var a=this.url.split(":")[1].split(";").pop().split(","),b=a.pop(),b="base64"==a.pop()?window.atob(b.replace(/-/g,"+").replace(/_/g,"/")):window.decodeURIComponent(b);"arraybuffer"==this.o.responseType&&(b=y(b).buffer);a=JSON.parse(JSON.stringify(new XMLHttpRequest));a.response=b;a.responseText=b.toString();b=this.v;b.resolve(a);Nb(this);return b}this.Vb++;this.mc=Date.now();this.Xa||(this.Xa=this.o.rc);this.n=
new XMLHttpRequest;a=this.url;this.pa&&(a=new K(a),a.wa.add("_",Date.now()),a=a.toString());this.n.open(this.o.method,a,!0);this.n.responseType=this.o.responseType;this.n.timeout=this.o.Wc;this.n.withCredentials=this.o.withCredentials;this.n.onload=this.Ic.bind(this);this.n.onerror=this.Jb.bind(this);for(b in this.o.Nb)this.n.setRequestHeader(b,this.o.Nb[b]);this.n.send(this.o.body);return this.v};
function Pb(a,b,c){b=Error(b);b.type=c;b.status=a.n.status;b.url=a.url;b.method=a.o.method;b.body=a.o.body;b.fd=a.n;return b}N.prototype.abort=function(){if(this.n&&this.n.readyState!=XMLHttpRequest.DONE){this.n.abort();var a=Pb(this,"Request aborted.","aborted");this.v.reject(a);Nb(this)}};
N.prototype.Ic=function(a){this.pa&&this.pa.sb(Date.now()-this.mc,a.loaded);200<=this.n.status&&299>=this.n.status?(this.v.resolve(this.n),Nb(this)):this.Vb<this.o.bc?(Ob(this),window.setTimeout(this.tb.bind(this),this.Xa*(1+(2*Math.random()-1)*this.o.Yc)),this.Xa*=this.o.Xc):(a=Pb(this,"HTTP error.","net"),this.v.reject(a),Nb(this))};N.prototype.Jb=function(){var a=Pb(this,"Network failure.","net");this.v.reject(a);Nb(this)};function Qb(a,b,c){N.call(this,a);this.o.body=b;this.o.method="POST";this.o.bc=3;this.o.withCredentials=c}q(Qb,N);Qb.prototype.send=function(){return this.tb().then(function(a){return Promise.resolve(new Uint8Array(a.response))})};function O(a){E.call(this,null);this.a=a;this.G=this.ob=this.d=null;this.b=new G;this.qb={};this.Ea=[];this.ub=[];this.sa="en";this.bb=this.rb=null;this.Ra=!1;this.L=new Ba;this.Ca=!0}q(O,E);m("shaka.player.Player",O);O.version="v1.2.2";
O.isBrowserSupported=function(){return!!window.MediaSource&&!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration&&!!window.Promise&&!!HTMLVideoElement.prototype.getVideoPlaybackQuality&&!!Element.prototype.requestFullscreen&&!!document.exitFullscreen&&document.hasOwnProperty("fullscreenElement")&&!!document.body.children};
function Rb(a){return 0<=a.indexOf("mp4a.40.5")?!1:"text/vtt"==a?!!window.VTTCue:MediaSource.isTypeSupported(a)}O.isTypeSupported=Rb;O.prototype.u=function(){this.Sb().catch(function(){});this.b.u();this.a=this.b=null};O.prototype.destroy=O.prototype.u;
O.prototype.Sb=function(){this.a.pause();Za(this.b);Sb(this);Tb(this);for(var a=0;a<this.ub.length;++a)this.ub[a].close().catch(function(){});this.ub=[];this.Ea=[];this.G=this.ob=null;this.a.src="";a=this.a.setMediaKeys(null);this.d&&(this.d.u(),this.d=null);this.Ra=!1;this.qb={};this.L=new Ba;return a};O.prototype.unload=O.prototype.Sb;
O.prototype.load=function(a){var b=this.d?this.Sb():Promise.resolve();this.a.autoplay&&(I("load"),H(this.b,this.a,"timeupdate",this.Gc.bind(this)));a.ja(this.Ca);return b.then(t(this,function(){return a.load(this.sa)})).then(t(this,function(){this.d=a;var b;b=new Aa;for(var d=this.d.kb(),e=0;e<d.length;++e){var f=d[e];f.ha.keySystem||f.la&&!Rb(f.la)||b.push(f.contentType,f)}for(var e={},f=!1,g=0;g<d.length;++g){var k=d[g];if(k.ha.keySystem&&!b.has(k.contentType)){var l=k.ha.keySystem,p=e[l];p||(p=
e[l]={audioCapabilities:[],videoCapabilities:[],initDataTypes:[],distinctiveIdentifier:"optional",persistentState:"optional"});k.la&&(l=k.contentType+"Capabilities",p[l]&&(f=!0,p[l].push({contentType:k.la})))}}f||(this.G=d[0].ha);0==Object.keys(e).length?(this.d.Za(b),b=Promise.resolve()):(f=new s,e=Ub(e,f),e=e.then(this.sc.bind(this,d,b)),e=e.then(this.cd.bind(this)),f.reject(null),b=e);return b})).then(t(this,function(){H(this.b,this.a,"error",this.Jb.bind(this));H(this.b,this.a,"play",this.Lc.bind(this));
H(this.b,this.a,"playing",this.Mc.bind(this));H(this.b,this.a,"seeking",this.Kb.bind(this));H(this.b,this.a,"pause",this.Kc.bind(this));H(this.b,this.a,"ended",this.Fc.bind(this));return this.d.eb(this,this.a)})).then(t(this,function(){for(var a=0;a<this.Ea.length;++a)this.dc(this.Ea[a]);return Promise.resolve()})).catch(t(this,function(b){a.u();this.d=null;var d=x(b);this.dispatchEvent(d);return Promise.reject(b)}))};O.prototype.load=O.prototype.load;
function Ub(a,b){for(var c in a){var d=a[c];b=b.catch(function(){return navigator.requestMediaKeySystemAccess(c,[d])})}return b}h=O.prototype;h.sc=function(a,b,c){for(var d=c.keySystem,e=c.getConfiguration(),f=["audio","video"],g=0;g<f.length;++g){var k=f[g];if(!b.has(k)){var l=e[k+"Capabilities"][0];if(l){for(var p=[],n=0;n<a.length;++n){var r=a[n];if(r.ha.keySystem==d&&r.la==l.contentType){p.push(r);this.G=this.G?La(this.G,r.ha):r.ha;break}}b.set(k,p)}}}this.d.Za(b);return c.createMediaKeys()};
h.cd=function(a){this.ob=a;return this.a.setMediaKeys(this.ob).then(t(this,function(){this.Ea=[];for(var a=0;a<this.G.Ga.length;++a){var c=this.G.Ga[a];this.Ea.push({type:"encrypted",initDataType:c.initDataType,initData:c.initData})}0==this.Ea.length&&H(this.b,this.a,"encrypted",this.dc.bind(this))}))};
h.dc=function(a){var b=new Uint8Array(a.initData),c=Array.prototype.join.apply(b);this.G.nc&&(c="first");this.qb[c]||(b=this.ob.createSession(),this.ub.push(b),H(this.b,b,"message",this.Nc.bind(this)),H(this.b,b,"keystatuseschange",this.Hc.bind(this)),a=b.generateRequest(a.initDataType,a.initData),this.qb[c]=!0,a.catch(t(this,function(a){this.qb[c]=!1;a=x(a);this.dispatchEvent(a)})))};h.Nc=function(a){Vb(this,a.target,this.G.$b,a.message,this.G.withCredentials,this.G.Zb)};
h.Hc=function(a){var b=a.target.keyStatuses.values();for(a=b.next();!a.done;a=b.next()){var c=Wb[a.value];c&&(c=Error(c),c.type=a.value,a=x(c),this.dispatchEvent(a))}};function Vb(a,b,c,d,e,f){(new Qb(c,d,e)).send().then(t(a,function(a){if(f){var c=new Ja;a=f(a,c);this.d.wb(c)}return b.update(a)})).then(function(){}).catch(t(a,function(a){a.jd=b;a=x(a);this.dispatchEvent(a)}))}h.Gc=function(){J("load");this.L.playbackLatency=Fa("load")/1E3;this.b.$a(this.a,"timeupdate")};
h.Jb=function(a){this.a.error&&(a=this.a.error.code,a!=MediaError.MEDIA_ERR_ABORTED&&(a=Error(Xb[a]||"Unknown playback error."),a.type="playback",a=x(a),this.dispatchEvent(a)))};h.Lc=function(){};h.Mc=function(){I("playing");Sb(this);this.bb=window.setTimeout(this.fc.bind(this),100)};h.Kb=function(){Sb(this);this.Ra=!1};h.Kc=function(){J("playing");Ea(this.L)};h.Fc=function(){this.getStats();Sb(this)};
h.getStats=function(){this.a.paused||(J("playing"),Ea(this.L),I("playing"));var a=this.L,b=this.a.getVideoPlaybackQuality();b&&(a.decodedFrames=b.totalVideoFrames,a.droppedFrames=b.droppedVideoFrames);return this.L};O.prototype.getStats=O.prototype.getStats;O.prototype.wc=function(){var a=this.a.videoWidth,b=this.a.videoHeight;return a&&b?{width:a,height:b}:null};O.prototype.getCurrentResolution=O.prototype.wc;O.prototype.getVideoTracks=function(){return this.d?this.d.getVideoTracks():[]};
h.resolve=function(a){var b=this.clone(),c=!!a.na;c?sb(b,a.na):c=!!a.Ba;c?b.Ba=a.Ba:c=!!a.ga;c?b.ga=a.ga:c=null!=a.La;var d=a.Z;if(c)tb(b,a.La);else if(c=!!a.Z){if("/"!=d.charAt(0))if(this.ga&&!this.Z)d="/"+d;else{var e=b.Z.lastIndexOf("/");-1!=e&&(d=b.Z.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){for(var e=0==d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;g<d.length;){var k=d[g++];"."==k?e&&g==d.length&&f.push(""):".."==k?((1<f.length||1==f.length&&""!=
f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(k),e=!0)}d=f.join("/")}}c?b.Z=d:c=""!==a.wa.toString();c?ub(b,a.wa.clone()):c=!!a.qa;c&&(b.qa=a.qa);return b};h.clone=function(){return new L(this)};function sb(a,b,c){a.na=c?vb(b,!0):b;a.na&&(a.na=a.na.replace(/:$/,""))}function tb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.La=b}else a.La=null}function ub(a,b,c){b instanceof wb?a.wa=b:(c||(b=xb(b,Cb)),a.wa=new wb(b))}
function vb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function xb(a,b,c){return"string"==typeof a?(a=encodeURI(a).replace(b,Db),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Db(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var yb=/[#\/\?@]/g,Ab=/[\#\?:]/g,zb=/[\#\?]/g,Cb=/[\#\?@]/g,Bb=/#/g;function wb(a){this.ka=a||null}h=wb.prototype;h.Q=null;h.ib=null;
h.add=function(a,b){if(!this.Q&&(this.Q={},this.ib=0,this.ka))for(var c=this.ka.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null,g=null;0<=e?(f=c[d].substring(0,e),g=c[d].substring(e+1)):f=c[d];f=decodeURIComponent(f.replace(/\+/g," "));g=g||"";this.add(f,decodeURIComponent(g.replace(/\+/g," ")))}this.ka=null;(c=this.Q.hasOwnProperty(a)&&this.Q[a])||(this.Q[a]=c=[]);c.push(b);this.ib++;return this};
h.toString=function(){if(this.ka)return this.ka;if(!this.Q)return"";var a=[],b;for(b in this.Q)for(var c=encodeURIComponent(b),d=this.Q[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.ka=a.join("&")};h.clone=function(){var a=new wb;a.ka=this.ka;if(this.Q){var b={},c;for(c in this.Q)b[c]=this.Q[c].concat();a.Q=b;a.ib=this.ib}return a};function Eb(a,b,c,d,e,f){this.index=a;this.startTime=b;this.endTime=c;this.Pa=d;this.Ta=e;this.url=f};function Fb(a){this.Vc=a};function Gb(a){this.Ka=a}Gb.prototype.parse=function(a,b,c){a=null;try{a=this.Lb(b,c)}catch(d){if(!(d instanceof RangeError))throw d;}return a};
Gb.prototype.Lb=function(a,b){var c=new ta(a,ua),d=[],e=G(c);if(1936286840!=G(c))return null;1==e&&(e=Wa(c));var f=ya(c);z(c,3);z(c,4);var g=G(c);if(0==g)return null;var k,l;0==f?(k=G(c),l=G(c)):(k=Wa(c),l=Wa(c));z(c,2);f=c.h.getUint16(c.f,c.Hb);c.f+=2;e=b+e+l;for(l=0;l<f;l++){var p=G(c),n=(p&2147483648)>>>31,p=p&2147483647,r=G(c);G(c);if(1==n)return null;d.push(new Eb(l,k/g,(k+r)/g,e,e+p-1,this.Ka));k+=r;e+=p}return d};function Hb(a){this.Ka=a}Hb.prototype.parse=function(a,b){var c=null;try{c=this.Lb(a,b)}catch(d){if(!(d instanceof RangeError))throw d;}return c};
Hb.prototype.Lb=function(a,b){var c;var d=new x(a);if(440786851!=y(d).id)c=null;else if(c=y(d),408125543!=c.id)c=null;else{d=c.h.byteOffset;c=new x(c.h);for(var e=null;c.ra();){var f=y(c);if(357149030==f.id){e=f;break}}if(e){c=new x(e.h);for(e=1E6;c.ra();)if(f=y(c),2807729==f.id){e=za(f);break}c=e/1E9}else c=null;c=c?{$c:d,ed:c}:null}if(!c)return null;e=y(new x(b));if(475249515!=e.id)return null;d=c.$c;c=c.ed;for(var e=new x(e.h),f=[],g=-1,k=-1,l=0;e.ra();){var p=y(e);if(187==p.id){var n;n=new x(p.h);
p=y(n);if(179!=p.id)n=null;else if(p=za(p),n=y(n),183!=n.id)n=null;else{n=new x(n.h);for(var r=0;n.ra();){var w=y(n);if(241==w.id){r=za(w);break}}n={fd:p,Wc:r}}n&&(p=c*n.fd,n=d+n.Wc,0<=g&&(f.push(new Eb(l,g,p,k,n-1,this.Ka)),++l),g=p,k=n)}}0<=g&&f.push(new Eb(l,g,null,k,null,this.Ka));return f};function Ib(a){this.i=a}function Jb(a,b){return 0>b||b>=a.i.length?null:a.i[b]}function Kb(a,b,c){var d=Lb(a,b);if(0>d)return null;for(var e=[];d<a.i.length;d++){e.push(a.i[d]);var f=a.i[d].endTime;if(!f||f>b+c)break}return new Fb(e)}function Lb(a,b){for(var c=0;c<a.i.length;c++)if(a.i[c].startTime>b)return c?c-1:0;return a.i.length-1};function N(a){this.url=a;this.o=new Mb;this.Ya=this.mc=this.Vb=0;this.n=null;this.v=new s;this.pa=null}function Mb(){this.body=null;this.bc=1;this.rc=1E3;this.Yc=2;this.Zc=.5;this.Xc=0;this.method="GET";this.responseType="arraybuffer";this.Nb={};this.withCredentials=!1}function Nb(a){Ob(a);a.o.body=null;a.v=null;a.pa=null}function Ob(a){a.n&&(a.n.onload=null,a.n.onerror=null);a.n=null}
N.prototype.ub=function(){if(this.n)return this.v;if(0==this.url.lastIndexOf("data:",0)){var a=this.url.split(":")[1].split(";").pop().split(","),b=a.pop(),b="base64"==a.pop()?window.atob(b.replace(/-/g,"+").replace(/_/g,"/")):window.decodeURIComponent(b);"arraybuffer"==this.o.responseType&&(b=v(b).buffer);a=JSON.parse(JSON.stringify(new XMLHttpRequest));a.response=b;a.responseText=b.toString();b=this.v;b.resolve(a);Nb(this);return b}this.Vb++;this.mc=Date.now();this.Ya||(this.Ya=this.o.rc);this.n=
new XMLHttpRequest;a=this.url;this.pa&&(a=new L(a),a.wa.add("_",Date.now()),a=a.toString());this.n.open(this.o.method,a,!0);this.n.responseType=this.o.responseType;this.n.timeout=this.o.Xc;this.n.withCredentials=this.o.withCredentials;this.n.onload=this.Jc.bind(this);this.n.onerror=this.Jb.bind(this);for(b in this.o.Nb)this.n.setRequestHeader(b,this.o.Nb[b]);this.n.send(this.o.body);return this.v};
function Pb(a,b,c){b=Error(b);b.type=c;b.status=a.n.status;b.url=a.url;b.method=a.o.method;b.body=a.o.body;b.gd=a.n;return b}N.prototype.abort=function(){if(this.n&&this.n.readyState!=XMLHttpRequest.DONE){this.n.abort();var a=Pb(this,"Request aborted.","aborted");this.v.reject(a);Nb(this)}};
N.prototype.Jc=function(a){this.pa&&this.pa.tb(Date.now()-this.mc,a.loaded);200<=this.n.status&&299>=this.n.status?(this.v.resolve(this.n),Nb(this)):this.Vb<this.o.bc?(Ob(this),window.setTimeout(this.ub.bind(this),this.Ya*(1+(2*Math.random()-1)*this.o.Zc)),this.Ya*=this.o.Yc):(a=Pb(this,"HTTP error.","net"),this.v.reject(a),Nb(this))};N.prototype.Jb=function(){var a=Pb(this,"Network failure.","net");this.v.reject(a);Nb(this)};function Qb(a,b,c){N.call(this,a);this.o.body=b;this.o.method="POST";this.o.bc=3;this.o.withCredentials=c}q(Qb,N);Qb.prototype.send=function(){return this.ub().then(function(a){return Promise.resolve(new Uint8Array(a.response))})};function O(a){F.call(this,null);this.a=a;this.G=this.pb=this.d=null;this.b=new H;this.rb={};this.Ea=[];this.vb=[];this.sa="en";this.cb=this.sb=null;this.Ra=!1;this.L=new Ba;this.Ca=!0}q(O,F);m("shaka.player.Player",O);O.version="v1.2.3";
O.isBrowserSupported=function(){return!!window.MediaSource&&!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration&&!!window.Promise&&!!HTMLVideoElement.prototype.getVideoPlaybackQuality&&!!Element.prototype.requestFullscreen&&!!document.exitFullscreen&&"fullscreenElement"in document&&!!document.body.children};
function Rb(a){return"text/vtt"==a?!!window.VTTCue:MediaSource.isTypeSupported(a)}O.isTypeSupported=Rb;O.prototype.u=function(){this.Sb().catch(function(){});this.b.u();this.a=this.b=null};O.prototype.destroy=O.prototype.u;
O.prototype.Sb=function(){this.a.pause();Ya(this.b);Sb(this);Tb(this);for(var a=0;a<this.vb.length;++a)this.vb[a].close().catch(function(){});this.vb=[];this.Ea=[];this.G=this.pb=null;this.a.src="";a=this.a.setMediaKeys(null);this.d&&(this.d.u(),this.d=null);this.Ra=!1;this.rb={};this.L=new Ba;return a};O.prototype.unload=O.prototype.Sb;
O.prototype.load=function(a){var b=this.d?this.Sb():Promise.resolve();this.a.autoplay&&(J("load"),I(this.b,this.a,"timeupdate",this.Hc.bind(this)));a.ja(this.Ca);return b.then(t(this,function(){return a.load(this.sa)})).then(t(this,function(){this.d=a;var b;b=new Aa;for(var d=this.d.lb(),e=0;e<d.length;++e){var f=d[e];f.ha.keySystem||f.la&&!Rb(f.la)||b.push(f.contentType,f)}for(var e={},f=!1,g=0;g<d.length;++g){var k=d[g];if(k.ha.keySystem&&!b.has(k.contentType)){var l=k.ha.keySystem,p=e[l];p||(p=
e[l]={audioCapabilities:void 0,videoCapabilities:void 0,initDataTypes:void 0,distinctiveIdentifier:"optional",persistentState:"optional"});k.la&&(l=k.contentType+"Capabilities",l in p&&(f=!0,p[l]||(p[l]=[]),p[l].push({contentType:k.la})))}}f||(this.G=d[0].ha);0==Object.keys(e).length?(this.d.$a(b),b=Promise.resolve()):(f=new s,e=Ub(e,f),e=e.then(this.sc.bind(this,d,b)),e=e.then(this.dd.bind(this)),f.reject(null),b=e);return b})).then(t(this,function(){I(this.b,this.a,"error",this.Jb.bind(this));I(this.b,
this.a,"play",this.Mc.bind(this));I(this.b,this.a,"playing",this.Nc.bind(this));I(this.b,this.a,"seeking",this.Kb.bind(this));I(this.b,this.a,"pause",this.Lc.bind(this));I(this.b,this.a,"ended",this.Gc.bind(this));return this.d.fb(this,this.a)})).then(t(this,function(){for(var a=0;a<this.Ea.length;++a)this.dc(this.Ea[a]);return Promise.resolve()})).catch(t(this,function(b){a.u();this.d=null;var d=D(b);this.dispatchEvent(d);return Promise.reject(b)}))};O.prototype.load=O.prototype.load;
function Ub(a,b){for(var c in a){var d=a[c];b=b.catch(function(){return navigator.requestMediaKeySystemAccess(c,[d])})}return b}h=O.prototype;h.sc=function(a,b,c){for(var d=c.keySystem,e=c.getConfiguration(),f=["audio","video"],g=0;g<f.length;++g){var k=f[g];if(!b.has(k)){var l=e[k+"Capabilities"];if(l&&l.length){for(var l=l[0],p=[],n=0;n<a.length;++n){var r=a[n];if(r.ha.keySystem==d&&r.la==l.contentType){p.push(r);this.G=this.G?La(this.G,r.ha):r.ha;break}}b.set(k,p)}}}this.d.$a(b);return c.createMediaKeys()};
h.dd=function(a){this.pb=a;return this.a.setMediaKeys(this.pb).then(t(this,function(){this.Ea=[];for(var a=0;a<this.G.Ga.length;++a){var c=this.G.Ga[a];this.Ea.push({type:"encrypted",initDataType:c.initDataType,initData:c.initData})}0==this.Ea.length&&I(this.b,this.a,"encrypted",this.dc.bind(this))}))};
h.dc=function(a){var b=new Uint8Array(a.initData),c=Array.prototype.join.apply(b);this.G.nc&&(c="first");this.rb[c]||(b=this.pb.createSession(),this.vb.push(b),I(this.b,b,"message",this.Oc.bind(this)),I(this.b,b,"keystatuseschange",this.Ic.bind(this)),a=b.generateRequest(a.initDataType,a.initData),this.rb[c]=!0,a.catch(t(this,function(a){this.rb[c]=!1;a=D(a);this.dispatchEvent(a)})))};h.Oc=function(a){Vb(this,a.target,this.G.$b,a.message,this.G.withCredentials,this.G.Zb)};
h.Ic=function(a){var b=a.target.keyStatuses.values();for(a=b.next();!a.done;a=b.next()){var c=Wb[a.value];c&&(c=Error(c),c.type=a.value,a=D(c),this.dispatchEvent(a))}};function Vb(a,b,c,d,e,f){(new Qb(c,d,e)).send().then(t(a,function(a){if(f){var c=new Ja;a=f(a,c);this.d.xb(c)}return b.update(a)})).then(function(){}).catch(t(a,function(a){a.kd=b;a=D(a);this.dispatchEvent(a)}))}h.Hc=function(){K("load");this.L.playbackLatency=Fa("load")/1E3;this.b.ab(this.a,"timeupdate")};
h.Jb=function(a){this.a.error&&(a=this.a.error.code,a!=MediaError.MEDIA_ERR_ABORTED&&(a=Error(Xb[a]||"Unknown playback error."),a.type="playback",a=D(a),this.dispatchEvent(a)))};h.Mc=function(){};h.Nc=function(){J("playing");Sb(this);this.cb=window.setTimeout(this.fc.bind(this),100)};h.Kb=function(){Sb(this);this.Ra=!1};h.Lc=function(){K("playing");Ea(this.L)};h.Gc=function(){this.getStats();Sb(this)};
h.getStats=function(){this.a.paused||(K("playing"),Ea(this.L),J("playing"));var a=this.L,b=this.a.getVideoPlaybackQuality();b&&(a.decodedFrames=b.totalVideoFrames,a.droppedFrames=b.droppedVideoFrames);return this.L};O.prototype.getStats=O.prototype.getStats;O.prototype.wc=function(){var a=this.a.videoWidth,b=this.a.videoHeight;return a&&b?{width:a,height:b}:null};O.prototype.getCurrentResolution=O.prototype.wc;O.prototype.getVideoTracks=function(){return this.d?this.d.getVideoTracks():[]};
O.prototype.getVideoTracks=O.prototype.getVideoTracks;O.prototype.getAudioTracks=function(){return this.d?this.d.getAudioTracks():[]};O.prototype.getAudioTracks=O.prototype.getAudioTracks;O.prototype.Fa=function(){return this.d?this.d.Fa():[]};O.prototype.getTextTracks=O.prototype.Fa;O.prototype.za=function(a,b){return this.d?this.d.za(a,void 0==b?!0:b):!1};O.prototype.selectVideoTrack=O.prototype.za;O.prototype.Na=function(a){return this.d?this.d.Na(a,!1):!1};O.prototype.selectAudioTrack=O.prototype.Na;
O.prototype.Oa=function(a){return this.d?this.d.Oa(a,!1):!1};O.prototype.selectTextTrack=O.prototype.Oa;O.prototype.oa=function(a){this.d&&this.d.oa(a)};O.prototype.enableTextTrack=O.prototype.oa;O.prototype.ja=function(a){this.Ca=a;this.d&&this.d.ja(a)};O.prototype.enableAdaptation=O.prototype.ja;O.prototype.vc=function(){return this.Ca};O.prototype.getAdaptationEnabled=O.prototype.vc;O.prototype.xc=function(){return this.a.currentTime};O.prototype.getCurrentTime=O.prototype.xc;O.prototype.yc=function(){return this.a.duration};
O.prototype.getDuration=O.prototype.yc;O.prototype.zc=function(){return this.a.muted};O.prototype.getMuted=O.prototype.zc;O.prototype.Ac=function(){return this.a.volume};O.prototype.getVolume=O.prototype.Ac;O.prototype.play=function(){this.kc(1);this.a.play()};O.prototype.play=O.prototype.play;O.prototype.pause=function(){this.a.pause()};O.prototype.pause=O.prototype.pause;O.prototype.requestFullscreen=function(){this.a.requestFullscreen()};O.prototype.requestFullscreen=O.prototype.requestFullscreen;
O.prototype.seek=function(a){this.a.currentTime=a};O.prototype.seek=O.prototype.seek;O.prototype.$c=function(a){this.a.muted=a};O.prototype.setMuted=O.prototype.$c;O.prototype.bd=function(a){this.a.volume=a};O.prototype.setVolume=O.prototype.bd;O.prototype.ad=function(a){this.sa=Pa(a)};O.prototype.setPreferredLanguage=O.prototype.ad;O.prototype.kc=function(a){0!=a&&(Tb(this),0<a?this.a.playbackRate=a:(this.a.playbackRate=0,this.ec(a)))};O.prototype.setPlaybackRate=O.prototype.kc;
function Tb(a){a.rb&&(window.clearTimeout(a.rb),a.rb=null)}function Sb(a){a.bb&&(window.clearTimeout(a.bb),a.bb=null)}O.prototype.ec=function(a){this.a.currentTime+=.1*a;this.rb=window.setTimeout(this.ec.bind(this,a),100)};
O.prototype.fc=function(){this.bb=window.setTimeout(this.fc.bind(this),100);var a=this.a.buffered,a=a.length?a.end(a.length-1):0,a=this.a.currentTime-a;this.Ra?a<-this.d.lb()&&(J("buffering"),a=this.L,a.bufferingTime+=Fa("buffering")/1E3,this.Ra=!1,this.dispatchEvent(w({type:"bufferingEnd"})),this.a.play()):.05<a&&(this.Ra=!0,this.a.pause(),this.L.bufferingHistory.push(Date.now()/1E3),I("buffering"),this.dispatchEvent(w({type:"bufferingStart"})))};
var Wb={"output-not-allowed":"The required output protection is not available.",expired:"A required key has expired and the content cannot be decrypted.","internal-error":"An unknown error has occurred in the CDM."},Xb={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."};function Yb(){}Yb.prototype.Mb=function(a){for(var b=0;b<a.length;++b)for(var c=a[b],d=0;d<c.N.length;++d){for(var e=c.N[d],f=e,g=0;g<f.j.length;++g)Rb(da(f.j[g]))||(f.j.splice(g,1),--g);0==e.j.length&&(c.N.splice(d,1),--d)}for(b=0;b<a.length;++b)for(c=a[b],d=0;d<c.N.length;++d)c.N[d].j.sort(Zb)};function Zb(a,b){var c=a.bandwidth||Number.MAX_VALUE,d=b.bandwidth||Number.MAX_VALUE;return c<d?-1:c>d?1:0};function $b(a,b){this.A=a;this.d=b;this.b=new G;this.Hb=Date.now()/1E3+4;this.Wb=!0;H(this.b,this.A,"bandwidth",this.Ib.bind(this))}$b.prototype.u=function(){this.b.u();this.d=this.A=this.b=null};$b.prototype.enable=function(a){this.Wb=a};$b.prototype.Ib=function(){if(this.Wb){var a=Date.now()/1E3;if(!(a<this.Hb)){var b=ac(this);if(b){if(b.active){this.Hb=a+3;return}this.d.za(b.id,!1)}this.Hb=a+8}}};
function ac(a){var b=a.d.getVideoTracks();if(0==b.length)return null;b.sort(ma);var c;a:{c=a.d.getAudioTracks();for(var d=0;d<c.length;++d)if(c[d].active){c=c[d];break a}c=null}c=c?c.bandwidth:0;a=Va(a.A);for(var d=b[0],e=0;e<b.length;++e){var f=b[e],g=e+1<b.length?b[e+1]:{bandwidth:Number.POSITIVE_INFINITY};if(f.bandwidth&&(g=(g.bandwidth+c)/.85,a>=(f.bandwidth+c)/.95&&a<=g&&(d=f,d.active)))break}return d};function bc(a,b,c){E.call(this,null);this.Ka=a;this.oc=b;this.G=c?c:Ka();this.da=null}q(bc,E);m("shaka.player.HttpVideoSource",bc);h=bc.prototype;h.u=function(){this.da&&(this.da.parentElement.removeChild(this.da),this.da=null);this.parent=this.G=null};h.eb=function(a,b){this.parent=a;var c=b.mediaKeys;b.src=this.Ka;c=b.setMediaKeys(c);this.oc&&(this.da=document.createElement("track"),this.da.src=this.oc,b.appendChild(this.da),this.da.track.mode="showing");return c};h.load=function(){return Promise.resolve()};
h.getVideoTracks=function(){return[]};h.getAudioTracks=function(){return[]};h.Fa=function(){return[]};h.lb=function(){return 5};h.kb=function(){var a=new ha;a.ha=this.G;return[a]};h.Za=function(){};h.za=function(){return!1};h.Na=function(){return!1};h.Oa=function(){return!1};h.oa=function(a){this.da&&(this.da.track.mode=a?"showing":"disabled")};h.ja=function(){};h.wb=function(){};function cc(a,b,c){N.call(this,a);if(b||c)this.o.Nb.Range="bytes="+(b+"-"+(null!=c?c:""))}q(cc,N);cc.prototype.send=function(){return this.tb().then(function(a){return Promise.resolve(a.response)})};function dc(a,b,c){this.R=a;this.ba=b;this.A=c;this.b=new G;this.Ha=[];this.e=P;this.ia=this.v=null;this.i=[];this.aa=null;this.ya=[];H(this.b,this.ba,"updateend",this.Oc.bind(this))}var P=0,ec=1/60;h=dc.prototype;h.u=function(){this.abort();this.v=this.ia=this.i=this.aa=this.ya=this.e=null;this.b.u();this.R=this.ba=this.Ha=this.b=null};
function fc(a,b,c){if(a.e!=P)return a=Error("Cannot fetch: previous operation not complete."),a.type="stream",Promise.reject(a);a.e=1;a.v=new s;a.i=b.Uc;c&&a.ya.push(c);b=!0;c=a.i[0].url.toString();for(var d=1;d<a.i.length;++d)if(a.i[d].url.toString()!=c){b=!1;break}(b?gc(a):hc(a)).then(t(a,function(){Va(this.A);this.ba.appendBuffer(this.ya.shift());this.e=2;this.aa=null})).catch(t(a,function(a){"aborted"!=a.type&&ic(this,a)}));return a.v}
function gc(a){a.aa=new cc(a.i[0].url.toString(),a.i[0].Pa,a.i[a.i.length-1].Ta);a.aa.pa=a.A;return a.aa.send().then(a.yb.bind(a))}function hc(a){function b(a){this.aa=new cc(a.url.toString(),a.Pa,a.Ta);this.aa.pa=this.A;return this.aa.send()}for(var c=b.bind(a)(a.i[0]),d=a.yb.bind(a),e=1;e<a.i.length;++e)var f=b.bind(a,a.i[e]),c=c.then(d).then(f);return c=c.then(a.yb.bind(a))}h.yb=function(a){this.ya.push(a);return Promise.resolve()};
O.prototype.seek=function(a){this.a.currentTime=a};O.prototype.seek=O.prototype.seek;O.prototype.ad=function(a){this.a.muted=a};O.prototype.setMuted=O.prototype.ad;O.prototype.cd=function(a){this.a.volume=a};O.prototype.setVolume=O.prototype.cd;O.prototype.bd=function(a){this.sa=E(a)};O.prototype.setPreferredLanguage=O.prototype.bd;O.prototype.kc=function(a){Tb(this);0<=a?this.a.playbackRate=a:(this.a.playbackRate=0,this.ec(this.a.currentTime,Date.now(),a))};O.prototype.setPlaybackRate=O.prototype.kc;
function Tb(a){a.sb&&(window.clearTimeout(a.sb),a.sb=null)}function Sb(a){a.cb&&(window.clearTimeout(a.cb),a.cb=null)}O.prototype.ec=function(a,b,c){this.a.currentTime=a+(Date.now()-b)/1E3*c;this.sb=window.setTimeout(this.ec.bind(this,a,b,c),100)};
O.prototype.fc=function(){this.cb=window.setTimeout(this.fc.bind(this),100);var a=this.a.buffered,a=a.length?a.end(a.length-1):0,a=this.a.currentTime-a;this.Ra?a<-this.d.mb()&&(K("buffering"),a=this.L,a.bufferingTime+=Fa("buffering")/1E3,this.Ra=!1,this.dispatchEvent(B({type:"bufferingEnd"})),this.a.play()):.05<a&&(this.Ra=!0,this.a.pause(),this.L.bufferingHistory.push(Date.now()/1E3),J("buffering"),this.dispatchEvent(B({type:"bufferingStart"})))};
var Wb={"output-not-allowed":"The required output protection is not available.",expired:"A required key has expired and the content cannot be decrypted.","internal-error":"An unknown error has occurred in the CDM."},Xb={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."};function Yb(){}Yb.prototype.Mb=function(a){for(var b=0;b<a.length;++b)for(var c=a[b],d=0;d<c.N.length;++d){for(var e=c.N[d],f=e,g=0;g<f.j.length;++g)Rb(da(f.j[g]))||(f.j.splice(g,1),--g);0==e.j.length&&(c.N.splice(d,1),--d)}for(b=0;b<a.length;++b)for(c=a[b],d=0;d<c.N.length;++d)c.N[d].j.sort(Zb)};function Zb(a,b){var c=a.bandwidth||Number.MAX_VALUE,d=b.bandwidth||Number.MAX_VALUE;return c<d?-1:c>d?1:0};function $b(a,b){this.A=a;this.d=b;this.b=new H;this.Wa=Date.now()/1E3+4;this.Wb=!0;I(this.b,this.A,"bandwidth",this.Ib.bind(this));I(this.b,this.d,"adaptation",this.Fc.bind(this))}$b.prototype.u=function(){this.b.u();this.d=this.A=this.b=null};$b.prototype.enable=function(a){this.Wb=a};$b.prototype.Ib=function(){if(this.Wb){var a=Date.now()/1E3;if(!(a<this.Wa)){var b=ac(this);if(b){if(b.active){this.Wa=a+3;return}this.d.za(b.id,!1)}this.Wa=Number.POSITIVE_INFINITY}}};
$b.prototype.Fc=function(){this.Wa==Number.POSITIVE_INFINITY&&(this.Wa=Date.now()/1E3+30)};
function ac(a){var b=a.d.getVideoTracks();if(0==b.length)return null;b.sort(ma);var c;a:{c=a.d.getAudioTracks();for(var d=0;d<c.length;++d)if(c[d].active){c=c[d];break a}c=null}c=c?c.bandwidth:0;a=Ua(a.A);for(var d=b[0],e=0;e<b.length;++e){var f=b[e],g=e+1<b.length?b[e+1]:{bandwidth:Number.POSITIVE_INFINITY};if(f.bandwidth&&(g=(g.bandwidth+c)/.85,a>=(f.bandwidth+c)/.95&&a<=g&&(d=f,d.active)))break}return d};function bc(a,b,c){F.call(this,null);this.Ka=a;this.oc=b;this.G=c?c:Ka();this.da=null}q(bc,F);m("shaka.player.HttpVideoSource",bc);h=bc.prototype;h.u=function(){this.da&&(this.da.parentElement.removeChild(this.da),this.da=null);this.parent=this.G=null};h.fb=function(a,b){this.parent=a;var c=b.mediaKeys;b.src=this.Ka;c=b.setMediaKeys(c);this.oc&&(this.da=document.createElement("track"),this.da.src=this.oc,b.appendChild(this.da),this.da.track.mode="showing");return c};h.load=function(){return Promise.resolve()};
h.getVideoTracks=function(){return[]};h.getAudioTracks=function(){return[]};h.Fa=function(){return[]};h.mb=function(){return 5};h.lb=function(){var a=new ha;a.ha=this.G;return[a]};h.$a=function(){};h.za=function(){return!1};h.Na=function(){return!1};h.Oa=function(){return!1};h.oa=function(a){this.da&&(this.da.track.mode=a?"showing":"disabled")};h.ja=function(){};h.xb=function(){};function cc(a,b,c){N.call(this,a);if(b||c)this.o.Nb.Range="bytes="+(b+"-"+(null!=c?c:""))}q(cc,N);cc.prototype.send=function(){return this.ub().then(function(a){return Promise.resolve(a.response)})};function dc(a,b,c){this.R=a;this.ba=b;this.A=c;this.b=new H;this.Ha=[];this.e=P;this.ia=this.v=null;this.i=[];this.aa=null;this.ya=[];I(this.b,this.ba,"updateend",this.Pc.bind(this))}var P=0,ec=1/60;h=dc.prototype;h.u=function(){this.abort();this.v=this.ia=this.i=this.aa=this.ya=this.e=null;this.b.u();this.R=this.ba=this.Ha=this.b=null};
function fc(a,b,c){if(a.e!=P)return a=Error("Cannot fetch: previous operation not complete."),a.type="stream",Promise.reject(a);a.e=1;a.v=new s;a.i=b.Vc;c&&a.ya.push(c);b=!0;c=a.i[0].url.toString();for(var d=1;d<a.i.length;++d)if(a.i[d].url.toString()!=c){b=!1;break}(b?gc(a):hc(a)).then(t(a,function(){Ua(this.A);this.ba.appendBuffer(this.ya.shift());this.e=2;this.aa=null})).catch(t(a,function(a){"aborted"!=a.type&&ic(this,a)}));return a.v}
function gc(a){a.aa=new cc(a.i[0].url.toString(),a.i[0].Pa,a.i[a.i.length-1].Ta);a.aa.pa=a.A;return a.aa.send().then(a.zb.bind(a))}function hc(a){function b(a){this.aa=new cc(a.url.toString(),a.Pa,a.Ta);this.aa.pa=this.A;return this.aa.send()}for(var c=b.bind(a)(a.i[0]),d=a.zb.bind(a),e=1;e<a.i.length;++e)var f=b.bind(a,a.i[e]),c=c.then(d).then(f);return c=c.then(a.zb.bind(a))}h.zb=function(a){this.ya.push(a);return Promise.resolve()};
h.clear=function(){if(this.e!=P){var a=Error("Cannot clear: previous operation not complete.");a.type="stream";return Promise.reject(a)}if(0==this.ba.buffered.length)return Promise.resolve();try{this.ba.remove(0,Number.POSITIVE_INFINITY)}catch(b){return Promise.reject(b)}this.Ha=[];this.e=3;return this.v=new s};h.reset=function(){this.Ha=[]};
h.abort=function(){switch(this.e){case P:return Promise.resolve();case 1:this.e=4;var a=this.ia=new s;this.aa.abort();jc(this);return a;case 2:case 3:return this.e=4,this.ia=new s,"open"==this.R.readyState&&this.ba.abort(),this.ia;case 4:return this.ia}};
h.Oc=function(){switch(this.e){case 2:if(0<this.ya.length){try{this.ba.appendBuffer(this.ya.shift())}catch(a){ic(this,a)}break}for(var b=0;b<this.i.length;++b)this.Ha[this.i[b].index]=!0;this.i=[];case 3:this.e=P;this.v.resolve();this.v=null;break;case 4:jc(this)}};function jc(a){a.ia.resolve();a.ia=null;var b=Error("Current operation aborted.");b.type="aborted";ic(a,b)}function ic(a,b){a.v.reject(b);a.e=P;a.v=null;a.i=[];a.aa=null;a.ya=[]};function kc(){this.duration=this.c=this.type=this.id=null;this.t=5;this.p=[]}function lc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.duration=this.start=null;this.P=[]}function mc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.contentType=this.lang=null;this.fa=[];this.m=[]}function nc(){this.value=null}function oc(){this.contentType=this.lang=this.id=null}
function pc(){this.lang=this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.bandwidth=null;this.fa=[];this.Va=!1}function qc(){this.value=this.schemeIdUri=null;this.children=[];this.pssh=null}function rc(){this.parsedPssh=this.psshBox=null}function Q(){this.url=null}function R(){this.D=this.c=null;this.F=1;this.W=0;this.ma=this.S=this.Db=null}function sc(){this.$=this.url=null}function tc(){this.$=this.url=null}
function S(){this.c=null;this.F=1;this.W=0;this.T=null;this.ca=1;this.ma=null;this.B=[]}function uc(){this.duration=this.startTime=this.pb=this.D=null}function vc(){this.F=1;this.W=0;this.T=null;this.ca=1;this.Rb=this.Eb=this.mb=this.ta=null}function wc(){this.pc=[]}function xc(){this.repeat=this.duration=this.startTime=null}function yc(a,b){this.gb=a;this.end=b}kc.TAG_NAME="MPD";lc.TAG_NAME="Period";mc.TAG_NAME="AdaptationSet";nc.TAG_NAME="Role";oc.TAG_NAME="ContentComponent";pc.TAG_NAME="Representation";
h.Pc=function(){switch(this.e){case 2:if(0<this.ya.length){try{this.ba.appendBuffer(this.ya.shift())}catch(a){ic(this,a)}break}for(var b=0;b<this.i.length;++b)this.Ha[this.i[b].index]=!0;this.i=[];case 3:this.e=P;this.v.resolve();this.v=null;break;case 4:jc(this)}};function jc(a){a.ia.resolve();a.ia=null;var b=Error("Current operation aborted.");b.type="aborted";ic(a,b)}function ic(a,b){a.v.reject(b);a.e=P;a.v=null;a.i=[];a.aa=null;a.ya=[]};function kc(){this.duration=this.c=this.type=this.id=null;this.t=5;this.p=[]}function lc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.duration=this.start=null;this.P=[]}function mc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.contentType=this.lang=null;this.fa=[];this.m=[]}function nc(){this.value=null}function oc(){this.contentType=this.lang=this.id=null}
function pc(){this.lang=this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.bandwidth=null;this.fa=[];this.Va=!1}function qc(){this.value=this.schemeIdUri=null;this.children=[];this.pssh=null}function rc(){this.parsedPssh=this.psshBox=null}function Q(){this.url=null}function R(){this.D=this.c=null;this.F=1;this.W=0;this.ma=this.S=this.Eb=null}function sc(){this.$=this.url=null}function tc(){this.$=this.url=null}
function S(){this.c=null;this.F=1;this.W=0;this.T=null;this.ca=1;this.ma=null;this.B=[]}function uc(){this.duration=this.startTime=this.qb=this.D=null}function vc(){this.F=1;this.W=0;this.T=null;this.ca=1;this.Rb=this.Fb=this.nb=this.ta=null}function wc(){this.pc=[]}function xc(){this.repeat=this.duration=this.startTime=null}function yc(a,b){this.hb=a;this.end=b}kc.TAG_NAME="MPD";lc.TAG_NAME="Period";mc.TAG_NAME="AdaptationSet";nc.TAG_NAME="Role";oc.TAG_NAME="ContentComponent";pc.TAG_NAME="Representation";
qc.TAG_NAME="ContentProtection";rc.TAG_NAME="cenc:pssh";Q.TAG_NAME="BaseURL";R.TAG_NAME="SegmentBase";sc.TAG_NAME="RepresentationIndex";tc.TAG_NAME="Initialization";S.TAG_NAME="SegmentList";uc.TAG_NAME="SegmentURL";vc.TAG_NAME="SegmentTemplate";wc.TAG_NAME="SegmentTimeline";xc.TAG_NAME="S";
kc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.type=T(b,"type",U);this.duration=T(b,"mediaPresentationDuration",zc);this.t=T(b,"minBufferTime",zc)||5;var c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.p=X(this,b,lc)};lc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.start=T(b,"start",zc);this.duration=T(b,"duration",zc);this.t=a.t;var c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.q=V(this,b,R);this.r=V(this,b,S);this.w=V(this,b,vc);this.P=X(this,b,mc)};
mc.prototype.parse=function(a,b){var c=V(this,b,oc)||{},d=V(this,b,nc);this.id=T(b,"id",U);this.lang=T(b,"lang",U)||c.lang;this.contentType=T(b,"contentType",U)||c.contentType;this.width=T(b,"width",Y);this.height=T(b,"height",Y);this.l=T(b,"mimeType",U);this.ea=T(b,"codecs",U);this.Va=d&&"main"==d.value;this.lang&&(this.lang=Pa(this.lang));this.t=a.t;c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.fa=X(this,b,qc);!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]);this.q=V(this,b,R)||
a.q;this.r=V(this,b,S)||a.r;this.w=V(this,b,vc)||a.w;this.m=X(this,b,pc);!this.l&&this.m.length&&(this.l=this.m[0].l,!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]))};nc.prototype.parse=function(a,b){this.value=T(b,"value",U)};oc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.lang=T(b,"lang",U);this.contentType=T(b,"contentType",U);this.lang&&(this.lang=Pa(this.lang))};
mc.prototype.parse=function(a,b){var c=V(this,b,oc)||{},d=V(this,b,nc);this.id=T(b,"id",U);this.lang=T(b,"lang",U)||c.lang;this.contentType=T(b,"contentType",U)||c.contentType;this.width=T(b,"width",Y);this.height=T(b,"height",Y);this.l=T(b,"mimeType",U);this.ea=T(b,"codecs",U);this.Va=d&&"main"==d.value;this.lang&&(this.lang=E(this.lang));this.t=a.t;c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.fa=X(this,b,qc);!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]);this.q=V(this,b,R)||
a.q;this.r=V(this,b,S)||a.r;this.w=V(this,b,vc)||a.w;this.m=X(this,b,pc);!this.l&&this.m.length&&(this.l=this.m[0].l,!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]))};nc.prototype.parse=function(a,b){this.value=T(b,"value",U)};oc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.lang=T(b,"lang",U);this.contentType=T(b,"contentType",U);this.lang&&(this.lang=E(this.lang))};
pc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.bandwidth=T(b,"bandwidth",Y);this.width=T(b,"width",Y)||a.width;this.height=T(b,"height",Y)||a.height;this.l=T(b,"mimeType",U)||a.l;this.ea=T(b,"codecs",U)||a.ea;this.lang=a.lang;this.t=a.t;var c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.fa=X(this,b,qc);this.q=V(this,b,R)||a.q;this.r=V(this,b,S)||a.r;this.w=V(this,b,vc)||a.w;0==this.fa.length&&(this.fa=a.fa)};
qc.prototype.parse=function(a,b){this.schemeIdUri=T(b,"schemeIdUri",U);this.value=T(b,"value",U);this.pssh=V(this,b,rc);this.children=b.children};rc.prototype.parse=function(a,b){var c=Ac(b);if(c){this.psshBox=qa(c);try{this.parsedPssh=new ab(this.psshBox)}catch(d){if(!(d instanceof RangeError))throw d;}}};Q.prototype.parse=function(a,b){this.url=Ac(b)};
R.prototype.parse=function(a,b){this.D=this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",Z)||0;this.Db=T(b,"indexRange",Bc);this.S=V(this,b,sc);this.ma=V(this,b,tc);this.S?this.S.$||(this.S.$=this.Db):(this.S=new sc,this.S.url=this.c,this.S.$=this.Db)};sc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};tc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};
S.prototype.parse=function(a,b){this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",Z)||0;this.T=T(b,"duration",Z);this.ca=T(b,"startNumber",Y)||1;this.ma=V(this,b,tc);this.B=X(this,b,uc)};uc.prototype.parse=function(a,b){var c=T(b,"media",U);this.D=W(a.c,c);this.pb=T(b,"mediaRange",Bc)};
vc.prototype.parse=function(a,b){this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",Z)||0;this.T=T(b,"duration",Z);this.ca=T(b,"startNumber",Y)||1;this.ta=T(b,"media",U);this.mb=T(b,"index",U);this.Eb=T(b,"initialization",U);this.Rb=V(this,b,wc)};wc.prototype.parse=function(a,b){this.pc=X(this,b,xc)};xc.prototype.parse=function(a,b){this.startTime=T(b,"t",Z);this.duration=T(b,"d",Z);this.repeat=T(b,"r",Z)};function W(a,b){var c=b?new K(b):null;return a?c?a.resolve(c):a:c}
qc.prototype.parse=function(a,b){this.schemeIdUri=T(b,"schemeIdUri",U);this.value=T(b,"value",U);this.pssh=V(this,b,rc);this.children=b.children};rc.prototype.parse=function(a,b){var c=Ac(b);if(c){this.psshBox=qa(c);try{this.parsedPssh=new $a(this.psshBox)}catch(d){if(!(d instanceof RangeError))throw d;}}};Q.prototype.parse=function(a,b){this.url=Ac(b)};
R.prototype.parse=function(a,b){this.D=this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",$)||0;this.Eb=T(b,"indexRange",Bc);this.S=V(this,b,sc);this.ma=V(this,b,tc);this.S?this.S.$||(this.S.$=this.Eb):(this.S=new sc,this.S.url=this.c,this.S.$=this.Eb)};sc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};tc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};
S.prototype.parse=function(a,b){this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",$)||0;this.T=T(b,"duration",$);this.ca=T(b,"startNumber",Y)||1;this.ma=V(this,b,tc);this.B=X(this,b,uc)};uc.prototype.parse=function(a,b){var c=T(b,"media",U);this.D=W(a.c,c);this.qb=T(b,"mediaRange",Bc)};
vc.prototype.parse=function(a,b){this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",$)||0;this.T=T(b,"duration",$);this.ca=T(b,"startNumber",Y)||1;this.ta=T(b,"media",U);this.nb=T(b,"index",U);this.Fb=T(b,"initialization",U);this.Rb=V(this,b,wc)};wc.prototype.parse=function(a,b){this.pc=X(this,b,xc)};xc.prototype.parse=function(a,b){this.startTime=T(b,"t",$);this.duration=T(b,"d",$);this.repeat=T(b,"r",$)};function W(a,b){var c=b?new L(b):null;return a?c?a.resolve(c):a:c}
function V(a,b,c){for(var d=null,e=0;e<b.children.length;e++)if(b.children[e].tagName==c.TAG_NAME){if(d)return null;d=b.children[e]}if(!d)return null;b=new c;b.parse.call(b,a,d);return b}function X(a,b,c){for(var d=[],e=0;e<b.children.length;e++)if(b.children[e].tagName==c.TAG_NAME){var f=new c;f.parse.call(f,a,b.children[e]);d.push(f)}return d}function Ac(a){a=a.firstChild;return a.nodeType!=Node.TEXT_NODE?null:a.nodeValue}function T(a,b,c){return c(a.getAttribute(b))}
function zc(a){if(!a)return null;var b=/^P(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!b)return null;a=0;var c=Z(b[1]);c&&(a+=86400*c);(c=Z(b[2]))&&(a+=3600*c);(c=Z(b[3]))&&(a+=60*c);b=window.parseFloat(b[4]);(b=isNaN(b)?null:b)&&(a+=b);return a}function Bc(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Z(b[1]);if(null==a)return null;b=Z(b[2]);return null==b?null:new yc(a,b)}function Y(a){a=window.parseInt(a,10);return 0<a?a:null}
function Z(a){a=window.parseInt(a,10);return 0<=a?a:null}function U(a){return a};function Cc(a,b){E.call(this,a);this.a=b;this.X=this.M=null}q(Cc,E);h=Cc.prototype;h.u=function(){this.X&&this.a.removeChild(this.X);this.parent=this.a=this.M=this.X=null};h.Xb=function(){return!0};h.start=function(a){this.M=a;a=this.Cb();this.X&&(this.vb(!1),this.a.removeChild(this.X));this.X=document.createElement("track");this.a.appendChild(this.X);this.X.src=this.M.D.toString();this.vb(a)};h.Qb=function(a){this.start(a)};h.ic=function(){};h.vb=function(a){this.X.track.mode=a?"showing":"disabled"};
h.Cb=function(){return this.X?"showing"==this.X.track.mode:!1};function Dc(a,b,c,d,e){E.call(this,a);this.a=b;this.ba=d;this.K=new dc(c,d,e);this.A=e;this.ab=this.Wa=this.H=this.M=null;this.e=Ec;this.Aa=""}q(Dc,E);var Ec=0;h=Dc.prototype;h.u=function(){this.e=null;Fc(this);this.A=this.M=this.H=this.Wa=null;this.K.u();this.parent=this.a=this.ba=this.K=null};h.Xb=function(){return 5==this.e};
h.start=function(a){if(this.e==Ec){this.M=a;this.Aa=a.l.split("/")[0];this.H=null;this.e=1;var b=Gc(this,a);Promise.all(b).then(t(this,function(b){var d=b[0];b=b[1];if(a.Ya){if(this.H=this.ib(a,d,b),!this.H)return d=Error("Failed to create SegmentIndex."),d.type="stream",Promise.reject(d)}else this.H=a.Ma;return(d=Kb(this.H,this.a.currentTime,a.t))?fc(this.K,d,b):Promise.reject(Error("No segments available."))})).then(t(this,function(){Hc(this,a);Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&
(this.e=Ec,a=x(a),this.dispatchEvent(a))}))}};
h.Qb=function(a,b){I("switch");I("switch logic");if(this.e!=Ec)if(1==this.e||2==this.e||3==this.e)this.Wa=this.Qb.bind(this,a,b);else if(a==this.M)this.va();else{if(b&&a.height&&a.height!=this.M.height){var c=function(b){b.videoHeight==a.height?J("switch"):window.setTimeout(c,50)}.bind(null,this.a);c()}this.e=2;var d=Gc(this,a),e=this.a.paused;b&&(this.a.pause(),Fc(this),d.push(this.K.abort()));var f;Promise.all(d).then(t(this,function(b){var c=b[0];f=b[1];if(a.Ya){if(this.H=this.ib(a,c,f),!this.H)return b=
Error("Failed to create SegmentIndex."),b.type="stream",Promise.reject(b)}else this.H=a.Ma;this.M=a;this.Aa=a.l.split("/")[0];this.e=3;this.K.reset();Hc(this,a);Fc(this);return this.K.abort()})).then(t(this,function(){var b=Math.max(a.t,15);return(b=Kb(this.H,this.a.currentTime,b))?fc(this.K,b,f):Promise.reject(Error("No segments available."))})).then(t(this,function(){b&&(this.a.currentTime-=.05,e||this.a.play());J("switch logic");Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&(a=x(a),this.dispatchEvent(a),
this.e=4,this.va())}))}};function Hc(a,b){var c=b.l.split("/")[0],c=w({type:"adaptation",bubbles:!0,contentType:c,size:"video"!=c?null:{width:b.width,height:b.height},bandwidth:b.bandwidth});a.dispatchEvent(c)}function Ic(a){a.e=4;if(a.Wa){var b=a.Wa;a.Wa=null;b()}else a.va()}
h.ic=function(){this.e!=Ec&&1!=this.e&&2!=this.e&&3!=this.e&&(Fc(this),this.K.abort().then(t(this,function(){var a=this.a.currentTime,b=Lb(this.H,a);a:{for(var c=this.K.ba.buffered,d=0;d<c.length;++d){var e=c.start(d)-ec,f=c.end(d)+ec;if(a>=e&&a<=f){a=!0;break a}}a=!1}return a&&this.K.Ha[b]?Promise.resolve():this.K.clear()})).then(t(this,function(){this.e=4;this.va()})))};h.vb=function(){};h.Cb=function(){return!0};function Gc(a,b){return[Jc(a,b.Ya),Jc(a,b.Ob)]}
function Jc(a,b){if(!b||!b.url)return Promise.resolve(null);var c=new cc(b.url.toString(),b.Pa,b.Ta);c.pa=a.A;return c.send()}h.ib=function(a,b,c){var d=null;if(0<=a.l.indexOf("mp4"))d=new Gb(a.D);else if(0<=a.l.indexOf("webm")){if(!c)return null;d=new Hb(a.D)}else return null;c=c?new DataView(c):null;b=new DataView(b);return(a=d.parse(c,b,a.Ya.Pa))?new Ib(a):null};
h.va=function(){Fc(this);var a=this.a.currentTime,b=Kc(this,a);if(b=Jb(this.H,b)){var c=Math.max(this.M.t,15);b.startTime-a>=c?this.ab=window.setTimeout(this.va.bind(this),1E3):fc(this.K,new Fb([b])).then(t(this,function(){this.va()})).catch(t(this,function(a){if("aborted"!=a.type){var b=x(a);this.dispatchEvent(b);"net"==a.type&&0==a.fd.status&&(this.ab=window.setTimeout(this.va.bind(this),5E3))}}))}else this.e=5,a=w({type:"ended"}),this.dispatchEvent(a)};
function Kc(a,b){for(var c=Lb(a.H,b);0<=c&&c<a.H.i.length&&a.K.Ha[c];)c++;return c}function Fc(a){a.ab&&(window.clearTimeout(a.ab),a.ab=null)};function Lc(a){E.call(this,null);this.I=a;this.hc=0;this.gc=new Yb;this.R=new MediaSource;this.a=null;this.C={};this.s={};this.b=new G;this.fb=new s;this.sa="";this.Pb=!1;this.A=new Ua;this.L=null;this.cb=new $b(this.A,this)}q(Lc,E);m("shaka.player.StreamVideoSource",Lc);h=Lc.prototype;h.u=function(){this.b.u();this.b=null;this.cb.u();this.cb=null;Mc(this);this.parent=this.A=this.fb=this.a=this.R=this.gc=this.C=null};
h.eb=function(a,b){if(0==this.I.J.length){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}this.parent=a;this.a=b;this.L=a.getStats();H(this.b,this.R,"sourceopen",this.Jc.bind(this));H(this.b,this.a,"seeking",this.Kb.bind(this));H(this.b,this.A,"bandwidth",this.Ib.bind(this));c=this.a.mediaKeys;this.a.src=window.URL.createObjectURL(this.R);c=this.a.setMediaKeys(c);return Promise.all([this.fb,c])};
function zc(a){if(!a)return null;var b=/^P(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!b)return null;a=0;var c=$(b[1]);c&&(a+=86400*c);(c=$(b[2]))&&(a+=3600*c);(c=$(b[3]))&&(a+=60*c);b=window.parseFloat(b[4]);(b=isNaN(b)?null:b)&&(a+=b);return a}function Bc(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=$(b[1]);if(null==a)return null;b=$(b[2]);return null==b?null:new yc(a,b)}function Y(a){a=window.parseInt(a,10);return 0<a?a:null}
function $(a){a=window.parseInt(a,10);return 0<=a?a:null}function U(a){return a};function Cc(a,b){F.call(this,a);this.a=b;this.X=this.M=null}q(Cc,F);h=Cc.prototype;h.u=function(){this.X&&this.a.removeChild(this.X);this.parent=this.a=this.M=this.X=null};h.Xb=function(){return!0};h.start=function(a){this.M=a;a=this.Db();this.X&&(this.wb(!1),this.a.removeChild(this.X));this.X=document.createElement("track");this.a.appendChild(this.X);this.X.src=this.M.D.toString();this.wb(a)};h.Qb=function(a){this.start(a)};h.ic=function(){};h.wb=function(a){this.X.track.mode=a?"showing":"disabled"};
h.Db=function(){return this.X?"showing"==this.X.track.mode:!1};function Dc(a,b,c,d,e){F.call(this,a);this.a=b;this.ba=d;this.K=new dc(c,d,e);this.A=e;this.bb=this.Xa=this.H=this.M=null;this.e=Ec;this.Aa=""}q(Dc,F);var Ec=0;h=Dc.prototype;h.u=function(){this.e=null;Fc(this);this.A=this.M=this.H=this.Xa=null;this.K.u();this.parent=this.a=this.ba=this.K=null};h.Xb=function(){return 5==this.e};
h.start=function(a){if(this.e==Ec){this.M=a;this.Aa=a.l.split("/")[0];this.H=null;this.e=1;var b=Gc(this,a);Promise.all(b).then(t(this,function(b){var d=b[0];b=b[1];if(a.Za){if(this.H=this.jb(a,d,b),!this.H)return d=Error("Failed to create SegmentIndex."),d.type="stream",Promise.reject(d)}else this.H=a.Ma;return(d=Kb(this.H,this.a.currentTime,a.t))?fc(this.K,d,b):Promise.reject(Error("No segments available."))})).then(t(this,function(){Hc(this,a);Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&
(this.e=Ec,a=D(a),this.dispatchEvent(a))}))}};
h.Qb=function(a,b){J("switch");J("switch logic");if(this.e!=Ec)if(1==this.e||2==this.e||3==this.e)this.Xa=this.Qb.bind(this,a,b);else if(a==this.M)this.va();else{if(b&&a.height&&a.height!=this.M.height){var c=function(b){b.videoHeight==a.height?K("switch"):window.setTimeout(c,50)}.bind(null,this.a);c()}this.e=2;var d=Gc(this,a),e=this.a.paused;b&&(this.a.pause(),Fc(this),d.push(this.K.abort()));var f;Promise.all(d).then(t(this,function(b){var c=b[0];f=b[1];if(a.Za){if(this.H=this.jb(a,c,f),!this.H)return b=
Error("Failed to create SegmentIndex."),b.type="stream",Promise.reject(b)}else this.H=a.Ma;this.M=a;this.Aa=a.l.split("/")[0];this.e=3;this.K.reset();Fc(this);return this.K.abort()})).then(t(this,function(){var b=Math.max(a.t,15);return(b=Kb(this.H,this.a.currentTime,b))?fc(this.K,b,f):Promise.reject(Error("No segments available."))})).then(t(this,function(){b&&(this.a.currentTime-=.05,e||this.a.play());K("switch logic");Hc(this,a);Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&(a=D(a),this.dispatchEvent(a),
this.e=4,this.va())}))}};function Hc(a,b){var c=b.l.split("/")[0],c=B({type:"adaptation",bubbles:!0,contentType:c,size:"video"!=c?null:{width:b.width,height:b.height},bandwidth:b.bandwidth});a.dispatchEvent(c)}function Ic(a){a.e=4;if(a.Xa){var b=a.Xa;a.Xa=null;b()}else a.va()}
h.ic=function(){this.e!=Ec&&1!=this.e&&2!=this.e&&3!=this.e&&(Fc(this),this.K.abort().then(t(this,function(){var a=this.a.currentTime,b=Lb(this.H,a);a:{for(var c=this.K.ba.buffered,d=0;d<c.length;++d){var e=c.start(d)-ec,f=c.end(d)+ec;if(a>=e&&a<=f){a=!0;break a}}a=!1}return a&&this.K.Ha[b]?Promise.resolve():this.K.clear()})).then(t(this,function(){this.e=4;this.va()})))};h.wb=function(){};h.Db=function(){return!0};function Gc(a,b){return[Jc(a,b.Za),Jc(a,b.Ob)]}
function Jc(a,b){if(!b||!b.url)return Promise.resolve(null);var c=new cc(b.url.toString(),b.Pa,b.Ta);c.pa=a.A;return c.send()}h.jb=function(a,b,c){var d=null;if(0<=a.l.indexOf("mp4"))d=new Gb(a.D);else if(0<=a.l.indexOf("webm")){if(!c)return null;d=new Hb(a.D)}else return null;c=c?new DataView(c):null;b=new DataView(b);return(a=d.parse(c,b,a.Za.Pa))?new Ib(a):null};
h.va=function(){Fc(this);var a=this.a.currentTime,b=Kc(this,a);if(b=Jb(this.H,b)){var c=Math.max(this.M.t,15);b.startTime-a>=c?this.bb=window.setTimeout(this.va.bind(this),1E3):fc(this.K,new Fb([b])).then(t(this,function(){this.va()})).catch(t(this,function(a){if("aborted"!=a.type){var b=D(a);this.dispatchEvent(b);"net"==a.type&&0==a.gd.status&&(this.bb=window.setTimeout(this.va.bind(this),5E3))}}))}else this.e=5,a=B({type:"ended"}),this.dispatchEvent(a)};
function Kc(a,b){for(var c=Lb(a.H,b);0<=c&&c<a.H.i.length&&a.K.Ha[c];)c++;return c}function Fc(a){a.bb&&(window.clearTimeout(a.bb),a.bb=null)};function Lc(a){F.call(this,null);this.I=a;this.hc=0;this.gc=new Yb;this.R=new MediaSource;this.a=null;this.C={};this.s={};this.b=new H;this.gb=new s;this.sa="";this.Pb=!1;this.A=new Ta;this.L=null;this.eb=new $b(this.A,this)}q(Lc,F);m("shaka.player.StreamVideoSource",Lc);h=Lc.prototype;h.u=function(){this.b.u();this.b=null;this.eb.u();this.eb=null;Mc(this);this.parent=this.A=this.gb=this.a=this.R=this.gc=this.C=null};
h.fb=function(a,b){if(0==this.I.J.length){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}this.parent=a;this.a=b;this.L=a.getStats();I(this.b,this.R,"sourceopen",this.Kc.bind(this));I(this.b,this.a,"seeking",this.Kb.bind(this));I(this.b,this.A,"bandwidth",this.Ib.bind(this));c=this.a.mediaKeys;this.a.src=window.URL.createObjectURL(this.R);c=this.a.setMediaKeys(c);return Promise.all([this.gb,c])};
h.load=function(a){this.sa=a;if(0==this.I.J.length)return a=Error("The manifest contains no stream information."),a.type="stream",Promise.reject(a);this.hc=this.I.t;this.gc.Mb(this.I.J);return 0==this.I.J.length||0==this.I.J[0].N.length?(a=Error("The manifest specifies content that cannot be displayed on this browser/platform."),a.type="stream",Promise.reject(a)):Promise.resolve()};
h.getVideoTracks=function(){if(!this.s.video)return[];for(var a=this.C.video,a=(a=a?a.M:null)?a.Y:0,b=[],c=0;c<this.s.video.length;++c)for(var d=this.s.video[c],e=0;e<d.j.length;++e){var f=d.j[e];if(f.enabled){var g=f.Y,f=new la(g,f.bandwidth,f.width,f.height);g==a&&(f.active=!0);b.push(f)}}return b};
h.getAudioTracks=function(){if(!this.s.audio)return[];for(var a=this.C.audio,a=(a=a?a.M:null)?a.Y:0,b=[],c=0;c<this.s.audio.length;++c)for(var d=this.s.audio[c],e=d.lang,f=0;f<d.j.length;++f){var g=d.j[f],k=g.Y,g=new na(k,g.bandwidth,e);k==a&&(g.active=!0);b.push(g)}return b};
h.Fa=function(){if(!this.s.text)return[];for(var a=this.C.text,b=a?a.M:null,b=b?b.Y:0,c=[],d=0;d<this.s.text.length;++d)for(var e=this.s.text[d],f=e.lang,g=0;g<e.j.length;++g){var k=e.j[g].Y,l=new ka(k,f);k==b&&(l.active=!0,l.enabled=a.Cb());c.push(l)}return c};h.lb=function(){return this.hc};h.kb=function(){return 0==this.I.J.length?[]:this.I.J[0].Bb()};
h.Za=function(a){for(var b={},c=this.I.J[0],d=0;d<c.N.length;++d){var e=c.N[d];b[e.Y]=e}this.s={};c=a.keys();for(d=0;d<c.length;++d){var e=c[d],f=a.get(e);this.s[e]=[];if("video"==e){var g=f[0].id;this.s[e].push(b[g])}else if("audio"==e)for(var g=f[0].la.split(";")[0],k=0;k<f.length;++k){var l=f[k];l.la.split(";")[0]==g&&this.s[e].push(b[l.id])}else for(k=0;k<f.length;++k)g=f[k].id,this.s[e].push(b[g])}this.Pb=!0;if(a=this.s.audio)Nc(this,a),Oa(2,this.sa,a[0].lang||this.sa)&&(this.Pb=!1);(a=this.s.text)&&
Nc(this,a)};h.za=function(a,b){return Oc(this,"video",a,b)};h.Na=function(a,b){return Oc(this,"audio",a,b)};h.Oa=function(a,b){return Oc(this,"text",a,b)};h.oa=function(a){var b=this.C.text;b&&b.vb(a)};h.ja=function(a){this.cb.enable(a)};h.wb=function(a){for(var b=0;b<this.I.J.length;++b)for(var c=this.I.J[b],d=0;d<c.N.length;++d)for(var e=c.N[d],f=0;f<e.j.length;++f){var g=e.j[f];g.enabled=!0;a.maxWidth&&g.width>a.maxWidth&&(g.enabled=!1);a.maxHeight&&g.height>a.maxHeight&&(g.enabled=!1)}};
h.Fa=function(){if(!this.s.text)return[];for(var a=this.C.text,b=a?a.M:null,b=b?b.Y:0,c=[],d=0;d<this.s.text.length;++d)for(var e=this.s.text[d],f=e.lang,g=0;g<e.j.length;++g){var k=e.j[g].Y,l=new ka(k,f);k==b&&(l.active=!0,l.enabled=a.Db());c.push(l)}return c};h.mb=function(){return this.hc};h.lb=function(){return 0==this.I.J.length?[]:this.I.J[0].Cb()};
h.$a=function(a){for(var b={},c=this.I.J[0],d=0;d<c.N.length;++d){var e=c.N[d];b[e.Y]=e}this.s={};c=a.keys();for(d=0;d<c.length;++d){var e=c[d],f=a.get(e);this.s[e]=[];if("video"==e){var g=f[0].id;this.s[e].push(b[g])}else if("audio"==e)for(var g=f[0].la.split(";")[0],k=0;k<f.length;++k){var l=f[k];l.la.split(";")[0]==g&&this.s[e].push(b[l.id])}else for(k=0;k<f.length;++k)g=f[k].id,this.s[e].push(b[g])}this.Pb=!0;if(a=this.s.audio)Nc(this,a),Oa(2,this.sa,a[0].lang||this.sa)&&(this.Pb=!1);(a=this.s.text)&&
Nc(this,a)};h.za=function(a,b){return Oc(this,"video",a,b)};h.Na=function(a,b){return Oc(this,"audio",a,b)};h.Oa=function(a,b){return Oc(this,"text",a,b)};h.oa=function(a){var b=this.C.text;b&&b.wb(a)};h.ja=function(a){this.eb.enable(a)};h.xb=function(a){for(var b=0;b<this.I.J.length;++b)for(var c=this.I.J[b],d=0;d<c.N.length;++d)for(var e=c.N[d],f=0;f<e.j.length;++f){var g=e.j[f];g.enabled=!0;a.maxWidth&&g.width>a.maxWidth&&(g.enabled=!1);a.maxHeight&&g.height>a.maxHeight&&(g.enabled=!1)}};
function Oc(a,b,c,d){if(!a.s[b])return!1;for(var e=0;e<a.s[b].length;++e)for(var f=a.s[b][e],g=0;g<f.j.length;++g){var k=f.j[g];if(k.Y==c)return Ga(a.L,k),a.C[b].Qb(k,d),!0}return!1}function Nc(a,b){for(var c=0;2>=c;++c)for(var d=0;d<b.length;++d){var e=b[d];if(Oa(c,a.sa,e.lang)){b.splice(d,1);b.splice(0,0,e);return}}for(d=0;d<b.length;++d)if(e=b[d],e.Va){b.splice(d,1);b.splice(0,0,e);break}}
h.Jc=function(){this.b.$a(this.R,"sourceopen");this.R.duration=this.I.J[0].duration;for(var a=[],b=["audio","video","text"],c=0;c<b.length;++c){var d=b[c];this.s[d]&&a.push(this.s[d][0])}b={};for(c=d=0;c<a.length;++c){var e=a[c],f=e.j[0];if("video"==e.contentType){var g;g=(g=ac(this.cb))?g.id:null;for(var k=0;k<e.j.length&&(f=e.j[k],f.Y!=g);++k);}else"audio"==e.contentType&&(f=e.j[Math.floor(e.j.length/2)]);Ga(this.L,f);if("text"==e.contentType)g=new Cc(this,this.a);else a:{g=f;var k=da(g),l=void 0;
try{l=this.R.addSourceBuffer(k)}catch(p){Mc(this);g=Error("Failed to create stream for "+k+".");g.type="stream";g.hd=p;this.fb.reject(g);g=null;break a}l.timestampOffset=this.I.J[0].start-g.timestampOffset;g=new Dc(this,this.a,this.R,l,this.A)}if(!g)return;this.C[e.contentType]=g;b[e.contentType]=f;f.Ma&&(e=Jb(f.Ma,0))&&(d=Math.max(d,e.startTime))}this.a.currentTime=d;for(var n in this.C)g=this.C[n],H(this.b,g,"ended",this.Pc.bind(this)),g.start(b[n]);this.oa(this.Pb);this.fb.resolve()};
function Mc(a){for(var b in a.C)a.C[b].u();a.C={}}h.Pc=function(){if("open"==this.R.readyState){for(var a in this.C)if(!this.C[a].Xb())return;this.R.endOfStream()}};h.Kb=function(){for(var a in this.C)this.C[a].ic()};h.Ib=function(){var a=this.L,b=Va(this.A);a.estimatedBandwidth=b;a.bandwidthHistory.push(new Ia(b))};function Pc(a){N.call(this,a);this.o.responseType="text"}q(Pc,N);Pc.prototype.send=function(){var a=this.url;return this.tb().then(function(b){b=b.responseText;if(b=(new DOMParser).parseFromString(b,"text/xml")){var c={c:new K(a)};b=V(c,b,kc)}else b=null;if(b)return Promise.resolve(b);b=Error("MPD parse failure.");b.type="mpd";return Promise.reject(b)})};function Qc(a){this.Ua=a;this.nb=new ja}
Qc.prototype.Mb=function(a){this.nb=new ja;for(var b=0;b<a.p.length;++b)for(var c=a.p[b],d=0;d<c.P.length;++d){var e=c.P[d];if("text"!=e.contentType)for(var f=0;f<e.m.length;++f){var g=e.m[f],k=0,k=k+(g.q?1:0),k=k+(g.r?1:0),k=k+(g.w?1:0);0==k?(e.m.splice(f,1),--f):1!=k&&(g.q?(g.r=null,g.w=null):g.r&&(g.w=null));!g.q||g.q.S&&g.q.S.$&&g.q.D||(e.m.splice(f,1),--f)}}Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d)for(e=c.P[d],f=0;f<e.m.length;++f)if(g=e.m[f],g.w)if(k=g.w,k.mb){a:{var k=
g,l=k.w,p=new R,n;n=k;var r=n.w;if(r.mb){var v=new sc;(r=Sc(r.mb,n.id,null,n.bandwidth,null))?(v.url=n.c&&r?n.c.resolve(r):r,n=v):n=null}else n=null;p.S=n;if(p.S){p.ma=Tc(k);n=void 0;if(l.ta){l=Sc(l.ta,k.id,1,k.bandwidth,0);if(!l)break a;n=k.c?k.c.resolve(l):l}else n=k.c;p.D=n;k.q=p}}g.q||(e.m.splice(f,1),--f)}else if(k.Rb){a:if(k=g,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=p.Rb.pc;for(var v=1,r=-1,u=0;u<n.length;++u)for(var C=n[u].repeat||0,Ca=0;Ca<=C;++Ca){if(!n[u].duration)break a;
var $;$=n[u].startTime&&0==Ca?n[u].startTime:0==u&&0==Ca?0:r;if(0<=r&&$!=r){var M=l.B[l.B.length-1];M.duration+=$-r}r=$+n[u].duration;M=Sc(p.ta,k.id,v-1+p.ca,k.bandwidth,$);if(!M)break a;var M=k.c?k.c.resolve(M):M,Da=new uc;Da.D=M;Da.startTime=$;Da.duration=n[u].duration;l.B.push(Da);++v}k.r=l}g.r||(e.m.splice(f,1),--f)}else if(k.T)if(null!=c.duration){a:if(k=g,n=c.duration,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.T=p.T;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=Math.floor(n/(p.T/p.F));for(v=1;v<=n;++v){r=(v-1+(p.ca-
1))*p.T;u=Sc(p.ta,k.id,v-1+p.ca,k.bandwidth,r);if(!u)break a;u=k.c?k.c.resolve(u):u;C=new uc;C.D=u;C.startTime=r;C.duration=p.T;l.B.push(C)}k.r=l}g.r||(e.m.splice(f,1),--f)}else e.m.splice(f,1),--f;else e.m.splice(f,1),--f;Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d){f=e=c.P[d];g=null;for(k=0;k<f.m.length;++k)(p=f.m[k].l||"",g)?p!=g&&(f.m.splice(k,1),--k):g=p;0==e.m.length&&(c.P.splice(d,1),--d)}this.nb.t=a.t||0;for(b=0;b<a.p.length;++b){c=a.p[b];d=new ia;d.start=c.start||0;d.duration=
c.duration||0;for(e=0;e<c.P.length;++e){f=c.P[e];g=new fa;g.Va=f.Va;g.contentType=f.contentType||"";g.lang=f.lang||"";for(k=0;k<f.m.length;++k){l=f.m[k];n=p=g.Sa.slice(0);v=l;r=[];if(0==v.fa.length)r.push(Ka());else if(this.Ua)for(u=0;u<v.fa.length;++u)(C=this.Ua(v.fa[u]))&&r.push(C);v=r;if(0==n.length)Array.prototype.push.apply(n,v);else for(r=0;r<n.length;++r){u=!1;for(C=0;C<v.length;++C)if(n[r].key()==v[C].key()){u=!0;break}u||(n.splice(r,1),--r)}if(!(0==p.length&&0<g.Sa.length)){a:{n=new ba;n.id=
l.id;n.t=l.t;n.bandwidth=l.bandwidth;n.width=l.width;n.height=l.height;n.l=l.l||"";n.ea=l.ea||"";n.D=l.c;if(l.q)n.timestampOffset=l.q.W/l.q.F,n.D=l.q.D,n.Ya=Uc(l.q.S),n.Ob=Uc(l.q.ma);else if(l.r&&(n.timestampOffset=l.r.W/l.r.F,n.Ob=Uc(l.r.ma),n.Ma=this.ib(l.r),!n.Ma)){l=null;break a}l=n}l&&(g.j.push(l),g.Sa=p)}}d.N.push(g)}this.nb.J.push(d)}};
h.Kc=function(){this.b.ab(this.R,"sourceopen");this.R.duration=this.I.J[0].duration;for(var a=[],b=["audio","video","text"],c=0;c<b.length;++c){var d=b[c];this.s[d]&&a.push(this.s[d][0])}b={};for(c=d=0;c<a.length;++c){var e=a[c],f=e.j[0];if("video"==e.contentType){var g;g=(g=ac(this.eb))?g.id:null;for(var k=0;k<e.j.length&&(f=e.j[k],f.Y!=g);++k);}else"audio"==e.contentType&&(f=e.j[Math.floor(e.j.length/2)]);Ga(this.L,f);if("text"==e.contentType)g=new Cc(this,this.a);else a:{g=f;var k=da(g),l=void 0;
try{l=this.R.addSourceBuffer(k)}catch(p){Mc(this);g=Error("Failed to create stream for "+k+".");g.type="stream";g.jd=p;this.gb.reject(g);g=null;break a}l.timestampOffset=this.I.J[0].start-g.timestampOffset;g=new Dc(this,this.a,this.R,l,this.A)}if(!g)return;this.C[e.contentType]=g;b[e.contentType]=f;f.Ma&&(e=Jb(f.Ma,0))&&(d=Math.max(d,e.startTime))}this.a.currentTime=d;for(var n in this.C)g=this.C[n],I(this.b,g,"ended",this.Qc.bind(this)),g.start(b[n]);this.oa(this.Pb);this.gb.resolve()};
function Mc(a){for(var b in a.C)a.C[b].u();a.C={}}h.Qc=function(){if("open"==this.R.readyState){for(var a in this.C)if(!this.C[a].Xb())return;this.R.endOfStream()}};h.Kb=function(){for(var a in this.C)this.C[a].ic()};h.Ib=function(){var a=this.L,b=Ua(this.A);a.estimatedBandwidth=b;a.bandwidthHistory.push(new Ia(b))};function Pc(a){N.call(this,a);this.o.responseType="text"}q(Pc,N);Pc.prototype.send=function(){var a=this.url;return this.ub().then(function(b){b=b.responseText;if(b=(new DOMParser).parseFromString(b,"text/xml")){var c={c:new L(a)};b=V(c,b,kc)}else b=null;if(b)return Promise.resolve(b);b=Error("MPD parse failure.");b.type="mpd";return Promise.reject(b)})};function Qc(a){this.Ua=a;this.ob=new ja}
Qc.prototype.Mb=function(a){this.ob=new ja;for(var b=0;b<a.p.length;++b)for(var c=a.p[b],d=0;d<c.P.length;++d){var e=c.P[d];if("text"!=e.contentType)for(var f=0;f<e.m.length;++f){var g=e.m[f],k=0,k=k+(g.q?1:0),k=k+(g.r?1:0),k=k+(g.w?1:0);0==k?(e.m.splice(f,1),--f):1!=k&&(g.q?(g.r=null,g.w=null):g.r&&(g.w=null));!g.q||g.q.S&&g.q.S.$&&g.q.D||(e.m.splice(f,1),--f)}}Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d)for(e=c.P[d],f=0;f<e.m.length;++f)if(g=e.m[f],g.w)if(k=g.w,k.nb){a:{var k=
g,l=k.w,p=new R,n;n=k;var r=n.w;if(r.nb){var w=new sc;(r=Sc(r.nb,n.id,null,n.bandwidth,null))?(w.url=n.c&&r?n.c.resolve(r):r,n=w):n=null}else n=null;p.S=n;if(p.S){p.ma=Tc(k);n=void 0;if(l.ta){l=Sc(l.ta,k.id,1,k.bandwidth,0);if(!l)break a;n=k.c?k.c.resolve(l):l}else n=k.c;p.D=n;k.q=p}}g.q||(e.m.splice(f,1),--f)}else if(k.Rb){a:if(k=g,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=p.Rb.pc;for(var w=1,r=-1,u=0;u<n.length;++u)for(var C=n[u].repeat||0,Ca=0;Ca<=C;++Ca){if(!n[u].duration)break a;
var Z;Z=n[u].startTime&&0==Ca?n[u].startTime:0==u&&0==Ca?0:r;if(0<=r&&Z!=r){var M=l.B[l.B.length-1];M.duration+=Z-r}r=Z+n[u].duration;M=Sc(p.ta,k.id,w-1+p.ca,k.bandwidth,Z);if(!M)break a;var M=k.c?k.c.resolve(M):M,Da=new uc;Da.D=M;Da.startTime=Z;Da.duration=n[u].duration;l.B.push(Da);++w}k.r=l}g.r||(e.m.splice(f,1),--f)}else if(k.T)if(null!=c.duration){a:if(k=g,n=c.duration,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.T=p.T;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=Math.floor(n/(p.T/p.F));for(w=1;w<=n;++w){r=(w-1+(p.ca-
1))*p.T;u=Sc(p.ta,k.id,w-1+p.ca,k.bandwidth,r);if(!u)break a;u=k.c?k.c.resolve(u):u;C=new uc;C.D=u;C.startTime=r;C.duration=p.T;l.B.push(C)}k.r=l}g.r||(e.m.splice(f,1),--f)}else e.m.splice(f,1),--f;else e.m.splice(f,1),--f;Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d){f=e=c.P[d];g=null;for(k=0;k<f.m.length;++k)(p=f.m[k].l||"",g)?p!=g&&(f.m.splice(k,1),--k):g=p;0==e.m.length&&(c.P.splice(d,1),--d)}this.ob.t=a.t||0;for(b=0;b<a.p.length;++b){c=a.p[b];d=new ia;d.start=c.start||0;d.duration=
c.duration||0;for(e=0;e<c.P.length;++e){f=c.P[e];g=new fa;g.Va=f.Va;g.contentType=f.contentType||"";g.lang=f.lang||"";for(k=0;k<f.m.length;++k){l=f.m[k];n=p=g.Sa.slice(0);w=l;r=[];if(0==w.fa.length)r.push(Ka());else if(this.Ua)for(u=0;u<w.fa.length;++u)(C=this.Ua(w.fa[u]))&&r.push(C);w=r;if(0==n.length)Array.prototype.push.apply(n,w);else for(r=0;r<n.length;++r){u=!1;for(C=0;C<w.length;++C)if(n[r].key()==w[C].key()){u=!0;break}u||(n.splice(r,1),--r)}if(!(0==p.length&&0<g.Sa.length)){a:{n=new ba;n.id=
l.id;n.t=l.t;n.bandwidth=l.bandwidth;n.width=l.width;n.height=l.height;n.l=l.l||"";n.ea=l.ea||"";n.D=l.c;if(l.q)n.timestampOffset=l.q.W/l.q.F,n.D=l.q.D,n.Za=Uc(l.q.S),n.Ob=Uc(l.q.ma);else if(l.r&&(n.timestampOffset=l.r.W/l.r.F,n.Ob=Uc(l.r.ma),n.Ma=this.jb(l.r),!n.Ma)){l=null;break a}l=n}l&&(g.j.push(l),g.Sa=p)}}d.N.push(g)}this.ob.J.push(d)}};
function Rc(a){if(a.p.length){"static"==a.type&&null==a.p[0].start&&(a.p[0].start=0);var b=function(a){return 0==a||!!a};1==a.p.length&&!b(a.p[0].duration)&&b(a.duration)&&(a.p[0].duration=a.duration);for(var c=0;c<a.p.length;++c){var d=a.p[c-1],e=a.p[c];Vc(e);var f=a.p[c+1]||{start:a.duration};!b(e.start)&&d&&b(d.duration)&&(e.start=d.start+d.duration);!b(e.duration)&&b(f.start)&&(e.duration=f.start-e.start)}c=a.p[a.p.length-1];!b(a.duration)&&b(c.start)&&b(c.duration)&&(a.duration=c.start+c.duration)}}
function Vc(a){if(null==a.duration){for(var b=null,c=0;c<a.P.length;++c)for(var d=a.P[c],e=0;e<d.m.length;++e){var f=d.m[e];if(f.r){f=f.r;if(0==f.B.length)f=0;else if(f.T)f=f.T/f.F*f.B.length;else{for(var g=f.B[0].startTime,k=0;k<f.B.length;++k)g+=f.B[k].duration;f=g/f.F}b=Math.max(b,f)}}a.duration=b}}function Tc(a){var b=a.w;if(!b.Eb)return null;var c=new tc,b=Sc(b.Eb,a.id,null,a.bandwidth,null);if(!b)return null;c.url=a.c&&b?a.c.resolve(b):b;return c}
function Sc(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};a=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;c=Math.max(0,c-a.length);return Array(c+1).join("0")+a});try{return new K(a)}catch(g){if(g instanceof URIError)return null;throw g;}}
function Uc(a){if(!a)return null;var b=new ea;b.url=a.url;a.$&&(b.Pa=a.$.gb,b.Ta=a.$.end);return b}Qc.prototype.ib=function(a){for(var b=a.F,c=a.T,d=[],e=0;e<a.B.length;++e){var f=a.B[e],g=0,k=null,l=0,p=null;if(null!=f.startTime)0<e&&null!=a.B[e-1].startTime&&(g=a.B[e-1].startTime),g=f.startTime/b,k=g+f.duration/b;else{if(!c)return null;0==e?g=0:(g=d[e-1].startTime,g+=c/b);k=g+c/b;f.pb&&(l=f.pb.gb,p=f.pb.end)}d.push(new Eb(e,g,k,l,p,f.D))}return new Ib(d)};function Wc(a,b){E.call(this,null);this.Ec=a;this.Ua=b;this.g=null;this.Ca=!0}q(Wc,E);m("shaka.player.DashVideoSource",Wc);h=Wc.prototype;h.u=function(){this.g&&(this.g.u(),this.g=null);this.parent=this.Ua=null};h.eb=function(a,b){if(!this.g){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}return this.g.eb(a,b)};h.load=function(a){return(new Pc(this.Ec)).send().then(t(this,function(b){var c=new Qc(this.Ua);c.Mb(b);this.g=new Lc(c.nb);this.g.ja(this.Ca);return this.g.load(a)}))};
h.getVideoTracks=function(){return this.g?this.g.getVideoTracks():[]};h.getAudioTracks=function(){return this.g?this.g.getAudioTracks():[]};h.Fa=function(){return this.g?this.g.Fa():[]};h.lb=function(){return this.g?this.g.lb():0};h.kb=function(){return this.g?this.g.kb():[]};h.Za=function(a){return this.g.Za(a)};h.za=function(a,b){return this.g?this.g.za(a,b):!1};h.Na=function(a,b){return this.g?this.g.Na(a,b):!1};h.Oa=function(a,b){return this.g?this.g.Oa(a,b):!1};h.oa=function(a){this.g&&this.g.oa(a)};
h.ja=function(a){this.Ca=a;this.g&&this.g.ja(a)};h.wb=function(a){this.g&&this.g.wb(a)};}.bind(window))()
function Vc(a){if(null==a.duration){for(var b=null,c=0;c<a.P.length;++c)for(var d=a.P[c],e=0;e<d.m.length;++e){var f=d.m[e];if(f.r){f=f.r;if(0==f.B.length)f=0;else if(f.T)f=f.T/f.F*f.B.length;else{for(var g=f.B[0].startTime,k=0;k<f.B.length;++k)g+=f.B[k].duration;f=g/f.F}b=Math.max(b,f)}}a.duration=b}}function Tc(a){var b=a.w;if(!b.Fb)return null;var c=new tc,b=Sc(b.Fb,a.id,null,a.bandwidth,null);if(!b)return null;c.url=a.c&&b?a.c.resolve(b):b;return c}
function Sc(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};a=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;c=Math.max(0,c-a.length);return Array(c+1).join("0")+a});try{return new L(a)}catch(g){if(g instanceof URIError)return null;throw g;}}
function Uc(a){if(!a)return null;var b=new ea;b.url=a.url;a.$&&(b.Pa=a.$.hb,b.Ta=a.$.end);return b}Qc.prototype.jb=function(a){for(var b=a.F,c=a.T,d=[],e=0;e<a.B.length;++e){var f=a.B[e],g=0,k=null,l=0,p=null;if(null!=f.startTime)0<e&&null!=a.B[e-1].startTime&&(g=a.B[e-1].startTime),g=f.startTime/b,k=g+f.duration/b;else{if(!c)return null;0==e?g=0:(g=d[e-1].startTime,g+=c/b);k=g+c/b;f.qb&&(l=f.qb.hb,p=f.qb.end)}d.push(new Eb(e,g,k,l,p,f.D))}return new Ib(d)};function Wc(a,b){F.call(this,null);this.Ec=a;this.Ua=b;this.g=null;this.Ca=!0}q(Wc,F);m("shaka.player.DashVideoSource",Wc);h=Wc.prototype;h.u=function(){this.g&&(this.g.u(),this.g=null);this.parent=this.Ua=null};h.fb=function(a,b){if(!this.g){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}return this.g.fb(a,b)};h.load=function(a){return(new Pc(this.Ec)).send().then(t(this,function(b){var c=new Qc(this.Ua);c.Mb(b);this.g=new Lc(c.ob);this.g.ja(this.Ca);return this.g.load(a)}))};
h.getVideoTracks=function(){return this.g?this.g.getVideoTracks():[]};h.getAudioTracks=function(){return this.g?this.g.getAudioTracks():[]};h.Fa=function(){return this.g?this.g.Fa():[]};h.mb=function(){return this.g?this.g.mb():0};h.lb=function(){return this.g?this.g.lb():[]};h.$a=function(a){return this.g.$a(a)};h.za=function(a,b){return this.g?this.g.za(a,b):!1};h.Na=function(a,b){return this.g?this.g.Na(a,b):!1};h.Oa=function(a,b){return this.g?this.g.Oa(a,b):!1};h.oa=function(a){this.g&&this.g.oa(a)};
h.ja=function(a){this.Ca=a;this.g&&this.g.ja(a)};h.xb=function(a){this.g&&this.g.xb(a)};}.bind((typeof(module)!="undefined"&&module.exports)?module.exports:window))()
//# sourceMappingURL=shaka-player.compiled.debug.map

@@ -1,113 +0,114 @@

(function(){var h,aa=this;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=d[e]?d[e]:d[e]={}:d[e]=b}function q(a,b){function c(){}c.prototype=b.prototype;a.kd=b.prototype;a.prototype=new c;a.gd=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};function ba(){this.Y=ca++;this.id=null;this.timestampOffset=this.t=0;this.height=this.width=this.bandwidth=null;this.ea=this.l="";this.Ma=this.Ob=this.Ya=this.D=null;this.enabled=!0}var ca=0;function da(a){var b=a.l||"";a.ea&&(b+='; codecs="'+a.ea+'"');return b}function ea(){this.url=null;this.Pa=0;this.Ta=null}function fa(){this.Y=ga++;this.contentType="";this.j=[];this.Sa=[];this.lang="";this.Va=!1}var ga=0;
fa.prototype.Bb=function(){for(var a=[],b=0;b<this.Sa.length;++b){var c=new ha;c.id=this.Y;c.ha=this.Sa[b];c.contentType=this.contentType;c.la=this.j.length?da(this.j[0]):"";a.push(c)}return a};function ia(){this.duration=this.start=0;this.N=[]}ia.prototype.Bb=function(){for(var a=[],b=0;b<this.N.length;++b)a.push.apply(a,this.N[b].Bb());return a};function ja(){this.t=0;this.J=[]}function ha(){this.id=0;this.ha=null;this.la=this.contentType=""};function ka(a,b){this.id=a;this.lang=b||"unknown";this.enabled=this.active=!1}m("shaka.player.TextTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:0});function la(a,b,c,d){this.id=a;this.bandwidth=b||0;this.width=c||0;this.height=d||0;this.active=!1}function ma(a,b){var c=a.width*a.height,d=b.width*b.height;return c<d?-1:c>d?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0}m("shaka.player.VideoTrack.compare",ma);function na(a,b,c){this.id=a;this.bandwidth=b||0;this.lang=c||"unknown";this.active=!1}m("shaka.player.AudioTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0});function s(){var a,b,c=new Promise(function(c,e){a=c;b=e});c.resolve=a;c.reject=b;return c};function t(a,b){return b.bind(a)};function w(a){var b=new CustomEvent(a.type,{detail:a.detail,bubbles:!!a.bubbles}),c;for(c in a)b[c]=a[c];return b}function x(a){return new CustomEvent("error",{detail:a,bubbles:!0})};function oa(a,b){for(var c={},d=0;d<a.length;++d){var e=b?b(a[d]):a[d].toString();c[e]=a[d]}var d=[],f;for(f in c)d.push(c[f]);return d};function pa(a){return String.fromCharCode.apply(null,a)}m("shaka.util.Uint8ArrayUtils.toString",pa);function y(a){for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}m("shaka.util.Uint8ArrayUtils.fromString",y);m("shaka.util.Uint8ArrayUtils.toBase64",function(a,b){var c=void 0==b?!0:b,d=window.btoa(pa(a)).replace(/\+/g,"-").replace(/\//g,"_");return c?d:d.replace(/=*$/,"")});function qa(a){return y(window.atob(a.replace(/-/g,"+").replace(/_/g,"/")))}
m("shaka.util.Uint8ArrayUtils.fromBase64",qa);m("shaka.util.Uint8ArrayUtils.fromHex",function(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 ra(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}m("shaka.util.Uint8ArrayUtils.toHex",ra);function sa(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 z(a){this.h=a;this.xa=new ta(a,ua)}var va=[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])];z.prototype.ra=function(){return this.xa.ra()};
function A(a){var b;b=wa(a);if(7<b.length)throw new RangeError("EbmlParser: EBML ID must be at most 7 bytes.");for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=wa(a);a:{for(d=0;d<va.length;d++)if(sa(c,va[d])){d=!0;break a}d=!1}if(d)throw new RangeError("EbmlParser: Element cannot contain dynamically sized data.");if(8==c.length&&c[1]&224)throw new RangeError("EbmlParser: Variable sized integer value must be at most 53 bits.");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.xa.f+c<=a.h.byteLength?c:a.h.byteLength-a.xa.f;d=new DataView(a.h.buffer,a.h.byteOffset+a.xa.f,c);B(a.xa,c);return new xa(b,d)}function wa(a){var b=ya(a.xa),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new RangeError("EbmlParser: Variable sized integer must fit within 8 bytes.");var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=ya(a.xa);return d}function xa(a,b){this.id=a;this.h=b}
(function(){var h,aa=this;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=d[e]?d[e]:d[e]={}:d[e]=b}function q(a,b){function c(){}c.prototype=b.prototype;a.ld=b.prototype;a.prototype=new c;a.hd=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};function ba(){this.Y=ca++;this.id=null;this.timestampOffset=this.t=0;this.height=this.width=this.bandwidth=null;this.ea=this.l="";this.Ma=this.Ob=this.Za=this.D=null;this.enabled=!0}var ca=0;function da(a){var b=a.l||"";a.ea&&(b+='; codecs="'+a.ea+'"');return b}function ea(){this.url=null;this.Pa=0;this.Ta=null}function fa(){this.Y=ga++;this.contentType="";this.j=[];this.Sa=[];this.lang="";this.Va=!1}var ga=0;
fa.prototype.Cb=function(){for(var a=[],b=0;b<this.Sa.length;++b){var c=new ha;c.id=this.Y;c.ha=this.Sa[b];c.contentType=this.contentType;c.la=this.j.length?da(this.j[0]):"";a.push(c)}return a};function ia(){this.duration=this.start=0;this.N=[]}ia.prototype.Cb=function(){for(var a=[],b=0;b<this.N.length;++b)a.push.apply(a,this.N[b].Cb());return a};function ja(){this.t=0;this.J=[]}function ha(){this.id=0;this.ha=null;this.la=this.contentType=""};function ka(a,b){this.id=a;this.lang=b||"unknown";this.enabled=this.active=!1}m("shaka.player.TextTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:0});function la(a,b,c,d){this.id=a;this.bandwidth=b||0;this.width=c||0;this.height=d||0;this.active=!1}function ma(a,b){var c=a.width*a.height,d=b.width*b.height;return c<d?-1:c>d?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0}m("shaka.player.VideoTrack.compare",ma);function na(a,b,c){this.id=a;this.bandwidth=b||0;this.lang=c||"unknown";this.active=!1}m("shaka.player.AudioTrack.compare",function(a,b){return a.lang<b.lang?-1:a.lang>b.lang?1:a.bandwidth<b.bandwidth?-1:a.bandwidth>b.bandwidth?1:0});function s(){var a,b,c=new Promise(function(c,e){a=c;b=e});c.resolve=a;c.reject=b;return c};function t(a,b){return b.bind(a)};function oa(a,b){for(var c={},d=0;d<a.length;++d){var e=b?b(a[d]):a[d].toString();c[e]=a[d]}var d=[],f;for(f in c)d.push(c[f]);return d};function pa(a){return String.fromCharCode.apply(null,a)}m("shaka.util.Uint8ArrayUtils.toString",pa);function v(a){for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}m("shaka.util.Uint8ArrayUtils.fromString",v);m("shaka.util.Uint8ArrayUtils.toBase64",function(a,b){var c=void 0==b?!0:b,d=window.btoa(pa(a)).replace(/\+/g,"-").replace(/\//g,"_");return c?d:d.replace(/=*$/,"")});function qa(a){return v(window.atob(a.replace(/-/g,"+").replace(/_/g,"/")))}
m("shaka.util.Uint8ArrayUtils.fromBase64",qa);m("shaka.util.Uint8ArrayUtils.fromHex",function(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 ra(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}m("shaka.util.Uint8ArrayUtils.toHex",ra);function sa(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 x(a){this.h=a;this.xa=new ta(a,ua)}var va=[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])];x.prototype.ra=function(){return this.xa.ra()};
function y(a){var b;b=wa(a);if(7<b.length)throw new RangeError("EbmlParser: EBML ID must be at most 7 bytes.");for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=wa(a);a:{for(d=0;d<va.length;d++)if(sa(c,va[d])){d=!0;break a}d=!1}if(d)throw new RangeError("EbmlParser: Element cannot contain dynamically sized data.");if(8==c.length&&c[1]&224)throw new RangeError("EbmlParser: Variable sized integer value must be at most 53 bits.");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.xa.f+c<=a.h.byteLength?c:a.h.byteLength-a.xa.f;d=new DataView(a.h.buffer,a.h.byteOffset+a.xa.f,c);z(a.xa,c);return new xa(b,d)}function wa(a){var b=ya(a.xa),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new RangeError("EbmlParser: Variable sized integer must fit within 8 bytes.");var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=ya(a.xa);return d}function xa(a,b){this.id=a;this.h=b}
function za(a){if(8<a.h.byteLength)throw new RangeError("EbmlElement: Unsigned integer has too many bytes.");if(8==a.h.byteLength&&a.h.getUint8(0)&224)throw new RangeError("EbmlParser: Unsigned integer must be at most 53 bits.");for(var b=0,c=0;c<a.h.byteLength;c++)var d=a.h.getUint8(c),b=256*b+d;return b};function Aa(){this.V={}}h=Aa.prototype;h.push=function(a,b){this.V.hasOwnProperty(a)?this.V[a].push(b):this.V[a]=[b]};h.set=function(a,b){this.V[a]=b};h.has=function(a){return this.V.hasOwnProperty(a)};h.get=function(a){return(a=this.V[a])?a.slice():null};h.remove=function(a,b){var c=this.V[a];if(c)for(var d=0;d<c.length;++d)c[d]==b&&(c.splice(d,1),--d)};h.keys=function(){var a=[],b;for(b in this.V)a.push(b);return a};h.clear=function(){this.V={}};function Ba(){this.streamStats=null;this.droppedFrames=this.decodedFrames=NaN;this.bufferingTime=this.playTime=this.estimatedBandwidth=0;this.playbackLatency=NaN;this.bufferingHistory=[];this.bandwidthHistory=[];this.streamHistory=[]}function Ea(a){a.playTime+=Fa("playing")/1E3}function Ga(a,b){var c=new Ha(b);a.streamHistory.push(new Ia(c));if(c.videoHeight||!a.streamStats)a.streamStats=c}
function Ha(a){this.videoWidth=a.width;this.videoHeight=a.height;this.videoMimeType=a.l;this.videoBandwidth=a.bandwidth}function Ia(a){this.timestamp=Date.now()/1E3;this.value=a};function D(a,b,c,d,e,f){this.keySystem=a;this.nc=b;this.$b=c;this.withCredentials=d;this.Ga=[];this.Zb=f;e&&this.Ga.push(e)}m("shaka.player.DrmSchemeInfo",D);function Ja(){this.maxWidth=this.maxHeight=null}function Ka(){return new D("",!1,"",!1,null,null)}D.createUnencrypted=Ka;function La(a,b){var c=new D(a.keySystem,a.nc,a.$b,a.withCredentials,null,a.Zb);c.Ga=oa(a.Ga.concat(b.Ga),function(a){return Array.prototype.join.apply(a.initData)});return c}D.combine=La;D.prototype.key=function(){return JSON.stringify(this)};function Ma(a){this.Ub=Math.exp(Math.log(.5)/a);this.xb=this.zb=0}Ma.prototype.sb=function(a,b){var c=Math.pow(this.Ub,a);this.zb=b*(1-c)+c*this.zb;this.xb+=a};function Na(a){return a.zb/(1-Math.pow(a.Ub,a.xb))};function Oa(a,b,c){Pa(b);Pa(c);return c==b||a>=Qa&&c==b.split("-")[0]||a>=Ra&&c.split("-")[0]==b.split("-")[0]?!0:!1}var Qa=1,Ra=2;function Pa(a){a=a.toLowerCase().split("-");var b=Sa[a[0]];b&&(a[0]=b);return a.join("-")}
var Sa={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",
function Ha(a){this.videoWidth=a.width;this.videoHeight=a.height;this.videoMimeType=a.l;this.videoBandwidth=a.bandwidth}function Ia(a){this.timestamp=Date.now()/1E3;this.value=a};function A(a,b,c,d,e,f){this.keySystem=a;this.nc=b;this.$b=c;this.withCredentials=d;this.Ga=[];this.Zb=f;e&&this.Ga.push(e)}m("shaka.player.DrmSchemeInfo",A);function Ja(){this.maxWidth=this.maxHeight=null}function Ka(){return new A("",!1,"",!1,null,null)}A.createUnencrypted=Ka;function La(a,b){var c=new A(a.keySystem,a.nc,a.$b,a.withCredentials,null,a.Zb);c.Ga=oa(a.Ga.concat(b.Ga),function(a){return Array.prototype.join.apply(a.initData)});return c}A.combine=La;A.prototype.key=function(){return JSON.stringify(this)};function Ma(a){this.Ub=Math.exp(Math.log(.5)/a);this.yb=this.Ab=0}Ma.prototype.tb=function(a,b){var c=Math.pow(this.Ub,a);this.Ab=b*(1-c)+c*this.Ab;this.yb+=a};function Na(a){return a.Ab/(1-Math.pow(a.Ub,a.yb))};function B(a){var b=new CustomEvent(a.type,{detail:a.detail,bubbles:!!a.bubbles}),c;for(c in a)c in b||(b[c]=a[c]);return b}function D(a){return new CustomEvent("error",{detail:a,bubbles:!0})};function Oa(a,b,c){E(b);E(c);return c==b||a>=Pa&&c==b.split("-")[0]||a>=Qa&&c.split("-")[0]==b.split("-")[0]?!0:!1}var Pa=1,Qa=2;function E(a){a=a.toLowerCase().split("-");var b=Ra[a[0]];b&&(a[0]=b);return a.join("-")}
var Ra={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 E(a){this.Fb=new Aa;this.parent=a}E.prototype.addEventListener=function(a,b,c){c||this.Fb.push(a,b)};E.prototype.removeEventListener=function(a,b,c){c||this.Fb.remove(a,b)};E.prototype.dispatchEvent=function(a){delete a.currentTarget;delete a.srcElement;delete a.target;a.srcElement=null;a.target=this;return Ta(this,a)};
function Ta(a,b){b.currentTarget=a;for(var c=a.Fb.get(b.type)||[],d=0;d<c.length;++d){var e=c[d];e.handleEvent?e.handleEvent(b):e.call(a,b)}a.parent&&b.bubbles&&Ta(a.parent,b);return b.defaultPrevented};function Ua(){E.call(this,null);this.Ab=new Ma(3);this.lc=new Ma(10);this.Cc=50;this.uc=5E5;this.Dc=.5;this.Bc=65536}q(Ua,E);Ua.prototype.sb=function(a,b){if(!(b<this.Bc)){a=Math.max(a,this.Cc);var c=8E3*b/a,d=a/1E3;this.Ab.sb(d,c);this.lc.sb(d,c);this.dispatchEvent(w({type:"bandwidth"}))}};function Va(a){return a.Ab.xb<a.Dc?a.uc:Math.min(Na(a.Ab),Na(a.lc))};function ta(a,b){this.h=a;this.Gb=b==Wa;this.f=0}var ua=0,Wa=1;ta.prototype.ra=function(){return this.f<this.h.byteLength};function ya(a){var b=a.h.getUint8(a.f);a.f+=1;return b}function F(a){var b=a.h.getUint32(a.f,a.Gb);a.f+=4;return b}function Xa(a){var b,c;a.Gb?(b=a.h.getUint32(a.f,!0),c=a.h.getUint32(a.f+4,!0)):(c=a.h.getUint32(a.f,!1),b=a.h.getUint32(a.f+4,!1));if(2097151<c)throw new RangeError("DataViewReader: Overflow reading 64-bit value.");a.f+=8;return c*Math.pow(2,32)+b}
function Ya(a){if(a.f+16>a.h.byteLength)throw new RangeError("DataViewReader: Read past end of DataView.");var b=new Uint8Array(a.h.buffer,a.f,16);a.f+=16;return b}function B(a,b){if(a.f+b>a.h.byteLength)throw new RangeError("DataViewReader: Skip past end of DataView.");a.f+=b};function G(){this.Da=new Aa}G.prototype.u=function(){Za(this);this.Da=null};function H(a,b,c,d){b=new $a(b,c,d);a.Da.push(c,b)}G.prototype.$a=function(a,b){for(var c=this.Da.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.$a(),this.Da.remove(b,e))}};function Za(a){var b=a.Da,c=[],d;for(d in b.V)c.push.apply(c,b.V[d]);for(b=0;b<c.length;++b)c[b].$a();a.Da.clear()}function $a(a,b,c){this.target=a;this.type=b;this.ac=c;this.target.addEventListener(b,c,!1)}
$a.prototype.$a=function(){this.target&&(this.target.removeEventListener(this.type,this.ac,!1),this.ac=this.target=null)};function ab(a){this.systemIds=[];this.cencKeyIds=[];a=new ta(new DataView(a.buffer),ua);try{for(;a.ra();){var b=a.f,c=F(a),d=F(a);1==c?c=Xa(a):0==c&&(c=a.h.byteLength-b);if(1886614376!=d)B(a,c-(a.f-b));else{var e=ya(a);if(1<e)B(a,c-(a.f-b));else{B(a,3);var f=ra(Ya(a)),g=[];if(0<e)for(var k=F(a),l=0;l<k;++l){var p=ra(Ya(a));g.push(p)}var n=F(a);B(a,n);this.cencKeyIds.push.apply(this.cencKeyIds,g);this.systemIds.push(f);a.f!=b+c&&B(a,c-(a.f-b))}}}}catch(r){}};function I(a){bb[a]={gb:cb(),end:NaN}}function J(a){if(a=bb[a])a.end=cb()}function Fa(a){return(a=bb[a])&&a.end?a.end-a.gb:NaN}var cb=window.performance?window.performance.now.bind(window.performance):Date.now,bb={};m("shaka.polyfill.VideoPlaybackQuality.install",function(){var a=HTMLVideoElement.prototype;a.getVideoPlaybackQuality||(a.getVideoPlaybackQuality=function(){return"webkitDroppedFrameCount"in this?{corruptedVideoFrames:0,droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,creationTime:null,totalFrameDelay:null}:null})});m("shaka.polyfill.Fullscreen.install",function(){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;document.fullscreenElement||Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}})});function db(){return Promise.reject(Error("The key system specified is not supported."))}function eb(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function fb(){throw new TypeError("Illegal constructor.");}fb.prototype.createSession=function(){};function gb(){throw new TypeError("Illegal constructor.");}gb.prototype.getConfiguration=function(){};gb.prototype.createMediaKeys=function(){};function hb(a,b){try{var c=new ib(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function jb(a){var b=this.mediaKeys;b&&b!=a&&kb(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&kb(a,this);return Promise.resolve()}
function ib(a,b){this.Ia=this.keySystem=a;"org.w3.clearkey"==a&&(this.Ia="webkit-org.w3.clearkey");var c=!1,d;d=document.getElementsByTagName("video");d=d.length?d[0]:document.createElement("video");for(var e=0;e<b.length;++e){var f=b[e],g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes},k=!1;if(f.audioCapabilities)for(var l=0;l<f.audioCapabilities.length;++l){var p=f.audioCapabilities[l];p.contentType&&(k=!0,d.canPlayType(p.contentType.split(";")[0],
this.Ia)&&(g.audioCapabilities.push(p),c=!0))}if(f.videoCapabilities)for(l=0;l<f.videoCapabilities.length;++l)p=f.videoCapabilities[l],p.contentType&&(k=!0,d.canPlayType(p.contentType,this.Ia)&&(g.videoCapabilities.push(p),c=!0));k||(c=d.canPlayType("video/mp4",this.Ia)||d.canPlayType("video/webm",this.Ia));if(c){this.tc=g;return}}throw Error("The key system specified is not supported.");}ib.prototype.createMediaKeys=function(){var a=new lb(this.Ia);return Promise.resolve(a)};
ib.prototype.getConfiguration=function(){return this.tc};function lb(a){this.Ja=a;this.ua=null;this.b=new G;this.cc=[];this.jc={}}function kb(a,b){a.ua=b;Za(a.b);b&&(H(a.b,b,"webkitneedkey",a.Tc.bind(a)),H(a.b,b,"webkitkeymessage",a.Sc.bind(a)),H(a.b,b,"webkitkeyadded",a.Qc.bind(a)),H(a.b,b,"webkitkeyerror",a.Rc.bind(a)))}h=lb.prototype;
h.createSession=function(a){var b=a||"temporary";if("temporary"!=b&&"persistent"!=b)throw new TypeError("Session type "+a+" is unsupported on this platform.");a=new mb(this.ua,this.Ja,b);this.cc.push(a);return a};h.Tc=function(a){a=w({type:"encrypted",initDataType:"webm",initData:a.initData});this.ua.dispatchEvent(a)};
h.Sc=function(a){var b=nb(this,a.sessionId);b&&(a=w({type:"message",messageType:isNaN(b.expiration)?"licenserequest":"licenserenewal",message:a.message}),b.U&&(b.U.resolve(),b.U=null),b.dispatchEvent(a))};h.Qc=function(a){(a=nb(this,a.sessionId))&&a.ready()};h.Rc=function(a){var b=nb(this,a.sessionId);b&&b.handleError(a)};function nb(a,b){var c=a.jc[b];return c?c:(c=a.cc.shift())?(c.sessionId=b,a.jc[b]=c):null}
function mb(a,b,c){E.call(this,null);this.ua=a;this.O=this.U=null;this.Ja=b;this.Aa=c;this.sessionId="";this.expiration=NaN;this.closed=new s;this.keyStatuses=new ob}q(mb,E);h=mb.prototype;h.ready=function(){this.expiration=Number.POSITIVE_INFINITY;pb(this,"usable");this.O&&this.O.resolve();this.O=null};
h.handleError=function(a){var b=Error("EME v0.1b key error");b.errorCode=a.errorCode;b.errorCode.systemCode=a.systemCode;!a.sessionId&&this.U?(b.method="generateRequest",this.U.reject(b),this.U=null):a.sessionId&&this.O?(b.method="update",this.O.reject(b),this.O=null):(b=a.systemCode,a.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?pb(this,"output-not-allowed"):1==b?pb(this,"expired"):pb(this,"internal-error"))};
h.jb=function(a,b,c){if(this.U)this.U.then(this.jb.bind(this,a,b,c)).catch(this.jb.bind(this,a,b,c));else{this.U=a;try{var d;if("persistent"==this.Aa)if(c)d=y("LOAD_SESSION|"+c);else{var e=new Uint8Array(b);d=y("PERSISTENT|"+pa(e))}else d=new Uint8Array(b);this.ua.webkitGenerateKeyRequest(this.Ja,d)}catch(f){this.U.reject(f),this.U=null}}};
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 F(a){this.Gb=new Aa;this.parent=a}F.prototype.addEventListener=function(a,b,c){c||this.Gb.push(a,b)};F.prototype.removeEventListener=function(a,b,c){c||this.Gb.remove(a,b)};F.prototype.dispatchEvent=function(a){delete a.srcElement;delete a.target;delete a.currentTarget;Object.defineProperties(a,{srcElement:{value:null,writable:!0},target:{value:this,writable:!0},currentTarget:{value:null,writable:!0}});return Sa(this,a)};
function Sa(a,b){b.currentTarget=a;for(var c=a.Gb.get(b.type)||[],d=0;d<c.length;++d){var e=c[d];e.handleEvent?e.handleEvent(b):e.call(a,b)}a.parent&&b.bubbles&&Sa(a.parent,b);return b.defaultPrevented};function Ta(){F.call(this,null);this.Bb=new Ma(3);this.lc=new Ma(10);this.Cc=50;this.uc=5E5;this.Dc=.5;this.Bc=65536}q(Ta,F);Ta.prototype.tb=function(a,b){if(!(b<this.Bc)){a=Math.max(a,this.Cc);var c=8E3*b/a,d=a/1E3;this.Bb.tb(d,c);this.lc.tb(d,c);this.dispatchEvent(B({type:"bandwidth"}))}};function Ua(a){return a.Bb.yb<a.Dc?a.uc:Math.min(Na(a.Bb),Na(a.lc))};function ta(a,b){this.h=a;this.Hb=b==Va;this.f=0}var ua=0,Va=1;ta.prototype.ra=function(){return this.f<this.h.byteLength};function ya(a){var b=a.h.getUint8(a.f);a.f+=1;return b}function G(a){var b=a.h.getUint32(a.f,a.Hb);a.f+=4;return b}function Wa(a){var b,c;a.Hb?(b=a.h.getUint32(a.f,!0),c=a.h.getUint32(a.f+4,!0)):(c=a.h.getUint32(a.f,!1),b=a.h.getUint32(a.f+4,!1));if(2097151<c)throw new RangeError("DataViewReader: Overflow reading 64-bit value.");a.f+=8;return c*Math.pow(2,32)+b}
function Xa(a){if(a.f+16>a.h.byteLength)throw new RangeError("DataViewReader: Read past end of DataView.");var b=new Uint8Array(a.h.buffer,a.f,16);a.f+=16;return b}function z(a,b){if(a.f+b>a.h.byteLength)throw new RangeError("DataViewReader: Skip past end of DataView.");a.f+=b};function H(){this.Da=new Aa}H.prototype.u=function(){Ya(this);this.Da=null};function I(a,b,c,d){b=new Za(b,c,d);a.Da.push(c,b)}H.prototype.ab=function(a,b){for(var c=this.Da.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.ab(),this.Da.remove(b,e))}};function Ya(a){var b=a.Da,c=[],d;for(d in b.V)c.push.apply(c,b.V[d]);for(b=0;b<c.length;++b)c[b].ab();a.Da.clear()}function Za(a,b,c){this.target=a;this.type=b;this.ac=c;this.target.addEventListener(b,c,!1)}
Za.prototype.ab=function(){this.target&&(this.target.removeEventListener(this.type,this.ac,!1),this.ac=this.target=null)};function $a(a){this.systemIds=[];this.cencKeyIds=[];a=new ta(new DataView(a.buffer),ua);try{for(;a.ra();){var b=a.f,c=G(a),d=G(a);1==c?c=Wa(a):0==c&&(c=a.h.byteLength-b);if(1886614376!=d)z(a,c-(a.f-b));else{var e=ya(a);if(1<e)z(a,c-(a.f-b));else{z(a,3);var f=ra(Xa(a)),g=[];if(0<e)for(var k=G(a),l=0;l<k;++l){var p=ra(Xa(a));g.push(p)}var n=G(a);z(a,n);this.cencKeyIds.push.apply(this.cencKeyIds,g);this.systemIds.push(f);a.f!=b+c&&z(a,c-(a.f-b))}}}}catch(r){}};function J(a){ab[a]={hb:bb(),end:NaN}}function K(a){if(a=ab[a])a.end=bb()}function Fa(a){return(a=ab[a])&&a.end?a.end-a.hb:NaN}var bb=window.performance?window.performance.now.bind(window.performance):Date.now,ab={};m("shaka.polyfill.VideoPlaybackQuality.install",function(){var a=HTMLVideoElement.prototype;a.getVideoPlaybackQuality||(a.getVideoPlaybackQuality=function(){return"webkitDroppedFrameCount"in this?{corruptedVideoFrames:0,droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,creationTime:null,totalFrameDelay:null}:null})});m("shaka.polyfill.Fullscreen.install",function(){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;document.fullscreenElement||Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}})});function cb(){return Promise.reject(Error("The key system specified is not supported."))}function db(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function eb(){throw new TypeError("Illegal constructor.");}eb.prototype.createSession=function(){};function fb(){throw new TypeError("Illegal constructor.");}fb.prototype.getConfiguration=function(){};fb.prototype.createMediaKeys=function(){};function gb(a,b){try{var c=new hb(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function ib(a){var b=this.mediaKeys;b&&b!=a&&jb(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&jb(a,this);return Promise.resolve()}
function hb(a,b){this.Ia=this.keySystem=a;"org.w3.clearkey"==a&&(this.Ia="webkit-org.w3.clearkey");var c=!1,d;d=document.getElementsByTagName("video");d=d.length?d[0]:document.createElement("video");for(var e=0;e<b.length;++e){var f=b[e],g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes},k=!1;if(f.audioCapabilities)for(var l=0;l<f.audioCapabilities.length;++l){var p=f.audioCapabilities[l];p.contentType&&(k=!0,d.canPlayType(p.contentType.split(";")[0],
this.Ia)&&(g.audioCapabilities.push(p),c=!0))}if(f.videoCapabilities)for(l=0;l<f.videoCapabilities.length;++l)p=f.videoCapabilities[l],p.contentType&&(k=!0,d.canPlayType(p.contentType,this.Ia)&&(g.videoCapabilities.push(p),c=!0));k||(c=d.canPlayType("video/mp4",this.Ia)||d.canPlayType("video/webm",this.Ia));if(c){this.tc=g;return}}throw Error("The key system specified is not supported.");}hb.prototype.createMediaKeys=function(){var a=new kb(this.Ia);return Promise.resolve(a)};
hb.prototype.getConfiguration=function(){return this.tc};function kb(a){this.Ja=a;this.ua=null;this.b=new H;this.cc=[];this.jc={}}function jb(a,b){a.ua=b;Ya(a.b);b&&(I(a.b,b,"webkitneedkey",a.Uc.bind(a)),I(a.b,b,"webkitkeymessage",a.Tc.bind(a)),I(a.b,b,"webkitkeyadded",a.Rc.bind(a)),I(a.b,b,"webkitkeyerror",a.Sc.bind(a)))}h=kb.prototype;
h.createSession=function(a){var b=a||"temporary";if("temporary"!=b&&"persistent"!=b)throw new TypeError("Session type "+a+" is unsupported on this platform.");a=new lb(this.ua,this.Ja,b);this.cc.push(a);return a};h.Uc=function(a){a=B({type:"encrypted",initDataType:"webm",initData:a.initData});this.ua.dispatchEvent(a)};
h.Tc=function(a){var b=mb(this,a.sessionId);b&&(a=B({type:"message",messageType:isNaN(b.expiration)?"licenserequest":"licenserenewal",message:a.message}),b.U&&(b.U.resolve(),b.U=null),b.dispatchEvent(a))};h.Rc=function(a){(a=mb(this,a.sessionId))&&a.ready()};h.Sc=function(a){var b=mb(this,a.sessionId);b&&b.handleError(a)};function mb(a,b){var c=a.jc[b];return c?c:(c=a.cc.shift())?(c.sessionId=b,a.jc[b]=c):null}
function lb(a,b,c){F.call(this,null);this.ua=a;this.O=this.U=null;this.Ja=b;this.Aa=c;this.sessionId="";this.expiration=NaN;this.closed=new s;this.keyStatuses=new nb}q(lb,F);h=lb.prototype;h.ready=function(){this.expiration=Number.POSITIVE_INFINITY;ob(this,"usable");this.O&&this.O.resolve();this.O=null};
h.handleError=function(a){var b=Error("EME v0.1b key error");b.errorCode=a.errorCode;b.errorCode.systemCode=a.systemCode;!a.sessionId&&this.U?(b.method="generateRequest",this.U.reject(b),this.U=null):a.sessionId&&this.O?(b.method="update",this.O.reject(b),this.O=null):(b=a.systemCode,a.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?ob(this,"output-not-allowed"):1==b?ob(this,"expired"):ob(this,"internal-error"))};
h.kb=function(a,b,c){if(this.U)this.U.then(this.kb.bind(this,a,b,c)).catch(this.kb.bind(this,a,b,c));else{this.U=a;try{var d;if("persistent"==this.Aa)if(c)d=v("LOAD_SESSION|"+c);else{var e=new Uint8Array(b);d=v("PERSISTENT|"+pa(e))}else d=new Uint8Array(b);this.ua.webkitGenerateKeyRequest(this.Ja,d)}catch(f){this.U.reject(f),this.U=null}}};
h.Tb=function(a,b){if(this.O)this.O.then(this.Tb.bind(this,a,b)).catch(this.Tb.bind(this,a,b));else{this.O=a;var c,d;if("webkit-org.w3.clearkey"==this.Ja){c=pa(new Uint8Array(b));d=JSON.parse(c);c=d.keys[0].kty;if("A128KW"!=d.keys[0].alg||"oct"!=c)this.O.reject(Error("Response is not a valid JSON Web Key Set.")),this.O=null;c=qa(d.keys[0].k);d=qa(d.keys[0].kid)}else c=new Uint8Array(b),d=null;try{this.ua.webkitAddKey(this.Ja,c,d,this.sessionId)}catch(e){this.O.reject(e),this.O=null}}};
function pb(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.Qa=b;c=w({type:"keystatuseschange"});a.dispatchEvent(c)}h.generateRequest=function(a,b){var c=new s;this.jb(c,b,null);return c};h.load=function(a){if("persistent"==this.Aa){var b=new s;this.jb(b,null,a);return b}return Promise.reject(Error('The session type is not "persistent".'))};h.update=function(a){var b=new s;this.Tb(b,a);return b};
h.close=function(){if("persistent"!=this.Aa){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;this.ua.webkitCancelKeyRequest(this.Ja,this.sessionId)}this.closed.resolve();return this.closed};h.remove=function(){return"persistent"!=this.Aa?Promise.reject(Error("Not a persistent session.")):this.close()};function qb(a){this.qc=a;this.Yb=0}qb.prototype.next=function(){return this.Yb>=this.qc.length?{value:void 0,done:!0}:{value:this.qc[this.Yb++],done:!1}};
function ob(){this.size=0;this.Qa=void 0}var rb=y("FAKE_KEY_ID");ob.prototype.get=function(a){if(this.has(a))return this.Qa};ob.prototype.has=function(a){return this.Qa&&sa(new Uint8Array(a),rb)?!0:!1};ob.prototype.keys=function(){var a=[];this.Qa&&a.push(rb);return new qb(a)};ob.prototype.values=function(){var a=[];this.Qa&&a.push(this.Qa);return new qb(a)};m("shaka.polyfill.MediaKeys.install",function(){Navigator.prototype.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?(Navigator.prototype.requestMediaKeySystemAccess=hb,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.waitingFor="",HTMLMediaElement.prototype.setMediaKeys=jb,window.MediaKeys=lb,window.MediaKeySystemAccess=ib):(Navigator.prototype.requestMediaKeySystemAccess=db,HTMLMediaElement.prototype.mediaKeys=
null,HTMLMediaElement.prototype.waitingFor="",HTMLMediaElement.prototype.setMediaKeys=eb,window.MediaKeys=fb,window.MediaKeySystemAccess=gb))});var sb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function K(a){var b;a instanceof K?(tb(this,a.na),this.Ba=a.Ba,this.ga=a.ga,ub(this,a.La),this.Z=a.Z,vb(this,a.wa.clone()),this.qa=a.qa):a&&(b=String(a).match(sb))?(tb(this,b[1]||"",!0),this.Ba=L(b[2]||""),this.ga=L(b[3]||"",!0),ub(this,b[4]),this.Z=L(b[5]||"",!0),vb(this,b[6]||"",!0),this.qa=L(b[7]||"")):this.wa=new wb(null)}h=K.prototype;h.na="";h.Ba="";h.ga="";h.La=null;h.Z="";h.qa="";
function ob(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.Qa=b;c=B({type:"keystatuseschange"});a.dispatchEvent(c)}h.generateRequest=function(a,b){var c=new s;this.kb(c,b,null);return c};h.load=function(a){if("persistent"==this.Aa){var b=new s;this.kb(b,null,a);return b}return Promise.reject(Error('The session type is not "persistent".'))};h.update=function(a){var b=new s;this.Tb(b,a);return b};
h.close=function(){if("persistent"!=this.Aa){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;this.ua.webkitCancelKeyRequest(this.Ja,this.sessionId)}this.closed.resolve();return this.closed};h.remove=function(){return"persistent"!=this.Aa?Promise.reject(Error("Not a persistent session.")):this.close()};function pb(a){this.qc=a;this.Yb=0}pb.prototype.next=function(){return this.Yb>=this.qc.length?{value:void 0,done:!0}:{value:this.qc[this.Yb++],done:!1}};
function nb(){this.size=0;this.Qa=void 0}var qb=v("FAKE_KEY_ID");nb.prototype.get=function(a){if(this.has(a))return this.Qa};nb.prototype.has=function(a){return this.Qa&&sa(new Uint8Array(a),qb)?!0:!1};nb.prototype.keys=function(){var a=[];this.Qa&&a.push(qb);return new pb(a)};nb.prototype.values=function(){var a=[];this.Qa&&a.push(this.Qa);return new pb(a)};m("shaka.polyfill.MediaKeys.install",function(){Navigator.prototype.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?(Navigator.prototype.requestMediaKeySystemAccess=gb,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ib,window.MediaKeys=kb,window.MediaKeySystemAccess=hb):(Navigator.prototype.requestMediaKeySystemAccess=cb,delete HTMLMediaElement.prototype.mediaKeys,
HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=db,window.MediaKeys=eb,window.MediaKeySystemAccess=fb))});var rb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function L(a){var b;a instanceof L?(sb(this,a.na),this.Ba=a.Ba,this.ga=a.ga,tb(this,a.La),this.Z=a.Z,ub(this,a.wa.clone()),this.qa=a.qa):a&&(b=String(a).match(rb))?(sb(this,b[1]||"",!0),this.Ba=vb(b[2]||""),this.ga=vb(b[3]||"",!0),tb(this,b[4]),this.Z=vb(b[5]||"",!0),ub(this,b[6]||"",!0),this.qa=vb(b[7]||"")):this.wa=new wb(null)}h=L.prototype;h.na="";h.Ba="";h.ga="";h.La=null;h.Z="";h.qa="";
h.toString=function(){var a=[],b=this.na;b&&a.push(xb(b,yb,!0),":");if(b=this.ga){a.push("//");var c=this.Ba;c&&a.push(xb(c,yb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.La;null!=b&&a.push(":",String(b))}if(b=this.Z)this.ga&&"/"!=b.charAt(0)&&a.push("/"),a.push(xb(b,"/"==b.charAt(0)?zb:Ab,!0));(b=this.wa.toString())&&a.push("?",b);(b=this.qa)&&a.push("#",xb(b,Bb));return a.join("")};
h.resolve=function(a){var b=this.clone(),c=!!a.na;c?tb(b,a.na):c=!!a.Ba;c?b.Ba=a.Ba:c=!!a.ga;c?b.ga=a.ga:c=null!=a.La;var d=a.Z;if(c)ub(b,a.La);else if(c=!!a.Z){if("/"!=d.charAt(0))if(this.ga&&!this.Z)d="/"+d;else{var e=b.Z.lastIndexOf("/");-1!=e&&(d=b.Z.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){for(var e=0==d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;g<d.length;){var k=d[g++];"."==k?e&&g==d.length&&f.push(""):".."==k?((1<f.length||1==f.length&&""!=
f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(k),e=!0)}d=f.join("/")}}c?b.Z=d:c=""!==a.wa.toString();c?vb(b,L(a.wa.toString())):c=!!a.qa;c&&(b.qa=a.qa);return b};h.clone=function(){return new K(this)};function tb(a,b,c){a.na=c?L(b,!0):b;a.na&&(a.na=a.na.replace(/:$/,""))}function ub(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.La=b}else a.La=null}function vb(a,b,c){b instanceof wb?a.wa=b:(c||(b=xb(b,Cb)),a.wa=new wb(b))}
function L(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function xb(a,b,c){return"string"==typeof a?(a=encodeURI(a).replace(b,Db),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Db(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var yb=/[#\/\?@]/g,Ab=/[\#\?:]/g,zb=/[\#\?]/g,Cb=/[\#\?@]/g,Bb=/#/g;function wb(a){this.ka=a||null}h=wb.prototype;h.Q=null;h.hb=null;
h.add=function(a,b){if(!this.Q&&(this.Q={},this.hb=0,this.ka))for(var c=this.ka.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null,g=null;0<=e?(f=c[d].substring(0,e),g=c[d].substring(e+1)):f=c[d];f=decodeURIComponent(f.replace(/\+/g," "));g=g||"";this.add(f,decodeURIComponent(g.replace(/\+/g," ")))}this.ka=null;(c=this.Q.hasOwnProperty(a)&&this.Q[a])||(this.Q[a]=c=[]);c.push(b);this.hb++;return this};
h.toString=function(){if(this.ka)return this.ka;if(!this.Q)return"";var a=[],b;for(b in this.Q)for(var c=encodeURIComponent(b),d=this.Q[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.ka=a.join("&")};h.clone=function(){var a=new wb;a.ka=this.ka;if(this.Q){var b={},c;for(c in this.Q)b[c]=this.Q[c].concat();a.Q=b;a.hb=this.hb}return a};function Eb(a,b,c,d,e,f){this.index=a;this.startTime=b;this.endTime=c;this.Pa=d;this.Ta=e;this.url=f};function Fb(a){this.Uc=a};function Gb(a){this.Ka=a}Gb.prototype.parse=function(a,b,c){a=null;try{a=this.Lb(b,c)}catch(d){if(!(d instanceof RangeError))throw d;}return a};
Gb.prototype.Lb=function(a,b){var c=new ta(a,ua),d=[],e=F(c);if(1936286840!=F(c))return null;1==e&&(e=Xa(c));var f=ya(c);B(c,3);B(c,4);var g=F(c);if(0==g)return null;var k,l;0==f?(k=F(c),l=F(c)):(k=Xa(c),l=Xa(c));B(c,2);f=c.h.getUint16(c.f,c.Gb);c.f+=2;e=b+e+l;for(l=0;l<f;l++){var p=F(c),n=(p&2147483648)>>>31,p=p&2147483647,r=F(c);F(c);if(1==n)return null;d.push(new Eb(l,k/g,(k+r)/g,e,e+p-1,this.Ka));k+=r;e+=p}return d};function Hb(a){this.Ka=a}Hb.prototype.parse=function(a,b){var c=null;try{c=this.Lb(a,b)}catch(d){if(!(d instanceof RangeError))throw d;}return c};
Hb.prototype.Lb=function(a,b){var c;var d=new z(a);if(440786851!=A(d).id)c=null;else if(c=A(d),408125543!=c.id)c=null;else{d=c.h.byteOffset;c=new z(c.h);for(var e=null;c.ra();){var f=A(c);if(357149030==f.id){e=f;break}}if(e){c=new z(e.h);for(e=1E6;c.ra();)if(f=A(c),2807729==f.id){e=za(f);break}c=e/1E9}else c=null;c=c?{Zc:d,dd:c}:null}if(!c)return null;e=A(new z(b));if(475249515!=e.id)return null;d=c.Zc;c=c.dd;for(var e=new z(e.h),f=[],g=-1,k=-1,l=0;e.ra();){var p=A(e);if(187==p.id){var n;n=new z(p.h);
p=A(n);if(179!=p.id)n=null;else if(p=za(p),n=A(n),183!=n.id)n=null;else{n=new z(n.h);for(var r=0;n.ra();){var v=A(n);if(241==v.id){r=za(v);break}}n={ed:p,Vc:r}}n&&(p=c*n.ed,n=d+n.Vc,0<=g&&(f.push(new Eb(l,g,p,k,n-1,this.Ka)),++l),g=p,k=n)}}0<=g&&f.push(new Eb(l,g,null,k,null,this.Ka));return f};function Ib(a){this.i=a}function Jb(a,b){return 0>b||b>=a.i.length?null:a.i[b]}function Kb(a,b,c){var d=Lb(a,b);if(0>d)return null;for(var e=[];d<a.i.length;d++){e.push(a.i[d]);var f=a.i[d].endTime;if(!f||f>b+c)break}return new Fb(e)}function Lb(a,b){for(var c=0;c<a.i.length;c++)if(a.i[c].startTime>b)return c?c-1:0;return a.i.length-1};function N(a){this.url=a;this.o=new Mb;this.Xa=this.mc=this.Vb=0;this.n=null;this.v=new s;this.pa=null}function Mb(){this.body=null;this.bc=1;this.rc=1E3;this.Xc=2;this.Yc=.5;this.Wc=0;this.method="GET";this.responseType="arraybuffer";this.Nb={};this.withCredentials=!1}function Nb(a){Ob(a);a.o.body=null;a.v=null;a.pa=null}function Ob(a){a.n&&(a.n.onload=null,a.n.onerror=null);a.n=null}
N.prototype.tb=function(){if(this.n)return this.v;if(0==this.url.lastIndexOf("data:",0)){var a=this.url.split(":")[1].split(";").pop().split(","),b=a.pop(),b="base64"==a.pop()?window.atob(b.replace(/-/g,"+").replace(/_/g,"/")):window.decodeURIComponent(b);"arraybuffer"==this.o.responseType&&(b=y(b).buffer);a=JSON.parse(JSON.stringify(new XMLHttpRequest));a.response=b;a.responseText=b.toString();b=this.v;b.resolve(a);Nb(this);return b}this.Vb++;this.mc=Date.now();this.Xa||(this.Xa=this.o.rc);this.n=
new XMLHttpRequest;a=this.url;this.pa&&(a=new K(a),a.wa.add("_",Date.now()),a=a.toString());this.n.open(this.o.method,a,!0);this.n.responseType=this.o.responseType;this.n.timeout=this.o.Wc;this.n.withCredentials=this.o.withCredentials;this.n.onload=this.Ic.bind(this);this.n.onerror=this.Jb.bind(this);for(b in this.o.Nb)this.n.setRequestHeader(b,this.o.Nb[b]);this.n.send(this.o.body);return this.v};
function Pb(a,b,c){b=Error(b);b.type=c;b.status=a.n.status;b.url=a.url;b.method=a.o.method;b.body=a.o.body;b.fd=a.n;return b}N.prototype.abort=function(){if(this.n&&this.n.readyState!=XMLHttpRequest.DONE){this.n.abort();var a=Pb(this,"Request aborted.","aborted");this.v.reject(a);Nb(this)}};
N.prototype.Ic=function(a){this.pa&&this.pa.sb(Date.now()-this.mc,a.loaded);200<=this.n.status&&299>=this.n.status?(this.v.resolve(this.n),Nb(this)):this.Vb<this.o.bc?(Ob(this),window.setTimeout(this.tb.bind(this),this.Xa*(1+(2*Math.random()-1)*this.o.Yc)),this.Xa*=this.o.Xc):(a=Pb(this,"HTTP error.","net"),this.v.reject(a),Nb(this))};N.prototype.Jb=function(){var a=Pb(this,"Network failure.","net");this.v.reject(a);Nb(this)};function Qb(a,b,c){N.call(this,a);this.o.body=b;this.o.method="POST";this.o.bc=3;this.o.withCredentials=c}q(Qb,N);Qb.prototype.send=function(){return this.tb().then(function(a){return Promise.resolve(new Uint8Array(a.response))})};function O(a){E.call(this,null);this.a=a;this.G=this.ob=this.d=null;this.b=new G;this.qb={};this.Ea=[];this.ub=[];this.sa="en";this.bb=this.rb=null;this.Ra=!1;this.L=new Ba;this.Ca=!0}q(O,E);m("shaka.player.Player",O);O.version="v1.2.2";
O.isBrowserSupported=function(){return!!window.MediaSource&&!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration&&!!window.Promise&&!!HTMLVideoElement.prototype.getVideoPlaybackQuality&&!!Element.prototype.requestFullscreen&&!!document.exitFullscreen&&document.hasOwnProperty("fullscreenElement")&&!!document.body.children};
function Rb(a){return 0<=a.indexOf("mp4a.40.5")?!1:"text/vtt"==a?!!window.VTTCue:MediaSource.isTypeSupported(a)}O.isTypeSupported=Rb;O.prototype.u=function(){this.Sb().catch(function(){});this.b.u();this.a=this.b=null};O.prototype.destroy=O.prototype.u;
O.prototype.Sb=function(){this.a.pause();Za(this.b);Sb(this);Tb(this);for(var a=0;a<this.ub.length;++a)this.ub[a].close().catch(function(){});this.ub=[];this.Ea=[];this.G=this.ob=null;this.a.src="";a=this.a.setMediaKeys(null);this.d&&(this.d.u(),this.d=null);this.Ra=!1;this.qb={};this.L=new Ba;return a};O.prototype.unload=O.prototype.Sb;
O.prototype.load=function(a){var b=this.d?this.Sb():Promise.resolve();this.a.autoplay&&(I("load"),H(this.b,this.a,"timeupdate",this.Gc.bind(this)));a.ja(this.Ca);return b.then(t(this,function(){return a.load(this.sa)})).then(t(this,function(){this.d=a;var b;b=new Aa;for(var d=this.d.kb(),e=0;e<d.length;++e){var f=d[e];f.ha.keySystem||f.la&&!Rb(f.la)||b.push(f.contentType,f)}for(var e={},f=!1,g=0;g<d.length;++g){var k=d[g];if(k.ha.keySystem&&!b.has(k.contentType)){var l=k.ha.keySystem,p=e[l];p||(p=
e[l]={audioCapabilities:[],videoCapabilities:[],initDataTypes:[],distinctiveIdentifier:"optional",persistentState:"optional"});k.la&&(l=k.contentType+"Capabilities",p[l]&&(f=!0,p[l].push({contentType:k.la})))}}f||(this.G=d[0].ha);0==Object.keys(e).length?(this.d.Za(b),b=Promise.resolve()):(f=new s,e=Ub(e,f),e=e.then(this.sc.bind(this,d,b)),e=e.then(this.cd.bind(this)),f.reject(null),b=e);return b})).then(t(this,function(){H(this.b,this.a,"error",this.Jb.bind(this));H(this.b,this.a,"play",this.Lc.bind(this));
H(this.b,this.a,"playing",this.Mc.bind(this));H(this.b,this.a,"seeking",this.Kb.bind(this));H(this.b,this.a,"pause",this.Kc.bind(this));H(this.b,this.a,"ended",this.Fc.bind(this));return this.d.eb(this,this.a)})).then(t(this,function(){for(var a=0;a<this.Ea.length;++a)this.dc(this.Ea[a]);return Promise.resolve()})).catch(t(this,function(b){a.u();this.d=null;var d=x(b);this.dispatchEvent(d);return Promise.reject(b)}))};O.prototype.load=O.prototype.load;
function Ub(a,b){for(var c in a){var d=a[c];b=b.catch(function(){return navigator.requestMediaKeySystemAccess(c,[d])})}return b}h=O.prototype;h.sc=function(a,b,c){for(var d=c.keySystem,e=c.getConfiguration(),f=["audio","video"],g=0;g<f.length;++g){var k=f[g];if(!b.has(k)){var l=e[k+"Capabilities"][0];if(l){for(var p=[],n=0;n<a.length;++n){var r=a[n];if(r.ha.keySystem==d&&r.la==l.contentType){p.push(r);this.G=this.G?La(this.G,r.ha):r.ha;break}}b.set(k,p)}}}this.d.Za(b);return c.createMediaKeys()};
h.cd=function(a){this.ob=a;return this.a.setMediaKeys(this.ob).then(t(this,function(){this.Ea=[];for(var a=0;a<this.G.Ga.length;++a){var c=this.G.Ga[a];this.Ea.push({type:"encrypted",initDataType:c.initDataType,initData:c.initData})}0==this.Ea.length&&H(this.b,this.a,"encrypted",this.dc.bind(this))}))};
h.dc=function(a){var b=new Uint8Array(a.initData),c=Array.prototype.join.apply(b);this.G.nc&&(c="first");this.qb[c]||(b=this.ob.createSession(),this.ub.push(b),H(this.b,b,"message",this.Nc.bind(this)),H(this.b,b,"keystatuseschange",this.Hc.bind(this)),a=b.generateRequest(a.initDataType,a.initData),this.qb[c]=!0,a.catch(t(this,function(a){this.qb[c]=!1;a=x(a);this.dispatchEvent(a)})))};h.Nc=function(a){Vb(this,a.target,this.G.$b,a.message,this.G.withCredentials,this.G.Zb)};
h.Hc=function(a){var b=a.target.keyStatuses.values();for(a=b.next();!a.done;a=b.next()){var c=Wb[a.value];c&&(c=Error(c),c.type=a.value,a=x(c),this.dispatchEvent(a))}};function Vb(a,b,c,d,e,f){(new Qb(c,d,e)).send().then(t(a,function(a){if(f){var c=new Ja;a=f(a,c);this.d.wb(c)}return b.update(a)})).then(function(){}).catch(t(a,function(a){a.jd=b;a=x(a);this.dispatchEvent(a)}))}h.Gc=function(){J("load");this.L.playbackLatency=Fa("load")/1E3;this.b.$a(this.a,"timeupdate")};
h.Jb=function(a){this.a.error&&(a=this.a.error.code,a!=MediaError.MEDIA_ERR_ABORTED&&(a=Error(Xb[a]||"Unknown playback error."),a.type="playback",a=x(a),this.dispatchEvent(a)))};h.Lc=function(){};h.Mc=function(){I("playing");Sb(this);this.bb=window.setTimeout(this.fc.bind(this),100)};h.Kb=function(){Sb(this);this.Ra=!1};h.Kc=function(){J("playing");Ea(this.L)};h.Fc=function(){this.getStats();Sb(this)};
h.getStats=function(){this.a.paused||(J("playing"),Ea(this.L),I("playing"));var a=this.L,b=this.a.getVideoPlaybackQuality();b&&(a.decodedFrames=b.totalVideoFrames,a.droppedFrames=b.droppedVideoFrames);return this.L};O.prototype.getStats=O.prototype.getStats;O.prototype.wc=function(){var a=this.a.videoWidth,b=this.a.videoHeight;return a&&b?{width:a,height:b}:null};O.prototype.getCurrentResolution=O.prototype.wc;O.prototype.getVideoTracks=function(){return this.d?this.d.getVideoTracks():[]};
h.resolve=function(a){var b=this.clone(),c=!!a.na;c?sb(b,a.na):c=!!a.Ba;c?b.Ba=a.Ba:c=!!a.ga;c?b.ga=a.ga:c=null!=a.La;var d=a.Z;if(c)tb(b,a.La);else if(c=!!a.Z){if("/"!=d.charAt(0))if(this.ga&&!this.Z)d="/"+d;else{var e=b.Z.lastIndexOf("/");-1!=e&&(d=b.Z.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){for(var e=0==d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;g<d.length;){var k=d[g++];"."==k?e&&g==d.length&&f.push(""):".."==k?((1<f.length||1==f.length&&""!=
f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(k),e=!0)}d=f.join("/")}}c?b.Z=d:c=""!==a.wa.toString();c?ub(b,a.wa.clone()):c=!!a.qa;c&&(b.qa=a.qa);return b};h.clone=function(){return new L(this)};function sb(a,b,c){a.na=c?vb(b,!0):b;a.na&&(a.na=a.na.replace(/:$/,""))}function tb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.La=b}else a.La=null}function ub(a,b,c){b instanceof wb?a.wa=b:(c||(b=xb(b,Cb)),a.wa=new wb(b))}
function vb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function xb(a,b,c){return"string"==typeof a?(a=encodeURI(a).replace(b,Db),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Db(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var yb=/[#\/\?@]/g,Ab=/[\#\?:]/g,zb=/[\#\?]/g,Cb=/[\#\?@]/g,Bb=/#/g;function wb(a){this.ka=a||null}h=wb.prototype;h.Q=null;h.ib=null;
h.add=function(a,b){if(!this.Q&&(this.Q={},this.ib=0,this.ka))for(var c=this.ka.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null,g=null;0<=e?(f=c[d].substring(0,e),g=c[d].substring(e+1)):f=c[d];f=decodeURIComponent(f.replace(/\+/g," "));g=g||"";this.add(f,decodeURIComponent(g.replace(/\+/g," ")))}this.ka=null;(c=this.Q.hasOwnProperty(a)&&this.Q[a])||(this.Q[a]=c=[]);c.push(b);this.ib++;return this};
h.toString=function(){if(this.ka)return this.ka;if(!this.Q)return"";var a=[],b;for(b in this.Q)for(var c=encodeURIComponent(b),d=this.Q[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.ka=a.join("&")};h.clone=function(){var a=new wb;a.ka=this.ka;if(this.Q){var b={},c;for(c in this.Q)b[c]=this.Q[c].concat();a.Q=b;a.ib=this.ib}return a};function Eb(a,b,c,d,e,f){this.index=a;this.startTime=b;this.endTime=c;this.Pa=d;this.Ta=e;this.url=f};function Fb(a){this.Vc=a};function Gb(a){this.Ka=a}Gb.prototype.parse=function(a,b,c){a=null;try{a=this.Lb(b,c)}catch(d){if(!(d instanceof RangeError))throw d;}return a};
Gb.prototype.Lb=function(a,b){var c=new ta(a,ua),d=[],e=G(c);if(1936286840!=G(c))return null;1==e&&(e=Wa(c));var f=ya(c);z(c,3);z(c,4);var g=G(c);if(0==g)return null;var k,l;0==f?(k=G(c),l=G(c)):(k=Wa(c),l=Wa(c));z(c,2);f=c.h.getUint16(c.f,c.Hb);c.f+=2;e=b+e+l;for(l=0;l<f;l++){var p=G(c),n=(p&2147483648)>>>31,p=p&2147483647,r=G(c);G(c);if(1==n)return null;d.push(new Eb(l,k/g,(k+r)/g,e,e+p-1,this.Ka));k+=r;e+=p}return d};function Hb(a){this.Ka=a}Hb.prototype.parse=function(a,b){var c=null;try{c=this.Lb(a,b)}catch(d){if(!(d instanceof RangeError))throw d;}return c};
Hb.prototype.Lb=function(a,b){var c;var d=new x(a);if(440786851!=y(d).id)c=null;else if(c=y(d),408125543!=c.id)c=null;else{d=c.h.byteOffset;c=new x(c.h);for(var e=null;c.ra();){var f=y(c);if(357149030==f.id){e=f;break}}if(e){c=new x(e.h);for(e=1E6;c.ra();)if(f=y(c),2807729==f.id){e=za(f);break}c=e/1E9}else c=null;c=c?{$c:d,ed:c}:null}if(!c)return null;e=y(new x(b));if(475249515!=e.id)return null;d=c.$c;c=c.ed;for(var e=new x(e.h),f=[],g=-1,k=-1,l=0;e.ra();){var p=y(e);if(187==p.id){var n;n=new x(p.h);
p=y(n);if(179!=p.id)n=null;else if(p=za(p),n=y(n),183!=n.id)n=null;else{n=new x(n.h);for(var r=0;n.ra();){var w=y(n);if(241==w.id){r=za(w);break}}n={fd:p,Wc:r}}n&&(p=c*n.fd,n=d+n.Wc,0<=g&&(f.push(new Eb(l,g,p,k,n-1,this.Ka)),++l),g=p,k=n)}}0<=g&&f.push(new Eb(l,g,null,k,null,this.Ka));return f};function Ib(a){this.i=a}function Jb(a,b){return 0>b||b>=a.i.length?null:a.i[b]}function Kb(a,b,c){var d=Lb(a,b);if(0>d)return null;for(var e=[];d<a.i.length;d++){e.push(a.i[d]);var f=a.i[d].endTime;if(!f||f>b+c)break}return new Fb(e)}function Lb(a,b){for(var c=0;c<a.i.length;c++)if(a.i[c].startTime>b)return c?c-1:0;return a.i.length-1};function N(a){this.url=a;this.o=new Mb;this.Ya=this.mc=this.Vb=0;this.n=null;this.v=new s;this.pa=null}function Mb(){this.body=null;this.bc=1;this.rc=1E3;this.Yc=2;this.Zc=.5;this.Xc=0;this.method="GET";this.responseType="arraybuffer";this.Nb={};this.withCredentials=!1}function Nb(a){Ob(a);a.o.body=null;a.v=null;a.pa=null}function Ob(a){a.n&&(a.n.onload=null,a.n.onerror=null);a.n=null}
N.prototype.ub=function(){if(this.n)return this.v;if(0==this.url.lastIndexOf("data:",0)){var a=this.url.split(":")[1].split(";").pop().split(","),b=a.pop(),b="base64"==a.pop()?window.atob(b.replace(/-/g,"+").replace(/_/g,"/")):window.decodeURIComponent(b);"arraybuffer"==this.o.responseType&&(b=v(b).buffer);a=JSON.parse(JSON.stringify(new XMLHttpRequest));a.response=b;a.responseText=b.toString();b=this.v;b.resolve(a);Nb(this);return b}this.Vb++;this.mc=Date.now();this.Ya||(this.Ya=this.o.rc);this.n=
new XMLHttpRequest;a=this.url;this.pa&&(a=new L(a),a.wa.add("_",Date.now()),a=a.toString());this.n.open(this.o.method,a,!0);this.n.responseType=this.o.responseType;this.n.timeout=this.o.Xc;this.n.withCredentials=this.o.withCredentials;this.n.onload=this.Jc.bind(this);this.n.onerror=this.Jb.bind(this);for(b in this.o.Nb)this.n.setRequestHeader(b,this.o.Nb[b]);this.n.send(this.o.body);return this.v};
function Pb(a,b,c){b=Error(b);b.type=c;b.status=a.n.status;b.url=a.url;b.method=a.o.method;b.body=a.o.body;b.gd=a.n;return b}N.prototype.abort=function(){if(this.n&&this.n.readyState!=XMLHttpRequest.DONE){this.n.abort();var a=Pb(this,"Request aborted.","aborted");this.v.reject(a);Nb(this)}};
N.prototype.Jc=function(a){this.pa&&this.pa.tb(Date.now()-this.mc,a.loaded);200<=this.n.status&&299>=this.n.status?(this.v.resolve(this.n),Nb(this)):this.Vb<this.o.bc?(Ob(this),window.setTimeout(this.ub.bind(this),this.Ya*(1+(2*Math.random()-1)*this.o.Zc)),this.Ya*=this.o.Yc):(a=Pb(this,"HTTP error.","net"),this.v.reject(a),Nb(this))};N.prototype.Jb=function(){var a=Pb(this,"Network failure.","net");this.v.reject(a);Nb(this)};function Qb(a,b,c){N.call(this,a);this.o.body=b;this.o.method="POST";this.o.bc=3;this.o.withCredentials=c}q(Qb,N);Qb.prototype.send=function(){return this.ub().then(function(a){return Promise.resolve(new Uint8Array(a.response))})};function O(a){F.call(this,null);this.a=a;this.G=this.pb=this.d=null;this.b=new H;this.rb={};this.Ea=[];this.vb=[];this.sa="en";this.cb=this.sb=null;this.Ra=!1;this.L=new Ba;this.Ca=!0}q(O,F);m("shaka.player.Player",O);O.version="v1.2.3";
O.isBrowserSupported=function(){return!!window.MediaSource&&!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration&&!!window.Promise&&!!HTMLVideoElement.prototype.getVideoPlaybackQuality&&!!Element.prototype.requestFullscreen&&!!document.exitFullscreen&&"fullscreenElement"in document&&!!document.body.children};
function Rb(a){return"text/vtt"==a?!!window.VTTCue:MediaSource.isTypeSupported(a)}O.isTypeSupported=Rb;O.prototype.u=function(){this.Sb().catch(function(){});this.b.u();this.a=this.b=null};O.prototype.destroy=O.prototype.u;
O.prototype.Sb=function(){this.a.pause();Ya(this.b);Sb(this);Tb(this);for(var a=0;a<this.vb.length;++a)this.vb[a].close().catch(function(){});this.vb=[];this.Ea=[];this.G=this.pb=null;this.a.src="";a=this.a.setMediaKeys(null);this.d&&(this.d.u(),this.d=null);this.Ra=!1;this.rb={};this.L=new Ba;return a};O.prototype.unload=O.prototype.Sb;
O.prototype.load=function(a){var b=this.d?this.Sb():Promise.resolve();this.a.autoplay&&(J("load"),I(this.b,this.a,"timeupdate",this.Hc.bind(this)));a.ja(this.Ca);return b.then(t(this,function(){return a.load(this.sa)})).then(t(this,function(){this.d=a;var b;b=new Aa;for(var d=this.d.lb(),e=0;e<d.length;++e){var f=d[e];f.ha.keySystem||f.la&&!Rb(f.la)||b.push(f.contentType,f)}for(var e={},f=!1,g=0;g<d.length;++g){var k=d[g];if(k.ha.keySystem&&!b.has(k.contentType)){var l=k.ha.keySystem,p=e[l];p||(p=
e[l]={audioCapabilities:void 0,videoCapabilities:void 0,initDataTypes:void 0,distinctiveIdentifier:"optional",persistentState:"optional"});k.la&&(l=k.contentType+"Capabilities",l in p&&(f=!0,p[l]||(p[l]=[]),p[l].push({contentType:k.la})))}}f||(this.G=d[0].ha);0==Object.keys(e).length?(this.d.$a(b),b=Promise.resolve()):(f=new s,e=Ub(e,f),e=e.then(this.sc.bind(this,d,b)),e=e.then(this.dd.bind(this)),f.reject(null),b=e);return b})).then(t(this,function(){I(this.b,this.a,"error",this.Jb.bind(this));I(this.b,
this.a,"play",this.Mc.bind(this));I(this.b,this.a,"playing",this.Nc.bind(this));I(this.b,this.a,"seeking",this.Kb.bind(this));I(this.b,this.a,"pause",this.Lc.bind(this));I(this.b,this.a,"ended",this.Gc.bind(this));return this.d.fb(this,this.a)})).then(t(this,function(){for(var a=0;a<this.Ea.length;++a)this.dc(this.Ea[a]);return Promise.resolve()})).catch(t(this,function(b){a.u();this.d=null;var d=D(b);this.dispatchEvent(d);return Promise.reject(b)}))};O.prototype.load=O.prototype.load;
function Ub(a,b){for(var c in a){var d=a[c];b=b.catch(function(){return navigator.requestMediaKeySystemAccess(c,[d])})}return b}h=O.prototype;h.sc=function(a,b,c){for(var d=c.keySystem,e=c.getConfiguration(),f=["audio","video"],g=0;g<f.length;++g){var k=f[g];if(!b.has(k)){var l=e[k+"Capabilities"];if(l&&l.length){for(var l=l[0],p=[],n=0;n<a.length;++n){var r=a[n];if(r.ha.keySystem==d&&r.la==l.contentType){p.push(r);this.G=this.G?La(this.G,r.ha):r.ha;break}}b.set(k,p)}}}this.d.$a(b);return c.createMediaKeys()};
h.dd=function(a){this.pb=a;return this.a.setMediaKeys(this.pb).then(t(this,function(){this.Ea=[];for(var a=0;a<this.G.Ga.length;++a){var c=this.G.Ga[a];this.Ea.push({type:"encrypted",initDataType:c.initDataType,initData:c.initData})}0==this.Ea.length&&I(this.b,this.a,"encrypted",this.dc.bind(this))}))};
h.dc=function(a){var b=new Uint8Array(a.initData),c=Array.prototype.join.apply(b);this.G.nc&&(c="first");this.rb[c]||(b=this.pb.createSession(),this.vb.push(b),I(this.b,b,"message",this.Oc.bind(this)),I(this.b,b,"keystatuseschange",this.Ic.bind(this)),a=b.generateRequest(a.initDataType,a.initData),this.rb[c]=!0,a.catch(t(this,function(a){this.rb[c]=!1;a=D(a);this.dispatchEvent(a)})))};h.Oc=function(a){Vb(this,a.target,this.G.$b,a.message,this.G.withCredentials,this.G.Zb)};
h.Ic=function(a){var b=a.target.keyStatuses.values();for(a=b.next();!a.done;a=b.next()){var c=Wb[a.value];c&&(c=Error(c),c.type=a.value,a=D(c),this.dispatchEvent(a))}};function Vb(a,b,c,d,e,f){(new Qb(c,d,e)).send().then(t(a,function(a){if(f){var c=new Ja;a=f(a,c);this.d.xb(c)}return b.update(a)})).then(function(){}).catch(t(a,function(a){a.kd=b;a=D(a);this.dispatchEvent(a)}))}h.Hc=function(){K("load");this.L.playbackLatency=Fa("load")/1E3;this.b.ab(this.a,"timeupdate")};
h.Jb=function(a){this.a.error&&(a=this.a.error.code,a!=MediaError.MEDIA_ERR_ABORTED&&(a=Error(Xb[a]||"Unknown playback error."),a.type="playback",a=D(a),this.dispatchEvent(a)))};h.Mc=function(){};h.Nc=function(){J("playing");Sb(this);this.cb=window.setTimeout(this.fc.bind(this),100)};h.Kb=function(){Sb(this);this.Ra=!1};h.Lc=function(){K("playing");Ea(this.L)};h.Gc=function(){this.getStats();Sb(this)};
h.getStats=function(){this.a.paused||(K("playing"),Ea(this.L),J("playing"));var a=this.L,b=this.a.getVideoPlaybackQuality();b&&(a.decodedFrames=b.totalVideoFrames,a.droppedFrames=b.droppedVideoFrames);return this.L};O.prototype.getStats=O.prototype.getStats;O.prototype.wc=function(){var a=this.a.videoWidth,b=this.a.videoHeight;return a&&b?{width:a,height:b}:null};O.prototype.getCurrentResolution=O.prototype.wc;O.prototype.getVideoTracks=function(){return this.d?this.d.getVideoTracks():[]};
O.prototype.getVideoTracks=O.prototype.getVideoTracks;O.prototype.getAudioTracks=function(){return this.d?this.d.getAudioTracks():[]};O.prototype.getAudioTracks=O.prototype.getAudioTracks;O.prototype.Fa=function(){return this.d?this.d.Fa():[]};O.prototype.getTextTracks=O.prototype.Fa;O.prototype.za=function(a,b){return this.d?this.d.za(a,void 0==b?!0:b):!1};O.prototype.selectVideoTrack=O.prototype.za;O.prototype.Na=function(a){return this.d?this.d.Na(a,!1):!1};O.prototype.selectAudioTrack=O.prototype.Na;
O.prototype.Oa=function(a){return this.d?this.d.Oa(a,!1):!1};O.prototype.selectTextTrack=O.prototype.Oa;O.prototype.oa=function(a){this.d&&this.d.oa(a)};O.prototype.enableTextTrack=O.prototype.oa;O.prototype.ja=function(a){this.Ca=a;this.d&&this.d.ja(a)};O.prototype.enableAdaptation=O.prototype.ja;O.prototype.vc=function(){return this.Ca};O.prototype.getAdaptationEnabled=O.prototype.vc;O.prototype.xc=function(){return this.a.currentTime};O.prototype.getCurrentTime=O.prototype.xc;O.prototype.yc=function(){return this.a.duration};
O.prototype.getDuration=O.prototype.yc;O.prototype.zc=function(){return this.a.muted};O.prototype.getMuted=O.prototype.zc;O.prototype.Ac=function(){return this.a.volume};O.prototype.getVolume=O.prototype.Ac;O.prototype.play=function(){this.kc(1);this.a.play()};O.prototype.play=O.prototype.play;O.prototype.pause=function(){this.a.pause()};O.prototype.pause=O.prototype.pause;O.prototype.requestFullscreen=function(){this.a.requestFullscreen()};O.prototype.requestFullscreen=O.prototype.requestFullscreen;
O.prototype.seek=function(a){this.a.currentTime=a};O.prototype.seek=O.prototype.seek;O.prototype.$c=function(a){this.a.muted=a};O.prototype.setMuted=O.prototype.$c;O.prototype.bd=function(a){this.a.volume=a};O.prototype.setVolume=O.prototype.bd;O.prototype.ad=function(a){this.sa=Pa(a)};O.prototype.setPreferredLanguage=O.prototype.ad;O.prototype.kc=function(a){0!=a&&(Tb(this),0<a?this.a.playbackRate=a:(this.a.playbackRate=0,this.ec(a)))};O.prototype.setPlaybackRate=O.prototype.kc;
function Tb(a){a.rb&&(window.clearTimeout(a.rb),a.rb=null)}function Sb(a){a.bb&&(window.clearTimeout(a.bb),a.bb=null)}O.prototype.ec=function(a){this.a.currentTime+=.1*a;this.rb=window.setTimeout(this.ec.bind(this,a),100)};
O.prototype.fc=function(){this.bb=window.setTimeout(this.fc.bind(this),100);var a=this.a.buffered,a=a.length?a.end(a.length-1):0,a=this.a.currentTime-a;this.Ra?a<-this.d.lb()&&(J("buffering"),a=this.L,a.bufferingTime+=Fa("buffering")/1E3,this.Ra=!1,this.dispatchEvent(w({type:"bufferingEnd"})),this.a.play()):.05<a&&(this.Ra=!0,this.a.pause(),this.L.bufferingHistory.push(Date.now()/1E3),I("buffering"),this.dispatchEvent(w({type:"bufferingStart"})))};
var Wb={"output-not-allowed":"The required output protection is not available.",expired:"A required key has expired and the content cannot be decrypted.","internal-error":"An unknown error has occurred in the CDM."},Xb={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."};function Yb(){}Yb.prototype.Mb=function(a){for(var b=0;b<a.length;++b)for(var c=a[b],d=0;d<c.N.length;++d){for(var e=c.N[d],f=e,g=0;g<f.j.length;++g)Rb(da(f.j[g]))||(f.j.splice(g,1),--g);0==e.j.length&&(c.N.splice(d,1),--d)}for(b=0;b<a.length;++b)for(c=a[b],d=0;d<c.N.length;++d)c.N[d].j.sort(Zb)};function Zb(a,b){var c=a.bandwidth||Number.MAX_VALUE,d=b.bandwidth||Number.MAX_VALUE;return c<d?-1:c>d?1:0};function $b(a,b){this.A=a;this.d=b;this.b=new G;this.Hb=Date.now()/1E3+4;this.Wb=!0;H(this.b,this.A,"bandwidth",this.Ib.bind(this))}$b.prototype.u=function(){this.b.u();this.d=this.A=this.b=null};$b.prototype.enable=function(a){this.Wb=a};$b.prototype.Ib=function(){if(this.Wb){var a=Date.now()/1E3;if(!(a<this.Hb)){var b=ac(this);if(b){if(b.active){this.Hb=a+3;return}this.d.za(b.id,!1)}this.Hb=a+8}}};
function ac(a){var b=a.d.getVideoTracks();if(0==b.length)return null;b.sort(ma);var c;a:{c=a.d.getAudioTracks();for(var d=0;d<c.length;++d)if(c[d].active){c=c[d];break a}c=null}c=c?c.bandwidth:0;a=Va(a.A);for(var d=b[0],e=0;e<b.length;++e){var f=b[e],g=e+1<b.length?b[e+1]:{bandwidth:Number.POSITIVE_INFINITY};if(f.bandwidth&&(g=(g.bandwidth+c)/.85,a>=(f.bandwidth+c)/.95&&a<=g&&(d=f,d.active)))break}return d};function bc(a,b,c){E.call(this,null);this.Ka=a;this.oc=b;this.G=c?c:Ka();this.da=null}q(bc,E);m("shaka.player.HttpVideoSource",bc);h=bc.prototype;h.u=function(){this.da&&(this.da.parentElement.removeChild(this.da),this.da=null);this.parent=this.G=null};h.eb=function(a,b){this.parent=a;var c=b.mediaKeys;b.src=this.Ka;c=b.setMediaKeys(c);this.oc&&(this.da=document.createElement("track"),this.da.src=this.oc,b.appendChild(this.da),this.da.track.mode="showing");return c};h.load=function(){return Promise.resolve()};
h.getVideoTracks=function(){return[]};h.getAudioTracks=function(){return[]};h.Fa=function(){return[]};h.lb=function(){return 5};h.kb=function(){var a=new ha;a.ha=this.G;return[a]};h.Za=function(){};h.za=function(){return!1};h.Na=function(){return!1};h.Oa=function(){return!1};h.oa=function(a){this.da&&(this.da.track.mode=a?"showing":"disabled")};h.ja=function(){};h.wb=function(){};function cc(a,b,c){N.call(this,a);if(b||c)this.o.Nb.Range="bytes="+(b+"-"+(null!=c?c:""))}q(cc,N);cc.prototype.send=function(){return this.tb().then(function(a){return Promise.resolve(a.response)})};function dc(a,b,c){this.R=a;this.ba=b;this.A=c;this.b=new G;this.Ha=[];this.e=P;this.ia=this.v=null;this.i=[];this.aa=null;this.ya=[];H(this.b,this.ba,"updateend",this.Oc.bind(this))}var P=0,ec=1/60;h=dc.prototype;h.u=function(){this.abort();this.v=this.ia=this.i=this.aa=this.ya=this.e=null;this.b.u();this.R=this.ba=this.Ha=this.b=null};
function fc(a,b,c){if(a.e!=P)return a=Error("Cannot fetch: previous operation not complete."),a.type="stream",Promise.reject(a);a.e=1;a.v=new s;a.i=b.Uc;c&&a.ya.push(c);b=!0;c=a.i[0].url.toString();for(var d=1;d<a.i.length;++d)if(a.i[d].url.toString()!=c){b=!1;break}(b?gc(a):hc(a)).then(t(a,function(){Va(this.A);this.ba.appendBuffer(this.ya.shift());this.e=2;this.aa=null})).catch(t(a,function(a){"aborted"!=a.type&&ic(this,a)}));return a.v}
function gc(a){a.aa=new cc(a.i[0].url.toString(),a.i[0].Pa,a.i[a.i.length-1].Ta);a.aa.pa=a.A;return a.aa.send().then(a.yb.bind(a))}function hc(a){function b(a){this.aa=new cc(a.url.toString(),a.Pa,a.Ta);this.aa.pa=this.A;return this.aa.send()}for(var c=b.bind(a)(a.i[0]),d=a.yb.bind(a),e=1;e<a.i.length;++e)var f=b.bind(a,a.i[e]),c=c.then(d).then(f);return c=c.then(a.yb.bind(a))}h.yb=function(a){this.ya.push(a);return Promise.resolve()};
O.prototype.seek=function(a){this.a.currentTime=a};O.prototype.seek=O.prototype.seek;O.prototype.ad=function(a){this.a.muted=a};O.prototype.setMuted=O.prototype.ad;O.prototype.cd=function(a){this.a.volume=a};O.prototype.setVolume=O.prototype.cd;O.prototype.bd=function(a){this.sa=E(a)};O.prototype.setPreferredLanguage=O.prototype.bd;O.prototype.kc=function(a){Tb(this);0<=a?this.a.playbackRate=a:(this.a.playbackRate=0,this.ec(this.a.currentTime,Date.now(),a))};O.prototype.setPlaybackRate=O.prototype.kc;
function Tb(a){a.sb&&(window.clearTimeout(a.sb),a.sb=null)}function Sb(a){a.cb&&(window.clearTimeout(a.cb),a.cb=null)}O.prototype.ec=function(a,b,c){this.a.currentTime=a+(Date.now()-b)/1E3*c;this.sb=window.setTimeout(this.ec.bind(this,a,b,c),100)};
O.prototype.fc=function(){this.cb=window.setTimeout(this.fc.bind(this),100);var a=this.a.buffered,a=a.length?a.end(a.length-1):0,a=this.a.currentTime-a;this.Ra?a<-this.d.mb()&&(K("buffering"),a=this.L,a.bufferingTime+=Fa("buffering")/1E3,this.Ra=!1,this.dispatchEvent(B({type:"bufferingEnd"})),this.a.play()):.05<a&&(this.Ra=!0,this.a.pause(),this.L.bufferingHistory.push(Date.now()/1E3),J("buffering"),this.dispatchEvent(B({type:"bufferingStart"})))};
var Wb={"output-not-allowed":"The required output protection is not available.",expired:"A required key has expired and the content cannot be decrypted.","internal-error":"An unknown error has occurred in the CDM."},Xb={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."};function Yb(){}Yb.prototype.Mb=function(a){for(var b=0;b<a.length;++b)for(var c=a[b],d=0;d<c.N.length;++d){for(var e=c.N[d],f=e,g=0;g<f.j.length;++g)Rb(da(f.j[g]))||(f.j.splice(g,1),--g);0==e.j.length&&(c.N.splice(d,1),--d)}for(b=0;b<a.length;++b)for(c=a[b],d=0;d<c.N.length;++d)c.N[d].j.sort(Zb)};function Zb(a,b){var c=a.bandwidth||Number.MAX_VALUE,d=b.bandwidth||Number.MAX_VALUE;return c<d?-1:c>d?1:0};function $b(a,b){this.A=a;this.d=b;this.b=new H;this.Wa=Date.now()/1E3+4;this.Wb=!0;I(this.b,this.A,"bandwidth",this.Ib.bind(this));I(this.b,this.d,"adaptation",this.Fc.bind(this))}$b.prototype.u=function(){this.b.u();this.d=this.A=this.b=null};$b.prototype.enable=function(a){this.Wb=a};$b.prototype.Ib=function(){if(this.Wb){var a=Date.now()/1E3;if(!(a<this.Wa)){var b=ac(this);if(b){if(b.active){this.Wa=a+3;return}this.d.za(b.id,!1)}this.Wa=Number.POSITIVE_INFINITY}}};
$b.prototype.Fc=function(){this.Wa==Number.POSITIVE_INFINITY&&(this.Wa=Date.now()/1E3+30)};
function ac(a){var b=a.d.getVideoTracks();if(0==b.length)return null;b.sort(ma);var c;a:{c=a.d.getAudioTracks();for(var d=0;d<c.length;++d)if(c[d].active){c=c[d];break a}c=null}c=c?c.bandwidth:0;a=Ua(a.A);for(var d=b[0],e=0;e<b.length;++e){var f=b[e],g=e+1<b.length?b[e+1]:{bandwidth:Number.POSITIVE_INFINITY};if(f.bandwidth&&(g=(g.bandwidth+c)/.85,a>=(f.bandwidth+c)/.95&&a<=g&&(d=f,d.active)))break}return d};function bc(a,b,c){F.call(this,null);this.Ka=a;this.oc=b;this.G=c?c:Ka();this.da=null}q(bc,F);m("shaka.player.HttpVideoSource",bc);h=bc.prototype;h.u=function(){this.da&&(this.da.parentElement.removeChild(this.da),this.da=null);this.parent=this.G=null};h.fb=function(a,b){this.parent=a;var c=b.mediaKeys;b.src=this.Ka;c=b.setMediaKeys(c);this.oc&&(this.da=document.createElement("track"),this.da.src=this.oc,b.appendChild(this.da),this.da.track.mode="showing");return c};h.load=function(){return Promise.resolve()};
h.getVideoTracks=function(){return[]};h.getAudioTracks=function(){return[]};h.Fa=function(){return[]};h.mb=function(){return 5};h.lb=function(){var a=new ha;a.ha=this.G;return[a]};h.$a=function(){};h.za=function(){return!1};h.Na=function(){return!1};h.Oa=function(){return!1};h.oa=function(a){this.da&&(this.da.track.mode=a?"showing":"disabled")};h.ja=function(){};h.xb=function(){};function cc(a,b,c){N.call(this,a);if(b||c)this.o.Nb.Range="bytes="+(b+"-"+(null!=c?c:""))}q(cc,N);cc.prototype.send=function(){return this.ub().then(function(a){return Promise.resolve(a.response)})};function dc(a,b,c){this.R=a;this.ba=b;this.A=c;this.b=new H;this.Ha=[];this.e=P;this.ia=this.v=null;this.i=[];this.aa=null;this.ya=[];I(this.b,this.ba,"updateend",this.Pc.bind(this))}var P=0,ec=1/60;h=dc.prototype;h.u=function(){this.abort();this.v=this.ia=this.i=this.aa=this.ya=this.e=null;this.b.u();this.R=this.ba=this.Ha=this.b=null};
function fc(a,b,c){if(a.e!=P)return a=Error("Cannot fetch: previous operation not complete."),a.type="stream",Promise.reject(a);a.e=1;a.v=new s;a.i=b.Vc;c&&a.ya.push(c);b=!0;c=a.i[0].url.toString();for(var d=1;d<a.i.length;++d)if(a.i[d].url.toString()!=c){b=!1;break}(b?gc(a):hc(a)).then(t(a,function(){Ua(this.A);this.ba.appendBuffer(this.ya.shift());this.e=2;this.aa=null})).catch(t(a,function(a){"aborted"!=a.type&&ic(this,a)}));return a.v}
function gc(a){a.aa=new cc(a.i[0].url.toString(),a.i[0].Pa,a.i[a.i.length-1].Ta);a.aa.pa=a.A;return a.aa.send().then(a.zb.bind(a))}function hc(a){function b(a){this.aa=new cc(a.url.toString(),a.Pa,a.Ta);this.aa.pa=this.A;return this.aa.send()}for(var c=b.bind(a)(a.i[0]),d=a.zb.bind(a),e=1;e<a.i.length;++e)var f=b.bind(a,a.i[e]),c=c.then(d).then(f);return c=c.then(a.zb.bind(a))}h.zb=function(a){this.ya.push(a);return Promise.resolve()};
h.clear=function(){if(this.e!=P){var a=Error("Cannot clear: previous operation not complete.");a.type="stream";return Promise.reject(a)}if(0==this.ba.buffered.length)return Promise.resolve();try{this.ba.remove(0,Number.POSITIVE_INFINITY)}catch(b){return Promise.reject(b)}this.Ha=[];this.e=3;return this.v=new s};h.reset=function(){this.Ha=[]};
h.abort=function(){switch(this.e){case P:return Promise.resolve();case 1:this.e=4;var a=this.ia=new s;this.aa.abort();jc(this);return a;case 2:case 3:return this.e=4,this.ia=new s,"open"==this.R.readyState&&this.ba.abort(),this.ia;case 4:return this.ia}};
h.Oc=function(){switch(this.e){case 2:if(0<this.ya.length){try{this.ba.appendBuffer(this.ya.shift())}catch(a){ic(this,a)}break}for(var b=0;b<this.i.length;++b)this.Ha[this.i[b].index]=!0;this.i=[];case 3:this.e=P;this.v.resolve();this.v=null;break;case 4:jc(this)}};function jc(a){a.ia.resolve();a.ia=null;var b=Error("Current operation aborted.");b.type="aborted";ic(a,b)}function ic(a,b){a.v.reject(b);a.e=P;a.v=null;a.i=[];a.aa=null;a.ya=[]};function kc(){this.duration=this.c=this.type=this.id=null;this.t=5;this.p=[]}function lc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.duration=this.start=null;this.P=[]}function mc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.contentType=this.lang=null;this.fa=[];this.m=[]}function nc(){this.value=null}function oc(){this.contentType=this.lang=this.id=null}
function pc(){this.lang=this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.bandwidth=null;this.fa=[];this.Va=!1}function qc(){this.value=this.schemeIdUri=null;this.children=[];this.pssh=null}function rc(){this.parsedPssh=this.psshBox=null}function Q(){this.url=null}function R(){this.D=this.c=null;this.F=1;this.W=0;this.ma=this.S=this.Db=null}function sc(){this.$=this.url=null}function tc(){this.$=this.url=null}
function S(){this.c=null;this.F=1;this.W=0;this.T=null;this.ca=1;this.ma=null;this.B=[]}function uc(){this.duration=this.startTime=this.pb=this.D=null}function vc(){this.F=1;this.W=0;this.T=null;this.ca=1;this.Rb=this.Eb=this.mb=this.ta=null}function wc(){this.pc=[]}function xc(){this.repeat=this.duration=this.startTime=null}function yc(a,b){this.gb=a;this.end=b}kc.TAG_NAME="MPD";lc.TAG_NAME="Period";mc.TAG_NAME="AdaptationSet";nc.TAG_NAME="Role";oc.TAG_NAME="ContentComponent";pc.TAG_NAME="Representation";
h.Pc=function(){switch(this.e){case 2:if(0<this.ya.length){try{this.ba.appendBuffer(this.ya.shift())}catch(a){ic(this,a)}break}for(var b=0;b<this.i.length;++b)this.Ha[this.i[b].index]=!0;this.i=[];case 3:this.e=P;this.v.resolve();this.v=null;break;case 4:jc(this)}};function jc(a){a.ia.resolve();a.ia=null;var b=Error("Current operation aborted.");b.type="aborted";ic(a,b)}function ic(a,b){a.v.reject(b);a.e=P;a.v=null;a.i=[];a.aa=null;a.ya=[]};function kc(){this.duration=this.c=this.type=this.id=null;this.t=5;this.p=[]}function lc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.duration=this.start=null;this.P=[]}function mc(){this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.contentType=this.lang=null;this.fa=[];this.m=[]}function nc(){this.value=null}function oc(){this.contentType=this.lang=this.id=null}
function pc(){this.lang=this.id=null;this.t=5;this.w=this.r=this.q=this.c=this.ea=this.l=this.height=this.width=this.bandwidth=null;this.fa=[];this.Va=!1}function qc(){this.value=this.schemeIdUri=null;this.children=[];this.pssh=null}function rc(){this.parsedPssh=this.psshBox=null}function Q(){this.url=null}function R(){this.D=this.c=null;this.F=1;this.W=0;this.ma=this.S=this.Eb=null}function sc(){this.$=this.url=null}function tc(){this.$=this.url=null}
function S(){this.c=null;this.F=1;this.W=0;this.T=null;this.ca=1;this.ma=null;this.B=[]}function uc(){this.duration=this.startTime=this.qb=this.D=null}function vc(){this.F=1;this.W=0;this.T=null;this.ca=1;this.Rb=this.Fb=this.nb=this.ta=null}function wc(){this.pc=[]}function xc(){this.repeat=this.duration=this.startTime=null}function yc(a,b){this.hb=a;this.end=b}kc.TAG_NAME="MPD";lc.TAG_NAME="Period";mc.TAG_NAME="AdaptationSet";nc.TAG_NAME="Role";oc.TAG_NAME="ContentComponent";pc.TAG_NAME="Representation";
qc.TAG_NAME="ContentProtection";rc.TAG_NAME="cenc:pssh";Q.TAG_NAME="BaseURL";R.TAG_NAME="SegmentBase";sc.TAG_NAME="RepresentationIndex";tc.TAG_NAME="Initialization";S.TAG_NAME="SegmentList";uc.TAG_NAME="SegmentURL";vc.TAG_NAME="SegmentTemplate";wc.TAG_NAME="SegmentTimeline";xc.TAG_NAME="S";
kc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.type=T(b,"type",U);this.duration=T(b,"mediaPresentationDuration",zc);this.t=T(b,"minBufferTime",zc)||5;var c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.p=X(this,b,lc)};lc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.start=T(b,"start",zc);this.duration=T(b,"duration",zc);this.t=a.t;var c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.q=V(this,b,R);this.r=V(this,b,S);this.w=V(this,b,vc);this.P=X(this,b,mc)};
mc.prototype.parse=function(a,b){var c=V(this,b,oc)||{},d=V(this,b,nc);this.id=T(b,"id",U);this.lang=T(b,"lang",U)||c.lang;this.contentType=T(b,"contentType",U)||c.contentType;this.width=T(b,"width",Y);this.height=T(b,"height",Y);this.l=T(b,"mimeType",U);this.ea=T(b,"codecs",U);this.Va=d&&"main"==d.value;this.lang&&(this.lang=Pa(this.lang));this.t=a.t;c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.fa=X(this,b,qc);!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]);this.q=V(this,b,R)||
a.q;this.r=V(this,b,S)||a.r;this.w=V(this,b,vc)||a.w;this.m=X(this,b,pc);!this.l&&this.m.length&&(this.l=this.m[0].l,!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]))};nc.prototype.parse=function(a,b){this.value=T(b,"value",U)};oc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.lang=T(b,"lang",U);this.contentType=T(b,"contentType",U);this.lang&&(this.lang=Pa(this.lang))};
mc.prototype.parse=function(a,b){var c=V(this,b,oc)||{},d=V(this,b,nc);this.id=T(b,"id",U);this.lang=T(b,"lang",U)||c.lang;this.contentType=T(b,"contentType",U)||c.contentType;this.width=T(b,"width",Y);this.height=T(b,"height",Y);this.l=T(b,"mimeType",U);this.ea=T(b,"codecs",U);this.Va=d&&"main"==d.value;this.lang&&(this.lang=E(this.lang));this.t=a.t;c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.fa=X(this,b,qc);!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]);this.q=V(this,b,R)||
a.q;this.r=V(this,b,S)||a.r;this.w=V(this,b,vc)||a.w;this.m=X(this,b,pc);!this.l&&this.m.length&&(this.l=this.m[0].l,!this.contentType&&this.l&&(this.contentType=this.l.split("/")[0]))};nc.prototype.parse=function(a,b){this.value=T(b,"value",U)};oc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.lang=T(b,"lang",U);this.contentType=T(b,"contentType",U);this.lang&&(this.lang=E(this.lang))};
pc.prototype.parse=function(a,b){this.id=T(b,"id",U);this.bandwidth=T(b,"bandwidth",Y);this.width=T(b,"width",Y)||a.width;this.height=T(b,"height",Y)||a.height;this.l=T(b,"mimeType",U)||a.l;this.ea=T(b,"codecs",U)||a.ea;this.lang=a.lang;this.t=a.t;var c=V(this,b,Q);this.c=W(a.c,c?c.url:null);this.fa=X(this,b,qc);this.q=V(this,b,R)||a.q;this.r=V(this,b,S)||a.r;this.w=V(this,b,vc)||a.w;0==this.fa.length&&(this.fa=a.fa)};
qc.prototype.parse=function(a,b){this.schemeIdUri=T(b,"schemeIdUri",U);this.value=T(b,"value",U);this.pssh=V(this,b,rc);this.children=b.children};rc.prototype.parse=function(a,b){var c=Ac(b);if(c){this.psshBox=qa(c);try{this.parsedPssh=new ab(this.psshBox)}catch(d){if(!(d instanceof RangeError))throw d;}}};Q.prototype.parse=function(a,b){this.url=Ac(b)};
R.prototype.parse=function(a,b){this.D=this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",Z)||0;this.Db=T(b,"indexRange",Bc);this.S=V(this,b,sc);this.ma=V(this,b,tc);this.S?this.S.$||(this.S.$=this.Db):(this.S=new sc,this.S.url=this.c,this.S.$=this.Db)};sc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};tc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};
S.prototype.parse=function(a,b){this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",Z)||0;this.T=T(b,"duration",Z);this.ca=T(b,"startNumber",Y)||1;this.ma=V(this,b,tc);this.B=X(this,b,uc)};uc.prototype.parse=function(a,b){var c=T(b,"media",U);this.D=W(a.c,c);this.pb=T(b,"mediaRange",Bc)};
vc.prototype.parse=function(a,b){this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",Z)||0;this.T=T(b,"duration",Z);this.ca=T(b,"startNumber",Y)||1;this.ta=T(b,"media",U);this.mb=T(b,"index",U);this.Eb=T(b,"initialization",U);this.Rb=V(this,b,wc)};wc.prototype.parse=function(a,b){this.pc=X(this,b,xc)};xc.prototype.parse=function(a,b){this.startTime=T(b,"t",Z);this.duration=T(b,"d",Z);this.repeat=T(b,"r",Z)};function W(a,b){var c=b?new K(b):null;return a?c?a.resolve(c):a:c}
qc.prototype.parse=function(a,b){this.schemeIdUri=T(b,"schemeIdUri",U);this.value=T(b,"value",U);this.pssh=V(this,b,rc);this.children=b.children};rc.prototype.parse=function(a,b){var c=Ac(b);if(c){this.psshBox=qa(c);try{this.parsedPssh=new $a(this.psshBox)}catch(d){if(!(d instanceof RangeError))throw d;}}};Q.prototype.parse=function(a,b){this.url=Ac(b)};
R.prototype.parse=function(a,b){this.D=this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",$)||0;this.Eb=T(b,"indexRange",Bc);this.S=V(this,b,sc);this.ma=V(this,b,tc);this.S?this.S.$||(this.S.$=this.Eb):(this.S=new sc,this.S.url=this.c,this.S.$=this.Eb)};sc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};tc.prototype.parse=function(a,b){var c=T(b,"sourceURL",U);this.url=W(a.c,c);this.$=T(b,"range",Bc)};
S.prototype.parse=function(a,b){this.c=a.c;this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",$)||0;this.T=T(b,"duration",$);this.ca=T(b,"startNumber",Y)||1;this.ma=V(this,b,tc);this.B=X(this,b,uc)};uc.prototype.parse=function(a,b){var c=T(b,"media",U);this.D=W(a.c,c);this.qb=T(b,"mediaRange",Bc)};
vc.prototype.parse=function(a,b){this.F=T(b,"timescale",Y)||1;this.W=T(b,"presentationTimeOffset",$)||0;this.T=T(b,"duration",$);this.ca=T(b,"startNumber",Y)||1;this.ta=T(b,"media",U);this.nb=T(b,"index",U);this.Fb=T(b,"initialization",U);this.Rb=V(this,b,wc)};wc.prototype.parse=function(a,b){this.pc=X(this,b,xc)};xc.prototype.parse=function(a,b){this.startTime=T(b,"t",$);this.duration=T(b,"d",$);this.repeat=T(b,"r",$)};function W(a,b){var c=b?new L(b):null;return a?c?a.resolve(c):a:c}
function V(a,b,c){for(var d=null,e=0;e<b.children.length;e++)if(b.children[e].tagName==c.TAG_NAME){if(d)return null;d=b.children[e]}if(!d)return null;b=new c;b.parse.call(b,a,d);return b}function X(a,b,c){for(var d=[],e=0;e<b.children.length;e++)if(b.children[e].tagName==c.TAG_NAME){var f=new c;f.parse.call(f,a,b.children[e]);d.push(f)}return d}function Ac(a){a=a.firstChild;return a.nodeType!=Node.TEXT_NODE?null:a.nodeValue}function T(a,b,c){return c(a.getAttribute(b))}
function zc(a){if(!a)return null;var b=/^P(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!b)return null;a=0;var c=Z(b[1]);c&&(a+=86400*c);(c=Z(b[2]))&&(a+=3600*c);(c=Z(b[3]))&&(a+=60*c);b=window.parseFloat(b[4]);(b=isNaN(b)?null:b)&&(a+=b);return a}function Bc(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Z(b[1]);if(null==a)return null;b=Z(b[2]);return null==b?null:new yc(a,b)}function Y(a){a=window.parseInt(a,10);return 0<a?a:null}
function Z(a){a=window.parseInt(a,10);return 0<=a?a:null}function U(a){return a};function Cc(a,b){E.call(this,a);this.a=b;this.X=this.M=null}q(Cc,E);h=Cc.prototype;h.u=function(){this.X&&this.a.removeChild(this.X);this.parent=this.a=this.M=this.X=null};h.Xb=function(){return!0};h.start=function(a){this.M=a;a=this.Cb();this.X&&(this.vb(!1),this.a.removeChild(this.X));this.X=document.createElement("track");this.a.appendChild(this.X);this.X.src=this.M.D.toString();this.vb(a)};h.Qb=function(a){this.start(a)};h.ic=function(){};h.vb=function(a){this.X.track.mode=a?"showing":"disabled"};
h.Cb=function(){return this.X?"showing"==this.X.track.mode:!1};function Dc(a,b,c,d,e){E.call(this,a);this.a=b;this.ba=d;this.K=new dc(c,d,e);this.A=e;this.ab=this.Wa=this.H=this.M=null;this.e=Ec;this.Aa=""}q(Dc,E);var Ec=0;h=Dc.prototype;h.u=function(){this.e=null;Fc(this);this.A=this.M=this.H=this.Wa=null;this.K.u();this.parent=this.a=this.ba=this.K=null};h.Xb=function(){return 5==this.e};
h.start=function(a){if(this.e==Ec){this.M=a;this.Aa=a.l.split("/")[0];this.H=null;this.e=1;var b=Gc(this,a);Promise.all(b).then(t(this,function(b){var d=b[0];b=b[1];if(a.Ya){if(this.H=this.ib(a,d,b),!this.H)return d=Error("Failed to create SegmentIndex."),d.type="stream",Promise.reject(d)}else this.H=a.Ma;return(d=Kb(this.H,this.a.currentTime,a.t))?fc(this.K,d,b):Promise.reject(Error("No segments available."))})).then(t(this,function(){Hc(this,a);Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&
(this.e=Ec,a=x(a),this.dispatchEvent(a))}))}};
h.Qb=function(a,b){I("switch");I("switch logic");if(this.e!=Ec)if(1==this.e||2==this.e||3==this.e)this.Wa=this.Qb.bind(this,a,b);else if(a==this.M)this.va();else{if(b&&a.height&&a.height!=this.M.height){var c=function(b){b.videoHeight==a.height?J("switch"):window.setTimeout(c,50)}.bind(null,this.a);c()}this.e=2;var d=Gc(this,a),e=this.a.paused;b&&(this.a.pause(),Fc(this),d.push(this.K.abort()));var f;Promise.all(d).then(t(this,function(b){var c=b[0];f=b[1];if(a.Ya){if(this.H=this.ib(a,c,f),!this.H)return b=
Error("Failed to create SegmentIndex."),b.type="stream",Promise.reject(b)}else this.H=a.Ma;this.M=a;this.Aa=a.l.split("/")[0];this.e=3;this.K.reset();Hc(this,a);Fc(this);return this.K.abort()})).then(t(this,function(){var b=Math.max(a.t,15);return(b=Kb(this.H,this.a.currentTime,b))?fc(this.K,b,f):Promise.reject(Error("No segments available."))})).then(t(this,function(){b&&(this.a.currentTime-=.05,e||this.a.play());J("switch logic");Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&(a=x(a),this.dispatchEvent(a),
this.e=4,this.va())}))}};function Hc(a,b){var c=b.l.split("/")[0],c=w({type:"adaptation",bubbles:!0,contentType:c,size:"video"!=c?null:{width:b.width,height:b.height},bandwidth:b.bandwidth});a.dispatchEvent(c)}function Ic(a){a.e=4;if(a.Wa){var b=a.Wa;a.Wa=null;b()}else a.va()}
h.ic=function(){this.e!=Ec&&1!=this.e&&2!=this.e&&3!=this.e&&(Fc(this),this.K.abort().then(t(this,function(){var a=this.a.currentTime,b=Lb(this.H,a);a:{for(var c=this.K.ba.buffered,d=0;d<c.length;++d){var e=c.start(d)-ec,f=c.end(d)+ec;if(a>=e&&a<=f){a=!0;break a}}a=!1}return a&&this.K.Ha[b]?Promise.resolve():this.K.clear()})).then(t(this,function(){this.e=4;this.va()})))};h.vb=function(){};h.Cb=function(){return!0};function Gc(a,b){return[Jc(a,b.Ya),Jc(a,b.Ob)]}
function Jc(a,b){if(!b||!b.url)return Promise.resolve(null);var c=new cc(b.url.toString(),b.Pa,b.Ta);c.pa=a.A;return c.send()}h.ib=function(a,b,c){var d=null;if(0<=a.l.indexOf("mp4"))d=new Gb(a.D);else if(0<=a.l.indexOf("webm")){if(!c)return null;d=new Hb(a.D)}else return null;c=c?new DataView(c):null;b=new DataView(b);return(a=d.parse(c,b,a.Ya.Pa))?new Ib(a):null};
h.va=function(){Fc(this);var a=this.a.currentTime,b=Kc(this,a);if(b=Jb(this.H,b)){var c=Math.max(this.M.t,15);b.startTime-a>=c?this.ab=window.setTimeout(this.va.bind(this),1E3):fc(this.K,new Fb([b])).then(t(this,function(){this.va()})).catch(t(this,function(a){if("aborted"!=a.type){var b=x(a);this.dispatchEvent(b);"net"==a.type&&0==a.fd.status&&(this.ab=window.setTimeout(this.va.bind(this),5E3))}}))}else this.e=5,a=w({type:"ended"}),this.dispatchEvent(a)};
function Kc(a,b){for(var c=Lb(a.H,b);0<=c&&c<a.H.i.length&&a.K.Ha[c];)c++;return c}function Fc(a){a.ab&&(window.clearTimeout(a.ab),a.ab=null)};function Lc(a){E.call(this,null);this.I=a;this.hc=0;this.gc=new Yb;this.R=new MediaSource;this.a=null;this.C={};this.s={};this.b=new G;this.fb=new s;this.sa="";this.Pb=!1;this.A=new Ua;this.L=null;this.cb=new $b(this.A,this)}q(Lc,E);m("shaka.player.StreamVideoSource",Lc);h=Lc.prototype;h.u=function(){this.b.u();this.b=null;this.cb.u();this.cb=null;Mc(this);this.parent=this.A=this.fb=this.a=this.R=this.gc=this.C=null};
h.eb=function(a,b){if(0==this.I.J.length){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}this.parent=a;this.a=b;this.L=a.getStats();H(this.b,this.R,"sourceopen",this.Jc.bind(this));H(this.b,this.a,"seeking",this.Kb.bind(this));H(this.b,this.A,"bandwidth",this.Ib.bind(this));c=this.a.mediaKeys;this.a.src=window.URL.createObjectURL(this.R);c=this.a.setMediaKeys(c);return Promise.all([this.fb,c])};
function zc(a){if(!a)return null;var b=/^P(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!b)return null;a=0;var c=$(b[1]);c&&(a+=86400*c);(c=$(b[2]))&&(a+=3600*c);(c=$(b[3]))&&(a+=60*c);b=window.parseFloat(b[4]);(b=isNaN(b)?null:b)&&(a+=b);return a}function Bc(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=$(b[1]);if(null==a)return null;b=$(b[2]);return null==b?null:new yc(a,b)}function Y(a){a=window.parseInt(a,10);return 0<a?a:null}
function $(a){a=window.parseInt(a,10);return 0<=a?a:null}function U(a){return a};function Cc(a,b){F.call(this,a);this.a=b;this.X=this.M=null}q(Cc,F);h=Cc.prototype;h.u=function(){this.X&&this.a.removeChild(this.X);this.parent=this.a=this.M=this.X=null};h.Xb=function(){return!0};h.start=function(a){this.M=a;a=this.Db();this.X&&(this.wb(!1),this.a.removeChild(this.X));this.X=document.createElement("track");this.a.appendChild(this.X);this.X.src=this.M.D.toString();this.wb(a)};h.Qb=function(a){this.start(a)};h.ic=function(){};h.wb=function(a){this.X.track.mode=a?"showing":"disabled"};
h.Db=function(){return this.X?"showing"==this.X.track.mode:!1};function Dc(a,b,c,d,e){F.call(this,a);this.a=b;this.ba=d;this.K=new dc(c,d,e);this.A=e;this.bb=this.Xa=this.H=this.M=null;this.e=Ec;this.Aa=""}q(Dc,F);var Ec=0;h=Dc.prototype;h.u=function(){this.e=null;Fc(this);this.A=this.M=this.H=this.Xa=null;this.K.u();this.parent=this.a=this.ba=this.K=null};h.Xb=function(){return 5==this.e};
h.start=function(a){if(this.e==Ec){this.M=a;this.Aa=a.l.split("/")[0];this.H=null;this.e=1;var b=Gc(this,a);Promise.all(b).then(t(this,function(b){var d=b[0];b=b[1];if(a.Za){if(this.H=this.jb(a,d,b),!this.H)return d=Error("Failed to create SegmentIndex."),d.type="stream",Promise.reject(d)}else this.H=a.Ma;return(d=Kb(this.H,this.a.currentTime,a.t))?fc(this.K,d,b):Promise.reject(Error("No segments available."))})).then(t(this,function(){Hc(this,a);Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&
(this.e=Ec,a=D(a),this.dispatchEvent(a))}))}};
h.Qb=function(a,b){J("switch");J("switch logic");if(this.e!=Ec)if(1==this.e||2==this.e||3==this.e)this.Xa=this.Qb.bind(this,a,b);else if(a==this.M)this.va();else{if(b&&a.height&&a.height!=this.M.height){var c=function(b){b.videoHeight==a.height?K("switch"):window.setTimeout(c,50)}.bind(null,this.a);c()}this.e=2;var d=Gc(this,a),e=this.a.paused;b&&(this.a.pause(),Fc(this),d.push(this.K.abort()));var f;Promise.all(d).then(t(this,function(b){var c=b[0];f=b[1];if(a.Za){if(this.H=this.jb(a,c,f),!this.H)return b=
Error("Failed to create SegmentIndex."),b.type="stream",Promise.reject(b)}else this.H=a.Ma;this.M=a;this.Aa=a.l.split("/")[0];this.e=3;this.K.reset();Fc(this);return this.K.abort()})).then(t(this,function(){var b=Math.max(a.t,15);return(b=Kb(this.H,this.a.currentTime,b))?fc(this.K,b,f):Promise.reject(Error("No segments available."))})).then(t(this,function(){b&&(this.a.currentTime-=.05,e||this.a.play());K("switch logic");Hc(this,a);Ic(this)})).catch(t(this,function(a){"aborted"!=a.type&&(a=D(a),this.dispatchEvent(a),
this.e=4,this.va())}))}};function Hc(a,b){var c=b.l.split("/")[0],c=B({type:"adaptation",bubbles:!0,contentType:c,size:"video"!=c?null:{width:b.width,height:b.height},bandwidth:b.bandwidth});a.dispatchEvent(c)}function Ic(a){a.e=4;if(a.Xa){var b=a.Xa;a.Xa=null;b()}else a.va()}
h.ic=function(){this.e!=Ec&&1!=this.e&&2!=this.e&&3!=this.e&&(Fc(this),this.K.abort().then(t(this,function(){var a=this.a.currentTime,b=Lb(this.H,a);a:{for(var c=this.K.ba.buffered,d=0;d<c.length;++d){var e=c.start(d)-ec,f=c.end(d)+ec;if(a>=e&&a<=f){a=!0;break a}}a=!1}return a&&this.K.Ha[b]?Promise.resolve():this.K.clear()})).then(t(this,function(){this.e=4;this.va()})))};h.wb=function(){};h.Db=function(){return!0};function Gc(a,b){return[Jc(a,b.Za),Jc(a,b.Ob)]}
function Jc(a,b){if(!b||!b.url)return Promise.resolve(null);var c=new cc(b.url.toString(),b.Pa,b.Ta);c.pa=a.A;return c.send()}h.jb=function(a,b,c){var d=null;if(0<=a.l.indexOf("mp4"))d=new Gb(a.D);else if(0<=a.l.indexOf("webm")){if(!c)return null;d=new Hb(a.D)}else return null;c=c?new DataView(c):null;b=new DataView(b);return(a=d.parse(c,b,a.Za.Pa))?new Ib(a):null};
h.va=function(){Fc(this);var a=this.a.currentTime,b=Kc(this,a);if(b=Jb(this.H,b)){var c=Math.max(this.M.t,15);b.startTime-a>=c?this.bb=window.setTimeout(this.va.bind(this),1E3):fc(this.K,new Fb([b])).then(t(this,function(){this.va()})).catch(t(this,function(a){if("aborted"!=a.type){var b=D(a);this.dispatchEvent(b);"net"==a.type&&0==a.gd.status&&(this.bb=window.setTimeout(this.va.bind(this),5E3))}}))}else this.e=5,a=B({type:"ended"}),this.dispatchEvent(a)};
function Kc(a,b){for(var c=Lb(a.H,b);0<=c&&c<a.H.i.length&&a.K.Ha[c];)c++;return c}function Fc(a){a.bb&&(window.clearTimeout(a.bb),a.bb=null)};function Lc(a){F.call(this,null);this.I=a;this.hc=0;this.gc=new Yb;this.R=new MediaSource;this.a=null;this.C={};this.s={};this.b=new H;this.gb=new s;this.sa="";this.Pb=!1;this.A=new Ta;this.L=null;this.eb=new $b(this.A,this)}q(Lc,F);m("shaka.player.StreamVideoSource",Lc);h=Lc.prototype;h.u=function(){this.b.u();this.b=null;this.eb.u();this.eb=null;Mc(this);this.parent=this.A=this.gb=this.a=this.R=this.gc=this.C=null};
h.fb=function(a,b){if(0==this.I.J.length){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}this.parent=a;this.a=b;this.L=a.getStats();I(this.b,this.R,"sourceopen",this.Kc.bind(this));I(this.b,this.a,"seeking",this.Kb.bind(this));I(this.b,this.A,"bandwidth",this.Ib.bind(this));c=this.a.mediaKeys;this.a.src=window.URL.createObjectURL(this.R);c=this.a.setMediaKeys(c);return Promise.all([this.gb,c])};
h.load=function(a){this.sa=a;if(0==this.I.J.length)return a=Error("The manifest contains no stream information."),a.type="stream",Promise.reject(a);this.hc=this.I.t;this.gc.Mb(this.I.J);return 0==this.I.J.length||0==this.I.J[0].N.length?(a=Error("The manifest specifies content that cannot be displayed on this browser/platform."),a.type="stream",Promise.reject(a)):Promise.resolve()};
h.getVideoTracks=function(){if(!this.s.video)return[];for(var a=this.C.video,a=(a=a?a.M:null)?a.Y:0,b=[],c=0;c<this.s.video.length;++c)for(var d=this.s.video[c],e=0;e<d.j.length;++e){var f=d.j[e];if(f.enabled){var g=f.Y,f=new la(g,f.bandwidth,f.width,f.height);g==a&&(f.active=!0);b.push(f)}}return b};
h.getAudioTracks=function(){if(!this.s.audio)return[];for(var a=this.C.audio,a=(a=a?a.M:null)?a.Y:0,b=[],c=0;c<this.s.audio.length;++c)for(var d=this.s.audio[c],e=d.lang,f=0;f<d.j.length;++f){var g=d.j[f],k=g.Y,g=new na(k,g.bandwidth,e);k==a&&(g.active=!0);b.push(g)}return b};
h.Fa=function(){if(!this.s.text)return[];for(var a=this.C.text,b=a?a.M:null,b=b?b.Y:0,c=[],d=0;d<this.s.text.length;++d)for(var e=this.s.text[d],f=e.lang,g=0;g<e.j.length;++g){var k=e.j[g].Y,l=new ka(k,f);k==b&&(l.active=!0,l.enabled=a.Cb());c.push(l)}return c};h.lb=function(){return this.hc};h.kb=function(){return 0==this.I.J.length?[]:this.I.J[0].Bb()};
h.Za=function(a){for(var b={},c=this.I.J[0],d=0;d<c.N.length;++d){var e=c.N[d];b[e.Y]=e}this.s={};c=a.keys();for(d=0;d<c.length;++d){var e=c[d],f=a.get(e);this.s[e]=[];if("video"==e){var g=f[0].id;this.s[e].push(b[g])}else if("audio"==e)for(var g=f[0].la.split(";")[0],k=0;k<f.length;++k){var l=f[k];l.la.split(";")[0]==g&&this.s[e].push(b[l.id])}else for(k=0;k<f.length;++k)g=f[k].id,this.s[e].push(b[g])}this.Pb=!0;if(a=this.s.audio)Nc(this,a),Oa(2,this.sa,a[0].lang||this.sa)&&(this.Pb=!1);(a=this.s.text)&&
Nc(this,a)};h.za=function(a,b){return Oc(this,"video",a,b)};h.Na=function(a,b){return Oc(this,"audio",a,b)};h.Oa=function(a,b){return Oc(this,"text",a,b)};h.oa=function(a){var b=this.C.text;b&&b.vb(a)};h.ja=function(a){this.cb.enable(a)};h.wb=function(a){for(var b=0;b<this.I.J.length;++b)for(var c=this.I.J[b],d=0;d<c.N.length;++d)for(var e=c.N[d],f=0;f<e.j.length;++f){var g=e.j[f];g.enabled=!0;a.maxWidth&&g.width>a.maxWidth&&(g.enabled=!1);a.maxHeight&&g.height>a.maxHeight&&(g.enabled=!1)}};
h.Fa=function(){if(!this.s.text)return[];for(var a=this.C.text,b=a?a.M:null,b=b?b.Y:0,c=[],d=0;d<this.s.text.length;++d)for(var e=this.s.text[d],f=e.lang,g=0;g<e.j.length;++g){var k=e.j[g].Y,l=new ka(k,f);k==b&&(l.active=!0,l.enabled=a.Db());c.push(l)}return c};h.mb=function(){return this.hc};h.lb=function(){return 0==this.I.J.length?[]:this.I.J[0].Cb()};
h.$a=function(a){for(var b={},c=this.I.J[0],d=0;d<c.N.length;++d){var e=c.N[d];b[e.Y]=e}this.s={};c=a.keys();for(d=0;d<c.length;++d){var e=c[d],f=a.get(e);this.s[e]=[];if("video"==e){var g=f[0].id;this.s[e].push(b[g])}else if("audio"==e)for(var g=f[0].la.split(";")[0],k=0;k<f.length;++k){var l=f[k];l.la.split(";")[0]==g&&this.s[e].push(b[l.id])}else for(k=0;k<f.length;++k)g=f[k].id,this.s[e].push(b[g])}this.Pb=!0;if(a=this.s.audio)Nc(this,a),Oa(2,this.sa,a[0].lang||this.sa)&&(this.Pb=!1);(a=this.s.text)&&
Nc(this,a)};h.za=function(a,b){return Oc(this,"video",a,b)};h.Na=function(a,b){return Oc(this,"audio",a,b)};h.Oa=function(a,b){return Oc(this,"text",a,b)};h.oa=function(a){var b=this.C.text;b&&b.wb(a)};h.ja=function(a){this.eb.enable(a)};h.xb=function(a){for(var b=0;b<this.I.J.length;++b)for(var c=this.I.J[b],d=0;d<c.N.length;++d)for(var e=c.N[d],f=0;f<e.j.length;++f){var g=e.j[f];g.enabled=!0;a.maxWidth&&g.width>a.maxWidth&&(g.enabled=!1);a.maxHeight&&g.height>a.maxHeight&&(g.enabled=!1)}};
function Oc(a,b,c,d){if(!a.s[b])return!1;for(var e=0;e<a.s[b].length;++e)for(var f=a.s[b][e],g=0;g<f.j.length;++g){var k=f.j[g];if(k.Y==c)return Ga(a.L,k),a.C[b].Qb(k,d),!0}return!1}function Nc(a,b){for(var c=0;2>=c;++c)for(var d=0;d<b.length;++d){var e=b[d];if(Oa(c,a.sa,e.lang)){b.splice(d,1);b.splice(0,0,e);return}}for(d=0;d<b.length;++d)if(e=b[d],e.Va){b.splice(d,1);b.splice(0,0,e);break}}
h.Jc=function(){this.b.$a(this.R,"sourceopen");this.R.duration=this.I.J[0].duration;for(var a=[],b=["audio","video","text"],c=0;c<b.length;++c){var d=b[c];this.s[d]&&a.push(this.s[d][0])}b={};for(c=d=0;c<a.length;++c){var e=a[c],f=e.j[0];if("video"==e.contentType){var g;g=(g=ac(this.cb))?g.id:null;for(var k=0;k<e.j.length&&(f=e.j[k],f.Y!=g);++k);}else"audio"==e.contentType&&(f=e.j[Math.floor(e.j.length/2)]);Ga(this.L,f);if("text"==e.contentType)g=new Cc(this,this.a);else a:{g=f;var k=da(g),l=void 0;
try{l=this.R.addSourceBuffer(k)}catch(p){Mc(this);g=Error("Failed to create stream for "+k+".");g.type="stream";g.hd=p;this.fb.reject(g);g=null;break a}l.timestampOffset=this.I.J[0].start-g.timestampOffset;g=new Dc(this,this.a,this.R,l,this.A)}if(!g)return;this.C[e.contentType]=g;b[e.contentType]=f;f.Ma&&(e=Jb(f.Ma,0))&&(d=Math.max(d,e.startTime))}this.a.currentTime=d;for(var n in this.C)g=this.C[n],H(this.b,g,"ended",this.Pc.bind(this)),g.start(b[n]);this.oa(this.Pb);this.fb.resolve()};
function Mc(a){for(var b in a.C)a.C[b].u();a.C={}}h.Pc=function(){if("open"==this.R.readyState){for(var a in this.C)if(!this.C[a].Xb())return;this.R.endOfStream()}};h.Kb=function(){for(var a in this.C)this.C[a].ic()};h.Ib=function(){var a=this.L,b=Va(this.A);a.estimatedBandwidth=b;a.bandwidthHistory.push(new Ia(b))};function Pc(a){N.call(this,a);this.o.responseType="text"}q(Pc,N);Pc.prototype.send=function(){var a=this.url;return this.tb().then(function(b){b=b.responseText;if(b=(new DOMParser).parseFromString(b,"text/xml")){var c={c:new K(a)};b=V(c,b,kc)}else b=null;if(b)return Promise.resolve(b);b=Error("MPD parse failure.");b.type="mpd";return Promise.reject(b)})};function Qc(a){this.Ua=a;this.nb=new ja}
Qc.prototype.Mb=function(a){this.nb=new ja;for(var b=0;b<a.p.length;++b)for(var c=a.p[b],d=0;d<c.P.length;++d){var e=c.P[d];if("text"!=e.contentType)for(var f=0;f<e.m.length;++f){var g=e.m[f],k=0,k=k+(g.q?1:0),k=k+(g.r?1:0),k=k+(g.w?1:0);0==k?(e.m.splice(f,1),--f):1!=k&&(g.q?(g.r=null,g.w=null):g.r&&(g.w=null));!g.q||g.q.S&&g.q.S.$&&g.q.D||(e.m.splice(f,1),--f)}}Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d)for(e=c.P[d],f=0;f<e.m.length;++f)if(g=e.m[f],g.w)if(k=g.w,k.mb){a:{var k=
g,l=k.w,p=new R,n;n=k;var r=n.w;if(r.mb){var v=new sc;(r=Sc(r.mb,n.id,null,n.bandwidth,null))?(v.url=n.c&&r?n.c.resolve(r):r,n=v):n=null}else n=null;p.S=n;if(p.S){p.ma=Tc(k);n=void 0;if(l.ta){l=Sc(l.ta,k.id,1,k.bandwidth,0);if(!l)break a;n=k.c?k.c.resolve(l):l}else n=k.c;p.D=n;k.q=p}}g.q||(e.m.splice(f,1),--f)}else if(k.Rb){a:if(k=g,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=p.Rb.pc;for(var v=1,r=-1,u=0;u<n.length;++u)for(var C=n[u].repeat||0,Ca=0;Ca<=C;++Ca){if(!n[u].duration)break a;
var $;$=n[u].startTime&&0==Ca?n[u].startTime:0==u&&0==Ca?0:r;if(0<=r&&$!=r){var M=l.B[l.B.length-1];M.duration+=$-r}r=$+n[u].duration;M=Sc(p.ta,k.id,v-1+p.ca,k.bandwidth,$);if(!M)break a;var M=k.c?k.c.resolve(M):M,Da=new uc;Da.D=M;Da.startTime=$;Da.duration=n[u].duration;l.B.push(Da);++v}k.r=l}g.r||(e.m.splice(f,1),--f)}else if(k.T)if(null!=c.duration){a:if(k=g,n=c.duration,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.T=p.T;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=Math.floor(n/(p.T/p.F));for(v=1;v<=n;++v){r=(v-1+(p.ca-
1))*p.T;u=Sc(p.ta,k.id,v-1+p.ca,k.bandwidth,r);if(!u)break a;u=k.c?k.c.resolve(u):u;C=new uc;C.D=u;C.startTime=r;C.duration=p.T;l.B.push(C)}k.r=l}g.r||(e.m.splice(f,1),--f)}else e.m.splice(f,1),--f;else e.m.splice(f,1),--f;Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d){f=e=c.P[d];g=null;for(k=0;k<f.m.length;++k)(p=f.m[k].l||"",g)?p!=g&&(f.m.splice(k,1),--k):g=p;0==e.m.length&&(c.P.splice(d,1),--d)}this.nb.t=a.t||0;for(b=0;b<a.p.length;++b){c=a.p[b];d=new ia;d.start=c.start||0;d.duration=
c.duration||0;for(e=0;e<c.P.length;++e){f=c.P[e];g=new fa;g.Va=f.Va;g.contentType=f.contentType||"";g.lang=f.lang||"";for(k=0;k<f.m.length;++k){l=f.m[k];n=p=g.Sa.slice(0);v=l;r=[];if(0==v.fa.length)r.push(Ka());else if(this.Ua)for(u=0;u<v.fa.length;++u)(C=this.Ua(v.fa[u]))&&r.push(C);v=r;if(0==n.length)Array.prototype.push.apply(n,v);else for(r=0;r<n.length;++r){u=!1;for(C=0;C<v.length;++C)if(n[r].key()==v[C].key()){u=!0;break}u||(n.splice(r,1),--r)}if(!(0==p.length&&0<g.Sa.length)){a:{n=new ba;n.id=
l.id;n.t=l.t;n.bandwidth=l.bandwidth;n.width=l.width;n.height=l.height;n.l=l.l||"";n.ea=l.ea||"";n.D=l.c;if(l.q)n.timestampOffset=l.q.W/l.q.F,n.D=l.q.D,n.Ya=Uc(l.q.S),n.Ob=Uc(l.q.ma);else if(l.r&&(n.timestampOffset=l.r.W/l.r.F,n.Ob=Uc(l.r.ma),n.Ma=this.ib(l.r),!n.Ma)){l=null;break a}l=n}l&&(g.j.push(l),g.Sa=p)}}d.N.push(g)}this.nb.J.push(d)}};
h.Kc=function(){this.b.ab(this.R,"sourceopen");this.R.duration=this.I.J[0].duration;for(var a=[],b=["audio","video","text"],c=0;c<b.length;++c){var d=b[c];this.s[d]&&a.push(this.s[d][0])}b={};for(c=d=0;c<a.length;++c){var e=a[c],f=e.j[0];if("video"==e.contentType){var g;g=(g=ac(this.eb))?g.id:null;for(var k=0;k<e.j.length&&(f=e.j[k],f.Y!=g);++k);}else"audio"==e.contentType&&(f=e.j[Math.floor(e.j.length/2)]);Ga(this.L,f);if("text"==e.contentType)g=new Cc(this,this.a);else a:{g=f;var k=da(g),l=void 0;
try{l=this.R.addSourceBuffer(k)}catch(p){Mc(this);g=Error("Failed to create stream for "+k+".");g.type="stream";g.jd=p;this.gb.reject(g);g=null;break a}l.timestampOffset=this.I.J[0].start-g.timestampOffset;g=new Dc(this,this.a,this.R,l,this.A)}if(!g)return;this.C[e.contentType]=g;b[e.contentType]=f;f.Ma&&(e=Jb(f.Ma,0))&&(d=Math.max(d,e.startTime))}this.a.currentTime=d;for(var n in this.C)g=this.C[n],I(this.b,g,"ended",this.Qc.bind(this)),g.start(b[n]);this.oa(this.Pb);this.gb.resolve()};
function Mc(a){for(var b in a.C)a.C[b].u();a.C={}}h.Qc=function(){if("open"==this.R.readyState){for(var a in this.C)if(!this.C[a].Xb())return;this.R.endOfStream()}};h.Kb=function(){for(var a in this.C)this.C[a].ic()};h.Ib=function(){var a=this.L,b=Ua(this.A);a.estimatedBandwidth=b;a.bandwidthHistory.push(new Ia(b))};function Pc(a){N.call(this,a);this.o.responseType="text"}q(Pc,N);Pc.prototype.send=function(){var a=this.url;return this.ub().then(function(b){b=b.responseText;if(b=(new DOMParser).parseFromString(b,"text/xml")){var c={c:new L(a)};b=V(c,b,kc)}else b=null;if(b)return Promise.resolve(b);b=Error("MPD parse failure.");b.type="mpd";return Promise.reject(b)})};function Qc(a){this.Ua=a;this.ob=new ja}
Qc.prototype.Mb=function(a){this.ob=new ja;for(var b=0;b<a.p.length;++b)for(var c=a.p[b],d=0;d<c.P.length;++d){var e=c.P[d];if("text"!=e.contentType)for(var f=0;f<e.m.length;++f){var g=e.m[f],k=0,k=k+(g.q?1:0),k=k+(g.r?1:0),k=k+(g.w?1:0);0==k?(e.m.splice(f,1),--f):1!=k&&(g.q?(g.r=null,g.w=null):g.r&&(g.w=null));!g.q||g.q.S&&g.q.S.$&&g.q.D||(e.m.splice(f,1),--f)}}Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d)for(e=c.P[d],f=0;f<e.m.length;++f)if(g=e.m[f],g.w)if(k=g.w,k.nb){a:{var k=
g,l=k.w,p=new R,n;n=k;var r=n.w;if(r.nb){var w=new sc;(r=Sc(r.nb,n.id,null,n.bandwidth,null))?(w.url=n.c&&r?n.c.resolve(r):r,n=w):n=null}else n=null;p.S=n;if(p.S){p.ma=Tc(k);n=void 0;if(l.ta){l=Sc(l.ta,k.id,1,k.bandwidth,0);if(!l)break a;n=k.c?k.c.resolve(l):l}else n=k.c;p.D=n;k.q=p}}g.q||(e.m.splice(f,1),--f)}else if(k.Rb){a:if(k=g,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=p.Rb.pc;for(var w=1,r=-1,u=0;u<n.length;++u)for(var C=n[u].repeat||0,Ca=0;Ca<=C;++Ca){if(!n[u].duration)break a;
var Z;Z=n[u].startTime&&0==Ca?n[u].startTime:0==u&&0==Ca?0:r;if(0<=r&&Z!=r){var M=l.B[l.B.length-1];M.duration+=Z-r}r=Z+n[u].duration;M=Sc(p.ta,k.id,w-1+p.ca,k.bandwidth,Z);if(!M)break a;var M=k.c?k.c.resolve(M):M,Da=new uc;Da.D=M;Da.startTime=Z;Da.duration=n[u].duration;l.B.push(Da);++w}k.r=l}g.r||(e.m.splice(f,1),--f)}else if(k.T)if(null!=c.duration){a:if(k=g,n=c.duration,p=k.w,p.ta){l=new S;l.F=p.F;l.W=p.W;l.T=p.T;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=Math.floor(n/(p.T/p.F));for(w=1;w<=n;++w){r=(w-1+(p.ca-
1))*p.T;u=Sc(p.ta,k.id,w-1+p.ca,k.bandwidth,r);if(!u)break a;u=k.c?k.c.resolve(u):u;C=new uc;C.D=u;C.startTime=r;C.duration=p.T;l.B.push(C)}k.r=l}g.r||(e.m.splice(f,1),--f)}else e.m.splice(f,1),--f;else e.m.splice(f,1),--f;Rc(a);for(b=0;b<a.p.length;++b)for(c=a.p[b],d=0;d<c.P.length;++d){f=e=c.P[d];g=null;for(k=0;k<f.m.length;++k)(p=f.m[k].l||"",g)?p!=g&&(f.m.splice(k,1),--k):g=p;0==e.m.length&&(c.P.splice(d,1),--d)}this.ob.t=a.t||0;for(b=0;b<a.p.length;++b){c=a.p[b];d=new ia;d.start=c.start||0;d.duration=
c.duration||0;for(e=0;e<c.P.length;++e){f=c.P[e];g=new fa;g.Va=f.Va;g.contentType=f.contentType||"";g.lang=f.lang||"";for(k=0;k<f.m.length;++k){l=f.m[k];n=p=g.Sa.slice(0);w=l;r=[];if(0==w.fa.length)r.push(Ka());else if(this.Ua)for(u=0;u<w.fa.length;++u)(C=this.Ua(w.fa[u]))&&r.push(C);w=r;if(0==n.length)Array.prototype.push.apply(n,w);else for(r=0;r<n.length;++r){u=!1;for(C=0;C<w.length;++C)if(n[r].key()==w[C].key()){u=!0;break}u||(n.splice(r,1),--r)}if(!(0==p.length&&0<g.Sa.length)){a:{n=new ba;n.id=
l.id;n.t=l.t;n.bandwidth=l.bandwidth;n.width=l.width;n.height=l.height;n.l=l.l||"";n.ea=l.ea||"";n.D=l.c;if(l.q)n.timestampOffset=l.q.W/l.q.F,n.D=l.q.D,n.Za=Uc(l.q.S),n.Ob=Uc(l.q.ma);else if(l.r&&(n.timestampOffset=l.r.W/l.r.F,n.Ob=Uc(l.r.ma),n.Ma=this.jb(l.r),!n.Ma)){l=null;break a}l=n}l&&(g.j.push(l),g.Sa=p)}}d.N.push(g)}this.ob.J.push(d)}};
function Rc(a){if(a.p.length){"static"==a.type&&null==a.p[0].start&&(a.p[0].start=0);var b=function(a){return 0==a||!!a};1==a.p.length&&!b(a.p[0].duration)&&b(a.duration)&&(a.p[0].duration=a.duration);for(var c=0;c<a.p.length;++c){var d=a.p[c-1],e=a.p[c];Vc(e);var f=a.p[c+1]||{start:a.duration};!b(e.start)&&d&&b(d.duration)&&(e.start=d.start+d.duration);!b(e.duration)&&b(f.start)&&(e.duration=f.start-e.start)}c=a.p[a.p.length-1];!b(a.duration)&&b(c.start)&&b(c.duration)&&(a.duration=c.start+c.duration)}}
function Vc(a){if(null==a.duration){for(var b=null,c=0;c<a.P.length;++c)for(var d=a.P[c],e=0;e<d.m.length;++e){var f=d.m[e];if(f.r){f=f.r;if(0==f.B.length)f=0;else if(f.T)f=f.T/f.F*f.B.length;else{for(var g=f.B[0].startTime,k=0;k<f.B.length;++k)g+=f.B[k].duration;f=g/f.F}b=Math.max(b,f)}}a.duration=b}}function Tc(a){var b=a.w;if(!b.Eb)return null;var c=new tc,b=Sc(b.Eb,a.id,null,a.bandwidth,null);if(!b)return null;c.url=a.c&&b?a.c.resolve(b):b;return c}
function Sc(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};a=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;c=Math.max(0,c-a.length);return Array(c+1).join("0")+a});try{return new K(a)}catch(g){if(g instanceof URIError)return null;throw g;}}
function Uc(a){if(!a)return null;var b=new ea;b.url=a.url;a.$&&(b.Pa=a.$.gb,b.Ta=a.$.end);return b}Qc.prototype.ib=function(a){for(var b=a.F,c=a.T,d=[],e=0;e<a.B.length;++e){var f=a.B[e],g=0,k=null,l=0,p=null;if(null!=f.startTime)0<e&&null!=a.B[e-1].startTime&&(g=a.B[e-1].startTime),g=f.startTime/b,k=g+f.duration/b;else{if(!c)return null;0==e?g=0:(g=d[e-1].startTime,g+=c/b);k=g+c/b;f.pb&&(l=f.pb.gb,p=f.pb.end)}d.push(new Eb(e,g,k,l,p,f.D))}return new Ib(d)};function Wc(a,b){E.call(this,null);this.Ec=a;this.Ua=b;this.g=null;this.Ca=!0}q(Wc,E);m("shaka.player.DashVideoSource",Wc);h=Wc.prototype;h.u=function(){this.g&&(this.g.u(),this.g=null);this.parent=this.Ua=null};h.eb=function(a,b){if(!this.g){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}return this.g.eb(a,b)};h.load=function(a){return(new Pc(this.Ec)).send().then(t(this,function(b){var c=new Qc(this.Ua);c.Mb(b);this.g=new Lc(c.nb);this.g.ja(this.Ca);return this.g.load(a)}))};
h.getVideoTracks=function(){return this.g?this.g.getVideoTracks():[]};h.getAudioTracks=function(){return this.g?this.g.getAudioTracks():[]};h.Fa=function(){return this.g?this.g.Fa():[]};h.lb=function(){return this.g?this.g.lb():0};h.kb=function(){return this.g?this.g.kb():[]};h.Za=function(a){return this.g.Za(a)};h.za=function(a,b){return this.g?this.g.za(a,b):!1};h.Na=function(a,b){return this.g?this.g.Na(a,b):!1};h.Oa=function(a,b){return this.g?this.g.Oa(a,b):!1};h.oa=function(a){this.g&&this.g.oa(a)};
h.ja=function(a){this.Ca=a;this.g&&this.g.ja(a)};h.wb=function(a){this.g&&this.g.wb(a)};}.bind(window))()
function Vc(a){if(null==a.duration){for(var b=null,c=0;c<a.P.length;++c)for(var d=a.P[c],e=0;e<d.m.length;++e){var f=d.m[e];if(f.r){f=f.r;if(0==f.B.length)f=0;else if(f.T)f=f.T/f.F*f.B.length;else{for(var g=f.B[0].startTime,k=0;k<f.B.length;++k)g+=f.B[k].duration;f=g/f.F}b=Math.max(b,f)}}a.duration=b}}function Tc(a){var b=a.w;if(!b.Fb)return null;var c=new tc,b=Sc(b.Fb,a.id,null,a.bandwidth,null);if(!b)return null;c.url=a.c&&b?a.c.resolve(b):b;return c}
function Sc(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};a=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;c=Math.max(0,c-a.length);return Array(c+1).join("0")+a});try{return new L(a)}catch(g){if(g instanceof URIError)return null;throw g;}}
function Uc(a){if(!a)return null;var b=new ea;b.url=a.url;a.$&&(b.Pa=a.$.hb,b.Ta=a.$.end);return b}Qc.prototype.jb=function(a){for(var b=a.F,c=a.T,d=[],e=0;e<a.B.length;++e){var f=a.B[e],g=0,k=null,l=0,p=null;if(null!=f.startTime)0<e&&null!=a.B[e-1].startTime&&(g=a.B[e-1].startTime),g=f.startTime/b,k=g+f.duration/b;else{if(!c)return null;0==e?g=0:(g=d[e-1].startTime,g+=c/b);k=g+c/b;f.qb&&(l=f.qb.hb,p=f.qb.end)}d.push(new Eb(e,g,k,l,p,f.D))}return new Ib(d)};function Wc(a,b){F.call(this,null);this.Ec=a;this.Ua=b;this.g=null;this.Ca=!0}q(Wc,F);m("shaka.player.DashVideoSource",Wc);h=Wc.prototype;h.u=function(){this.g&&(this.g.u(),this.g=null);this.parent=this.Ua=null};h.fb=function(a,b){if(!this.g){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}return this.g.fb(a,b)};h.load=function(a){return(new Pc(this.Ec)).send().then(t(this,function(b){var c=new Qc(this.Ua);c.Mb(b);this.g=new Lc(c.ob);this.g.ja(this.Ca);return this.g.load(a)}))};
h.getVideoTracks=function(){return this.g?this.g.getVideoTracks():[]};h.getAudioTracks=function(){return this.g?this.g.getAudioTracks():[]};h.Fa=function(){return this.g?this.g.Fa():[]};h.mb=function(){return this.g?this.g.mb():0};h.lb=function(){return this.g?this.g.lb():[]};h.$a=function(a){return this.g.$a(a)};h.za=function(a,b){return this.g?this.g.za(a,b):!1};h.Na=function(a,b){return this.g?this.g.Na(a,b):!1};h.Oa=function(a,b){return this.g?this.g.Oa(a,b):!1};h.oa=function(a){this.g&&this.g.oa(a)};
h.ja=function(a){this.Ca=a;this.g&&this.g.ja(a)};h.xb=function(a){this.g&&this.g.xb(a)};}.bind((typeof(module)!="undefined"&&module.exports)?module.exports:window))()

@@ -23,5 +23,13 @@ /**

var eventManager;
var event1;
var event2;
var target1;
var target2;
beforeEach(function() {
eventManager = new shaka.util.EventManager();
target1 = document.createElement('div');
target2 = document.createElement('div');
event1 = new Event('eventtype1');
event2 = new Event('eventtype2');
});

@@ -34,7 +42,6 @@

it('listens for an event', function() {
var target = new FakeEventTarget();
var listener = jasmine.createSpy('listener');
eventManager.listen(target, 'event', listener);
target.dispatchEvent('event');
eventManager.listen(target1, 'eventtype1', listener);
target1.dispatchEvent(event1);

@@ -45,13 +52,10 @@ expect(listener).toHaveBeenCalled();

it('listens for an event from mutiple targets', function() {
var target1 = new FakeEventTarget();
var target2 = new FakeEventTarget();
var listener1 = jasmine.createSpy('listener1');
var listener2 = jasmine.createSpy('listener2');
eventManager.listen(target1, 'event', listener1);
eventManager.listen(target2, 'event', listener2);
eventManager.listen(target1, 'eventtype1', listener1);
eventManager.listen(target2, 'eventtype1', listener2);
target1.dispatchEvent('event');
target2.dispatchEvent('event');
target1.dispatchEvent(event1);
target2.dispatchEvent(event1);

@@ -63,12 +67,10 @@ expect(listener1).toHaveBeenCalled();

it('listens for multiple events', function() {
var target = new FakeEventTarget();
var listener1 = jasmine.createSpy('listener1');
var listener2 = jasmine.createSpy('listener2');
eventManager.listen(target, 'event1', listener1);
eventManager.listen(target, 'event2', listener2);
eventManager.listen(target1, 'eventtype1', listener1);
eventManager.listen(target1, 'eventtype2', listener2);
target.dispatchEvent('event1');
target.dispatchEvent('event2');
target1.dispatchEvent(event1);
target1.dispatchEvent(event2);

@@ -80,13 +82,10 @@ expect(listener1).toHaveBeenCalled();

it('listens for multiple events from mutiple targets', function() {
var target1 = new FakeEventTarget();
var target2 = new FakeEventTarget();
var listener1 = jasmine.createSpy('listener1');
var listener2 = jasmine.createSpy('listener2');
eventManager.listen(target1, 'event1', listener1);
eventManager.listen(target2, 'event2', listener2);
eventManager.listen(target1, 'eventtype1', listener1);
eventManager.listen(target2, 'eventtype2', listener2);
target1.dispatchEvent('event1');
target2.dispatchEvent('event2');
target1.dispatchEvent(event1);
target2.dispatchEvent(event2);

@@ -98,12 +97,9 @@ expect(listener1).toHaveBeenCalled();

it('listens for an event with multiple listeners', function() {
var target = new FakeEventTarget();
var listener1 = jasmine.createSpy('listener1');
var listener2 = jasmine.createSpy('listener2');
eventManager.listen(target, 'event', listener1);
eventManager.listen(target, 'event', listener2);
eventManager.listen(target1, 'eventtype1', listener1);
eventManager.listen(target1, 'eventtype1', listener2);
target.dispatchEvent('event');
target.dispatchEvent('event');
target1.dispatchEvent(event1);

@@ -115,9 +111,8 @@ expect(listener1).toHaveBeenCalled();

it('stops listening to an event', function() {
var target = new FakeEventTarget();
var listener = jasmine.createSpy('listener');
eventManager.listen(target, 'event', listener);
eventManager.unlisten(target, 'event');
eventManager.listen(target1, 'eventtype1', listener);
eventManager.unlisten(target1, 'eventtype1');
target.dispatchEvent('event');
target1.dispatchEvent(event1);

@@ -128,14 +123,12 @@ expect(listener).not.toHaveBeenCalled();

it('stops listening to multiple events', function() {
var target = new FakeEventTarget();
var listener1 = jasmine.createSpy('listener1');
var listener2 = jasmine.createSpy('listener2');
eventManager.listen(target, 'event1', listener1);
eventManager.listen(target, 'event2', listener2);
eventManager.listen(target1, 'eventtype1', listener1);
eventManager.listen(target1, 'eventtype2', listener2);
eventManager.removeAll(target);
eventManager.removeAll(target1);
target.dispatchEvent('event1');
target.dispatchEvent('event2');
target1.dispatchEvent(event1);
target1.dispatchEvent(event2);

@@ -147,14 +140,11 @@ expect(listener1).not.toHaveBeenCalled();

it('stops listening for an event with multiple listeners', function() {
var target = new FakeEventTarget();
var listener1 = jasmine.createSpy('listener1');
var listener2 = jasmine.createSpy('listener2');
eventManager.listen(target, 'event', listener1);
eventManager.listen(target, 'event', listener2);
eventManager.listen(target1, 'eventtype1', listener1);
eventManager.listen(target1, 'eventtype1', listener2);
eventManager.removeAll(target);
eventManager.removeAll(target1);
target.dispatchEvent('event');
target.dispatchEvent('event');
target1.dispatchEvent(event1);

@@ -161,0 +151,0 @@ expect(listener1).not.toHaveBeenCalled();

@@ -45,3 +45,3 @@ // This file was autogenerated by third_party/closure/deps/depswriter.py.

goog.addDependency('../../../lib/util/ewma_bandwidth_estimator.js', ['shaka.util.EWMABandwidthEstimator'], ['shaka.util.EWMA', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.IBandwidthEstimator']);
goog.addDependency('../../../lib/util/fake_event.js', ['shaka.util.FakeEvent'], []);
goog.addDependency('../../../lib/util/fake_event.js', ['shaka.util.FakeEvent'], ['shaka.asserts']);
goog.addDependency('../../../lib/util/fake_event_target.js', ['shaka.util.FakeEventTarget'], ['shaka.asserts', 'shaka.util.MultiMap']);

@@ -48,0 +48,0 @@ goog.addDependency('../../../lib/util/i_bandwidth_estimator.js', ['shaka.util.IBandwidthEstimator'], []);

@@ -280,3 +280,3 @@ // Copyright 2006 The Closure Library Authors. All Rights Reserved.

if (overridden) {
absoluteUri.setQueryData(relativeUri.getDecodedQuery());
absoluteUri.setQueryData(relativeUri.getQueryData().clone());
} else {

@@ -283,0 +283,0 @@ overridden = relativeUri.hasFragment();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc