Socket
Socket
Sign inDemoInstall

shaka-player

Package Overview
Dependencies
Maintainers
1
Versions
327
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.0 to 1.2.2

build/checkversion.sh

106

app.js

@@ -132,2 +132,8 @@ /**

}
if ('cycleVideo' in params) {
app.cycleVideo();
}
if ('cycleAudio' in params) {
app.cycleAudio();
}
};

@@ -180,8 +186,10 @@

* Called when a new video track is selected.
*
* @param {boolean=} opt_immediate
*/
app.onVideoChange = function() {
app.onVideoChange = function(opt_immediate) {
var id = document.getElementById('videoTracks').value;
document.getElementById('adaptationEnabled').checked = false;
app.onAdaptationChange();
app.player_.selectVideoTrack(id);
app.player_.selectVideoTrack(id, opt_immediate);
};

@@ -222,5 +230,55 @@

/**
* A very lazy demo function to cycle through audio tracks.
* A demo function to cycle through audio tracks.
*/
app.cycleAudio = function() {
app.cycleTracks_('cycleAudio', 'audioTracks', 3, function() {
app.onAudioChange();
}, function() {});
};
/**
* A demo function to cycle through video tracks.
*/
app.cycleVideo = function() {
// Disable adaptation.
var adaptationEnabled = document.getElementById('adaptationEnabled');
var originalAdaptationEnabled = adaptationEnabled.checked;
adaptationEnabled.checked = false;
adaptationEnabled.disabled = true;
app.onAdaptationChange();
app.cycleTracks_('cycleVideo', 'videoTracks', 6, function() {
// Select video track with immediate == false. This switches in the same
// smooth way as the AbrManager.
app.onVideoChange(false);
}, function() {
// Re-enable adaptation.
adaptationEnabled.disabled = false;
adaptationEnabled.checked = originalAdaptationEnabled;
app.onAdaptationChange();
});
};
/**
* Common functionality for cycling through tracks.
* @param {string} cycleButtonId
* @param {string} tracksId
* @param {number} seconds
* @param {function()} onSelect
* @param {function()} onComplete
* @private
*/
app.cycleTracks_ =
function(cycleButtonId, tracksId, seconds, onSelect, onComplete) {
// Indicate that we are busy cycling.
var cycleButton = document.getElementById(cycleButtonId);
var originalCycleText = cycleButton.textContent;
cycleButton.textContent = 'Cycling...';
cycleButton.disabled = true;
// Prevent the user from changing the settings while we are cycling.
var tracks = document.getElementById(tracksId);
tracks.disabled = true;
var intervalId = window.setInterval(function() {

@@ -230,11 +288,15 @@ // On EOF, the video goes into a paused state.

window.clearInterval(intervalId);
// Allow the user to change the settings again.
tracks.disabled = false;
cycleButton.disabled = false;
cycleButton.textContent = originalCycleText;
onComplete();
return;
}
var audioTracks = document.getElementById('audioTracks');
var option = audioTracks.selectedOptions[0];
option = option.nextElementSibling || audioTracks.firstElementChild;
audioTracks.value = option.value;
app.onAudioChange();
}, 3000);
var option = tracks.selectedOptions[0];
option = option.nextElementSibling || tracks.firstElementChild;
tracks.value = option.value;
onSelect();
}, seconds * 1000);
};

@@ -530,3 +592,3 @@

initData: keyid,
initDataType: 'cenc'
initDataType: 'webm'
};

@@ -539,2 +601,13 @@ var licenseServerUrl = 'data:application/json;base64,' +

var initDataOverride = null;
if (contentProtection.pssh && contentProtection.pssh.psshBox) {
// Override the init data with the PSSH from the manifest.
initDataOverride = {
initData: contentProtection.pssh.psshBox,
initDataType: 'cenc'
};
console.info('Found overridden PSSH with system IDs:',
contentProtection.pssh.parsedPssh.systemIds);
}
if (contentProtection.schemeIdUri == 'http://youtube.com/drm/2012/10/10') {

@@ -551,12 +624,2 @@ // This is another scheme used by YouTube.

if (licenseServerUrl) {
var initDataOverride = null;
if (contentProtection.pssh && contentProtection.pssh.psshBox) {
// Override the init data with the PSSH from the manifest.
initDataOverride = {
initData: contentProtection.pssh.psshBox,
initDataType: 'cenc'
};
console.info('Found overridden PSSH with system IDs:',
contentProtection.pssh.parsedPssh.systemIds);
}
return new shaka.player.DrmSchemeInfo(

@@ -573,3 +636,4 @@ 'com.widevine.alpha', true, licenseServerUrl, false, initDataOverride,

return new shaka.player.DrmSchemeInfo(
'com.widevine.alpha', true, licenseServerUrl, false, null, null);
'com.widevine.alpha', true, licenseServerUrl, false, initDataOverride,
null);
}

@@ -576,0 +640,0 @@

2

assets/test_license.json

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

{"keys":[{"kty":"oct","alg":"A128KW","kid":"MDEyMzQ1Njc4OTAxMjM0NQ","k":"691i8WgU0nto7xIq/OSuPA"}]}
{"keys":[{"kty":"oct","alg":"A128KW","kid":"MDEyMzQ1Njc4OTAxMjM0NQ","k":"691i8WgU0nto7xIq_OSuPA"}]}

@@ -0,1 +1,34 @@

## 1.2.2 (2015-03-11)
Bugfixes:
- Version 1.2.1 had multiple issues with its version numbering. These
are now corrected, but npm requires unique version numbers to publish.
Version 1.2.1 has been pulled from npm.
- https://github.com/google/shaka-player/issues/30
Features:
- Added getAdaptationEnabled() to Player.
- https://github.com/google/shaka-player/issues/29
## 1.2.1 (2015-03-10)
A roll-up of recent bugfixes, plus a few minor additions to the test app.
Branched from v1.2.0.
Bugfixes:
- Try to recover from a streaming failure.
- https://github.com/google/shaka-player/issues/28
- Ignore spurious error events from the video tag.
- Update docs WRT content restrictions and folder organization.
- Fix clearkey errors in Chrome 42+.
- Fix computation of the number of segments in MpdProcessor.
- Only affects assets which use SegmentTemplate with a duration attribute.
Test app features:
- Rename a confusing asset.
- Add a button to cycle video tracks.
- Support MPD init data overrides for all DRM schemes.
## 1.2.0 (2015-02-24)

@@ -2,0 +35,0 @@

@@ -597,4 +597,6 @@ /**

var numSegments =
Math.floor(periodDuration / segmentTemplate.segmentDuration);
// |periodDuration| is in seconds.
var numSegments = Math.floor(periodDuration /
(segmentTemplate.segmentDuration /
segmentTemplate.timescale));

@@ -601,0 +603,0 @@ for (var segmentNumber = 1; segmentNumber <= numSegments; ++segmentNumber) {

@@ -650,3 +650,2 @@ /**

this.dispatchEvent(event);
return;

@@ -686,2 +685,8 @@ }

this.dispatchEvent(event);
if (error.type == 'net' && error.xhr.status == 0) {
// Hope to recover soon...
this.updateTimerId_ =
window.setTimeout(this.onUpdate_.bind(this), 5000);
}
}

@@ -688,0 +693,0 @@ })

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

* this overrides the initData from EME 'encrypted' events in the Player.
* Note that initDataType values and the formats they correspond to are
* {@link http://goo.gl/hKBdff specified here}.
* @param {?shaka.player.DrmSchemeInfo.LicensePostProcessor}

@@ -40,0 +42,0 @@ * licensePostProcessor An optional post-processor for license responses.

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

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

@@ -770,2 +770,9 @@

shaka.player.Player.prototype.onError_ = function(event) {
if (!this.video_.error) {
// This occurred during testing with prefixed EME. Ignore errors we can't
// interpret, on the assumption that this is a browser bug.
shaka.log.debug('Uninterpretable error event!', event);
return;
}
var code = this.video_.error.code;

@@ -938,2 +945,4 @@ if (code == MediaError['MEDIA_ERR_ABORTED']) {

* @param {number} id The |id| field of the desired VideoTrack object.
* @param {boolean=} opt_immediate If true, switch immediately. Otherwise,
* switch when convenient. Defaults to true.
*

@@ -943,5 +952,6 @@ * @return {boolean} True if the specified VideoTrack was found.

*/
shaka.player.Player.prototype.selectVideoTrack = function(id) {
shaka.player.Player.prototype.selectVideoTrack = function(id, opt_immediate) {
if (!this.videoSource_) return false;
return this.videoSource_.selectVideoTrack(id, true);
var immediate = (opt_immediate == undefined) ? true : opt_immediate;
return this.videoSource_.selectVideoTrack(id, immediate);
};

@@ -1006,2 +1016,11 @@

/**
* @return {boolean} Return true if automatic bitrate adaptation enabled.
* @export
*/
shaka.player.Player.prototype.getAdaptationEnabled = function() {
return this.adaptationEnabled_;
};
/**
* @return {number} Current playback time in seconds.

@@ -1008,0 +1027,0 @@ * @export

@@ -368,3 +368,3 @@ /**

type: 'encrypted',
initDataType: 'cenc', // not used by v0.1b EME, but given a valid value
initDataType: 'webm', // not used by v0.1b EME, but given a valid value
initData: event.initData

@@ -371,0 +371,0 @@ });

@@ -29,3 +29,4 @@ /**

/**
* Convert a raw string to a base-64 string.
* Convert a raw string to a base64 string. The output will always use the
* alternate encoding/alphabet also known as "base64url".
* @param {string} str

@@ -37,4 +38,4 @@ * @param {boolean=} opt_padding If true, pad the output with equals signs.

shaka.util.StringUtils.toBase64 = function(str, opt_padding) {
var base64 = window.btoa(str);
var padding = (opt_padding == undefined) ? true : opt_padding;
var base64 = window.btoa(str).replace(/\+/g, '-').replace(/\//g, '_');
return padding ? base64 : base64.replace(/=*$/, '');

@@ -45,3 +46,4 @@ };

/**
* Convert a base-64 string to a raw string.
* Convert a base64 string to a raw string. Accepts either the standard
* alphabet or the alternate "base64url" alphabet.
* @param {string} str

@@ -51,4 +53,4 @@ * @return {string}

shaka.util.StringUtils.fromBase64 = function(str) {
return window.atob(str);
return window.atob(str.replace(/-/g, '+').replace(/_/g, '/'));
};

@@ -58,3 +58,4 @@ /**

/**
* Convert a Uint8Array to a base-64 string.
* Convert a Uint8Array to a base64 string. The output will always use the
* alternate encoding/alphabet also known as "base64url".
* @param {!Uint8Array} arr

@@ -73,3 +74,4 @@ * @param {boolean=} opt_padding If true, pad the output with equals signs.

/**
* Convert a base-64 string to a Uint8Array.
* Convert a base64 string to a Uint8Array. Accepts either the standard
* alphabet or the alternate "base64url" alphabet.
* @param {string} str

@@ -80,3 +82,4 @@ * @return {!Uint8Array}

shaka.util.Uint8ArrayUtils.fromBase64 = function(str) {
return shaka.util.Uint8ArrayUtils.fromString(window.atob(str));
return shaka.util.Uint8ArrayUtils.fromString(
shaka.util.StringUtils.fromBase64(str));
};

@@ -83,0 +86,0 @@

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

@@ -28,4 +28,4 @@ "author": "Google",

"scripts": {
"prepublish": "./build/all.sh"
"prepublish": "./build/checkversion.sh && ./build/all.sh"
}
}

@@ -1,8 +0,8 @@

(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.hd=b.prototype;a.prototype=new c;a.ed=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.La=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.Oa=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=window.btoa(pa(a));return void 0==b||b?c:c.replace(/=*$/,"")});function qa(a){return y(window.atob(a))}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.wa=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.wa.ra()};
(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.wa.f+c<=a.h.byteLength?c:a.h.byteLength-a.wa.f;d=new DataView(a.h.buffer,a.h.byteOffset+a.wa.f,c);B(a.wa,c);return new xa(b,d)}function wa(a){var b=ya(a.wa),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.wa);return d}function xa(a,b){this.id=a;this.h=b}
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 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.Ea=[];this.Zb=f;e&&this.Ea.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.Ea=oa(a.Ea.concat(b.Ea),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.wb=this.zb=0}Ma.prototype.rb=function(a,b){var c=Math.pow(this.Ub,a);this.zb=b*(1-c)+c*this.zb;this.wb+=a};function Na(a){return a.zb/(1-Math.pow(a.Ub,a.wb))};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("-")}
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",

@@ -12,59 +12,59 @@ 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",

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.Bc=50;this.uc=5E5;this.Cc=.5;this.Ac=65536}q(Ua,E);Ua.prototype.rb=function(a,b){if(!(b<this.Ac)){a=Math.max(a,this.Bc);var c=8E3*b/a,d=a/1E3;this.Ab.rb(d,c);this.lc.rb(d,c);this.dispatchEvent(w({type:"bandwidth"}))}};function Va(a){return a.Ab.wb<a.Cc?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.Ba=new Aa}G.prototype.u=function(){Za(this);this.Ba=null};function H(a,b,c,d){b=new $a(b,c,d);a.Ba.push(c,b)}G.prototype.$a=function(a,b){for(var c=this.Ba.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.$a(),this.Ba.remove(b,e))}};function Za(a){var b=a.Ba,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.Ba.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]={fb: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.fb: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.Ga=this.keySystem=a;"org.w3.clearkey"==a&&(this.Ga="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.Ga)&&(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.Ga)&&(g.videoCapabilities.push(p),c=!0));k||(c=d.canPlayType("video/mp4",this.Ga)||d.canPlayType("video/webm",this.Ga));if(c){this.tc=g;return}}throw Error("The key system specified is not supported.");}ib.prototype.createMediaKeys=function(){var a=new lb(this.Ga);return Promise.resolve(a)};
ib.prototype.getConfiguration=function(){return this.tc};function lb(a){this.Ha=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.Sc.bind(a)),H(a.b,b,"webkitkeymessage",a.Rc.bind(a)),H(a.b,b,"webkitkeyadded",a.Pc.bind(a)),H(a.b,b,"webkitkeyerror",a.Qc.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.Ha,b);this.cc.push(a);return a};h.Sc=function(a){a=w({type:"encrypted",initDataType:"cenc",initData:a.initData});this.ua.dispatchEvent(a)};
h.Rc=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.Pc=function(a){(a=nb(this,a.sessionId))&&a.ready()};h.Qc=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.Ha=b;this.za=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};
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.ib=function(a,b,c){if(this.U)this.U.then(this.ib.bind(this,a,b,c)).catch(this.ib.bind(this,a,b,c));else{this.U=a;try{var d;if("persistent"==this.za)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.Ha,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.Ha){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.Ha,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.Pa=b;c=w({type:"keystatuseschange"});a.dispatchEvent(c)}h.generateRequest=function(a,b){var c=new s;this.ib(c,b,null);return c};h.load=function(a){if("persistent"==this.za){var b=new s;this.ib(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.za){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;this.ua.webkitCancelKeyRequest(this.Ha,this.sessionId)}this.closed.resolve();return this.closed};h.remove=function(){return"persistent"!=this.za?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.Pa=void 0}var rb=y("FAKE_KEY_ID");ob.prototype.get=function(a){if(this.has(a))return this.Pa};ob.prototype.has=function(a){return this.Pa&&sa(new Uint8Array(a),rb)?!0:!1};ob.prototype.keys=function(){var a=[];this.Pa&&a.push(rb);return new qb(a)};ob.prototype.values=function(){var a=[];this.Pa&&a.push(this.Pa);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.Aa=a.Aa,this.ga=a.ga,ub(this,a.Ka),this.Z=a.Z,vb(this,a.va.clone()),this.qa=a.qa):a&&(b=String(a).match(sb))?(tb(this,b[1]||"",!0),this.Aa=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.va=new wb(null)}h=K.prototype;h.na="";h.Aa="";h.ga="";h.Ka=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.Aa;c&&a.push(xb(c,yb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Ka;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.va.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.Aa;c?b.Aa=a.Aa:c=!!a.ga;c?b.ga=a.ga:c=null!=a.Ka;var d=a.Z;if(c)ub(b,a.Ka);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.va.toString();c?vb(b,L(a.va.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.Ka=b}else a.Ka=null}function vb(a,b,c){b instanceof wb?a.va=b:(c||(b=xb(b,Cb)),a.va=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.gb=null;
h.add=function(a,b){if(!this.Q&&(this.Q={},this.gb=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.gb++;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.gb=this.gb}return a};function Eb(a,b,c,d,e,f){this.index=a;this.startTime=b;this.endTime=c;this.Oa=d;this.Ta=e;this.url=f};function Fb(a){this.Tc=a};function Gb(a){this.Ia=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.Ia));k+=r;e+=p}return d};function Hb(a){this.Ia=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?{Yc:d,cd:c}:null}if(!c)return null;e=A(new z(b));if(475249515!=e.id)return null;d=c.Yc;c=c.cd;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={dd:p,Uc:r}}n&&(p=c*n.dd,n=d+n.Uc,0<=g&&(f.push(new Eb(l,g,p,k,n-1,this.Ia)),++l),g=p,k=n)}}0<=g&&f.push(new Eb(l,g,null,k,null,this.Ia));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.Wc=2;this.Xc=.5;this.Vc=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.sb=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):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.va.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.Vc;this.n.withCredentials=this.o.withCredentials;this.n.onload=this.Hc.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.jd=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.Hc=function(a){this.pa&&this.pa.rb(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.sb.bind(this),this.Xa*(1+(2*Math.random()-1)*this.o.Xc)),this.Xa*=this.o.Wc):(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.sb().then(function(a){return Promise.resolve(new Uint8Array(a.response))})};function O(a){E.call(this,null);this.a=a;this.F=this.nb=this.d=null;this.b=new G;this.pb={};this.Ca=[];this.tb=[];this.sa="en";this.ab=this.qb=null;this.Ra=!1;this.L=new Ba;this.Qa=!0}q(O,E);m("shaka.player.Player",O);O.version="v1.2.0";
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}}};
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="";
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.tb.length;++a)this.tb[a].close().catch(function(){});this.tb=[];this.Ca=[];this.F=this.nb=null;this.a.src="";a=this.a.setMediaKeys(null);this.d&&(this.d.u(),this.d=null);this.Ra=!1;this.pb={};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.Fc.bind(this)));a.ja(this.Qa);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.jb(),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.F=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.bd.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.Kc.bind(this));
H(this.b,this.a,"playing",this.Lc.bind(this));H(this.b,this.a,"seeking",this.Kb.bind(this));H(this.b,this.a,"pause",this.Jc.bind(this));H(this.b,this.a,"ended",this.Ec.bind(this));return this.d.cb(this,this.a)})).then(t(this,function(){for(var a=0;a<this.Ca.length;++a)this.dc(this.Ca[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.F=this.F?La(this.F,r.ha):r.ha;break}}b.set(k,p)}}}this.d.Za(b);return c.createMediaKeys()};
h.bd=function(a){this.nb=a;return this.a.setMediaKeys(this.nb).then(t(this,function(){this.Ca=[];for(var a=0;a<this.F.Ea.length;++a){var c=this.F.Ea[a];this.Ca.push({type:"encrypted",initDataType:c.initDataType,initData:c.initData})}0==this.Ca.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.F.nc&&(c="first");this.pb[c]||(b=this.nb.createSession(),this.tb.push(b),H(this.b,b,"message",this.Mc.bind(this)),H(this.b,b,"keystatuseschange",this.Gc.bind(this)),a=b.generateRequest(a.initDataType,a.initData),this.pb[c]=!0,a.catch(t(this,function(a){this.pb[c]=!1;a=x(a);this.dispatchEvent(a)})))};h.Mc=function(a){Vb(this,a.target,this.F.$b,a.message,this.F.withCredentials,this.F.Zb)};
h.Gc=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.vb(c)}return b.update(a)})).then(function(){}).catch(t(a,function(a){a.gd=b;a=x(a);this.dispatchEvent(a)}))}h.Fc=function(){J("load");this.L.playbackLatency=Fa("load")/1E3;this.b.$a(this.a,"timeupdate")};
h.Jb=function(a){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.Kc=function(){};h.Lc=function(){I("playing");Sb(this);this.ab=window.setTimeout(this.fc.bind(this),100)};h.Kb=function(){Sb(this);this.Ra=!1};h.Jc=function(){J("playing");Ea(this.L)};h.Ec=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.vc=function(){var a=this.a.videoWidth,b=this.a.videoHeight;return a&&b?{width:a,height:b}:null};O.prototype.getCurrentResolution=O.prototype.vc;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.Da=function(){return this.d?this.d.Da():[]};O.prototype.getTextTracks=O.prototype.Da;O.prototype.ya=function(a){return this.d?this.d.ya(a,!0):!1};O.prototype.selectVideoTrack=O.prototype.ya;O.prototype.Ma=function(a){return this.d?this.d.Ma(a,!1):!1};O.prototype.selectAudioTrack=O.prototype.Ma;
O.prototype.Na=function(a){return this.d?this.d.Na(a,!1):!1};O.prototype.selectTextTrack=O.prototype.Na;O.prototype.oa=function(a){this.d&&this.d.oa(a)};O.prototype.enableTextTrack=O.prototype.oa;O.prototype.ja=function(a){this.Qa=a;this.d&&this.d.ja(a)};O.prototype.enableAdaptation=O.prototype.ja;O.prototype.wc=function(){return this.a.currentTime};O.prototype.getCurrentTime=O.prototype.wc;O.prototype.xc=function(){return this.a.duration};O.prototype.getDuration=O.prototype.xc;O.prototype.yc=function(){return this.a.muted};
O.prototype.getMuted=O.prototype.yc;O.prototype.zc=function(){return this.a.volume};O.prototype.getVolume=O.prototype.zc;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.Zc=function(a){this.a.muted=a};O.prototype.setMuted=O.prototype.Zc;O.prototype.ad=function(a){this.a.volume=a};O.prototype.setVolume=O.prototype.ad;O.prototype.$c=function(a){this.sa=Pa(a)};O.prototype.setPreferredLanguage=O.prototype.$c;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.qb&&(window.clearTimeout(a.qb),a.qb=null)}
function Sb(a){a.ab&&(window.clearTimeout(a.ab),a.ab=null)}O.prototype.ec=function(a){this.a.currentTime+=.1*a;this.qb=window.setTimeout(this.ec.bind(this,a),100)};
O.prototype.fc=function(){this.ab=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.kb()&&(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.ya(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.Ia=a;this.oc=b;this.F=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.F=null};h.cb=function(a,b){this.parent=a;var c=b.mediaKeys;b.src=this.Ia;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.Da=function(){return[]};h.kb=function(){return 5};h.jb=function(){var a=new ha;a.ha=this.F;return[a]};h.Za=function(){};h.ya=function(){return!1};h.Ma=function(){return!1};h.Na=function(){return!1};h.oa=function(a){this.da&&(this.da.track.mode=a?"showing":"disabled")};h.ja=function(){};h.vb=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.sb().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.Fa=[];this.e=P;this.ia=this.v=null;this.i=[];this.aa=null;this.xa=[];H(this.b,this.ba,"updateend",this.Nc.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.xa=this.e=null;this.b.u();this.R=this.ba=this.Fa=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.Tc;c&&a.xa.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.xa.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].Oa,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.Oa,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.xa.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.Fa=[];this.e=3;return this.v=new s};h.reset=function(){this.Fa=[]};
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():[]};
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()};
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.Nc=function(){switch(this.e){case 2:if(0<this.xa.length){try{this.ba.appendBuffer(this.xa.shift())}catch(a){ic(this,a)}break}for(var b=0;b<this.i.length;++b)this.Fa[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.xa=[]};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.H=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.H=1;this.W=0;this.T=null;this.ca=1;this.ma=null;this.B=[]}function uc(){this.duration=this.startTime=this.ob=this.D=null}function vc(){this.H=1;this.W=0;this.T=null;this.ca=1;this.Rb=this.Eb=this.lb=this.ta=null}function wc(){this.pc=[]}function xc(){this.repeat=this.duration=this.startTime=null}function yc(a,b){this.fb=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.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";
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";

@@ -76,41 +76,41 @@ 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)};

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.H=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.H=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.ob=T(b,"mediaRange",Bc)};
vc.prototype.parse=function(a,b){this.H=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.lb=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}
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}
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.ub(!1),this.a.removeChild(this.X));this.X=document.createElement("track");this.a.appendChild(this.X);this.X.src=this.M.D.toString();this.ub(a)};h.Qb=function(a){this.start(a)};h.ic=function(){};h.ub=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.xb=this.Wa=this.G=this.M=null;this.e=Ec;this.za=""}q(Dc,E);var Ec=0;h=Dc.prototype;h.u=function(){this.e=null;Fc(this);this.A=this.M=this.G=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.za=a.l.split("/")[0];this.G=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.G=this.hb(a,d,b),!this.G)return d=Error("Failed to create SegmentIndex."),d.type="stream",Promise.reject(d)}else this.G=a.La;return(d=Kb(this.G,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&&
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.Ja();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.G=this.hb(a,c,f),!this.G)return b=
Error("Failed to create SegmentIndex."),b.type="stream",Promise.reject(b)}else this.G=a.La;this.M=a;this.za=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.G,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.Ja())}))}};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.Ja()}
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.G,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.Fa[b]?Promise.resolve():this.K.clear()})).then(t(this,function(){this.e=4;this.Ja()})))};h.ub=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.Oa,b.Ta);c.pa=a.A;return c.send()}h.hb=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.Oa))?new Ib(a):null};
h.Ja=function(){Fc(this);var a=this.a.currentTime,b=Kc(this,a);if(b=Jb(this.G,b)){var c=Math.max(this.M.t,15);b.startTime-a>=c?this.xb=window.setTimeout(this.Ja.bind(this),1E3):fc(this.K,new Fb([b])).then(t(this,function(){this.Ja()})).catch(t(this,function(a){"aborted"!=a.type&&(a=x(a),this.dispatchEvent(a))}))}else this.e=5,a=w({type:"ended"}),this.dispatchEvent(a)};function Kc(a,b){for(var c=Lb(a.G,b);0<=c&&c<a.G.i.length&&a.K.Fa[c];)c++;return c}
function Fc(a){a.xb&&(window.clearTimeout(a.xb),a.xb=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.eb=new s;this.sa="";this.Pb=!1;this.A=new Ua;this.L=null;this.bb=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.bb.u();this.bb=null;Mc(this);this.parent=this.A=this.eb=this.a=this.R=this.gc=this.C=null};
h.cb=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.Ic.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.eb,c])};
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])};
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.Da=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.kb=function(){return this.hc};h.jb=function(){return 0==this.I.J.length?[]:this.I.J[0].Bb()};
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.ya=function(a,b){return Oc(this,"video",a,b)};h.Ma=function(a,b){return Oc(this,"audio",a,b)};h.Na=function(a,b){return Oc(this,"text",a,b)};h.oa=function(a){var b=this.C.text;b&&b.ub(a)};h.ja=function(a){this.bb.enable(a)};h.vb=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)}};
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)}};
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.Ic=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.bb))?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.fd=p;this.eb.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.La&&(e=Jb(f.La,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.Oc.bind(this)),g.start(b[n]);this.oa(this.Pb);this.eb.resolve()};
function Mc(a){for(var b in a.C)a.C[b].u();a.C={}}h.Oc=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.sb().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.mb=new ja}
Qc.prototype.Mb=function(a){this.mb=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.lb){a:{var k=
g,l=k.w,p=new R,n;n=k;var r=n.w;if(r.lb){var v=new sc;(r=Sc(r.lb,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.H=p.H;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.H=p.H;l.W=p.W;l.T=p.T;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=Math.floor(n/p.T);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.mb.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=
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.H,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.H,n.Ob=Uc(l.r.ma),n.La=this.hb(l.r),!n.La)){l=null;break a}l=n}l&&(g.j.push(l),g.Sa=p)}}d.N.push(g)}this.mb.J.push(d)}};
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)}};
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.H*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.H}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 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.Oa=a.$.fb,b.Ta=a.$.end);return b}Qc.prototype.hb=function(a){for(var b=a.H,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.ob&&(l=f.ob.fb,p=f.ob.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.Dc=a;this.Ua=b;this.g=null;this.Qa=!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.cb=function(a,b){if(!this.g){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}return this.g.cb(a,b)};h.load=function(a){return(new Pc(this.Dc)).send().then(t(this,function(b){var c=new Qc(this.Ua);c.Mb(b);this.g=new Lc(c.mb);this.g.ja(this.Qa);return this.g.load(a)}))};
h.getVideoTracks=function(){return this.g?this.g.getVideoTracks():[]};h.getAudioTracks=function(){return this.g?this.g.getAudioTracks():[]};h.Da=function(){return this.g?this.g.Da():[]};h.kb=function(){return this.g?this.g.kb():0};h.jb=function(){return this.g?this.g.jb():[]};h.Za=function(a){return this.g.Za(a)};h.ya=function(a,b){return this.g?this.g.ya(a,b):!1};h.Ma=function(a,b){return this.g?this.g.Ma(a,b):!1};h.Na=function(a,b){return this.g?this.g.Na(a,b):!1};h.oa=function(a){this.g&&this.g.oa(a)};
h.ja=function(a){this.Qa=a;this.g&&this.g.ja(a)};h.vb=function(a){this.g&&this.g.vb(a)};}.bind(window))()
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))()
//# sourceMappingURL=shaka-player.compiled.debug.map

@@ -1,8 +0,8 @@

(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.hd=b.prototype;a.prototype=new c;a.ed=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.La=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.Oa=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=window.btoa(pa(a));return void 0==b||b?c:c.replace(/=*$/,"")});function qa(a){return y(window.atob(a))}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.wa=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.wa.ra()};
(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.wa.f+c<=a.h.byteLength?c:a.h.byteLength-a.wa.f;d=new DataView(a.h.buffer,a.h.byteOffset+a.wa.f,c);B(a.wa,c);return new xa(b,d)}function wa(a){var b=ya(a.wa),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.wa);return d}function xa(a,b){this.id=a;this.h=b}
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 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.Ea=[];this.Zb=f;e&&this.Ea.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.Ea=oa(a.Ea.concat(b.Ea),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.wb=this.zb=0}Ma.prototype.rb=function(a,b){var c=Math.pow(this.Ub,a);this.zb=b*(1-c)+c*this.zb;this.wb+=a};function Na(a){return a.zb/(1-Math.pow(a.Ub,a.wb))};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("-")}
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",

@@ -12,59 +12,59 @@ 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",

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.Bc=50;this.uc=5E5;this.Cc=.5;this.Ac=65536}q(Ua,E);Ua.prototype.rb=function(a,b){if(!(b<this.Ac)){a=Math.max(a,this.Bc);var c=8E3*b/a,d=a/1E3;this.Ab.rb(d,c);this.lc.rb(d,c);this.dispatchEvent(w({type:"bandwidth"}))}};function Va(a){return a.Ab.wb<a.Cc?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.Ba=new Aa}G.prototype.u=function(){Za(this);this.Ba=null};function H(a,b,c,d){b=new $a(b,c,d);a.Ba.push(c,b)}G.prototype.$a=function(a,b){for(var c=this.Ba.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.$a(),this.Ba.remove(b,e))}};function Za(a){var b=a.Ba,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.Ba.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]={fb: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.fb: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.Ga=this.keySystem=a;"org.w3.clearkey"==a&&(this.Ga="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.Ga)&&(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.Ga)&&(g.videoCapabilities.push(p),c=!0));k||(c=d.canPlayType("video/mp4",this.Ga)||d.canPlayType("video/webm",this.Ga));if(c){this.tc=g;return}}throw Error("The key system specified is not supported.");}ib.prototype.createMediaKeys=function(){var a=new lb(this.Ga);return Promise.resolve(a)};
ib.prototype.getConfiguration=function(){return this.tc};function lb(a){this.Ha=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.Sc.bind(a)),H(a.b,b,"webkitkeymessage",a.Rc.bind(a)),H(a.b,b,"webkitkeyadded",a.Pc.bind(a)),H(a.b,b,"webkitkeyerror",a.Qc.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.Ha,b);this.cc.push(a);return a};h.Sc=function(a){a=w({type:"encrypted",initDataType:"cenc",initData:a.initData});this.ua.dispatchEvent(a)};
h.Rc=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.Pc=function(a){(a=nb(this,a.sessionId))&&a.ready()};h.Qc=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.Ha=b;this.za=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};
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.ib=function(a,b,c){if(this.U)this.U.then(this.ib.bind(this,a,b,c)).catch(this.ib.bind(this,a,b,c));else{this.U=a;try{var d;if("persistent"==this.za)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.Ha,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.Ha){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.Ha,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.Pa=b;c=w({type:"keystatuseschange"});a.dispatchEvent(c)}h.generateRequest=function(a,b){var c=new s;this.ib(c,b,null);return c};h.load=function(a){if("persistent"==this.za){var b=new s;this.ib(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.za){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;this.ua.webkitCancelKeyRequest(this.Ha,this.sessionId)}this.closed.resolve();return this.closed};h.remove=function(){return"persistent"!=this.za?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.Pa=void 0}var rb=y("FAKE_KEY_ID");ob.prototype.get=function(a){if(this.has(a))return this.Pa};ob.prototype.has=function(a){return this.Pa&&sa(new Uint8Array(a),rb)?!0:!1};ob.prototype.keys=function(){var a=[];this.Pa&&a.push(rb);return new qb(a)};ob.prototype.values=function(){var a=[];this.Pa&&a.push(this.Pa);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.Aa=a.Aa,this.ga=a.ga,ub(this,a.Ka),this.Z=a.Z,vb(this,a.va.clone()),this.qa=a.qa):a&&(b=String(a).match(sb))?(tb(this,b[1]||"",!0),this.Aa=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.va=new wb(null)}h=K.prototype;h.na="";h.Aa="";h.ga="";h.Ka=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.Aa;c&&a.push(xb(c,yb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Ka;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.va.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.Aa;c?b.Aa=a.Aa:c=!!a.ga;c?b.ga=a.ga:c=null!=a.Ka;var d=a.Z;if(c)ub(b,a.Ka);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.va.toString();c?vb(b,L(a.va.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.Ka=b}else a.Ka=null}function vb(a,b,c){b instanceof wb?a.va=b:(c||(b=xb(b,Cb)),a.va=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.gb=null;
h.add=function(a,b){if(!this.Q&&(this.Q={},this.gb=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.gb++;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.gb=this.gb}return a};function Eb(a,b,c,d,e,f){this.index=a;this.startTime=b;this.endTime=c;this.Oa=d;this.Ta=e;this.url=f};function Fb(a){this.Tc=a};function Gb(a){this.Ia=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.Ia));k+=r;e+=p}return d};function Hb(a){this.Ia=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?{Yc:d,cd:c}:null}if(!c)return null;e=A(new z(b));if(475249515!=e.id)return null;d=c.Yc;c=c.cd;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={dd:p,Uc:r}}n&&(p=c*n.dd,n=d+n.Uc,0<=g&&(f.push(new Eb(l,g,p,k,n-1,this.Ia)),++l),g=p,k=n)}}0<=g&&f.push(new Eb(l,g,null,k,null,this.Ia));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.Wc=2;this.Xc=.5;this.Vc=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.sb=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):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.va.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.Vc;this.n.withCredentials=this.o.withCredentials;this.n.onload=this.Hc.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.jd=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.Hc=function(a){this.pa&&this.pa.rb(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.sb.bind(this),this.Xa*(1+(2*Math.random()-1)*this.o.Xc)),this.Xa*=this.o.Wc):(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.sb().then(function(a){return Promise.resolve(new Uint8Array(a.response))})};function O(a){E.call(this,null);this.a=a;this.F=this.nb=this.d=null;this.b=new G;this.pb={};this.Ca=[];this.tb=[];this.sa="en";this.ab=this.qb=null;this.Ra=!1;this.L=new Ba;this.Qa=!0}q(O,E);m("shaka.player.Player",O);O.version="v1.2.0";
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}}};
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="";
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.tb.length;++a)this.tb[a].close().catch(function(){});this.tb=[];this.Ca=[];this.F=this.nb=null;this.a.src="";a=this.a.setMediaKeys(null);this.d&&(this.d.u(),this.d=null);this.Ra=!1;this.pb={};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.Fc.bind(this)));a.ja(this.Qa);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.jb(),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.F=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.bd.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.Kc.bind(this));
H(this.b,this.a,"playing",this.Lc.bind(this));H(this.b,this.a,"seeking",this.Kb.bind(this));H(this.b,this.a,"pause",this.Jc.bind(this));H(this.b,this.a,"ended",this.Ec.bind(this));return this.d.cb(this,this.a)})).then(t(this,function(){for(var a=0;a<this.Ca.length;++a)this.dc(this.Ca[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.F=this.F?La(this.F,r.ha):r.ha;break}}b.set(k,p)}}}this.d.Za(b);return c.createMediaKeys()};
h.bd=function(a){this.nb=a;return this.a.setMediaKeys(this.nb).then(t(this,function(){this.Ca=[];for(var a=0;a<this.F.Ea.length;++a){var c=this.F.Ea[a];this.Ca.push({type:"encrypted",initDataType:c.initDataType,initData:c.initData})}0==this.Ca.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.F.nc&&(c="first");this.pb[c]||(b=this.nb.createSession(),this.tb.push(b),H(this.b,b,"message",this.Mc.bind(this)),H(this.b,b,"keystatuseschange",this.Gc.bind(this)),a=b.generateRequest(a.initDataType,a.initData),this.pb[c]=!0,a.catch(t(this,function(a){this.pb[c]=!1;a=x(a);this.dispatchEvent(a)})))};h.Mc=function(a){Vb(this,a.target,this.F.$b,a.message,this.F.withCredentials,this.F.Zb)};
h.Gc=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.vb(c)}return b.update(a)})).then(function(){}).catch(t(a,function(a){a.gd=b;a=x(a);this.dispatchEvent(a)}))}h.Fc=function(){J("load");this.L.playbackLatency=Fa("load")/1E3;this.b.$a(this.a,"timeupdate")};
h.Jb=function(a){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.Kc=function(){};h.Lc=function(){I("playing");Sb(this);this.ab=window.setTimeout(this.fc.bind(this),100)};h.Kb=function(){Sb(this);this.Ra=!1};h.Jc=function(){J("playing");Ea(this.L)};h.Ec=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.vc=function(){var a=this.a.videoWidth,b=this.a.videoHeight;return a&&b?{width:a,height:b}:null};O.prototype.getCurrentResolution=O.prototype.vc;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.Da=function(){return this.d?this.d.Da():[]};O.prototype.getTextTracks=O.prototype.Da;O.prototype.ya=function(a){return this.d?this.d.ya(a,!0):!1};O.prototype.selectVideoTrack=O.prototype.ya;O.prototype.Ma=function(a){return this.d?this.d.Ma(a,!1):!1};O.prototype.selectAudioTrack=O.prototype.Ma;
O.prototype.Na=function(a){return this.d?this.d.Na(a,!1):!1};O.prototype.selectTextTrack=O.prototype.Na;O.prototype.oa=function(a){this.d&&this.d.oa(a)};O.prototype.enableTextTrack=O.prototype.oa;O.prototype.ja=function(a){this.Qa=a;this.d&&this.d.ja(a)};O.prototype.enableAdaptation=O.prototype.ja;O.prototype.wc=function(){return this.a.currentTime};O.prototype.getCurrentTime=O.prototype.wc;O.prototype.xc=function(){return this.a.duration};O.prototype.getDuration=O.prototype.xc;O.prototype.yc=function(){return this.a.muted};
O.prototype.getMuted=O.prototype.yc;O.prototype.zc=function(){return this.a.volume};O.prototype.getVolume=O.prototype.zc;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.Zc=function(a){this.a.muted=a};O.prototype.setMuted=O.prototype.Zc;O.prototype.ad=function(a){this.a.volume=a};O.prototype.setVolume=O.prototype.ad;O.prototype.$c=function(a){this.sa=Pa(a)};O.prototype.setPreferredLanguage=O.prototype.$c;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.qb&&(window.clearTimeout(a.qb),a.qb=null)}
function Sb(a){a.ab&&(window.clearTimeout(a.ab),a.ab=null)}O.prototype.ec=function(a){this.a.currentTime+=.1*a;this.qb=window.setTimeout(this.ec.bind(this,a),100)};
O.prototype.fc=function(){this.ab=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.kb()&&(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.ya(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.Ia=a;this.oc=b;this.F=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.F=null};h.cb=function(a,b){this.parent=a;var c=b.mediaKeys;b.src=this.Ia;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.Da=function(){return[]};h.kb=function(){return 5};h.jb=function(){var a=new ha;a.ha=this.F;return[a]};h.Za=function(){};h.ya=function(){return!1};h.Ma=function(){return!1};h.Na=function(){return!1};h.oa=function(a){this.da&&(this.da.track.mode=a?"showing":"disabled")};h.ja=function(){};h.vb=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.sb().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.Fa=[];this.e=P;this.ia=this.v=null;this.i=[];this.aa=null;this.xa=[];H(this.b,this.ba,"updateend",this.Nc.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.xa=this.e=null;this.b.u();this.R=this.ba=this.Fa=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.Tc;c&&a.xa.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.xa.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].Oa,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.Oa,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.xa.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.Fa=[];this.e=3;return this.v=new s};h.reset=function(){this.Fa=[]};
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():[]};
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()};
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.Nc=function(){switch(this.e){case 2:if(0<this.xa.length){try{this.ba.appendBuffer(this.xa.shift())}catch(a){ic(this,a)}break}for(var b=0;b<this.i.length;++b)this.Fa[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.xa=[]};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.H=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.H=1;this.W=0;this.T=null;this.ca=1;this.ma=null;this.B=[]}function uc(){this.duration=this.startTime=this.ob=this.D=null}function vc(){this.H=1;this.W=0;this.T=null;this.ca=1;this.Rb=this.Eb=this.lb=this.ta=null}function wc(){this.pc=[]}function xc(){this.repeat=this.duration=this.startTime=null}function yc(a,b){this.fb=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.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";
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";

@@ -76,40 +76,40 @@ 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)};

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.H=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.H=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.ob=T(b,"mediaRange",Bc)};
vc.prototype.parse=function(a,b){this.H=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.lb=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}
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}
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.ub(!1),this.a.removeChild(this.X));this.X=document.createElement("track");this.a.appendChild(this.X);this.X.src=this.M.D.toString();this.ub(a)};h.Qb=function(a){this.start(a)};h.ic=function(){};h.ub=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.xb=this.Wa=this.G=this.M=null;this.e=Ec;this.za=""}q(Dc,E);var Ec=0;h=Dc.prototype;h.u=function(){this.e=null;Fc(this);this.A=this.M=this.G=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.za=a.l.split("/")[0];this.G=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.G=this.hb(a,d,b),!this.G)return d=Error("Failed to create SegmentIndex."),d.type="stream",Promise.reject(d)}else this.G=a.La;return(d=Kb(this.G,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&&
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.Ja();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.G=this.hb(a,c,f),!this.G)return b=
Error("Failed to create SegmentIndex."),b.type="stream",Promise.reject(b)}else this.G=a.La;this.M=a;this.za=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.G,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.Ja())}))}};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.Ja()}
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.G,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.Fa[b]?Promise.resolve():this.K.clear()})).then(t(this,function(){this.e=4;this.Ja()})))};h.ub=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.Oa,b.Ta);c.pa=a.A;return c.send()}h.hb=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.Oa))?new Ib(a):null};
h.Ja=function(){Fc(this);var a=this.a.currentTime,b=Kc(this,a);if(b=Jb(this.G,b)){var c=Math.max(this.M.t,15);b.startTime-a>=c?this.xb=window.setTimeout(this.Ja.bind(this),1E3):fc(this.K,new Fb([b])).then(t(this,function(){this.Ja()})).catch(t(this,function(a){"aborted"!=a.type&&(a=x(a),this.dispatchEvent(a))}))}else this.e=5,a=w({type:"ended"}),this.dispatchEvent(a)};function Kc(a,b){for(var c=Lb(a.G,b);0<=c&&c<a.G.i.length&&a.K.Fa[c];)c++;return c}
function Fc(a){a.xb&&(window.clearTimeout(a.xb),a.xb=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.eb=new s;this.sa="";this.Pb=!1;this.A=new Ua;this.L=null;this.bb=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.bb.u();this.bb=null;Mc(this);this.parent=this.A=this.eb=this.a=this.R=this.gc=this.C=null};
h.cb=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.Ic.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.eb,c])};
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])};
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.Da=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.kb=function(){return this.hc};h.jb=function(){return 0==this.I.J.length?[]:this.I.J[0].Bb()};
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.ya=function(a,b){return Oc(this,"video",a,b)};h.Ma=function(a,b){return Oc(this,"audio",a,b)};h.Na=function(a,b){return Oc(this,"text",a,b)};h.oa=function(a){var b=this.C.text;b&&b.ub(a)};h.ja=function(a){this.bb.enable(a)};h.vb=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)}};
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)}};
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.Ic=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.bb))?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.fd=p;this.eb.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.La&&(e=Jb(f.La,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.Oc.bind(this)),g.start(b[n]);this.oa(this.Pb);this.eb.resolve()};
function Mc(a){for(var b in a.C)a.C[b].u();a.C={}}h.Oc=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.sb().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.mb=new ja}
Qc.prototype.Mb=function(a){this.mb=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.lb){a:{var k=
g,l=k.w,p=new R,n;n=k;var r=n.w;if(r.lb){var v=new sc;(r=Sc(r.lb,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.H=p.H;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.H=p.H;l.W=p.W;l.T=p.T;l.ca=p.ca;l.ma=Tc(k);l.B=[];n=Math.floor(n/p.T);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.mb.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=
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.H,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.H,n.Ob=Uc(l.r.ma),n.La=this.hb(l.r),!n.La)){l=null;break a}l=n}l&&(g.j.push(l),g.Sa=p)}}d.N.push(g)}this.mb.J.push(d)}};
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)}};
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.H*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.H}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 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.Oa=a.$.fb,b.Ta=a.$.end);return b}Qc.prototype.hb=function(a){for(var b=a.H,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.ob&&(l=f.ob.fb,p=f.ob.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.Dc=a;this.Ua=b;this.g=null;this.Qa=!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.cb=function(a,b){if(!this.g){var c=Error("Manifest has not been loaded.");c.type="stream";return Promise.reject(c)}return this.g.cb(a,b)};h.load=function(a){return(new Pc(this.Dc)).send().then(t(this,function(b){var c=new Qc(this.Ua);c.Mb(b);this.g=new Lc(c.mb);this.g.ja(this.Qa);return this.g.load(a)}))};
h.getVideoTracks=function(){return this.g?this.g.getVideoTracks():[]};h.getAudioTracks=function(){return this.g?this.g.getAudioTracks():[]};h.Da=function(){return this.g?this.g.Da():[]};h.kb=function(){return this.g?this.g.kb():0};h.jb=function(){return this.g?this.g.jb():[]};h.Za=function(a){return this.g.Za(a)};h.ya=function(a,b){return this.g?this.g.ya(a,b):!1};h.Ma=function(a,b){return this.g?this.g.Ma(a,b):!1};h.Na=function(a,b){return this.g?this.g.Na(a,b):!1};h.oa=function(a){this.g&&this.g.oa(a)};
h.ja=function(a){this.Qa=a;this.g&&this.g.ja(a)};h.vb=function(a){this.g&&this.g.vb(a)};}.bind(window))()
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))()

@@ -192,3 +192,3 @@ /**

it('creates SegmentBase from SegmentTemplate', function() {
it('creates SegmentBase', function() {
st.mediaUrlTemplate = 'http://example.com/$Bandwidth$-media.mp4';

@@ -247,9 +247,9 @@ st.indexUrlTemplate = 'http://example.com/$Bandwidth$-index.sidx';

it('creates SegmentList from SegmentTemplate+SegmentTimeline', function() {
it('creates SegmentList from SegmentTimeline w/o start times', function() {
var tp1 = new mpd.SegmentTimePoint();
tp1.duration = 10;
tp1.duration = 9000 * 10;
tp1.repeat = 1;
var tp2 = new mpd.SegmentTimePoint();
tp2.duration = 20;
tp2.duration = 9000 * 20;
tp2.repeat = 0;

@@ -300,17 +300,17 @@

expect(sl1.segmentUrls[0].startTime).toBe(0);
expect(sl1.segmentUrls[0].duration).toBe(10);
expect(sl1.segmentUrls[0].duration).toBe(9000 * 10);
expect(sl1.segmentUrls[1].mediaUrl).toBeTruthy();
expect(sl1.segmentUrls[1].mediaUrl.toString())
.toBe('http://example.com/2-10-250000-media.mp4');
.toBe('http://example.com/2-90000-250000-media.mp4');
expect(sl1.segmentUrls[1].mediaRange).toBeNull();
expect(sl1.segmentUrls[1].startTime).toBe(10);
expect(sl1.segmentUrls[1].duration).toBe(10);
expect(sl1.segmentUrls[1].startTime).toBe(9000 * 10);
expect(sl1.segmentUrls[1].duration).toBe(9000 * 10);
expect(sl1.segmentUrls[2].mediaUrl).toBeTruthy();
expect(sl1.segmentUrls[2].mediaUrl.toString())
.toBe('http://example.com/3-20-250000-media.mp4');
.toBe('http://example.com/3-180000-250000-media.mp4');
expect(sl1.segmentUrls[2].mediaRange).toBeNull();
expect(sl1.segmentUrls[2].startTime).toBe(20);
expect(sl1.segmentUrls[2].duration).toBe(20);
expect(sl1.segmentUrls[2].startTime).toBe(9000 * 20);
expect(sl1.segmentUrls[2].duration).toBe(9000 * 20);

@@ -339,20 +339,78 @@ // Check |r2|.

expect(sl2.segmentUrls[0].startTime).toBe(0);
expect(sl2.segmentUrls[0].duration).toBe(10);
expect(sl2.segmentUrls[0].duration).toBe(9000 * 10);
expect(sl2.segmentUrls[1].mediaUrl).toBeTruthy();
expect(sl2.segmentUrls[1].mediaUrl.toString())
.toBe('http://example.com/2-10-500000-media.mp4');
.toBe('http://example.com/2-90000-500000-media.mp4');
expect(sl2.segmentUrls[1].mediaRange).toBeNull();
expect(sl2.segmentUrls[1].startTime).toBe(10);
expect(sl2.segmentUrls[1].duration).toBe(10);
expect(sl2.segmentUrls[1].startTime).toBe(9000 * 10);
expect(sl2.segmentUrls[1].duration).toBe(9000 * 10);
expect(sl2.segmentUrls[2].mediaUrl).toBeTruthy();
expect(sl2.segmentUrls[2].mediaUrl.toString())
.toBe('http://example.com/3-20-500000-media.mp4');
.toBe('http://example.com/3-180000-500000-media.mp4');
expect(sl2.segmentUrls[2].mediaRange).toBeNull();
expect(sl2.segmentUrls[2].startTime).toBe(20);
expect(sl2.segmentUrls[2].duration).toBe(20);
expect(sl2.segmentUrls[2].startTime).toBe(9000 * 20);
expect(sl2.segmentUrls[2].duration).toBe(9000 * 20);
});
it('creates SegmentList from SegmentTemplate+segmentDuration', function() {
it('creates SegmentList from SegmentTimeline w/ start times', function() {
var tp1 = new mpd.SegmentTimePoint();
tp1.startTime = 9000 * 100;
tp1.duration = 9000 * 10;
tp1.repeat = 1;
var tp2 = new mpd.SegmentTimePoint();
tp2.startTime = (9000 * 100) + (9000 * 20);
tp2.duration = 9000 * 20;
tp2.repeat = 0;
var timeline = new mpd.SegmentTimeline();
timeline.timePoints.push(tp1);
timeline.timePoints.push(tp2);
st.timescale = 9000;
st.presentationTimeOffset = 0;
st.segmentDuration = null;
st.startNumber = 10;
st.mediaUrlTemplate = '$Number$-$Time$-$Bandwidth$-media.mp4';
st.initializationUrlTemplate = '$Bandwidth$-init.mp4';
st.timeline = timeline;
r1.bandwidth = 250000;
r1.baseUrl = new goog.Uri('http://example.com/');
processor.processSegmentTemplates_(m);
// Check |r1|.
expect(r1.segmentBase).toBeNull();
expect(r1.segmentList).toBeTruthy();
var sl1 = r1.segmentList;
expect(sl1.segmentUrls.length).toBe(3);
expect(sl1.segmentUrls[0].mediaUrl).toBeTruthy();
expect(sl1.segmentUrls[0].mediaUrl.toString())
.toBe('http://example.com/10-900000-250000-media.mp4');
expect(sl1.segmentUrls[0].mediaRange).toBeNull();
expect(sl1.segmentUrls[0].startTime).toBe(9000 * 100);
expect(sl1.segmentUrls[0].duration).toBe(9000 * 10);
expect(sl1.segmentUrls[1].mediaUrl).toBeTruthy();
expect(sl1.segmentUrls[1].mediaUrl.toString())
.toBe('http://example.com/11-990000-250000-media.mp4');
expect(sl1.segmentUrls[1].mediaRange).toBeNull();
expect(sl1.segmentUrls[1].startTime).toBe((9000 * 100) + (9000 * 10));
expect(sl1.segmentUrls[1].duration).toBe(9000 * 10);
expect(sl1.segmentUrls[2].mediaUrl).toBeTruthy();
expect(sl1.segmentUrls[2].mediaUrl.toString())
.toBe('http://example.com/12-1080000-250000-media.mp4');
expect(sl1.segmentUrls[2].mediaRange).toBeNull();
expect(sl1.segmentUrls[2].startTime).toBe((9000 * 100) + (9000 * 20));
expect(sl1.segmentUrls[2].duration).toBe(9000 * 20);
});
it('creates SegmentList from segmentDuration attribute', function() {
p.duration = 30;

@@ -362,3 +420,3 @@

st.presentationTimeOffset = 0;
st.segmentDuration = 10;
st.segmentDuration = 9000 * 10;
st.startNumber = 5; // Ensure startNumber > 1 works.

@@ -383,3 +441,3 @@ st.mediaUrlTemplate = '$Number$-$Time$-$Bandwidth$-media.mp4';

expect(sl1.presentationTimeOffset).toBe(0);
expect(sl1.segmentDuration).toBe(10);
expect(sl1.segmentDuration).toBe(9000 * 10);
expect(sl1.startNumber).toBe(5);

@@ -396,20 +454,20 @@

expect(sl1.segmentUrls[0].mediaUrl.toString())
.toBe('http://example.com/5-40-250000-media.mp4');
.toBe('http://example.com/5-360000-250000-media.mp4');
expect(sl1.segmentUrls[0].mediaRange).toBeNull();
expect(sl1.segmentUrls[0].startTime).toBe(40);
expect(sl1.segmentUrls[0].duration).toBe(10);
expect(sl1.segmentUrls[0].startTime).toBe(9000 * 40);
expect(sl1.segmentUrls[0].duration).toBe(9000 * 10);
expect(sl1.segmentUrls[1].mediaUrl).toBeTruthy();
expect(sl1.segmentUrls[1].mediaUrl.toString())
.toBe('http://example.com/6-50-250000-media.mp4');
.toBe('http://example.com/6-450000-250000-media.mp4');
expect(sl1.segmentUrls[1].mediaRange).toBeNull();
expect(sl1.segmentUrls[1].startTime).toBe(50);
expect(sl1.segmentUrls[1].duration).toBe(10);
expect(sl1.segmentUrls[1].startTime).toBe(9000 * 50);
expect(sl1.segmentUrls[1].duration).toBe(9000 * 10);
expect(sl1.segmentUrls[2].mediaUrl).toBeTruthy();
expect(sl1.segmentUrls[2].mediaUrl.toString())
.toBe('http://example.com/7-60-250000-media.mp4');
.toBe('http://example.com/7-540000-250000-media.mp4');
expect(sl1.segmentUrls[2].mediaRange).toBeNull();
expect(sl1.segmentUrls[2].startTime).toBe(60);
expect(sl1.segmentUrls[2].duration).toBe(10);
expect(sl1.segmentUrls[2].startTime).toBe(9000 * 60);
expect(sl1.segmentUrls[2].duration).toBe(9000 * 10);

@@ -423,3 +481,3 @@ // Check |r2|.

expect(sl2.presentationTimeOffset).toBe(0);
expect(sl2.segmentDuration).toBe(10);
expect(sl2.segmentDuration).toBe(9000 * 10);
expect(sl2.startNumber).toBe(5);

@@ -436,23 +494,23 @@

expect(sl2.segmentUrls[0].mediaUrl.toString())
.toBe('http://example.com/5-40-500000-media.mp4');
.toBe('http://example.com/5-360000-500000-media.mp4');
expect(sl2.segmentUrls[0].mediaRange).toBeNull();
expect(sl2.segmentUrls[0].startTime).toBe(40);
expect(sl2.segmentUrls[0].duration).toBe(10);
expect(sl2.segmentUrls[0].startTime).toBe(9000 * 40);
expect(sl2.segmentUrls[0].duration).toBe(9000 * 10);
expect(sl2.segmentUrls[1].mediaUrl).toBeTruthy();
expect(sl2.segmentUrls[1].mediaUrl.toString())
.toBe('http://example.com/6-50-500000-media.mp4');
.toBe('http://example.com/6-450000-500000-media.mp4');
expect(sl2.segmentUrls[1].mediaRange).toBeNull();
expect(sl2.segmentUrls[1].startTime).toBe(50);
expect(sl2.segmentUrls[1].duration).toBe(10);
expect(sl2.segmentUrls[1].startTime).toBe(9000 * 50);
expect(sl2.segmentUrls[1].duration).toBe(9000 * 10);
expect(sl2.segmentUrls[2].mediaUrl).toBeTruthy();
expect(sl2.segmentUrls[2].mediaUrl.toString())
.toBe('http://example.com/7-60-500000-media.mp4');
.toBe('http://example.com/7-540000-500000-media.mp4');
expect(sl2.segmentUrls[2].mediaRange).toBeNull();
expect(sl2.segmentUrls[2].startTime).toBe(60);
expect(sl2.segmentUrls[2].duration).toBe(10);
expect(sl2.segmentUrls[2].startTime).toBe(9000 * 60);
expect(sl2.segmentUrls[2].duration).toBe(9000 * 10);
});
it('can handle gaps within a SegmentTimeline', function() {
it('handles gaps within SegmentTimeline', function() {
var tp1 = new mpd.SegmentTimePoint();

@@ -515,3 +573,3 @@ tp1.startTime = 10;

it('can handle overlaps within a SegmentTimeline', function() {
it('handles overlaps within SegmentTimeline', function() {
var tp1 = new mpd.SegmentTimePoint();

@@ -518,0 +576,0 @@ tp1.startTime = 10;

@@ -380,3 +380,3 @@ /**

expect(track.active).toBe(false);
var ok = source.selectVideoTrack(track.id, false);
var ok = player.selectVideoTrack(track.id, false);
expect(ok).toBe(true);

@@ -383,0 +383,0 @@

@@ -230,3 +230,3 @@ /**

initData: keyid,
initDataType: 'cenc'
initDataType: 'webm'
};

@@ -233,0 +233,0 @@ var licenseServerUrl = 'data:application/json;base64,' +

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