diff --git a/build/karma.conf.js b/build/karma.conf.js index 171a4f59c..3a32047bb 100644 --- a/build/karma.conf.js +++ b/build/karma.conf.js @@ -1,7 +1,7 @@ const webpackConfig = require('./webpack.karma.config'); const DOC_STATIC_ASSETS_VERSION = '0.121.1'; -const MEDIA_STATIC_ASSETS_VERSION = '0.122.0'; +const MEDIA_STATIC_ASSETS_VERSION = '0.127.0'; const MODEL3D_STATIC_ASSETS_VERSION = '0.125.0'; const SWF_STATIC_ASSETS_VERSION = '0.112.0'; const TEXT_STATIC_ASSETS_VERSION = '0.114.0'; diff --git a/src/lib/constants.js b/src/lib/constants.js index 756afd079..0b678178f 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -74,7 +74,7 @@ export const X_REP_HINT_VIDEO_MP4 = '[mp4]'; // These should be updated to match the Preview version in package.json // whenever a file in that third party directory is updated export const DOC_STATIC_ASSETS_VERSION = '0.121.1'; -export const MEDIA_STATIC_ASSETS_VERSION = '0.122.0'; +export const MEDIA_STATIC_ASSETS_VERSION = '0.127.0'; export const MODEL3D_STATIC_ASSETS_VERSION = '0.125.0'; export const SWF_STATIC_ASSETS_VERSION = '0.112.0'; export const TEXT_STATIC_ASSETS_VERSION = '0.114.0'; diff --git a/src/lib/viewers/media/DashViewer.js b/src/lib/viewers/media/DashViewer.js index ac916e76d..b61ad22ac 100644 --- a/src/lib/viewers/media/DashViewer.js +++ b/src/lib/viewers/media/DashViewer.js @@ -129,6 +129,7 @@ const MANIFEST = 'manifest.mpd'; this.adapting = true; this.player = new shaka.Player(this.mediaEl); this.player.addEventListener('adaptation', this.adaptationHandler); + this.player.addEventListener('error', this.shakaErrorHandler); this.player.configure({ abr: { enabled: true @@ -293,6 +294,25 @@ const MANIFEST = 'manifest.mpd'; this.hideLoadingIcon(); } + /** + * Handles errors thrown by shaka player. See https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html + * + * @private + * @param {Object} shakaError + * @return {void} + */ + shakaErrorHandler(shakaError) { + const error = new Error( + `Shaka error. Code = ${shakaError.detail.code}, Category = ${shakaError.detail.category}, Severity = ${shakaError.detail.severity}` + ); + error.displayMessage = __('error_refresh'); + + if (shakaError.detail.severity > 1) { + // critical error + this.emit('error', error); + } + } + /** * Adds event listeners to the media controls. * Makes changes to the media element. diff --git a/src/lib/viewers/media/__tests__/DashViewer-test.js b/src/lib/viewers/media/__tests__/DashViewer-test.js index 047b48770..96748dceb 100644 --- a/src/lib/viewers/media/__tests__/DashViewer-test.js +++ b/src/lib/viewers/media/__tests__/DashViewer-test.js @@ -192,6 +192,7 @@ describe('lib/viewers/media/DashViewer', () => { dash.mediaUrl = 'url'; sandbox.stub(shaka, 'Player').returns(dash.player); stubs.mockPlayer.expects('addEventListener').withArgs('adaptation', sinon.match.func); + stubs.mockPlayer.expects('addEventListener').withArgs('error', sinon.match.func); stubs.mockPlayer.expects('configure'); stubs.mockPlayer.expects('load').withArgs('url'); @@ -347,6 +348,36 @@ describe('lib/viewers/media/DashViewer', () => { }); }); + describe('shakaErrorHandler()', () => { + it('should emit error on critical shaka errors', () => { + const shakaError = { + detail: { + severity: 2, // critical severity + category: 1, + code: 1100 + } + }; + + dash.shakaErrorHandler(shakaError); + + expect(dash.emit).to.be.calledWith('error'); + }); + + it('should not emit error on recoverable shaka errors', () => { + const shakaError = { + detail: { + severity: 1, // recoverable severity + category: 1, + code: 1100 + } + }; + + dash.shakaErrorHandler(shakaError); + + expect(dash.emit).to.not.be.called; + }); + }); + describe('addEventListenersForMediaControls()', () => { const listenerFunc = DashViewer.prototype.addEventListenersForMediaControls; diff --git a/src/third-party/media/0.127.0/shaka-player.compiled.js b/src/third-party/media/0.127.0/shaka-player.compiled.js new file mode 100644 index 000000000..989c83429 --- /dev/null +++ b/src/third-party/media/0.127.0/shaka-player.compiled.js @@ -0,0 +1,371 @@ +(function(){var g={}; +(function(window){var k,aa=this;aa.ue=!0;function m(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b}function ba(a){var b=p;function c(){}c.prototype=b.prototype;a.ze=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.we=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};/* + + Copyright 2016 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +function ca(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}function da(a,b,c){var d=Math.pow(a.c,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.b+=b)}function ea(a){return a.a/(1-Math.pow(a.c,a.b))};function fa(){this.c=new ca(2);this.f=new ca(5);this.a=0;this.b=5E5}fa.prototype.setDefaultEstimate=function(a){this.b=a};fa.prototype.getBandwidthEstimate=function(){return 128E3>this.a?this.b:Math.min(ea(this.c),ea(this.f))};function ga(){};function t(a,b,c,d){this.severity=a;this.category=b;this.code=c;this.data=Array.prototype.slice.call(arguments,3)}m("shaka.util.Error",t);t.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};t.Severity={RECOVERABLE:1,CRITICAL:2};t.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9}; +t.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005, +MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003, +DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022, +HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,INVALID_STREAMS_CHOSEN:5005,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012, +OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,LOAD_INTERRUPTED:7E3,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,STORE_ALREADY_IN_PROGRESS:9006,NO_INIT_DATA_FOR_OFFLINE:9007};var ha=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function ia(a){var b;a instanceof ia?(ja(this,a.aa),this.Aa=a.Aa,this.ca=a.ca,ka(this,a.Ia),this.W=a.W,la(this,ma(a.a)),this.ta=a.ta):a&&(b=String(a).match(ha))?(ja(this,b[1]||"",!0),this.Aa=na(b[2]||""),this.ca=na(b[3]||"",!0),ka(this,b[4]),this.W=na(b[5]||"",!0),la(this,b[6]||"",!0),this.ta=na(b[7]||"")):this.a=new pa(null)}k=ia.prototype;k.aa="";k.Aa="";k.ca="";k.Ia=null;k.W="";k.ta=""; +k.toString=function(){var a=[],b=this.aa;b&&a.push(qa(b,ra,!0),":");if(b=this.ca){a.push("//");var c=this.Aa;c&&a.push(qa(c,ra,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Ia;null!=b&&a.push(":",String(b))}if(b=this.W)this.ca&&"/"!=b.charAt(0)&&a.push("/"),a.push(qa(b,"/"==b.charAt(0)?sa:ta,!0));(b=this.a.toString())&&a.push("?",b);(b=this.ta)&&a.push("#",qa(b,ua));return a.join("")}; +k.resolve=function(a){var b=new ia(this);"data"===b.aa&&(b=new ia);var c=!!a.aa;c?ja(b,a.aa):c=!!a.Aa;c?b.Aa=a.Aa:c=!!a.ca;c?b.ca=a.ca:c=null!=a.Ia;var d=a.W;if(c)ka(b,a.Ia);else if(c=!!a.W){if("/"!=d.charAt(0))if(this.ca&&!this.W)d="/"+d;else{var e=b.W.lastIndexOf("/");-1!=e&&(d=b.W.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){for(var e=!d.lastIndexOf("/",0),d=d.split("/"),f=[],g=0;gb)throw Error("Bad port number "+b);a.Ia=b}else a.Ia=null}function la(a,b,c){b instanceof pa?a.a=b:(c||(b=qa(b,va)),a.a=new pa(b))} +function na(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function qa(a,b,c){return"string"==typeof a?(a=encodeURI(a).replace(b,wa),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function wa(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var ra=/[#\/\?@]/g,ta=/[\#\?:]/g,sa=/[\#\?]/g,va=/[\#\?@]/g,ua=/#/g;function pa(a){this.b=a||null}pa.prototype.a=null;pa.prototype.c=null; +pa.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var a=[],b;for(b in this.a)for(var c=encodeURIComponent(b),d=this.a[b],e=0;e=a[b]}.bind(null,b);if(b[0]||b[2]){if(!b[1]&&!b[3])return Qa(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return F(a)}else return Qa(a,!1);throw new t(2,2,2003);}m("shaka.util.StringUtils.fromBytesAutoDetect",Ra); +function Sa(a){a=unescape(encodeURIComponent(a));for(var b=new Uint8Array(a.length),c=0;cd||c&&1E3>d)&&!this.a[b].ib&&(this.a.splice(b,1),a.close());Ua(this.B)}};k.Id=function(){function a(a,c){return"expired"==c}!La(this.A)&&Oa(this.A,a)&&this.g(new t(2,6,6014));this.Ba(this.A)}; +function ob(){var a=[],b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],c=[{videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:b}],d={};"org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").forEach(function(b){var e=navigator.requestMediaKeySystemAccess(b,c).then(function(a){var c=a.getConfiguration().sessionTypes;d[b]= +{persistentState:c?0<=c.indexOf("persistent-license"):!1};return a.createMediaKeys()})["catch"](function(){d[b]=null});a.push(e)});return Promise.all(a).then(function(){return d})}k.od=function(){for(var a=0;a=b?null:new VTTCue(a,b,c)}m("shaka.media.TextEngine.makeCue",vb);rb.prototype.m=function(){this.c&&wb(this,function(){return!0});this.c=this.f=null;return Promise.resolve()}; +function xb(a,b,c,d){return Promise.resolve().then(function(){if(this.c)if(null==c||null==d)this.f.parseInit(b);else{for(var a=this.f.parseMedia(b,{periodStart:this.h,segmentStart:c,segmentEnd:d}),f=0;f=this.g);++f)this.c.addCue(a[f]);null==this.b&&(this.b=c);this.a=Math.min(d,this.g)}}.bind(a))} +rb.prototype.remove=function(a,b){return Promise.resolve().then(function(){this.c&&(wb(this,function(c){return c.startTime>=b||c.endTime<=a?!1:!0}),null==this.b||b<=this.b||a>=this.a||(a<=this.b&&b>=this.a?this.b=this.a=null:a<=this.b&&bthis.b&&b>=this.a&&(this.a=a)))}.bind(this))};function wb(a,b){for(var c=a.c.cues,d=[],e=0;ea.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function zb(a,b){return!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0)?!1:b>=a.start(0)&&b<=a.end(a.length-1)}function Ab(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=a.length-1;0<=d&&a.end(d)>b;--d)c+=a.end(d)-Math.max(a.start(d),b);return c};function Bb(a,b,c){this.f=a;this.N=b;this.i=c;this.c={};this.a=null;this.b={};this.g=new D;this.h=!1} +function Cb(){var a={};'video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hvc1.1.6.L93.90",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="av1",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",video/mp2t; codecs="mp4a.40.2",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").forEach(function(b){a[b]=!!sb[b]|| +MediaSource.isTypeSupported(b);var c=b.split(";")[0];a[c]=a[c]||a[b]});return a}k=Bb.prototype;k.m=function(){this.h=!0;var a=[],b;for(b in this.b){var c=this.b[b],d=c[0];this.b[b]=c.slice(0,1);d&&a.push(d.p["catch"](y));for(d=1;dc.end(0)-c.start(0)?null:1==c.length&&0>c.start(0)?0:c.length?c.start(0):null;return c}function Fb(a,b){try{return a.c[b].buffered}catch(c){return null}} +function Gb(a,b,c,d,e){return"text"==b?xb(a.a,c,d,e):Ib(a,b,a.ge.bind(a,b,c))}k.remove=function(a,b,c){return"text"==a?this.a.remove(b,c):Ib(this,a,this.oc.bind(this,a,b,c))};function Jb(a,b){return"text"==b?a.a.remove(0,Infinity):Ib(a,b,a.oc.bind(a,b,0,a.N.duration))}function Kb(a,b,c,d){if("text"==b)return a.a.h=c,null!=d&&(a.a.g=d),Promise.resolve();null==d&&(d=Infinity);return Promise.all([Ib(a,b,a.Cc.bind(a,b)),Ib(a,b,a.Xd.bind(a,b,c)),Ib(a,b,a.Vd.bind(a,b,d))])} +k.endOfStream=function(a){return Lb(this,function(){a?this.N.endOfStream(a):this.N.endOfStream()}.bind(this))};k.pa=function(a){return Lb(this,function(){this.N.duration=a}.bind(this))};k.Y=function(){return this.N.duration};k.ge=function(a,b){this.c[a].appendBuffer(b)};k.oc=function(a,b,c){c<=b?this.Ha(a):this.c[a].remove(b,c)};k.Cc=function(a){var b=this.c[a].appendWindowEnd;this.c[a].abort();this.c[a].appendWindowEnd=b;this.Ha(a)};k.Mc=function(a){this.f.currentTime-=.001;this.Ha(a)}; +k.Xd=function(a,b){this.c[a].timestampOffset=b;this.Ha(a)};k.Vd=function(a,b){this.c[a].appendWindowEnd=b+.04;this.Ha(a)};k.he=function(a){this.b[a][0].p.reject(new t(2,3,3014,this.f.error?this.f.error.code:0))};k.Ha=function(a){var b=this.b[a][0];b&&(b.p.resolve(),Mb(this,a))}; +function Ib(a,b,c){if(a.h)return Promise.reject();c={start:c,p:new A};a.b[b].push(c);if(1==a.b[b].length)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new t(2,3,3017,b)):c.p.reject(new t(2,3,3015,d)),Mb(a,b)}return c.p} +function Lb(a,b){if(a.h)return Promise.reject();var c=[],d;for(d in a.c){var e=new A,f={start:function(a){a.resolve()}.bind(null,e),p:e};a.b[d].push(f);c.push(e);1==a.b[d].length&&f.start()}return Promise.all(c).then(function(){var a;try{b()}catch(l){var c=Promise.reject(new t(2,3,3015,l))}for(a in this.c)Mb(this,a);return c}.bind(a),function(){return Promise.reject()}.bind(a))}function Mb(a,b){a.b[b].shift();var c=a.b[b][0];if(c)try{c.start()}catch(d){c.p.reject(new t(2,3,3015,d)),Mb(a,b)}};function Nb(a,b,c){return c==b||a>=Ob&&c==b.split("-")[0]||a>=Pb&&c.split("-")[0]==b.split("-")[0]?!0:!1}var Ob=1,Pb=2;function Qb(a){a=a.toLowerCase().split("-");var b=Rb[a[0]];b&&(a[0]=b);return a.join("-")} +var Rb={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr", +fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu", +lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq", +srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"};function Sb(a,b,c){var d=a.video;return d&&(d.widthb.maxWidth||d.width>c.width||d.heightb.maxHeight||d.height>c.height||d.width*d.heightb.maxPixels)||a.bandwidthb.maxBandwidth?!1:!0}function Tb(a,b,c){var d=!1;a.variants.forEach(function(a){var e=a.allowedByApplication;a.allowedByApplication=Sb(a,b,c);e!=a.allowedByApplication&&(d=!0)});return d} +function Ub(a,b,c){var d=b.video,e=b.audio;for(b=0;bd.indexOf(b)||c&&(a.mimeType!=c.mimeType||a.codecs.split(".")[0]!=c.codecs.split(".")[0])?!1:!0} +function Xb(a,b,c){return Yb(a.variants).map(function(a){var d;a.video&&a.audio?d=c==a.video.id&&b==a.audio.id:d=a.video&&c==a.video.id||a.audio&&b==a.audio.id;var f="";a.video&&(f+=a.video.codecs);a.audio&&(""!=f&&(f+=", "),f+=a.audio.codecs);var g=a.audio?a.audio.codecs:null,h=a.video?a.video.codecs:null,l=null;a.video?l=a.video.mimeType:a.audio&&(l=a.audio.mimeType);var n=null;a.audio?n=a.audio.kind:a.video&&(n=a.video.kind);return{id:a.id,active:d,type:"variant",bandwidth:a.bandwidth,language:a.language, +kind:n||null,width:a.video?a.video.width:null,height:a.video?a.video.height:null,frameRate:a.video?a.video.frameRate:void 0,mimeType:l,codecs:f,audioCodec:g,videoCodec:h,primary:a.primary}})}function Zb(a,b){return a.textStreams.map(function(a){return{id:a.id,active:b==a.id,type:"text",language:a.language,kind:a.kind,mimeType:a.mimeType,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary}})} +function $b(a,b){for(var c=0;c=a.periods[c].startTime)return c;return 0} +function gc(a,b){for(var c=0;c=g.bandwidth/.95&&e<=h&&(c=g)}(d=c)&&d.video&&(b.video=d.video);d&&d.audio&&(b.audio=d.audio)}-1b)){var d=8E3*b/a,e=a/1E3;c.a+=b;da(c.c,e,d);da(c.f,e,d)}if(null!=this.c&&this.b)a:{if(!this.j){if(!(128E3<=this.a.a))break a;this.j=!0}else if(8E3>Date.now()-this.c)break a;c=this.chooseStreams(["audio","video"]);this.a.getBandwidthEstimate();this.f(c)}}; +G.prototype.segmentDownloaded=G.prototype.segmentDownloaded;G.prototype.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate()};G.prototype.getBandwidthEstimate=G.prototype.getBandwidthEstimate;G.prototype.setDefaultEstimate=function(a){this.a.setDefaultEstimate(a)};G.prototype.setDefaultEstimate=G.prototype.setDefaultEstimate;G.prototype.setRestrictions=function(a){this.i=a};G.prototype.setRestrictions=G.prototype.setRestrictions;G.prototype.setVariants=function(a){this.h=a}; +G.prototype.setVariants=G.prototype.setVariants;G.prototype.setTextStreams=function(a){this.g=a};G.prototype.setTextStreams=G.prototype.setTextStreams;function hc(a,b){return b.filter(function(b){return Sb(b,a,{width:Infinity,height:Infinity})}).sort(function(a,b){return a.bandwidth-b.bandwidth})};function H(a,b){var c=b||{},d;for(d in c)this[d]=c[d];this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.a=!1}H.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};H.prototype.stopImmediatePropagation=function(){this.a=!0};H.prototype.stopPropagation=function(){};var ic="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),jc="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),kc=["loop","playbackRate"],lc=["pause","play"],mc="adaptation buffering emsg error loading unloading texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged".split(" "),nc="drmInfo getAudioLanguages getConfiguration getExpiration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTextLanguages getTextTracks getTracks getStats getVariantTracks isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "), +oc=[["getConfiguration","configure"]],pc=[["isTextTrackVisible","setTextTrackVisibility"]],qc="addTextTrack cancelTrickPlay configure resetConfiguration selectAudioLanguage selectTextLanguage selectTextTrack selectTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),rc=["load","unload"]; +function sc(a){return JSON.stringify(a,function(a,c){if("manager"!=a&&"function"!=typeof c){if(c instanceof Event||c instanceof H){var b={},e;for(e in c){var f=c[e];f&&"object"==typeof f||e in Event||(b[e]=f)}return b}if(c instanceof TimeRanges)for(b={__type__:"TimeRanges",length:c.length,start:[],end:[]},e=0;ec?"-Infinity":"Infinity":c;return b}})} +function tc(a){return JSON.parse(a,function(a,c){return"NaN"==c?NaN:"-Infinity"==c?-Infinity:"Infinity"==c?Infinity:c&&"object"==typeof c&&"TimeRanges"==c.__type__?uc(c):c})}function uc(a){return{length:a.length,start:function(b){return a.start[b]},end:function(b){return a.end[b]}}};function vc(a,b,c,d,e){this.J=a;this.l=b;this.B=c;this.G=d;this.v=e;this.c=this.j=this.h=!1;this.A="";this.a=this.i=null;this.b={video:{},player:{}};this.o=0;this.f={};this.g=null}k=vc.prototype;k.m=function(){wc(this);this.a&&(this.a.leave(function(){},function(){}),this.a=null);this.G=this.B=this.l=null;this.c=this.j=this.h=!1;this.g=this.f=this.b=this.i=null;return Promise.resolve()};k.V=function(){return this.c};k.Db=function(){return this.A}; +k.init=function(){if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.h=!0;this.l();var a=new chrome.cast.SessionRequest(this.J),a=new chrome.cast.ApiConfig(a,this.ed.bind(this),this.qd.bind(this),"origin_scoped");chrome.cast.initialize(a,function(){},function(){})}else window.__onGCastApiAvailable=function(a){a&&this.init()}.bind(this)};k.Gb=function(a){this.i=a;this.c&&xc(this,{type:"appData",appData:this.i})}; +k.cast=function(a){if(!this.h)return Promise.reject(new t(1,8,8E3));if(!this.j)return Promise.reject(new t(1,8,8001));if(this.c)return Promise.reject(new t(1,8,8002));this.g=new A;chrome.cast.requestSession(this.zb.bind(this,a),this.ac.bind(this));return this.g};k.$a=function(){this.c&&(wc(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null))}; +k.get=function(a,b){if("video"==a){if(0<=lc.indexOf(b))return this.nc.bind(this,a,b)}else if("player"==a){if(0<=qc.indexOf(b))return this.nc.bind(this,a,b);if(0<=rc.indexOf(b))return this.Md.bind(this,a,b);if(0<=nc.indexOf(b))return this.jc.bind(this,a,b)}return this.jc(a,b)};k.set=function(a,b,c){this.b[a][b]=c;xc(this,{type:"set",targetName:a,property:b,value:c})}; +k.zb=function(a,b){this.a=b;this.a.addUpdateListener(this.bc.bind(this));this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.kd.bind(this));this.bc();xc(this,{type:"init",initState:a,appData:this.i});this.g.resolve()};k.ac=function(a){var b=8003;switch(a.code){case "cancel":b=8004;break;case "timeout":b=8005;break;case "receiver_unavailable":b=8006}this.g.reject(new t(2,8,b,a))};k.jc=function(a,b){return this.b[a][b]}; +k.nc=function(a,b){xc(this,{type:"call",targetName:a,methodName:b,args:Array.prototype.slice.call(arguments,2)})};k.Md=function(a,b){var c=Array.prototype.slice.call(arguments,2),d=new A,e=this.o.toString();this.o++;this.f[e]=d;xc(this,{type:"asyncCall",targetName:a,methodName:b,args:c,id:e});return d};k.ed=function(a){var b=this.v();this.g=new A;this.zb(b,a)};k.qd=function(a){this.j="available"==a;this.l()}; +k.bc=function(){var a=this.a?"connected"==this.a.status:!1;if(this.c&&!a){this.G();for(var b in this.b)this.b[b]={};wc(this)}this.A=(this.c=a)?this.a.receiver.friendlyName:"";this.l()};function wc(a){for(var b in a.f){var c=a.f[b];delete a.f[b];c.reject(new t(1,7,7E3))}} +k.kd=function(a,b){var c=tc(b);switch(c.type){case "event":var d=c.targetName,e=c.event;this.B(d,new H(e.type,e));break;case "update":e=c.update;for(d in e){var c=this.b[d]||{};for(f in e[d])c[f]=e[d][f]}break;case "asyncComplete":d=c.id;var f=c.error;c=this.f[d];delete this.f[d];if(c)if(f){d=new t(f.severity,f.category,f.code);for(e in f)d[e]=f[e];c.reject(d)}else c.resolve()}};function xc(a,b){var c=sc(b);a.a.sendMessage("urn:x-cast:com.google.shaka.v2",c,function(){},ga)};function p(){this.lb=new Ha;this.Ta=this}p.prototype.addEventListener=function(a,b){this.lb.push(a,b)};p.prototype.removeEventListener=function(a,b){this.lb.remove(a,b)};p.prototype.dispatchEvent=function(a){for(var b=this.lb.get(a.type)||[],c=0;cu)if(v+1=u)break;u=Math.ceil((u-w)/K)-1}else{if(Infinity==n)break;else if(w/e>=n)break;u=Math.ceil((n*e-w)/K)-1}0this.H.byteLength&&Yc();var b=this.H.buffer.slice(this.u,this.u+a);this.u+=a;return new Uint8Array(b)};P.prototype.readBytes=P.prototype.Ja; +P.prototype.I=function(a){this.u+a>this.H.byteLength&&Yc();this.u+=a};P.prototype.skip=P.prototype.I;P.prototype.Bb=function(){for(var a=this.u;this.Z()&&this.H.getUint8(this.u);)this.u+=1;a=this.H.buffer.slice(a,this.u);this.u+=1;return F(a)};P.prototype.readTerminatedString=P.prototype.Bb;function Yc(){throw new t(2,3,3E3);};function Q(){this.b=[];this.a=[]}m("shaka.util.Mp4Parser",Q);Q.prototype.C=function(a,b){var c=Zc(a);this.b[c]=0;this.a[c]=b;return this};Q.prototype.box=Q.prototype.C;Q.prototype.da=function(a,b){var c=Zc(a);this.b[c]=1;this.a[c]=b;return this};Q.prototype.fullBox=Q.prototype.da;Q.prototype.parse=function(a){for(a=new P(new DataView(a),0);a.Z();)this.eb(0,a)};Q.prototype.parse=Q.prototype.parse; +Q.prototype.eb=function(a,b){var c=b.u,d=b.D(),e=b.D();switch(d){case 0:d=b.H.byteLength-c;break;case 1:d=b.Pa()}var f=this.a[e];if(f){var g=null,h=null;1==this.b[e]&&(h=b.D(),g=h>>>24,h&=16777215);e=c+d-b.u;e=0>>31;var n=n&2147483647,q=d.s.D();d.s.I(4);if(1==g)throw new t(2,3,3006);e.push(new O(e.length,b/f,(b+q)/f,function(){return c},a,a+n-1));b+=q;a+=n}return e};function S(a){this.a=a}m("shaka.media.SegmentIndex",S);S.prototype.m=function(){this.a=null;return Promise.resolve()};S.prototype.destroy=S.prototype.m;S.prototype.find=function(a){for(var b=this.a.length-1;0<=b;--b){var c=this.a[b];if(a>=c.startTime&&aa||a>=this.a.length?null:this.a[a]}; +S.prototype.get=S.prototype.get;S.prototype.vb=function(a){for(var b,c,d=[],e=c=0;cb.startTime||(.1a);++b);this.a.splice(0,b)};S.prototype.evict=S.prototype.ob;function dd(a,b){if(a.a.length){var c=a.a[a.a.length-1];c.startTime>b||(a.a[a.a.length-1]=new O(c.position,c.startTime,b,c.a,c.X,c.M))}};function ed(a){this.b=a;this.a=new P(a,0);fd||(fd=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}var fd;ed.prototype.Z=function(){return this.a.Z()}; +function gd(a){var b=hd(a);if(7=c&&!(b&1<<8-c);c++);if(8a||c&&a>=c?null:Math.floor(a/d)},getSegmentReference:function(a){var b=a*d;return 0>b||c&&b>=c?null:new O(a,b,b+d,function(){var c=Sc(g,l,a+e,h,b*f);return z(n,[c])},0,null)}}} +function zd(a,b){for(var c=[],d=0;da.l||(a.f=window.setTimeout(a.fe.bind(a),1E3*Math.max(Math.max(3,a.l)-b,0)))} +function Ld(a,b,c){b=b||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0};c=c||b.U;var d=M(a,"BaseURL").map(Fc),e=a.getAttribute("contentType")||b.contentType,f=a.getAttribute("mimeType")||b.mimeType,g=a.getAttribute("codecs")||b.codecs,h=N(a,"frameRate",Mc)||b.frameRate,l=!!M(a,"InbandEventStream").length;e||(e=Od(f,g));return{U:z(c,d),Qa:Ec(a,"SegmentBase")||b.Qa,oa:Ec(a,"SegmentList")||b.oa,Ra:Ec(a,"SegmentTemplate")||b.Ra,width:N(a,"width",Lc)||b.width,height:N(a,"height", +Lc)||b.height,contentType:e,mimeType:f,codecs:g,frameRate:h,containsEmsgBoxes:l||b.containsEmsgBoxes,id:a.getAttribute("id")}}function Pd(a){var b=0+(a.Qa?1:0);b+=a.oa?1:0;b+=a.Ra?1:0;if(!b)return"text"==a.contentType||"application"==a.contentType?!0:!1;1!=b&&(a.Qa&&(a.oa=null),a.Ra=null);return!0} +function Qd(a,b,c,d){b=z(b,[c]);b=C(b,a.b.retryParameters);b.method=d;return a.a.networkingEngine.request(0,b).then(function(a){if("HEAD"==d){if(!a.headers||!a.headers.date)return 0;a=a.headers.date}else a=F(a.data);a=Date.parse(a);return isNaN(a)?0:a-Date.now()})} +function Jd(a,b,c,d){c=c.map(function(a){return{scheme:a.getAttribute("schemeIdUri"),value:a.getAttribute("value")}});var e=a.b.dash.clockSyncUri;d&&!c.length&&e&&c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e});return xa(c,function(a){var c=a.value;switch(a.scheme){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return Qd(this,b,c,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return Qd(this, +b,c,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return a=Date.parse(c),isNaN(a)?0:a-Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return Promise.reject();default:return Promise.reject()}}.bind(a))["catch"](function(){return 0})} +k.Dd=function(a,b,c){var d=c.getAttribute("schemeIdUri")||"",e=c.getAttribute("value")||"",f=N(c,"timescale",Lc)||1;M(c,"Event").forEach(function(c){var g=N(c,"presentationTime",Lc)||0,l=N(c,"duration",Lc)||0,g=g/f+a,l=g+l/f;null!=b&&(g=Math.min(g,a+b),l=Math.min(l,a+b));c={schemeIdUri:d,value:e,startTime:g,endTime:l,id:c.getAttribute("id")||"",eventElement:c};this.a.onTimelineRegionAdded(c)}.bind(this))}; +k.Od=function(a,b,c){a=C(a,this.b.retryParameters);null!=b&&(a.headers.Range="bytes="+b+"-"+(null!=c?c:""));return this.a.networkingEngine.request(1,a).then(function(a){return a.data})};function Od(a,b){return sb[Wb(a,b)]?"text":a.split("/")[0]}Bd.mpd=Ed;Ad["application/dash+xml"]=Ed;function Rd(a,b,c,d){this.uri=a;this.type=b;this.ga=c;this.segments=d||null}function Sd(a,b,c,d){this.id=a;this.name=b;this.a=c;this.value=d||null}Sd.prototype.toString=function(){function a(a){return a.name+'="'+a.value+'"'}return this.value?"#"+this.name+":"+this.value:0b.length||"data"!=b[0])throw new t(2,1,1004,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw new t(2,1,1004,a);var c=b[0],b=window.decodeURIComponent(b.slice(1).join(",")),c=c.split(";"),d=null;1c.length)return null;var d=null,e=a;for(a=null;e&&!(a=e.getAttribute(b))&&(e=e.parentNode,e instanceof Element););if(b=a)for(a=0;ag[0].indexOf("--\x3e")&&(l=g[0],g.splice(0,1));var n=new Zd(g[0]),q=Ye(n),r=$d(n,/[ \t]+--\x3e[ \t]+/g),v=Ye(n);if(null==q||!r||null==v)throw new t(2,2,2001);if(g=vb(q+h,v+h,g.slice(1).join("\n").trim())){$d(n,/[ \t]+/gm);for(h=ae(n);h;)Ze(g,h),$d(n,/[ \t]+/gm),h=ae(n);null!=l&&(g.id=l);l=g}else l=null}l&&f.push(l)}return f}; +function Ze(a,b){var c;if(c=/^align:(start|middle|center|end|left|right)$/.exec(b))a.align=c[1],"center"==c[1]&&"center"!=a.align&&(a.position="auto",a.align="middle");else if(c=/^vertical:(lr|rl)$/.exec(b))a.vertical=c[1];else if(c=/^size:(\d{1,2}|100)%$/.exec(b))a.size=Number(c[1]);else if(c=/^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(c[1]),c[2]&&(a.positionAlign=c[2]);else if(c=/^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(b))a.snapToLines= +!1,a.line=Number(c[1]),c[2]&&(a.lineAlign=c[2]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.snapToLines=!0,a.line=Number(c[1]),c[2]&&(a.lineAlign=c[2])}function Ye(a){a=$d(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g);if(!a)return null;var b=Number(a[2]),c=Number(a[3]);return 59a.Y()?a.ma():a.bb()}k.pb=function(){return this.g}; +function hf(a,b){null!=a.f&&(window.clearInterval(a.f),a.f=null);a.g=b;a.a.playbackRate=a.h||0>b?0:b;!a.h&&0>b&&(a.f=window.setInterval(function(){this.a.currentTime+=b/4}.bind(a),250))}k.yb=function(){this.o=!0;this.fc()};k.pd=function(){this.a.playbackRate!=(this.h||0>this.g?0:this.g)&&hf(this,this.a.playbackRate)}; +k.dc=function(){var a=gf(this);.001>Math.abs(this.a.currentTime-a)?(E(this.b,this.a,"seeking",this.gc.bind(this)),E(this.b,this.a,"playing",this.ec.bind(this))):(Ka(this.b,this.a,"seeking",this.rd.bind(this)),this.a.currentTime=a)};k.rd=function(){E(this.b,this.a,"seeking",this.gc.bind(this));E(this.b,this.a,"playing",this.ec.bind(this))}; +k.fc=function(){if(this.a.readyState){this.a.readyState!=this.B&&(this.i=!1,this.B=this.a.readyState);var a=this.l.smallGapLimit,b=this.a.currentTime,c=this.a.buffered;a:{if(c&&c.length&&!(1==c.length&&1E-6>c.end(0)-c.start(0))){var d=.1;/(Edge|Trident)\//.test(navigator.userAgent)&&(d=.5);for(var e=0;eb&&(!e||c.end(e-1)-b<=d)){d=e;break a}}d=null}if(null==d){if(3>this.a.readyState&&0=c.start(d)&&b=this.c.presentationTimeline.bb())){var f=e-b,a=f<=a,g=!1;a||this.i||(this.i=!0,f=new H("largegap",{currentTime:b,gapSize:f}),f.cancelable=!0,this.G(f),this.l.jumpLargeGaps&&!f.defaultPrevented&&(g=!0));if(a||g)d&&c.end(d-1),jf(this,b,e)}}}; +k.gc=function(){this.o=!1;var a=this.a.currentTime,b=kf(this,a);.001f?f:b=g||c(b)?b:d} +function jf(a,b,c){a.a.currentTime=c;var d=0,e=function(){!this.a||10<=d++||this.a.currentTime!=b||(this.a.currentTime=c,setTimeout(e,100))}.bind(a);setTimeout(e,100)}function ef(a,b){var c=a.c.presentationTimeline.ma();if(bc?c:b};function lf(a,b,c,d,e,f){this.a=a;this.g=b;this.A=c;this.l=d;this.h=e;this.B=f;this.c=[];this.j=new D;this.b=!1;this.i=-1;this.f=null;mf(this)}lf.prototype.m=function(){var a=this.j?this.j.m():Promise.resolve();this.j=null;nf(this);this.B=this.h=this.l=this.A=this.g=this.a=null;this.c=[];return a}; +lf.prototype.v=function(a){if(!this.c.some(function(b){return b.info.schemeIdUri==a.schemeIdUri&&b.info.startTime==a.startTime&&b.info.endTime==a.endTime})){var b={info:a,status:1};this.c.push(b);var c=new H("timelineregionadded",{detail:of(a)});this.h(c);this.o(!0,b)}};function of(a){var b=Da(a);b.eventElement=a.eventElement;return b} +lf.prototype.o=function(a,b){var c=b.info.startTime>this.a.currentTime?1:b.info.endTime=this.g.presentationTimeline.ua()-.1||this.a.ended;if(this.b){var c=1*Math.max(this.g.minBufferTime||0,this.A.rebufferingGoal);(b||a>=c)&&0!=this.b&&(this.b=!1,this.l(!1))}else!b&&.5>a&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.o.bind(this,!1))};function pf(a,b){this.a=b;this.b=a;this.g=null;this.i=1;this.o=Promise.resolve();this.h=[];this.j={};this.c={};this.f=this.l=this.v=!1}k=pf.prototype;k.m=function(){for(var a in this.c)qf(this.c[a]);this.g=this.c=this.j=this.h=this.o=this.b=this.a=null;this.f=!0;return Promise.resolve()};k.configure=function(a){this.g=a};k.init=function(){var a=this.a.$b(this.b.periods[fc(this.b,ff(this.a.Oa))]);return La(a)?Promise.reject(new t(2,5,5005)):rf(this,a).then(function(){this.a&&this.a.gd&&this.a.gd()}.bind(this))}; +function V(a){return a.b.periods[fc(a.b,ff(a.a.Oa))]}function sf(a){return Na(a.c,function(a){return a.na||a.stream})}function tf(a,b){var c={};c.text=b;return rf(a,c)}function uf(a,b){var c=a.c.video;if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;if(e){var f=c.na;f||(vf(a,"video",e,!1),c.na=d)}}else if(f=c.na)c.na=null,vf(a,"video",f,!0)}} +function vf(a,b,c,d){var e=a.c[b];!e&&"text"==b&&a.g.ignoreTextStreamFailures?tf(a,c):e&&(e.na&&(c.trickModeVideo?(e.na=c,c=c.trickModeVideo):e.na=null),"text"==b&&Db(a.a.K,Wb(c.mimeType,c.codecs)),(b=a.h[gc(a.b,c)])&&b.Ka&&(b=a.j[c.id])&&b.Ka&&e.stream!=c&&(e.stream=c,e.cb=!0,d&&(e.sa?e.kb=!0:e.wa?(e.ra=!0,e.kb=!0):(qf(e),wf(a,e,!0)))))} +function xf(a){var b=ff(a.a.Oa);if(!Object.keys(a.c).every(function(a){var c=this.a.K;"text"==a?(a=c.a,a=b>=a.b&&bb?a.a.K.pa(b):a.a.K.pa(Math.pow(2,32))}k.ie=function(a){if(!this.f&&!a.wa&&null!=a.qa&&!a.sa)if(a.qa=null,a.ra)wf(this,a,a.kb);else{try{var b=Cf(this,a);null!=b&&(yf(this,a,b),a.rb=!1)}catch(c){this.a.onError(c);return}b=Ma(this.c);Df(this,a);b.every(function(a){return a.endOfStream})&&this.a.K.endOfStream().then(function(){this.b.presentationTimeline.pa(this.a.K.Y())}.bind(this))}}; +function Cf(a,b){var c=ff(a.a.Oa),d=b.Ea&&b.ea?a.b.periods[gc(a.b,b.Ea)].startTime+b.ea.endTime:Math.max(c,b.pc);b.pc=0;var e=gc(a.b,b.stream),f=fc(a.b,d);var g=a.a.K;var h=b.type;"text"==h?(g=g.a,g=null==g.a||g.a=a.b.presentationTimeline.Y())return b.endOfStream=!0,null;b.endOfStream=!1;b.Ma=f;if(f!=e)return null;if(g>=h)return.5;d=a.a.K;f=b.type;d="text"== +f?d.a.a:yb(Fb(d,f));b.ea&&b.stream==b.Ea?(f=b.ea.position+1,d=Ef(a,b,e,f)):(f=b.ea?b.stream.findSegmentPosition(Math.max(0,a.b.periods[gc(a.b,b.Ea)].startTime+b.ea.endTime-a.b.periods[e].startTime)):b.stream.findSegmentPosition(Math.max(0,(d||c)-a.b.periods[e].startTime)),null==f?d=null:(g=null,null==d&&(g=Ef(a,b,e,Math.max(0,f-1))),d=g||Ef(a,b,e,f)));if(!d)return 1;Ff(a,b,c,e,d);return null} +function Ef(a,b,c,d){c=a.b.periods[c];b=b.stream.getSegmentReference(d);if(!b)return null;a=a.b.presentationTimeline;d=a.ua();return c.startTime+b.endTimed?null:b} +function Ff(a,b,c,d,e){var f=a.b.periods[d],g=b.stream,h=a.b.periods[d+1],l=null,l=h?h.startTime:a.b.presentationTimeline.Y();d=Gf(a,b,d,l);b.wa=!0;b.cb=!1;h=Hf(a,e);Promise.all([d,h]).then(function(a){if(!this.f&&!this.l)return If(this,b,c,f,g,e,a[1])}.bind(a)).then(function(){this.f||this.l||(b.wa=!1,b.Eb=!1,b.ra||this.a.yb(),yf(this,b,0),Jf(this,g))}.bind(a))["catch"](function(a){this.f||this.l||(b.wa=!1,this.b.presentationTimeline.$()&&this.g.infiniteRetriesForLiveStreams&&(1001==a.code||1002== +a.code||1003==a.code)?"text"==b.type&&this.g.ignoreTextStreamFailures&&1001==a.code?delete this.c.text:(a.severity=1,this.a.onError(a),yf(this,b,4)):3017==a.code?Kf(this,b,a):"text"==b.type&&this.g.ignoreTextStreamFailures?delete this.c.text:(b.rb=!0,a.severity=2,this.a.onError(a)))}.bind(a))}function Kf(a,b,c){if(!Ma(a.c).some(function(a){return a!=b&&a.Eb})){var d=Math.round(100*a.i);if(20=c?Promise.resolve():a.a.K.remove(b.type,d,d+c).then(function(){}.bind(a))}function Jf(a,b){if(!a.v&&(a.v=Ma(a.c).every(function(a){return"text"==a.type?!0:!a.ra&&!a.sa&&a.ea}),a.v)){var c=gc(a.b,b);a.h[c]||Bf(a,c).then(function(){this.a.Zb()}.bind(a))["catch"](y);for(c=0;c=b.status&&202!=b.status)b.responseURL&&(a=b.responseURL),c({uri:a,data:b.response,headers:e,fromCache:!!e["x-shaka-from-cache"]}); +else{var f=null;try{f=Ra(b.response)}catch(n){}d(new t(401==b.status||403==b.status?2:1,1,1001,a,b.status,f,e))}};e.onerror=function(){d(new t(1,1,1002,a))};e.ontimeout=function(){d(new t(1,1,1003,a))};for(var f in b.headers)e.setRequestHeader(f,b.headers[f]);e.send(b.body)})}m("shaka.net.HttpPlugin",Nf);Ea.http=Nf;Ea.https=Nf;function Of(){this.a=null;this.b=[];this.c={}}k=Of.prototype;k.init=function(a,b){return Pf(this,a,b).then(function(){var b=Object.keys(a);return Promise.all(b.map(function(a){return Qf(this,a).then(function(b){this.c[a]=b}.bind(this))}.bind(this)))}.bind(this))};k.m=function(){return Promise.all(this.b.map(function(a){try{a.transaction.abort()}catch(b){}return a.L["catch"](y)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))}; +k.get=function(a,b){var c;return Rf(this,a,"readonly",function(a){c=a.get(b)}).then(function(){return c.result})};k.forEach=function(a,b){return Rf(this,a,"readonly",function(a){a.openCursor().onsuccess=function(a){if(a=a.target.result)b(a.value),a["continue"]()}})};function Sf(a,b,c){return Rf(a,b,"readwrite",function(a){a.put(c)})}k.remove=function(a,b){return Rf(this,a,"readwrite",function(a){a["delete"](b)})}; +function Tf(a,b,c){return Rf(a,"segment","readwrite",function(a){for(var d=0;d=a.length)return Promise.resolve();var d=a[b++];return fg(this,d).then(c)}.bind(this);return c()}.bind(a));a.b={};a.i=Promise.all(c).then(function(){return Sf(this.j,"manifest",b)}.bind(a)).then(function(){this.l=[]}.bind(a)); +return a.i} +function fg(a,b){var c=C(b.uris,a.A);if(b.X||null!=b.M)c.headers.Range="bytes="+b.X+"-"+(null==b.M?"":b.M);var d;return a.v.request(1,c).then(function(a){if(!this.a)return Promise.reject(new t(2,9,9002));d=a.data.byteLength;this.l.push(b.Fb.key);b.Fb.data=a.data;return Sf(this.j,"segment",b.Fb)}.bind(a)).then(function(){if(!this.a)return Promise.reject(new t(2,9,9002));null==b.M?(this.a.size+=d,this.f+=b.Pb):this.h+=d;var a=(this.h+this.f)/(this.c+this.g),c=Wf(this.a);this.o.progressCallback(c,a)}.bind(a))} +;function gg(){this.a=-1}k=gg.prototype;k.configure=function(){};k.start=function(a){var b=/^offline:([0-9]+)$/.exec(a);if(!b)return Promise.reject(new t(2,1,9004,a));var c=Number(b[1]),d=bg();this.a=c;return d?d.init(Vf).then(function(){return d.get("manifest",c)}).then(function(a){if(!a)throw new t(2,9,9003,c);return hg(a)}).then(function(a){return d.m().then(function(){return a})},function(a){return d.m().then(function(){throw a;})}):Promise.reject(new t(2,9,9E3))};k.stop=function(){return Promise.resolve()}; +k.update=function(){};k.onExpirationUpdated=function(a,b){var c=bg();c.init(Vf).then(function(){return c.get("manifest",this.a)}.bind(this)).then(function(d){if(d&&!(0>d.sessionIds.indexOf(a))&&(void 0==d.expiration||d.expiration>b))return d.expiration=b,Sf(c,"manifest",d)})["catch"](function(){}).then(function(){return c.m()})}; +function hg(a){var b=new T(null,0);b.pa(a.duration);var c=a.drmInfo?[a.drmInfo]:[];return{presentationTimeline:b,minBufferTime:10,offlineSessionIds:a.sessionIds,periods:a.periods.map(function(a){return Xf(a,c,b)})}}Ad["application/x-offline-manifest"]=gg;function ig(a){if(/^offline:([0-9]+)$/.exec(a)){var b={uri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(b)}if(b=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a)){var c=Number(b[1]),d=bg();return d?d.init(Vf).then(function(){return d.get("segment",c)}).then(function(b){return d.m().then(function(){if(!b)throw new t(2,9,9003,c);return{uri:a,data:b.data,headers:{}}})}):Promise.reject(new t(2,9,9E3))}return Promise.reject(new t(2,1,9004,a))} +m("shaka.offline.OfflineScheme",ig);Ea.offline=ig;function jg(){this.a=Promise.resolve();this.c=this.b=this.f=!1;this.g=new Promise(function(a){this.h=a}.bind(this))}jg.prototype.then=function(a){this.a=this.a.then(a).then(function(a){return this.c?(this.h(),Promise.reject(this.i)):Promise.resolve(a)}.bind(this));return this};function kg(a){a.f||(a.a=a.a.then(function(a){this.b=!0;return Promise.resolve(a)}.bind(a),function(a){this.b=!0;return Promise.reject(a)}.bind(a)));a.f=!0;return a.a} +jg.prototype.cancel=function(a){if(this.b)return Promise.resolve();this.c=!0;this.i=a;return this.g};function W(a,b){p.call(this);this.J=!1;this.f=a;this.A=null;this.l=new D;this.Ob=new G;this.Ya=this.c=this.h=this.a=this.v=this.g=this.Wa=this.ja=this.N=this.j=this.o=null;this.Bc=1E9;this.Va=[];this.ka=!1;this.Za=!0;this.la=this.G=null;this.B={};this.Xa=[];this.P={};this.b=lg(this);this.mb={width:Infinity,height:Infinity};this.i=mg();this.Ua=0;this.ia=this.b.preferredAudioLanguage;this.Ba=this.b.preferredTextLanguage;b&&b(this);this.o=new B(this.be.bind(this));this.Wa=ng(this);for(var c=0;cthis.Va.indexOf(a.id)}.bind(this))};W.prototype.getTextTracks=W.prototype.Vb; +W.prototype.rc=function(a){if(this.a&&(a=ac(V(this.a),a))){xg(this,a,!1);var b={};b.text=a;yg(this,b,!0)}};W.prototype.selectTextTrack=W.prototype.rc; +W.prototype.sc=function(a,b){if(this.a){var c={},d=$b(V(this.a),a),e=sf(this.a);if(d){if(!d.allowedByApplication||!d.allowedByKeySystem)return;d.audio&&(zg(this,d.audio),d.audio!=e.audio&&(c.audio=d.audio));d.video&&(zg(this,d.video),d.video!=e.video&&(c.video=d.video))}Ma(c).forEach(function(a){xg(this,a,!1)}.bind(this));(d=e.text)&&(c.text=d);yg(this,c,b)}};W.prototype.selectVariantTrack=W.prototype.sc; +W.prototype.Nc=function(){return this.a?Yb(V(this.a).variants).map(function(a){return a.language}).filter(Aa):[]};W.prototype.getAudioLanguages=W.prototype.Nc;W.prototype.Wc=function(){return this.a?V(this.a).textStreams.map(function(a){return a.language}).filter(Aa):[]};W.prototype.getTextLanguages=W.prototype.Wc;W.prototype.Sd=function(a){if(this.a){var b=V(this.a);this.ia=a;vg(this,b)}};W.prototype.selectAudioLanguage=W.prototype.Sd; +W.prototype.Td=function(a){if(this.a){var b=V(this.a);this.Ba=a;vg(this,b)}};W.prototype.selectTextLanguage=W.prototype.Td;W.prototype.$c=function(){return"showing"==this.A.mode};W.prototype.isTextTrackVisible=W.prototype.$c;W.prototype.Wd=function(a){this.A.mode=a?"showing":"hidden";Ag(this)};W.prototype.setTextTrackVisibility=W.prototype.Wd;W.prototype.Sc=function(){return this.c?new Date(1E3*this.c.presentationTimeline.f+1E3*this.f.currentTime):null};W.prototype.getPlayheadTimeAsDate=W.prototype.Sc; +W.prototype.getStats=function(){Bg(this);this.Sa();var a=null,b=null,c=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};this.g&&this.c&&(a=fc(this.c,ff(this.g)),b=this.P[a],b=ec(b.audio,b.video,this.c.periods[a].variants),a=b.video||{});a||(a={});b||(b={});return{width:a.width||0,height:a.height||0,streamBandwidth:b.bandwidth||0,decodedFrames:Number(c.totalVideoFrames),droppedFrames:Number(c.droppedVideoFrames),estimatedBandwidth:this.b.abr.manager.getBandwidthEstimate(), +loadLatency:this.i.loadLatency,playTime:this.i.playTime,bufferingTime:this.i.bufferingTime,switchHistory:Da(this.i.switchHistory),stateHistory:Da(this.i.stateHistory)}};W.prototype.getStats=W.prototype.getStats; +W.prototype.addTextTrack=function(a,b,c,d,e){if(!this.a)return Promise.reject();for(var f=V(this.a),g,h=0;hYb(a.variants).length;if(!b)throw new t(2,4,4011);if(a)throw new t(2,4,4012);}; +function yg(a,b,c){for(var d in b){var e=b[d],f=c||!1;"text"==d&&(f=!0);a.Za?a.B[d]={stream:e,Ic:f}:vf(a.a,d,e,f)}}function Bg(a){if(a.c){var b=Date.now()/1E3;a.ka?a.i.bufferingTime+=b-a.Ua:a.i.playTime+=b-a.Ua;a.Ua=b}} +function qg(a,b){function c(a,b){if(!a)return null;var c=a.findSegmentPosition(b-e.startTime);return null==c?null:(c=a.getSegmentReference(c))?c.startTime+e.startTime:null}var d=sf(a.a),e=V(a.a),f=c(d.video,b),d=c(d.audio,b);return null!=f&&null!=d?Math.max(f,d):null!=f?f:null!=d?d:b}k.be=function(a,b){this.b.abr.manager.segmentDownloaded(a,b)};k.xc=function(a){Bg(this);this.ka=a;this.Sa();if(this.g){var b=this.g;a!=b.h&&(b.h=a,hf(b,b.g))}this.dispatchEvent(new H("buffering",{buffering:a}))}; +k.Yd=function(){rg(this)};k.Sa=function(){if(!this.J){var a=this.ka?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing";var b=Date.now()/1E3;if(this.i.stateHistory.length){var c=this.i.stateHistory[this.i.stateHistory.length-1];c.duration=b-c.timestamp;if(a==c.state)return}this.i.stateHistory.push({timestamp:b,state:a,duration:0})}};k.ae=function(){if(this.v){var a=this.v;a.c.forEach(a.o.bind(a,!0))}this.a&&xf(this.a)}; +function Cg(a,b,c,d,e){if(!c||1>c.length)return a.xa(new t(2,4,4012)),{};a.b.abr.manager.setVariants(c);a.b.abr.manager.setTextStreams(d);var f=[];e&&(f=["video","audio"],b.textStreams.length&&f.push("text"));e=sf(a.a);if(b=dc(e.audio,e.video,b.variants)){b.allowedByApplication&&b.allowedByKeySystem||(f.push("audio"),f.push("video"));for(var g in e)b=e[g],"audio"==b.type&&b.language!=c[0].language?f.push(g):"text"==b.type&&0b&&(b+=Math.pow(2,32)),b=b.toString(16));this.xa(new t(2,3,3016,a,b))}}}; +k.$d=function(a){var b=["output-restricted","internal-error"],c=V(this.a),d=!1;c.variants.forEach(function(c){var e=[];c.audio&&e.push(c.audio);c.video&&e.push(c.video);e.forEach(function(e){var f=c.allowedByKeySystem;e.keyId&&(e=a[e.keyId],c.allowedByKeySystem=!!e&&0>b.indexOf(e));f!=c.allowedByKeySystem&&(d=!0)})});var e=sf(this.a);(e=dc(e.audio,e.video,c.variants))&&!e.allowedByKeySystem&&vg(this,c);d&&rg(this)}; +k.Zd=function(a,b){if(this.h&&this.h.onExpirationUpdated)this.h.onExpirationUpdated(a,b);this.dispatchEvent(new H("expirationupdated"))};function X(a){this.a=bg();this.f=a;this.i=Dg(this);this.b=null;this.v=!1;this.j=null;this.g=-1;this.l=0;this.c=null;this.h=new cg(this.a,a.o,a.getConfiguration().streaming.retryParameters,this.i)}m("shaka.offline.Storage",X);function Eg(){return!!window.indexedDB}X.support=Eg;X.prototype.m=function(){var a=this.a,b=this.h?this.h.m()["catch"](function(){}).then(function(){if(a)return a.m()}):Promise.resolve();this.i=this.f=this.h=this.a=null;return b};X.prototype.destroy=X.prototype.m; +X.prototype.configure=function(a){Ca(this.i,a,Dg(this),{},"")};X.prototype.configure=X.prototype.configure; +X.prototype.je=function(a,b,c){function d(a){f=a}if(this.v)return Promise.reject(new t(2,9,9006));this.v=!0;var e,f=null;return Fg(this).then(function(){Y(this);return Gg(this,a,d,c)}.bind(this)).then(function(c){Y(this);this.c=c.manifest;this.b=c.Jc;if(this.c.presentationTimeline.$()||this.c.presentationTimeline.va())throw new t(2,9,9005,a);this.c.periods.forEach(this.o.bind(this));this.g=this.a.c.manifest++;this.l=0;c=this.c.periods.map(this.B.bind(this));var d=this.b.b,f=hb(this.b);if(d){if(!f.length)throw new t(2, +9,9007,a);d.initData=[]}e={key:this.g,originalManifestUri:a,duration:this.l,size:0,expiration:this.b.ab(),periods:c,sessionIds:f,drmInfo:d,appMetadata:b};return eg(this.h,e)}.bind(this)).then(function(){Y(this);if(f)throw f;return Hg(this)}.bind(this)).then(function(){return Wf(e)}.bind(this))["catch"](function(a){return Hg(this)["catch"](y).then(function(){throw a;})}.bind(this))};X.prototype.store=X.prototype.je; +X.prototype.remove=function(a){function b(a){6013!=a.code&&(e=a)}var c=a.offlineUri,d=/^offline:([0-9]+)$/.exec(c);if(!d)return Promise.reject(new t(2,9,9004,c));var e=null,f,g,h=Number(d[1]);return Fg(this).then(function(){Y(this);return this.a.get("manifest",h)}.bind(this)).then(function(a){Y(this);if(!a)throw new t(2,9,9003,c);f=a;a=hg(f);g=new $a(this.f.o,b,function(){},function(){});g.configure(this.f.getConfiguration().drm);return g.init(a,!0)}.bind(this)).then(function(){return eb(g,f.sessionIds)}.bind(this)).then(function(){return g.m()}.bind(this)).then(function(){Y(this); +if(e)throw e;var b=f.periods.map(function(a){return a.streams.map(function(a){var b=a.segments.map(function(a){a=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.uri);return Number(a[1])});a.initSegmentUri&&(a=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a.initSegmentUri),b.push(Number(a[1])));return b}).reduce(x,[])}).reduce(x,[]),c=0,d=b.length,g=this.i.progressCallback;return Tf(this.a,b,function(){c++;g(a,c/d)})}.bind(this)).then(function(){Y(this);this.i.progressCallback(a,1);return this.a.remove("manifest", +h)}.bind(this))};X.prototype.remove=X.prototype.remove;X.prototype.list=function(){var a=[];return Fg(this).then(function(){Y(this);return this.a.forEach("manifest",function(b){a.push(Wf(b))})}.bind(this)).then(function(){return a})};X.prototype.list=X.prototype.list; +function Gg(a,b,c,d){function e(){}var f=a.f.o,g=a.f.getConfiguration(),h,l,n;return Dd(b,f,g.manifest.retryParameters,d).then(function(a){Y(this);n=new a;n.configure(g.manifest);return n.start(b,{networkingEngine:f,filterPeriod:this.o.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:c})}.bind(a)).then(function(a){Y(this);h=a;l=new $a(f,c,e,function(){});l.configure(g.drm);return l.init(h,!0)}.bind(a)).then(function(){Y(this);return Ig(h)}.bind(a)).then(function(){Y(this); +return db(l)}.bind(a)).then(function(){Y(this);return n.stop()}.bind(a)).then(function(){Y(this);return{manifest:h,Jc:l}}.bind(a))["catch"](function(a){if(n)return n.stop().then(function(){throw a;});throw a;})} +X.prototype.A=function(a){for(var b=[],c=Qb(this.f.getConfiguration().preferredAudioLanguage),d=[0,Ob,Pb],e=a.filter(function(a){return"variant"==a.type}),d=d.map(function(a){return e.filter(function(b){b=Qb(b.language);return Nb(a,c,b)})}),f,g=0;g=a.height});h.length&&(h.sort(function(a, +b){return b.height-a.height}),f=h.filter(function(a){return a.height==h[0].height}));f.sort(function(a,b){return a.bandwidth-b.bandwidth});f.length&&b.push(f[Math.floor(f.length/2)]);b.push.apply(b,a.filter(function(a){return"text"==a.type}));return b};function Dg(a){return{trackSelectionCallback:a.A.bind(a),progressCallback:function(a,c){if(a||c)return null}}}function Fg(a){return a.a?a.a.a?Promise.resolve():a.a.init(Vf):Promise.reject(new t(2,9,9E3))} +X.prototype.o=function(a){var b={};if(this.j){var c=this.j.filter(function(a){return"variant"==a.type}),d=null;c.length&&(d=$b(a,c[0]));d&&(d.video&&(b.video=d.video),d.audio&&(b.audio=d.audio))}Ub(this.b,b,a);Tb(a,this.f.getConfiguration().restrictions,{width:Infinity,height:Infinity})};function Hg(a){var b=a.b?a.b.m():Promise.resolve();a.b=null;a.c=null;a.v=!1;a.j=null;a.g=-1;return b} +function Ig(a){var b=a.periods.map(function(a){return a.variants}).reduce(x,[]).map(function(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}).reduce(x,[]).filter(Aa);a=a.periods.map(function(a){return a.textStreams}).reduce(x,[]);b.push.apply(b,a);return Promise.all(b.map(function(a){return a.createSegmentIndex()}))} +X.prototype.B=function(a){var b,c,d=Xb(a,null,null),e=Zb(a,null),d=this.i.trackSelectionCallback(d.concat(e));this.j||(this.j=d,this.c.periods.forEach(this.o.bind(this)));for(e=d.length-1;0=c.a.length)){for(var d=[],e=0;ea.indexOf("Apple")||(0<=b.indexOf("Version/8")?window.MediaSource=null:0<=b.indexOf("Version/9")?qh():0<=b.indexOf("Version/10")&&(qh(),rh()))}});function Z(a){this.c=[];this.b=[];this.za=uh;if(a)try{a(this.fa.bind(this),this.a.bind(this))}catch(b){this.a(b)}}var uh=0;function vh(a){var b=new Z;b.fa(void 0);return b.then(function(){return a})}function wh(a){var b=new Z;b.a(a);return b}function xh(a){function b(a,b,c){a.za==uh&&(e[b]=c,d++,d==e.length&&a.fa(e))}var c=new Z;if(!a.length)return c.fa([]),c;for(var d=0,e=Array(a.length),f=c.a.bind(c),g=0;g