shaka-player 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/controls.css +2 -2
- package/dist/controls.css.map +1 -1
- package/dist/locales.js +29 -29
- package/dist/shaka-player.compiled.d.ts +14 -0
- package/dist/shaka-player.compiled.debug.d.ts +14 -0
- package/dist/shaka-player.compiled.debug.externs.js +11 -0
- package/dist/shaka-player.compiled.debug.js +170 -168
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +11 -0
- package/dist/shaka-player.compiled.js +650 -650
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.d.ts +14 -0
- package/dist/shaka-player.ui.debug.d.ts +14 -0
- package/dist/shaka-player.ui.debug.externs.js +11 -0
- package/dist/shaka-player.ui.debug.js +178 -176
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +11 -0
- package/dist/shaka-player.ui.js +792 -792
- package/dist/shaka-player.ui.map +2 -2
- package/externs/shaka/text.js +10 -0
- package/lib/dash/dash_parser.js +4 -2
- package/lib/media/streaming_engine.js +5 -2
- package/lib/player.js +1 -1
- package/lib/polyfill/media_capabilities.js +30 -15
- package/lib/text/cue.js +6 -0
- package/lib/text/ttml_text_parser.js +84 -58
- package/lib/text/ui_text_displayer.js +17 -11
- package/lib/util/stream_utils.js +58 -7
- package/lib/util/xml_utils.js +19 -0
- package/package.json +2 -2
- package/test/dash/dash_parser_manifest_unit.js +33 -1
- package/test/media/drm_engine_unit.js +3 -3
- package/test/media/streaming_engine_integration.js +2 -1
- package/test/media/streaming_engine_unit.js +145 -0
- package/test/player_unit.js +5 -5
- package/test/test/util/ttml_utils.js +81 -0
- package/test/text/mp4_ttml_parser_unit.js +11 -18
- package/test/text/ttml_text_parser_unit.js +495 -228
- package/test/util/stream_utils_unit.js +35 -29
- package/ui/less/buttons.less +0 -4
- package/ui/text_selection.js +1 -0
- package/externs/media_capabilities.js +0 -16
|
@@ -53,9 +53,9 @@ ia("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ha(
|
|
|
53
53
|
Copyright 2016 Google LLC
|
|
54
54
|
SPDX-License-Identifier: Apache-2.0
|
|
55
55
|
*/
|
|
56
|
-
function Oa(a){this.i=Math.exp(Math.log(.5)/a);this.h=this.g=0}function
|
|
56
|
+
function Oa(a){this.i=Math.exp(Math.log(.5)/a);this.h=this.g=0}function Ra(a,b,c){var d=Math.pow(a.i,b);c=c*(1-d)+d*a.g;isNaN(c)||(a.g=c,a.h+=b)}function Sa(a){return a.g/(1-Math.pow(a.i,a.h))};function Ta(){this.h=new Oa(2);this.i=new Oa(5);this.g=0}Ta.prototype.getBandwidthEstimate=function(a){return 128E3>this.g?a:Math.min(Sa(this.h),Sa(this.i))};function Ua(){}function Va(){}function Wa(){}function Ya(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];Za.has(a)||(Za.add(a),Wa.apply(Ua,ka(c)))}function $a(){}function ab(){}function cb(){}function db(){}var Za=new Set;
|
|
57
57
|
if(window.console&&window.console.log.bind){var eb={},fb=(eb[1]=console.error.bind(console),eb[2]=console.warn.bind(console),eb[3]=console.info.bind(console),eb[4]=console.log.bind(console),eb[5]=console.debug.bind(console),eb[6]=console.debug.bind(console),eb);Wa=fb[2];Va=fb[1]};function gb(a,b){for(var c=[],d=t(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c}function hb(a,b){for(var c=t(a),d=c.next();!d.done;d=c.next())if(!b(d.value))return!1;return!0}
|
|
58
|
-
var jb=function ib(a){var c;return Fa(ib,function(d){1==d.g&&(c=0);if(3!=d.g)return c<a?v(d,c,3):d.v(0);c++;return d.v(2)})},mb=function
|
|
58
|
+
var jb=function ib(a){var c;return Fa(ib,function(d){1==d.g&&(c=0);if(3!=d.g)return c<a?v(d,c,3):d.v(0);c++;return d.v(2)})},mb=function lb(a){var c,d,e,f,g,h;return Fa(lb,function(k){1==k.g&&(c=-1,e=d=void 0,f=t(a),g=f.next());if(5!=k.g){if(g.done)return-1==c?k.v(0):v(k,{ga:c,vf:d,item:e,next:void 0},0);h=g.value;return 0<=c?v(k,{ga:c,item:e,vf:d,next:h},5):k.v(5)}c++;d=e;e=h;g=f.next();return k.v(2)})};function nb(){}function ob(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(pb(a)==pb(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;for(var c=qb(a),d=qb(b),e=t(jb(a.byteLength)),f=e.next();!f.done;f=e.next())if(f=f.value,c[f]!=d[f])return!1;return!0}function pb(a){return a instanceof ArrayBuffer?a:a.buffer}function rb(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer}
|
|
59
59
|
function qb(a,b,c){c=void 0===c?Infinity:c;return sb(a,void 0===b?0:b,c,Uint8Array)}function tb(a,b,c){c=void 0===c?Infinity:c;return sb(a,void 0===b?0:b,c,DataView)}function sb(a,b,c,d){var e=(a.byteOffset||0)+a.byteLength;b=Math.max(0,Math.min((a.byteOffset||0)+b,e));return new d(pb(a),b,Math.min(b+Math.max(c,0),e)-b)}M("shaka.util.BufferUtils",nb);nb.toDataView=tb;nb.toUint8=qb;nb.toArrayBuffer=rb;nb.equal=ob;function N(a,b,c,d){for(var e=[],f=3;f<arguments.length;++f)e[f-3]=arguments[f];this.severity=a;this.category=b;this.code=c;this.data=e;this.handled=!1}N.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};M("shaka.util.Error",N);N.Severity={RECOVERABLE:1,CRITICAL:2};N.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
|
|
60
60
|
N.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,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,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,
|
|
61
61
|
TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,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,
|
|
@@ -84,7 +84,7 @@ if(d)return a;if(0==g.length||!e)throw db(nc(a)),new N(2,3,3019);g.reverse();for
|
|
|
84
84
|
function qc(a,b,c,d,e){var f=rc.value(),g=a.subarray(c.start,c.start+c.size),h=tb(g),k=new Uint8Array(c.size+f.byteLength);k.set(g,0);g=tb(k);g.setUint32(4,e);k.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);sc(k,0,k.byteLength);e=new Uint8Array(a.byteLength+k.byteLength);c=ac()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(k,c);e.set(f,c+k.byteLength);a=t(d);for(d=a.next();!d.done;d=a.next())d=d.value,sc(e,d.start,d.size+k.byteLength);k=tb(e,b.start);b=Tb(b);a=k.getUint32(b);
|
|
85
85
|
k.setUint32(b,a+1);return e}function sc(a,b,c){a=tb(a,b);b=a.getUint32(0);0!=b&&(1==b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}var rc=new ub(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});function tc(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function uc(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)}function vc(a,b,c){c||(c=tc);if(a.length!=b.length)return!1;b=b.slice();var d={};a=t(a);for(var e=a.next();!e.done;d={Uc:d.Uc},e=a.next()){d.Uc=e.value;e=b.findIndex(function(f){return function(g){return c(f.Uc,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length}
|
|
86
86
|
function wc(a,b,c){c||(c=tc);if(a.length!=b.length)return!1;for(var d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};function xc(a,b,c){this.startTime=a;this.direction=yc;this.endTime=b;this.payload=c;this.region=new zc;this.position=null;this.positionAlign=Ac;this.size=0;this.textAlign=Bc;this.writingMode=Cc;this.lineInterpretation=Dc;this.line=null;this.lineHeight="";this.lineAlign=Ec;this.displayAlign=Fc;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=Gc;this.fontStyle=Hc;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textDecoration=
|
|
87
|
-
[];this.wrapLine=!0;this.id="";this.nestedCues=[];this.spacer=this.lineBreak=!1;this.cellResolution={columns:32,rows:15}}xc.prototype.clone=function(){var a=new xc(0,0,""),b;for(b in this)a[b]=this[b],a[b]&&a[b].constructor==Array&&(a[b]=a[b].slice());return a};
|
|
87
|
+
[];this.wrapLine=!0;this.id="";this.nestedCues=[];this.spacer=this.lineBreak=this.isContainer=!1;this.cellResolution={columns:32,rows:15}}xc.prototype.clone=function(){var a=new xc(0,0,""),b;for(b in this)a[b]=this[b],a[b]&&a[b].constructor==Array&&(a[b]=a[b].slice());return a};
|
|
88
88
|
function Ic(a,b){if(a.startTime!=b.startTime||a.endTime!=b.endTime||a.payload!=b.payload)return!1;for(var c in a)if("startTime"!=c&&"endTime"!=c&&"payload"!=c)if("nestedCues"==c){if(!wc(a.nestedCues,b.nestedCues,Ic))return!1}else if("region"==c||"cellResolution"==c)for(var d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!wc(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}M("shaka.text.Cue",xc);var Ac="auto";
|
|
89
89
|
xc.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Ac};var Bc="center",Jc={LEFT:"left",RIGHT:"right",CENTER:Bc,START:"start",END:"end"};xc.textAlign=Jc;var Fc="after",Kc={BEFORE:"before",CENTER:"center",AFTER:Fc};xc.displayAlign=Kc;var yc="ltr";xc.direction={HORIZONTAL_LEFT_TO_RIGHT:yc,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Cc="horizontal-tb";xc.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Cc,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var Dc=0;
|
|
90
90
|
xc.lineInterpretation={LINE_NUMBER:Dc,PERCENTAGE:1};var Ec="start",Lc={CENTER:"center",START:Ec,END:"end"};xc.lineAlign=Lc;var Mc={white:"#FFF",lime:"#0F0",cyan:"#0FF",red:"#F00",yellow:"#FF0",magenta:"#F0F",blue:"#00F",black:"#000"};xc.defaultTextColor=Mc;var Nc={bg_white:"#FFF",bg_lime:"#0F0",bg_cyan:"#0FF",bg_red:"#F00",bg_yellow:"#FF0",bg_magenta:"#F0F",bg_blue:"#00F",bg_black:"#000"};xc.defaultTextBackgroundColor=Nc;var Gc=400;xc.fontWeight={NORMAL:Gc,BOLD:700};
|
|
@@ -100,21 +100,21 @@ var pd=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"]
|
|
|
100
100
|
function Dd(a,b,c,d){if(b>=c)for(--d;0<=d;d--)a.i[b+d]=a.i[c+d].map(function(f){return f});else for(var e=0;e<d;e++)a.i[b+e]=a.i[c+e].map(function(f){return f})}function td(a,b,c){for(var d=0;d<=c;d++)a.i[b+d]=[]}
|
|
101
101
|
var vd=0,xd=1,zd=2,Bd=3,wd=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),yd=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57,"\u2800"],[58,"\u00e8"],[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),Ad=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],
|
|
102
102
|
[35,"\u00da"],[36,"\u00dc"],[37,"\u00fc"],[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],[63,"\u00bb"]]),Cd=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],
|
|
103
|
-
[39,"\u00d5"],[40,"\u00f5"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]);function Ed(a,b){this.h=Fd;this.s=new qd(a,b);this.i=new qd(a,b);this.l=new qd(a,b);this.g=this.i;this.j=0;this.m=null}function Gd(a,b,c){a.g=a.i;var d=a.g,e=null;a.h!==Hd&&a.h!==Id&&(e=sd(d,a.j,c),c=a.i,c.g=0<c.h?c.h:0,td(c,0,15),c=a.l,c.g=0<c.h?c.h:0,td(c,0,15),d.g=15);a.h=Hd;d.h=b;return e}function Jd(a){a.h=Kd;a.g=a.l;a.g.h=0}function Ld(a){
|
|
103
|
+
[39,"\u00d5"],[40,"\u00f5"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]);function Ed(a,b){this.h=Fd;this.s=new qd(a,b);this.i=new qd(a,b);this.l=new qd(a,b);this.g=this.i;this.j=0;this.m=null}function Gd(a,b,c){a.g=a.i;var d=a.g,e=null;a.h!==Hd&&a.h!==Id&&(e=sd(d,a.j,c),c=a.i,c.g=0<c.h?c.h:0,td(c,0,15),c=a.l,c.g=0<c.h?c.h:0,td(c,0,15),d.g=15);a.h=Hd;d.h=b;return e}function Jd(a){a.h=Kd;a.g=a.l;a.g.h=0}function Ld(a){Ya("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.g=a.s;a.h=Id}
|
|
104
104
|
var Fd=0,Kd=1,Hd=3,Id=4,Md="black green blue cyan red yellow magenta black".split(" "),Nd="white green blue cyan red yellow magenta white_italics".split(" ");function Od(){this.h=[];this.g=[];this.i=new dd;this.l=0;this.u=new Map([["CC1",new Ed(0,0)],["CC2",new Ed(0,1)],["CC3",new Ed(1,0)],["CC4",new Ed(1,1)]]);this.s=this.m=0;this.j=new Map;Pd(this)}function Pd(a){a.m=0;a.s=0;a=t(a.u.values());for(var b=a.next();!b.done;b=a.next())b=b.value,b.h=2,b.g=b.i,b.m=null,rd(b.i),rd(b.l),rd(b.s)}
|
|
105
105
|
function Qd(a){function b(f,g){return f.pts-g.pts||f.order-g.order}var c=[];a.h.sort(b);a.g.sort(b);for(var d=t(a.h),e=d.next();!e.done;e=d.next())(e=Rd(a,e.value))&&c.push(e);d=t(a.g);for(e=d.next();!e.done;e=d.next())ed(a.i,e.value);d=t(a.i.i);for(e=d.next();!e.done;e=d.next())e=Sd(a,e.value),c.push.apply(c,ka(e));a.i.i=[];a.h=[];a.g=[];return c}
|
|
106
|
-
function Rd(a,b){var c=b.type;if(16===(b.Ba&112)){var d=b.Ba>>3&1;0===c?a.m=d:a.s=d}c=a.u.get("CC"+(c<<1|(c?a.s:a.m)+1));if(255===b.Ba&&255===b.
|
|
106
|
+
function Rd(a,b){var c=b.type;if(16===(b.Ba&112)){var d=b.Ba>>3&1;0===c?a.m=d:a.s=d}c=a.u.get("CC"+(c<<1|(c?a.s:a.m)+1));if(255===b.Ba&&255===b.Sa||!b.Ba&&!b.Sa||!Td(b.Ba)||!Td(b.Sa))return 45<=++a.l&&Pd(a),null;a.l=0;b.Ba&=127;b.Sa&=127;if(!b.Ba&&!b.Sa)return null;d=null;if(16===(b.Ba&112))a:{var e=b.Ba;d=b.Sa;if(c.m===(e<<8|d))c.m=null;else if(c.m=e<<8|d,16===(e&240)&&64===(d&192)){e=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(e&7)<<1|d>>5&1];var f=(d&30)>>1,g="white",h=!1;7>f?g=Nd[f]:7===f&&(h=!0);
|
|
107
107
|
d=1===(d&1);if(c.h!==Id){f=c.g;if(c.h===Hd&&e!==f.g){var k=1+e-f.h;Dd(f,k,1+f.g-f.h,f.h);td(f,0,k-1);td(f,e+1,15-e)}f.g=e;c.g.m=d;c.g.j=h;c.g.l=g;c.g.s="black"}}else if(17===(e&247)&&32===(d&240))c.g.m=!1,c.g.j=!1,c.g.l="white",ud(c.g,vd,32),g=!1,e=Nd[(d&14)>>1],"white_italics"===e&&(e="white",g=!0),c.g.m=1===(d&1),c.g.j=g,c.g.l=e;else if(16===(e&247)&&32===(d&240)||23===(e&247)&&45===(d&255))g="black",0===(e&7)&&(g=Md[(d&14)>>1]),c.g.s=g;else if(17===(e&247)&&48===(d&240))ud(c.g,xd,d);else if(18===
|
|
108
|
-
(e&246)&&32===(d&224))ud(c.g,e&1?Bd:zd,d);else if(20===(e&246)&&32===(d&240)){d=b.pts;e=null;switch(b.
|
|
109
|
-
0,h-1),td(e,e.g,15-e.g),c.j=d,e=g);break;case 46:td(c.l,0,15);break;case 47:e=null,c.h!==Id&&(e=sd(c.i,c.j,d)),g=c.l,c.l=c.i,c.i=g,Jd(c),c.j=d}d=e;break a}d=null}else e=b.
|
|
108
|
+
(e&246)&&32===(d&224))ud(c.g,e&1?Bd:zd,d);else if(20===(e&246)&&32===(d&240)){d=b.pts;e=null;switch(b.Sa){case 32:Jd(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:e=Gd(c,2,d);break;case 38:e=Gd(c,3,d);break;case 39:e=Gd(c,4,d);break;case 40:ud(c.g,vd,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.j=d;break;case 42:rd(c.s);Ld(c);break;case 43:Ld(c);break;case 44:e=c.i;g=null;c.h!==Id&&(g=sd(e,c.j,d));td(e,0,15);e=g;break;case 45:e=c.g;c.h!==Hd?e=null:(g=sd(e,c.j,d),h=e.g-e.h+1,Dd(e,h-1,h,e.h),td(e,
|
|
109
|
+
0,h-1),td(e,e.g,15-e.g),c.j=d,e=g);break;case 46:td(c.l,0,15);break;case 47:e=null,c.h!==Id&&(e=sd(c.i,c.j,d)),g=c.l,c.l=c.i,c.i=g,Jd(c),c.j=d}d=e;break a}d=null}else e=b.Sa,ud(c.g,vd,b.Ba),ud(c.g,vd,e);return d}
|
|
110
110
|
function Sd(a,b){var c=[];try{for(;b.oa();){var d=gd(b).value,e=(d&224)>>5,f=d&31;7===e&&0!=f&&(e=gd(b).value&63);if(0!=e){a.j.has(e)||a.j.set(e,new hd(e));for(var g=a.j.get(e),h=b.$();b.$()-h<f;){e=b;var k=gd(e),l=k.value,m=k.pts;if(16===l){var n=gd(e);l=l<<16|n.value}if(0<=l&&31>=l){var p=m;if(g.g){var r=g.g;e=null;switch(l){case 8:!$c(r)||0>=r.g&&0>=r.h||(0>=r.g?(r.g=r.F-1,r.h--):r.g--,r.i[r.h][r.g]=null);break;case 13:r.isVisible()&&(e=ad(r,p,g.i));if(r.h+1>=r.I){p=r;for(var u=0,x=1;15>x;x++,
|
|
111
111
|
u++)p.i[u]=p.i[x];for(x=0;1>x;x++,u++)p.i[u]=Yc()}else r.h++;r.g=0;break;case 14:r.isVisible()&&(e=ad(r,p,g.i));r.i[r.h]=Yc();r.g=0;break;case 12:r.isVisible()&&(e=ad(r,p,g.i)),Xc(r),p=r,p.h=0,p.g=0}var w=e}else w=null}else if(128<=l&&159>=l)w=id(g,e,l,m);else{if(4096<=l&&4127>=l)p=l&255,8<=p&&15>=p?e.skip(1):16<=p&&23>=p?e.skip(2):24<=p&&31>=p&&e.skip(3);else if(4224<=l&&4255>=l)p=l&255,128<=p&&135>=p?e.skip(4):136<=p&&143>=p&&e.skip(5);else if(32<=l&&127>=l)e=l,g.g&&(127===e?Zc(g.g,"\u266a"):Zc(g.g,
|
|
112
|
-
String.fromCharCode(e)));else if(160<=l&&255>=l)g.g&&Zc(g.g,String.fromCharCode(l));else if(4128<=l&&4223>=l){if(e=l&255,g.g)if(pd.has(e)){var y=pd.get(e);Zc(g.g,y)}else Zc(g.g,"_")}else 4256<=l&&4351>=l&&g.g&&(160!=(l&255)?Zc(g.g,"_"):Zc(g.g,"[CC]"));w=null}(e=w)&&c.push(e)}}}}catch(C){if(C instanceof N&&3E3===C.code)
|
|
112
|
+
String.fromCharCode(e)));else if(160<=l&&255>=l)g.g&&Zc(g.g,String.fromCharCode(l));else if(4128<=l&&4223>=l){if(e=l&255,g.g)if(pd.has(e)){var y=pd.get(e);Zc(g.g,y)}else Zc(g.g,"_")}else 4256<=l&&4351>=l&&g.g&&(160!=(l&255)?Zc(g.g,"_"):Zc(g.g,"[CC]"));w=null}(e=w)&&c.push(e)}}}}catch(C){if(C instanceof N&&3E3===C.code)Ya("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw C;}return c}function Td(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b};function Ud(){}var Wd=function Vd(a,b){var d,e,f,g;return Fa(Vd,function(h){if(1==h.g){for(var k=b,l=0,m=0;m<k.length;)2==l&&3==k[m]?(l=0,k=[].concat(ka(k)),k.splice(m,1),k=new Uint8Array(k)):0==k[m]?l++:l=0,m++;d=k;e=0}if(4!=h.g){if(!(e<d.length))return h.v(0);for(f=0;255==d[e];)f+=255,e++;f+=d[e++];for(g=0;255==d[e];)g+=255,e++;g+=d[e++];return 4!=f?h.v(4):v(h,d.subarray(e,e+g),4)}e+=g;return h.v(2)})};function Xd(a,b){var c=null,d=null,e=a.N();b&1&&a.skip(8);b&2&&a.skip(4);b&8&&(c=a.N());b&16&&(d=a.N());return{trackId:e,Xd:c,Le:d}}function Yd(a,b){return{fd:1==b?a.Hb():a.N()}}function Zd(a,b){1==b?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));return{timescale:a.N()}}
|
|
113
113
|
function $d(a,b,c){var d=a.N(),e=[];c&1&&a.skip(4);c&4&&a.skip(4);for(var f=t(jb(d)),g=f.next();!g.done;g=f.next())g={Gd:null,sampleSize:null,Mc:null},c&256&&(g.Gd=a.N()),c&512&&(g.sampleSize=a.N()),c&1024&&a.skip(4),c&2048&&(g.Mc=0==b?a.N():a.ke()),e.push(g);return{tg:d,ne:e}};function ae(){this.j=new Ud;this.i=new Map;this.h=this.g=0}
|
|
114
114
|
ae.prototype.init=function(a){var b=this,c=[],d=[];(new Ob).box("moov",Sb).box("mvex",Sb).U("trex",function(e){var f=e.reader;f.skip(4);f.skip(4);e=f.N();f=f.N();b.g=e;b.h=f}).box("trak",Sb).U("tkhd",function(e){var f=e.reader;1==e.version?(f.skip(8),f.skip(8)):(f.skip(4),f.skip(4));e=f.N();c.push(e)}).box("mdia",Sb).U("mdhd",function(e){e=Zd(e.reader,e.version);d.push(e.timescale)}).parse(a,!0);if(!c.length||!d.length||c.length!=d.length)throw new N(2,2,2010);c.forEach(function(e,f){b.i.set(e,d[f])})};
|
|
115
115
|
ae.prototype.parse=function(a){var b=this,c=[],d=this.g,e=this.h,f=[],g=null,h=9E4;(new Ob).box("moof",Sb).box("traf",Sb).U("trun",function(k){f=$d(k.reader,k.version,k.flags).ne}).U("tfhd",function(k){k=Xd(k.reader,k.flags);d=k.Xd||b.g;e=k.Le||b.h;k=k.trackId;b.i.has(k)&&(h=b.i.get(k))}).U("tfdt",function(k){g=Yd(k.reader,k.version).fd}).box("mdat",function(k){if(null===g)throw new N(2,2,2010);k=k.reader;var l=g,m=h,n=d,p=e,r=f,u=0,x=p;for(r.length&&(x=r[0].sampleSize||p);k.oa();){var w=k.N();if(6==
|
|
116
116
|
(k.aa()&31)){var y=0;r.length>u&&(y=r[u].Mc||0);y=(l+y)/m;for(var C=t(Wd(b.j,k.bb(w-1))),D=C.next();!D.done;D=C.next())c.push({tf:D.value,pts:y})}else k.skip(w-1);x-=w+4;0==x&&(l=r.length>u?l+(r[u].Gd||n):l+n,u++,x=r.length>u?r[u].sampleSize||p:p)}}).parse(a,!1);return c};function be(){this.h=new ae;this.g=new Od}be.prototype.init=function(a){this.h.init(a)};
|
|
117
|
-
function ce(a,b){var c=a.h.parse(b);c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value,f=qb(e.tf);if(0<f.length&&(d=a.g,e=e.pts,f=new Cb(f,0),181===f.aa()&&49===f.Gb()&&1195456820===f.N()&&3===f.aa())){var g=f.aa();if(0!==(g&64)){g&=31;f.skip(1);for(var h=0;h<g;h++){var k=f.aa(),l=(k&4)>>2,m=f.aa(),n=f.aa();l&&(k&=3,0===k||1===k?d.h.push({pts:e,type:k,Ba:m,
|
|
117
|
+
function ce(a,b){var c=a.h.parse(b);c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value,f=qb(e.tf);if(0<f.length&&(d=a.g,e=e.pts,f=new Cb(f,0),181===f.aa()&&49===f.Gb()&&1195456820===f.N()&&3===f.aa())){var g=f.aa();if(0!==(g&64)){g&=31;f.skip(1);for(var h=0;h<g;h++){var k=f.aa(),l=(k&4)>>2,m=f.aa(),n=f.aa();l&&(k&=3,0===k||1===k?d.h.push({pts:e,type:k,Ba:m,Sa:n,order:d.h.length}):(d.g.push({pts:e,type:k,value:m,order:d.g.length}),d.g.push({pts:e,type:2,value:n,order:d.g.length})))}}}}return Qd(a.g)}
|
|
118
118
|
;function de(a){return!a||1==a.length&&1E-6>a.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function ee(a,b,c){c=void 0===c?0:c;return!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0)||b>a.end(a.length-1)?!1:b+c>=a.start(0)}function fe(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=t(ge(a)),e=d.next();!e.done;e=d.next()){var f=e.value;e=f.start;f=f.end;f>b&&(c+=f-Math.max(e,b))}return c}
|
|
119
119
|
function he(a,b,c){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return null;a=ge(a).findIndex(function(d,e,f){return d.start>b&&(0==e||f[e-1].end-b<=c)});return 0<=a?a:null}function ge(a){if(!a)return[];for(var b=[],c=t(jb(a.length)),d=c.next();!d.done;d=c.next())d=d.value,b.push({start:a.start(d),end:a.end(d)});return b};/*
|
|
120
120
|
@license
|
|
@@ -133,7 +133,7 @@ h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.p
|
|
|
133
133
|
function ne(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function pe(a,b,c){return null!=a?(a=encodeURI(a).replace(b,ve),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function ve(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var qe=/[#\/\?@]/g,se=/[#\?:]/g,re=/[#\?]/g,ue=/[#\?@]/g,te=/#/g;function oe(a){this.g=a||null}q=oe.prototype;q.va=null;q.xc=null;
|
|
134
134
|
q.add=function(a,b){if(!this.va&&(this.va={},this.xc=0,this.g))for(var c=this.g.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null;if(0<=e){var g=c[d].substring(0,e);f=c[d].substring(e+1)}else g=c[d];g=decodeURIComponent(g.replace(/\+/g," "));f=f||"";this.add(g,decodeURIComponent(f.replace(/\+/g," ")))}this.g=null;(c=this.va.hasOwnProperty(a)&&this.va[a])||(this.va[a]=c=[]);c.push(b);this.xc++;return this};
|
|
135
135
|
q.toString=function(){if(this.g)return this.g;if(!this.va)return"";var a=[],b;for(b in this.va)for(var c=encodeURIComponent(b),d=this.va[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};q.clone=function(){var a=new oe;a.g=this.g;if(this.va){var b={},c;for(c in this.va)b[c]=this.va[c].concat();a.va=b;a.xc=this.xc}return a};function we(a,b){if(0==b.length)return a;var c=b.map(function(d){return new je(d)});return a.map(function(d){return new je(d)}).map(function(d){return c.map(function(e){return d.resolve(e)})}).reduce(Kb,[]).map(function(d){return d.toString()})}function xe(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,sessionType:"",initData:b||[],keyIds:new Set}}
|
|
136
|
-
function ye(a,b){if(1==b.length)return b[0];var c=ze(a,b);if(null!=c)return c;throw new N(2,4,4025,b);}function ze(a,b){for(var c=t(Ae[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==Be?"":null}var Be="text",Ce={
|
|
136
|
+
function ye(a,b){if(1==b.length)return b[0];var c=ze(a,b);if(null!=c)return c;throw new N(2,4,4025,b);}function ze(a,b){for(var c=t(Ae[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==Be?"":null}var Be="text",Ce={Qa:"video",eb:"audio",ba:Be,oc:"image",Sf:"application"},Ae={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function De(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}De.prototype.resolve=function(){};De.prototype.reject=function(){};function Ee(){}M("shaka.dependencies",Ee);Ee.has=function(a){return Fe.has(a)};Ee.add=function(a,b){if(!Ge[a])throw Error(a+" is not supported");Fe.set(a,function(){return b})};var Ge={muxjs:"muxjs"};Ee.Allowed=Ge;var Fe=new Map([["muxjs",function(){return window.muxjs}]]);function He(){var a=this;this.s=Fe.get("muxjs")();this.g=new this.s.mp4.Transmuxer({keepOriginalTimestamps:!0});this.h=null;this.m=[];this.j=[];this.i=[];this.l=!1;this.g.on("data",function(b){a.j=b.captions;a.i=b.metadata;a.m.push(oc(b.initSegment,b.data))});this.g.on("done",function(){var b={data:oc.apply(ic,ka(a.m)),captions:a.j,metadata:a.i};a.h.resolve(b);a.l=!1})}He.prototype.destroy=function(){this.g.dispose();this.g=null;return Promise.resolve()};
|
|
137
137
|
function Ie(a,b){if(!Fe.get("muxjs")()||!Je(a))return!1;if(b)return MediaSource.isTypeSupported(Ke(b,a));var c=Ke("audio",a),d=Ke("video",a);return MediaSource.isTypeSupported(c)||MediaSource.isTypeSupported(d)}function Je(a){return"mp2t"==a.toLowerCase().split(";")[0].split("/")[1]}
|
|
138
138
|
function Ke(a,b){var c=b.replace(/mp2t/i,"mp4");"audio"==a&&(c=c.replace("video","audio"));var d=/avc1\.(66|77|100)\.(\d+)/.exec(c);if(d){var e="avc1.",f=d[1],g=Number(d[2]);e=("66"==f?e+"4200":"77"==f?e+"4d00":e+"6400")+(g>>4).toString(16);e+=(g&15).toString(16);c=c.replace(d[0],e)}return c}function Le(a,b){a.l=!0;a.h=new De;a.m=[];a.j=[];a.i=[];var c=qb(b);a.g.push(c);a.g.flush();a.l&&a.h.reject(new N(2,3,3018));return a.h};function Me(a,b){var c=a;b&&(c+='; codecs="'+b+'"');return c}function Ne(a,b,c){a=Me(a,b);return Fe.get("muxjs")()&&Je(a)?Ke(c,a):a}function Oe(a){var b=[a.mimeType];Pe.forEach(function(c,d){var e=a[d];e&&b.push(c+'="'+e+'"')});"PQ"==a.hdr&&b.push('eotf="smpte2084"');return b.join(";")}function Qe(a){a=a.split(".");var b=a[0];a.pop();return b}function Re(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}
|
|
139
139
|
var Pe=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Se(a){this.s=null;this.i=a;this.j=this.C=0;this.l=Infinity;this.h=this.g=null;this.u="";this.m=new Map}function Te(a){return Ue[a]||"application/cea-608"==a||"application/cea-708"==a?!0:!1}Se.prototype.destroy=function(){this.i=this.s=null;this.m.clear();return Promise.resolve()};
|
|
@@ -144,18 +144,18 @@ function $e(a,b,c,d,e){var f=c+" "+d,g=new Map;b=t(b);for(var h=b.next();!h.done
|
|
|
144
144
|
a.j):Math.min(a.g,Math.max(c,a.j));a.h=Math.max(a.h,Math.min(d,a.l))}M("shaka.text.TextEngine",Se);Se.prototype.destroy=Se.prototype.destroy;Se.findParser=function(a){return Ue[a]};Se.unregisterParser=function(a){delete Ue[a]};Se.registerParser=function(a,b){Ue[a]=b};var Ue={};function af(a){this.g=!1;this.h=new De;this.i=a}af.prototype.destroy=function(){var a=this;if(this.g)return this.h;this.g=!0;return this.i().then(function(){a.h.resolve()},function(){a.h.resolve()})};function bf(a,b){if(a.g){if(b instanceof N&&7003==b.code)throw b;throw new N(2,7,7003,b);}};function cf(){this.g={}}cf.prototype.push=function(a,b){this.g.hasOwnProperty(a)?this.g[a].push(b):this.g[a]=[b]};cf.prototype.get=function(a){return(a=this.g[a])?a.slice():null};cf.prototype.remove=function(a,b){a in this.g&&(this.g[a]=this.g[a].filter(function(c){return c!=b}),0==this.g[a].length&&delete this.g[a])};function df(a,b){for(var c in a.g)b(c,a.g[c])}cf.prototype.size=function(){return Object.keys(this.g).length};function ef(){this.g=new cf}q=ef.prototype;q.release=function(){this.ob();this.g=null};q.B=function(a,b,c,d){this.g&&(a=new ff(a,b,c,d),this.g.push(b,a))};q.wa=function(a,b,c,d){function e(g){f.Ea(a,b,e);c(g)}var f=this;this.B(a,b,e,d)};q.Ea=function(a,b,c){if(this.g){var d=this.g.get(b)||[];d=t(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.Ea(),this.g.remove(b,e))}};
|
|
145
145
|
q.ob=function(){if(this.g){var a=this.g,b=[],c;for(c in a.g)b.push.apply(b,ka(a.g[c]));a=t(b);for(b=a.next();!b.done;b=a.next())b.value.Ea();this.g.g={}}};M("shaka.util.EventManager",ef);ef.prototype.removeAll=ef.prototype.ob;ef.prototype.unlisten=ef.prototype.Ea;ef.prototype.listenOnce=ef.prototype.wa;ef.prototype.listen=ef.prototype.B;ef.prototype.release=ef.prototype.release;function ff(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=gf(a,d);this.target.addEventListener(b,c,this.g)}
|
|
146
146
|
ff.prototype.Ea=function(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1};function gf(a,b){if(void 0==b)return!1;if("boolean"==typeof b)return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return hf(a)?b:b.capture||!1}
|
|
147
|
-
function hf(a){var b=jf;if(void 0==b){b=!1;try{var c={},d={get:function(){b=!0;return!1}};Object.defineProperty(c,"passive",d);Object.defineProperty(c,"capture",d);d=function(){};a.addEventListener("test",d,c);a.removeEventListener("test",d,c)}catch(e){b=!1}jf=b}return b||!1}var jf=void 0;function kf(a,b,c,d){var e=this;this.g=a;this.m=c;this.j={};this.I={};this.i=null;this.L=d||function(){};this.l={};this.h=new ef;this.u={};this.C=b;this.F=new De;this.s=lf(this,this.F);this.J=new af(function(){return mf(e)});this.H=""}function lf(a,b){var c=new MediaSource;a.h.wa(c,"sourceopen",function(){URL.revokeObjectURL(a.H);b.resolve()});a.H=nf(c);a.g.src=a.H;return c}function
|
|
147
|
+
function hf(a){var b=jf;if(void 0==b){b=!1;try{var c={},d={get:function(){b=!0;return!1}};Object.defineProperty(c,"passive",d);Object.defineProperty(c,"capture",d);d=function(){};a.addEventListener("test",d,c);a.removeEventListener("test",d,c)}catch(e){b=!1}jf=b}return b||!1}var jf=void 0;function kf(a,b,c,d){var e=this;this.g=a;this.m=c;this.j={};this.I={};this.i=null;this.L=d||function(){};this.l={};this.h=new ef;this.u={};this.C=b;this.F=new De;this.s=lf(this,this.F);this.J=new af(function(){return mf(e)});this.H=""}function lf(a,b){var c=new MediaSource;a.h.wa(c,"sourceopen",function(){URL.revokeObjectURL(a.H);b.resolve()});a.H=nf(c);a.g.src=a.H;return c}function of(a){var b=Me(a.mimeType,a.codecs),c=Oe(a);return Te(b)||MediaSource.isTypeSupported(c)||Ie(b,a.type)}q=kf.prototype;
|
|
148
148
|
q.destroy=function(){return this.J.destroy()};
|
|
149
149
|
function mf(a){var b,c,d,e,f,g,h,k;return L(function(l){if(1==l.g){b=[];for(c in a.l)for(d=a.l[c],e=d[0],a.l[c]=d.slice(0,1),e&&b.push(e.p["catch"](Lb)),f=t(d.slice(1)),g=f.next();!g.done;g=f.next())h=g.value,h.p.reject(new N(2,7,7003,void 0));a.i&&b.push(a.i.destroy());a.m&&b.push(a.m.destroy());for(k in a.u)b.push(a.u[k].destroy());return v(l,Promise.all(b),2)}a.h&&(a.h.release(),a.h=null);a.g&&(a.g.removeAttribute("src"),a.g.load(),a.g=null);a.s=null;a.i=null;a.m=null;a.j={};a.u={};a.C=null;a.l=
|
|
150
150
|
{};z(l)})}
|
|
151
|
-
q.init=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){if(1==m.g)return d=Ce,v(m,c.F,2);e={};f=t(a.keys());for(g=f.next();!g.done;e={sa:e.sa},g=f.next())e.sa=g.value,h=a.get(e.sa),k=Me(h.mimeType,h.codecs),e.sa==d.ba?
|
|
152
|
-
c.j[e.sa]=l,c.I[e.sa]=k,c.l[e.sa]=[]);z(m)})};function
|
|
151
|
+
q.init=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){if(1==m.g)return d=Ce,v(m,c.F,2);e={};f=t(a.keys());for(g=f.next();!g.done;e={sa:e.sa},g=f.next())e.sa=g.value,h=a.get(e.sa),k=Me(h.mimeType,h.codecs),e.sa==d.ba?pf(c,k):(!b&&MediaSource.isTypeSupported(k)||!Ie(k,e.sa)||(c.u[e.sa]=new He,k=Ke(e.sa,k)),l=c.s.addSourceBuffer(k),c.h.B(l,"error",function(n){return function(){c.l[n.sa][0].p.reject(new N(2,3,3014,c.g.error?c.g.error.code:0))}}(e)),c.h.B(l,"updateend",function(n){return function(){return qf(c,n.sa)}}(e)),
|
|
152
|
+
c.j[e.sa]=l,c.I[e.sa]=k,c.l[e.sa]=[]);z(m)})};function pf(a,b){a.i||(a.i=new Se(a.m));"application/cea-608"!=b&&"application/cea-708"!=b&&(a.i.s=Nb(Ue[b]))}function sf(a){return a.s?"ended"==a.s.readyState:!0}function tf(a,b){if(b==Be)var c=a.i.g;else c=uf(a,b),c=!c||1==c.length&&1E-6>c.end(0)-c.start(0)?null:1==c.length&&0>c.start(0)?0:c.length?c.start(0):null;return c}function vf(a,b){return b==Be?a.i.h:de(uf(a,b))}
|
|
153
153
|
function wf(a,b,c){if(b==Be)return a=a.i,null==a.h||a.h<c?0:a.h-Math.max(c,a.g);a=uf(a,b);return fe(a,c)}q.zc=function(){var a={total:ge(this.g.buffered),audio:ge(uf(this,"audio")),video:ge(uf(this,"video")),text:[]};if(this.i){var b=this.i.g,c=this.i.h;null!=b&&null!=c&&a.text.push({start:b,end:c})}return a};function uf(a,b){try{return a.j[b].buffered}catch(c){return null}}
|
|
154
|
-
function xf(a,b,c,d,e,f){var g,h,k,l,m,n,p,r;return L(function(u){if(1==u.g){g=Ce;if(b==g.ba)return v(u,Ve(a.i,c,d,e),0);if(a.u[b])return v(u,Le(a.u[b],c),10);if(f)return a.i||
|
|
155
|
-
m,e));l.captions&&l.captions.length&&(n=a.j[g.
|
|
156
|
-
function Cf(a,b){var c;return L(function(d){c=Ce;return b==c.ba?a.i?v(d,a.i.remove(0,Infinity),0):d["return"]():v(d,zf(a,b,function(){var e=a.s.duration;0>=e?
|
|
157
|
-
function Df(a,b,c,d,e){var f;return L(function(g){f=Ce;return b==f.ba?(a.i.C=c,We(a.i,d,e),g["return"]()):v(g,Promise.all([zf(a,b,function(){var h=a.j[b].appendWindowStart,k=a.j[b].appendWindowEnd;a.j[b].abort();a.j[b].appendWindowStart=h;a.j[b].appendWindowEnd=k;
|
|
158
|
-
q.endOfStream=function(a){var b=this;return L(function(c){return v(c,Ef(b,function(){sf(b)||(a?b.s.endOfStream(a):b.s.endOfStream())}),0)})};q.
|
|
154
|
+
function xf(a,b,c,d,e,f){var g,h,k,l,m,n,p,r;return L(function(u){if(1==u.g){g=Ce;if(b==g.ba)return v(u,Ve(a.i,c,d,e),0);if(a.u[b])return v(u,Le(a.u[b],c),10);if(f)return a.i||pf(a,"text/vtt"),null==d&&null==e?a.C.init(c):(h=ce(a.C,c),h.length&&(k=a.j[g.Qa].timestampOffset,$e(a.i,h,d,e,k))),c=yf(a,c,d,b),v(u,zf(a,b,function(){a.j[b].appendBuffer(c)}),0);c=yf(a,c,d,b);return v(u,zf(a,b,function(){a.j[b].appendBuffer(c)}),0)}l=u.h;a.i||pf(a,"text/vtt");l.metadata&&(m=a.j[b].timestampOffset,a.L(l.metadata,
|
|
155
|
+
m,e));l.captions&&l.captions.length&&(n=a.j[g.Qa].timestampOffset,p=Ye(l.captions),$e(a.i,p,d,e,n));r=l.data;r=yf(a,r,d,b);return v(u,zf(a,b,function(){a.j[b].appendBuffer(r)}),0)})}function Af(a,b){var c=vf(a,"video")||0;Xe(a.i,b,c)}function Bf(a){a.i&&Xe(a.i,"",0)}q.remove=function(a,b,c){var d=this,e;return L(function(f){e=Ce;return a==e.ba?v(f,d.i.remove(b,c),0):v(f,zf(d,a,function(){c<=b?qf(d,a):d.j[a].remove(b,c)}),0)})};
|
|
156
|
+
function Cf(a,b){var c;return L(function(d){c=Ce;return b==c.ba?a.i?v(d,a.i.remove(0,Infinity),0):d["return"]():v(d,zf(a,b,function(){var e=a.s.duration;0>=e?qf(a,b):a.j[b].remove(0,e)}),0)})}q.flush=function(a){var b=this,c;return L(function(d){c=Ce;return a==c.ba?d["return"]():v(d,zf(b,a,function(){b.g.currentTime-=.001;qf(b,a)}),0)})};
|
|
157
|
+
function Df(a,b,c,d,e){var f;return L(function(g){f=Ce;return b==f.ba?(a.i.C=c,We(a.i,d,e),g["return"]()):v(g,Promise.all([zf(a,b,function(){var h=a.j[b].appendWindowStart,k=a.j[b].appendWindowEnd;a.j[b].abort();a.j[b].appendWindowStart=h;a.j[b].appendWindowEnd=k;qf(a,b)}),zf(a,b,function(){var h=c;0>h&&(h+=.001);a.j[b].timestampOffset=h;qf(a,b)}),zf(a,b,function(){a.j[b].appendWindowStart=0;a.j[b].appendWindowEnd=e;a.j[b].appendWindowStart=d;qf(a,b)})]),0)})}
|
|
158
|
+
q.endOfStream=function(a){var b=this;return L(function(c){return v(c,Ef(b,function(){sf(b)||(a?b.s.endOfStream(a):b.s.endOfStream())}),0)})};q.Ma=function(a){var b=this;return L(function(c){return v(c,Ef(b,function(){b.s.duration=a}),0)})};q.getDuration=function(){return this.s.duration};function qf(a,b){var c=a.l[b][0];c&&(c.p.resolve(),Ff(a,b))}function zf(a,b,c){bf(a.J);c={start:c,p:new De};a.l[b].push(c);1==a.l[b].length&&Gf(a,b);return c.p}
|
|
159
159
|
function Ef(a,b){var c,d,e,f,g,h;return L(function(k){switch(k.g){case 1:bf(a.J);c=[];d={};for(e in a.j)d.Lb=new De,f={start:function(l){return function(){return l.Lb.resolve()}}(d),p:d.Lb},a.l[e].push(f),c.push(d.Lb),1==a.l[e].length&&f.start(),d={Lb:d.Lb};B(k,2);return v(k,Promise.all(c),4);case 4:wa(k,3);break;case 2:throw g=F(k),g;case 3:try{b()}catch(l){throw new N(2,3,3015,l);}finally{for(h in a.j)Ff(a,h)}z(k)}})}function Ff(a,b){a.l[b].shift();Gf(a,b)}
|
|
160
160
|
function Gf(a,b){var c=a.l[b][0];if(c)try{c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new N(2,3,3017,b)):c.p.reject(new N(2,3,3015,d)),Ff(a,b)}}function yf(a,b,c,d){var e=a.g.mediaKeys;null==c&&e&&(cc()||ac())&&"mp4"==a.I[d].split(";")[0].split("/")[1]&&(b=pc(b));return b}var nf=window.URL.createObjectURL;function Hf(a,b){a=If(a);b=If(b);return a.split("-")[0]==b.split("-")[0]}function Jf(a,b){a=If(a);b=If(b);var c=a.split("-"),d=b.split("-");return c[0]==d[0]&&1==c.length&&2==d.length}function Kf(a,b){a=If(a);b=If(b);var c=a.split("-"),d=b.split("-");return 2==c.length&&2==d.length&&c[0]==d[0]}function If(a){var b=a.split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Lf.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a}function Mf(a,b){a=If(a);b=If(b);return b==a?4:Jf(b,a)?3:Kf(b,a)?2:Jf(a,b)?1:0}
|
|
161
161
|
function Nf(a){return a.language?If(a.language):a.audio&&a.audio.language?If(a.audio.language):a.video&&a.video.language?If(a.video.language):"und"}
|
|
@@ -170,707 +170,707 @@ function Sf(a){var b=0,c=new Map,d=a.size();df(a,function(e,f){for(var g=t(f),h=
|
|
|
170
170
|
function Uf(a){var b="";a.video&&(b=Qe(a.video.codecs));var c="";a.audio&&(c=Qe(a.audio.codecs));return b+"-"+c}function Vf(a,b,c){a.variants=a.variants.filter(function(d){return Wf(d,b,c)})}
|
|
171
171
|
function Wf(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&(!d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))||!d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))||a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0}
|
|
172
172
|
function Xf(a,b,c,d){return L(function(e){if(1==e.g)return d?v(e,$f(c,0<c.offlineSessionIds.length),2):(Yf(c,a),Zf(c),e.v(2));ag(b,c);bg(c);cg(c);z(e)})}function Yf(a,b){a.variants=a.variants.filter(function(c){return b&&b.L?dg(b,c)?!0:!1:!0})}
|
|
173
|
-
function $f(a,b){return L(function(c){if(1==c.g)return v(c,eg(a.variants,b,!1),2);a.variants=a.variants.filter(function(d){var e=d.video;if(
|
|
174
|
-
function Zf(a){a.variants=a.variants.filter(function(b){var c=b.audio;b=b.video;return c&&!
|
|
175
|
-
function eg(a,b,c){var d,e,f,g,h,k,l,m,n,p,r;return L(function(u){if(d=a.some(function(x){return x.decodingInfos.length}))return u["return"]();e=
|
|
173
|
+
function $f(a,b){return L(function(c){if(1==c.g)return v(c,eg(a.variants,b,!1),2);a.variants=a.variants.filter(function(d){var e=d.video;if(e){var f=fg(e.codecs);if(e.codecs.includes(",")){var g=e.codecs.split(",");f=ye("video",g);g=ye("audio",g);g=Ne(e.mimeType,g,"audio");if(!MediaSource.isTypeSupported(g))return!1}f=Ne(e.mimeType,f,"video");if(!MediaSource.isTypeSupported(f))return!1}if(f=d.audio)if(g=gg(f.codecs),f=Ne(f.mimeType,g,"audio"),!MediaSource.isTypeSupported(f))return!1;if(ac()&&e&&(e.width&&
|
|
174
|
+
1920<e.width||e.height&&1080<e.height)&&e.codecs.includes("avc1."))return ab(hg(d)),!1;(e=d.decodingInfos.some(function(h){return h.supported}))||ab(hg(d));return e});z(c)})}function Zf(a){a.variants=a.variants.filter(function(b){var c=b.audio;b=b.video;return c&&!of(c)||b&&!of(b)||ac()&&b&&(b.width&&1920<b.width||b.height&&1080<b.height)&&b.codecs.includes("avc1.")?!1:!0})}
|
|
175
|
+
function eg(a,b,c){var d,e,f,g,h,k,l,m,n,p,r;return L(function(u){if(d=a.some(function(x){return x.decodingInfos.length}))return u["return"]();e=navigator.mediaCapabilities;f=[];g=function(x,w){var y;return L(function(C){if(1==C.g)return B(C,2),v(C,e.decodingInfo(w),4);if(2!=C.g)return y=C.h,x.decodingInfos.push(y),wa(C,0);F(C);JSON.stringify(w);z(C)})};h=t(a);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=ig(l,b,c),n=t(m),p=n.next();!p.done;p=n.next())r=p.value,f.push(g(l,r));return v(u,Promise.all(f),
|
|
176
176
|
0)})}
|
|
177
|
-
function
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
function
|
|
183
|
-
function
|
|
177
|
+
function ig(a,b,c){var d=a.audio,e=a.video;c={type:c?"file":"media-source"};if(e){var f=e.codecs;if(e.codecs.includes(",")){var g=e.codecs.split(",");f=ye("video",g);f=fg(f);g=ye("audio",g);g=Ne(e.mimeType,g,"audio");c.audio={contentType:g,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1}}f=fg(f);f=Ne(e.mimeType,f,"video");c.video={contentType:f,width:e.width||1,height:e.height||1,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||1};if(e.hdr)switch(e.hdr){case "SDR":c.video.transferFunction="srgb";
|
|
178
|
+
break;case "PQ":c.video.transferFunction="pq";break;case "HLG":c.video.transferFunction="hlg"}}d&&(f=gg(d.codecs),f=Ne(d.mimeType,f,"audio"),c.audio={contentType:f,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});g=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[c];a=[];f=new Map;g=t(g);for(var h=g.next();!h.done;h=g.next()){var k=h.value;f.get(k.keySystem)||f.set(k.keySystem,[]);
|
|
179
|
+
f.get(k.keySystem).push(k)}g=b?"required":"optional";b=b?["persistent-license"]:["temporary"];k=t(f.keys());for(var l=k.next();!l.done;l=k.next()){var m=l.value;l=Object.assign({},c);var n=f.get(m);m={keySystem:m,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b};n=t(n);for(h=n.next();!h.done;h=n.next()){h=h.value;if(h.initData&&h.initData.length){for(var p=new Set,r=t(h.initData),u=r.next();!u.done;u=r.next())p.add(u.value.initDataType);m.initDataType=h.initData[0].initDataType}h.distinctiveIdentifierRequired&&
|
|
180
|
+
(m.distinctiveIdentifier="required");h.persistentStateRequired&&(m.persistentState="required");h.sessionType&&(m.sessionTypes=[h.sessionType]);d&&(m.audio?m.audio.robustness=m.audio.robustness||h.audioRobustness:m.audio={robustness:h.audioRobustness});e&&(m.video?m.video.robustness=m.video.robustness||h.videoRobustness:m.video={robustness:h.videoRobustness})}l.keySystemConfiguration=m;a.push(l)}return a}function gg(a){return cc()?"ac-3"==a.toLowerCase()?"ec-3":a:a}
|
|
181
|
+
function fg(a){return"vp9"==a?"vp09.00.10.08":a}function ag(a,b){b.variants=b.variants.filter(function(c){var d=c.audio;c=c.video;return d&&a&&a.audio&&!jg(d,a.audio)||c&&a&&a.video&&!jg(c,a.video)?!1:!0})}function bg(a){a.textStreams=a.textStreams.filter(function(b){return Te(Me(b.mimeType,b.codecs))})}function cg(a){a.imageStreams=a.imageStreams.filter(function(b){var c=["image/svg+xml","image/png","image/jpeg"];(bc("Web0S")||cc()||dc())&&c.push("image/webp");return c.includes(b.mimeType)})}
|
|
182
|
+
function jg(a,b){return a.mimeType!=b.mimeType||a.codecs.split(".")[0]!=b.codecs.split(".")[0]?!1:!0}
|
|
183
|
+
function kg(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=[];c&&g.push(c.mimeType);b&&g.push(b.mimeType);g=g[0]||null;var h=[];b&&h.push(b.kind);c&&h.push(c.kind);h=h[0]||null;var k=new Set;if(b)for(var l=t(b.roles),m=l.next();!m.done;m=l.next())k.add(m.value);if(c)for(l=t(c.roles),m=l.next();!m.done;m=l.next())k.add(m.value);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,kind:h,width:null,height:null,
|
|
184
184
|
frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:g,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(k),audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null};c&&(a.videoId=c.id,a.originalVideoId=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||
|
|
185
185
|
null,a.pixelAspectRatio=c.pixelAspectRatio||null,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a}
|
|
186
|
-
function
|
|
186
|
+
function lg(a){return{id:a.id,active:!1,type:Be,bandwidth:0,language:a.language,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:a.mimeType,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,forced:a.forced,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,
|
|
187
187
|
originalTextId:a.originalId,originalImageId:null}}
|
|
188
|
-
function
|
|
189
|
-
originalTextId:null,originalImageId:a.originalId}}function
|
|
190
|
-
function
|
|
191
|
-
function
|
|
188
|
+
function mg(a){return{id:a.id,active:!1,type:"image",bandwidth:a.bandwidth||0,language:"",label:null,kind:null,width:a.width||null,height:a.height||null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:a.mimeType,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:a.tilesLayout||null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,
|
|
189
|
+
originalTextId:null,originalImageId:a.originalId}}function ng(a){a.__shaka_id||(a.__shaka_id=og++);return a.__shaka_id}function pg(a){var b=qg(a);b.active=a.enabled;b.type="variant";b.originalAudioId=a.id;"main"==a.kind&&(b.primary=!0);a.kind&&(b.roles=[a.kind],b.audioRoles=[a.kind],b.label=a.label);return b}
|
|
190
|
+
function qg(a){return{id:ng(a),active:!1,type:"",bandwidth:0,language:If(a.language),label:a.label,kind:a.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],forced:!1,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null}}
|
|
191
|
+
function rg(a){return a.allowedByApplication&&a.allowedByKeySystem}function sg(a){return a.filter(function(b){return rg(b)})}
|
|
192
192
|
function Qf(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=t(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0==c.length)return a;e=c.filter(function(g){return g<=b});return e.length?d.get(Math.max.apply(Math,ka(e))):d.get(Math.min.apply(Math,ka(c)))}
|
|
193
|
-
function
|
|
194
|
-
|
|
195
|
-
function
|
|
196
|
-
q.chooseVariant=function(){var a=
|
|
197
|
-
q.disable=function(){this.i=!1};q.segmentDownloaded=function(a,b){var c=this.g;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.g+=b;
|
|
198
|
-
q.playbackRateChanged=function(a){this.m=a};q.configure=function(a){this.o=a};function
|
|
199
|
-
|
|
200
|
-
function
|
|
201
|
-
function
|
|
202
|
-
function
|
|
203
|
-
|
|
204
|
-
function
|
|
205
|
-
function
|
|
206
|
-
function
|
|
207
|
-
|
|
208
|
-
function
|
|
209
|
-
function
|
|
210
|
-
function
|
|
211
|
-
q.request=function(a,b){var c=this,d=new
|
|
212
|
-
var l=0;f.promise.then(function(){l=Date.now()},function(){});var m=g.ca(function(n){var p=Date.now()-l,r=n.response;r.timeMs+=k;r.timeMs+=p;n.kf||!c.j||r.fromCache||a!=
|
|
213
|
-
function
|
|
214
|
-
function
|
|
215
|
-
y&&(p=new P(function(){u=!0;w.abort()}),p.V(y/1E3));var C=c.retryParameters.stallTimeout;C&&(r=new P(function(){u=!0;w.abort()}));return w}).ca(function(w){p&&p.stop();r&&r.stop();void 0==w.timeMs&&(w.timeMs=Date.now()-x);return{response:w,kf:l}},function(w){p&&p.stop();r&&r.stop();if(a.i)return
|
|
216
|
-
return
|
|
217
|
-
|
|
218
|
-
function
|
|
219
|
-
function
|
|
220
|
-
function
|
|
221
|
-
function
|
|
222
|
-
v(C,eg(b,a.F,a.Y),2):(x=
|
|
223
|
-
q.Pb=function(a){var b=this,c,d;return L(function(e){if(1==e.g){if(!b.m)return b.h.wa(a,"encrypted",function(){b.l(new N(2,6,6010))}),e["return"]();b.g=a;b.h.wa(b.g,"play",function(){for(var f=t(b.I),g=f.next();!g.done;g=f.next())
|
|
224
|
-
c,2)}bf(b.J);
|
|
225
|
-
function
|
|
226
|
-
function
|
|
227
|
-
function
|
|
228
|
-
function
|
|
229
|
-
sessionTypes:g,label:e.keySystem,drmInfos:[]});c=t(b);for(e=c.next();!e.done;e=c.next())for(e=e.value,f=t([e.audio,e.video]),e=f.next();!e.done;e=f.next())if(g=e.value){var h=
|
|
193
|
+
function tg(a,b,c,d){var e=a,f=a.filter(function(k){return k.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(k){return k.language==g});if(b){var h=Of(If(b),a.map(function(k){return k.language}));h&&(e=a.filter(function(k){return If(k.language)==h}))}e=e.filter(function(k){return k.forced==d});if(c){if(a=ug(e,c),a.length)return a}else if(a=e.filter(function(k){return 0==k.roles.length}),a.length)return a;a=e.map(function(k){return k.roles}).reduce(Kb,[]);return a.length?
|
|
194
|
+
ug(e,a[0]):e}function ug(a,b){return a.filter(function(c){return c.roles.includes(b)})}function hg(a){var b=[];a.audio&&b.push(vg(a.audio));a.video&&b.push(vg(a.video));return b.join(", ")}
|
|
195
|
+
function vg(a){return"audio"==a.type?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:"video"==a.type?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}var og=0;function wg(){var a=this;this.j=null;this.i=!1;this.g=new Ta;navigator.connection&&navigator.connection.addEventListener("change",function(){if(a.o.useNetworkInformation&&a.i){a.g=new Ta;var b=a.chooseVariant();b&&a.j(b)}});this.h=[];this.m=1;this.s=!1;this.o=this.l=null}q=wg.prototype;q.stop=function(){this.j=null;this.i=!1;this.h=[];this.m=1;this.l=null};q.init=function(a){this.j=a};
|
|
196
|
+
q.chooseVariant=function(){var a=xg(this.o.restrictions,this.h),b=this.g.getBandwidthEstimate(yg(this));this.h.length&&!a.length&&(a=xg(null,this.h),a=[a[0]]);var c=a[0]||null;a=t(mb(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.item;var f=isNaN(this.m)?1:Math.abs(this.m);e=f*(e.next||{bandwidth:Infinity}).bandwidth/this.o.bandwidthUpgradeTarget;b>=f*d.bandwidth/this.o.bandwidthDowngradeTarget&&b<=e&&(c=d)}this.l=Date.now();return c};q.enable=function(){this.i=!0};
|
|
197
|
+
q.disable=function(){this.i=!1};q.segmentDownloaded=function(a,b){var c=this.g;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.g+=b;Ra(c.h,e,d);Ra(c.i,e,d)}if(null!=this.l&&this.i)a:{if(!this.s){if(!(128E3<=this.g.g))break a;this.s=!0}else if(Date.now()-this.l<1E3*this.o.switchInterval)break a;c=this.chooseVariant();this.g.getBandwidthEstimate(yg(this));c&&this.j(c)}};q.getBandwidthEstimate=function(){return this.g.getBandwidthEstimate(this.o.defaultBandwidthEstimate)};q.setVariants=function(a){this.h=a};
|
|
198
|
+
q.playbackRateChanged=function(a){this.m=a};q.configure=function(a){this.o=a};function yg(a){var b=a.o.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&a.o.useNetworkInformation&&(b=1E6*navigator.connection.downlink);return b}function xg(a,b){a&&(b=b.filter(function(c){return Wf(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})}M("shaka.abr.SimpleAbrManager",wg);wg.prototype.configure=wg.prototype.configure;
|
|
199
|
+
wg.prototype.playbackRateChanged=wg.prototype.playbackRateChanged;wg.prototype.setVariants=wg.prototype.setVariants;wg.prototype.getBandwidthEstimate=wg.prototype.getBandwidthEstimate;wg.prototype.segmentDownloaded=wg.prototype.segmentDownloaded;wg.prototype.disable=wg.prototype.disable;wg.prototype.enable=wg.prototype.enable;wg.prototype.chooseVariant=wg.prototype.chooseVariant;wg.prototype.init=wg.prototype.init;wg.prototype.stop=wg.prototype.stop;function zg(a,b){this.h=a;this.g=new Set([a]);b=b||[];for(var c=t(b),d=c.next();!d.done;d=c.next())this.add(d.value)}zg.prototype.add=function(a){return Ag(this.h,a)?(this.g.add(a),!0):!1};
|
|
200
|
+
function Ag(a,b){var c;if(!(c=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(c=a.audio&&b.audio)){c=a.audio;var d=b.audio;c=!((!(!c.channelsCount||!d.channelsCount||2<c.channelsCount||2<d.channelsCount)||c.channelsCount==d.channelsCount)&&Bg(c,d)&&Cg(c.roles,d.roles))}!c&&(c=a.video&&b.video)&&(c=a.video,d=b.video,c=!(Bg(c,d)&&Cg(c.roles,d.roles)));return c?!1:!0}zg.prototype.values=function(){return this.g.values()};
|
|
201
|
+
function Bg(a,b){if(a.mimeType!=b.mimeType)return!1;var c=a.codecs.split(",").map(function(g){return Qe(g)}),d=b.codecs.split(",").map(function(g){return Qe(g)});if(c.length!=d.length)return!1;c.sort();d.sort();for(var e=t(jb(c.length)),f=e.next();!f.done;f=e.next())if(f=f.value,c[f]!=d[f])return!1;return!0}
|
|
202
|
+
function Cg(a,b){var c=new Set(a),d=new Set(b);c["delete"]("main");d["delete"]("main");if(c.size!=d.size)return!1;c=t(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};function Dg(a){this.g=a;this.h=new Eg(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,"")}Dg.prototype.create=function(a){var b=this,c=a.filter(function(d){return Ag(b.g,d)});return c.length?new zg(c[0],c):this.h.create(a)};function Eg(a,b,c,d){this.i=a;this.j=b;this.g=c;this.h=void 0===d?"":d}
|
|
203
|
+
Eg.prototype.create=function(a){var b=[];b=Fg(a,this.i);var c=a.filter(function(d){return d.primary});b=b.length?b:c.length?c:a;a=Gg(b,this.j);a.length&&(b=a);this.g&&(a=Qf(b,this.g),a.length&&(b=a));this.h&&(a=Hg(b,this.h),a.length&&(b=a));a=new zg(b[0]);b=t(b);for(c=b.next();!c.done;c=b.next())c=c.value,Ag(a.h,c)&&a.add(c);return a};function Fg(a,b){var c=If(b),d=Of(c,a.map(function(e){return Nf(e)}));return d?a.filter(function(e){return d==Nf(e)}):[]}
|
|
204
|
+
function Gg(a,b){return a.filter(function(c){return c.audio?b?c.audio.roles.includes(b):0==c.audio.roles.length:!1})}function Hg(a,b){return a.filter(function(c){return c.audio?c.audio.label.toLowerCase()==b.toLowerCase():!1})};function Ig(){this.g=Jg;this.h=(new Map).set(Jg,2).set(Kg,1)}function Lg(a,b,c){a.h.set(Jg,c).set(Kg,b)}var Kg=0,Jg=1;function Mg(a,b){var c=Ng();this.l=null==a.maxAttempts?c.maxAttempts:a.maxAttempts;this.j=null==a.baseDelay?c.baseDelay:a.baseDelay;this.s=null==a.fuzzFactor?c.fuzzFactor:a.fuzzFactor;this.m=null==a.backoffFactor?c.backoffFactor:a.backoffFactor;this.g=0;this.h=this.j;if(this.i=void 0===b?!1:b)this.g=1}
|
|
205
|
+
function Og(a){var b,c;return L(function(d){if(1==d.g){if(a.g>=a.l)if(a.i)a.g=1,a.h=a.j;else throw new N(2,7,1010);b=a.g;a.g++;if(0==b)return d["return"]();c=a.h*(1+(2*Math.random()-1)*a.s);return v(d,new Promise(function(e){(new P(e)).V(c/1E3)}),2)}a.h*=a.m;z(d)})}function Ng(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}};function Pg(a,b){this.promise=a;this.i=b;this.g=!1}function Qg(a){return new Pg(Promise.reject(a),function(){return Promise.resolve()})}function Rg(){var a=Promise.reject(new N(2,7,7001));a["catch"](function(){});return new Pg(a,function(){return Promise.resolve()})}function Sg(a){return new Pg(Promise.resolve(a),function(){return Promise.resolve()})}function Tg(a){return new Pg(a,function(){return a["catch"](function(){})})}Pg.prototype.abort=function(){this.g=!0;return this.i()};
|
|
206
|
+
function Ug(a){return new Pg(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}Pg.prototype["finally"]=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};
|
|
207
|
+
Pg.prototype.ca=function(a,b){function c(h){return function(k){if(e.g&&h)f.reject(g);else{var l=h?a:b;l?d=Vg(l,k,f):(h?f.resolve:f.reject)(k)}}}function d(){f.reject(g);return e.abort()}var e=this,f=new De,g=new N(2,7,7001);this.promise.then(c(!0),c(!1));return new Pg(f,function(){return d()})};
|
|
208
|
+
function Vg(a,b,c){try{var d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){},function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}}M("shaka.util.AbortableOperation",Pg);Pg.prototype.chain=Pg.prototype.ca;Pg.prototype["finally"]=Pg.prototype["finally"];Pg.all=Ug;Pg.prototype.abort=Pg.prototype.abort;Pg.notAbortable=Tg;Pg.completed=Sg;Pg.aborted=Rg;Pg.failed=Qg;function R(a,b){if(b)if(b instanceof Map)for(var c=t(b.keys()),d=c.next();!d.done;d=c.next())d=d.value,Object.defineProperty(this,d,{value:b.get(d),writable:!0,enumerable:!0});else for(c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});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.g=!1}
|
|
209
|
+
function Wg(a){var b=new R(a.type),c;for(c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}R.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};R.prototype.stopImmediatePropagation=function(){this.g=!0};R.prototype.stopPropagation=function(){};M("shaka.util.FakeEvent",R);function Xg(){this.sc=new cf;this.rc=this}Xg.prototype.addEventListener=function(a,b){this.sc.push(a,b)};Xg.prototype.removeEventListener=function(a,b){this.sc.remove(a,b)};Xg.prototype.dispatchEvent=function(a){var b=this.sc.get(a.type)||[],c=this.sc.get("All");c&&(b=b.concat(c));b=t(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.rc;a.currentTarget=this.rc;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.g)break}return a.defaultPrevented};function Yg(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||d.buffer&&d.buffer.constructor==ArrayBuffer)return d;if(c.has(d))return null;var e=d.constructor==Array;if(d.constructor!=Object&&!e)return null;c.add(d);var f=e?[]:{},g;for(g in d)f[g]=b(d[g]);e&&(f.length=d.length);return f}}var c=new Set;return b(a)}function Zg(a){var b={},c;for(c in a)b[c]=a[c];return b};function $g(){this.g=[]}function ah(a,b){a.g.push(b["finally"](function(){uc(a.g,b)}))}$g.prototype.destroy=function(){for(var a=[],b=t(this.g),c=b.next();!c.done;c=b.next())c=c.value,c.promise["catch"](function(){}),a.push(c.abort());this.g=[];return Promise.all(a)};function bh(a){Xg.call(this);this.i=!1;this.l=new $g;this.g=new Set;this.h=new Set;this.j=a||null;this.m=!1}ra(bh,Xg);q=bh.prototype;q.Ld=function(a){this.m=a};function ch(a,b,c,d){c=c||dh;var e=eh[a];if(!e||c>=e.priority)eh[a]={priority:c,uf:b,wf:void 0===d?!1:d}}q.xf=function(a){this.g.add(a)};q.Of=function(a){this.g["delete"](a)};q.Ie=function(){this.g.clear()};q.yf=function(a){this.h.add(a)};q.Pf=function(a){this.h["delete"](a)};q.Je=function(){this.h.clear()};
|
|
210
|
+
function fh(a,b,c){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,streamDataCallback:void 0===c?null:c}}q.destroy=function(){this.i=!0;this.g.clear();this.h.clear();return this.l.destroy()};
|
|
211
|
+
q.request=function(a,b){var c=this,d=new gh;if(this.i){var e=Promise.reject(new N(2,7,7001));e["catch"](function(){});return new hh(e,function(){return Promise.resolve()},d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Yg(b.retryParameters):Ng();b.uris=Yg(b.uris);e=ih(this,a,b);var f=e.ca(function(){return jh(c,a,b,new Mg(b.retryParameters,!1),0,null,d)}),g=f.ca(function(n){return kh(c,a,n)}),h=Date.now(),k=0;e.promise.then(function(){k=Date.now()-h},function(){});
|
|
212
|
+
var l=0;f.promise.then(function(){l=Date.now()},function(){});var m=g.ca(function(n){var p=Date.now()-l,r=n.response;r.timeMs+=k;r.timeMs+=p;n.kf||!c.j||r.fromCache||a!=lh||c.j(r.timeMs,r.data.byteLength);return r},function(n){n&&(n.severity=2);throw n;});e=new hh(m.promise,function(){return m.abort()},d);ah(this.l,e);return e};
|
|
213
|
+
function ih(a,b,c){var d=Sg(void 0),e={};a=t(a.g);for(var f=a.next();!f.done;e={Zc:e.Zc},f=a.next())e.Zc=f.value,d=d.ca(function(g){return function(){c.body&&(c.body=rb(c.body));return g.Zc(b,c)}}(e));return d.ca(void 0,function(g){if(g instanceof N&&7001==g.code)throw g;throw new N(2,1,1006,g);})}
|
|
214
|
+
function jh(a,b,c,d,e,f,g){a.m&&(c.uris[e]=c.uris[e].replace("http://","https://"));var h=new je(c.uris[e]),k=h.Ga,l=!1;k||(k=location.protocol,k=k.slice(0,-1),ke(h,k),c.uris[e]=h.toString());k=k.toLowerCase();var m=(k=eh[k])?k.uf:null;if(!m)return Qg(new N(2,1,1E3,h));var n=k.wf,p=null,r=null,u=!1,x;return Tg(Og(d)).ca(function(){if(a.i)return Rg();x=Date.now();var w=m(c.uris[e],c,b,function(D,A,E){p&&p.stop();r&&r.V(C/1E3);a.j&&b==lh&&(a.j(D,A),l=!0,g.g=E)});if(!n)return w;var y=c.retryParameters.connectionTimeout;
|
|
215
|
+
y&&(p=new P(function(){u=!0;w.abort()}),p.V(y/1E3));var C=c.retryParameters.stallTimeout;C&&(r=new P(function(){u=!0;w.abort()}));return w}).ca(function(w){p&&p.stop();r&&r.stop();void 0==w.timeMs&&(w.timeMs=Date.now()-x);return{response:w,kf:l}},function(w){p&&p.stop();r&&r.stop();if(a.i)return Rg();u&&(w=new N(1,1,1003,c.uris[e],b));if(w instanceof N){if(7001==w.code)throw w;if(1010==w.code)throw f;if(1==w.severity){var y=(new Map).set("error",w);y=new R("retry",y);a.dispatchEvent(y);e=(e+1)%c.uris.length;
|
|
216
|
+
return jh(a,b,c,d,e,w,g)}}throw w;})}function kh(a,b,c){var d=Sg(void 0),e={};a=t(a.h);for(var f=a.next();!f.done;e={$c:e.$c},f=a.next())e.$c=f.value,d=d.ca(function(g){return function(){var h=c.response;h.data&&(h.data=rb(h.data));return g.$c(b,h)}}(e));return d.ca(function(){return c},function(g){var h=2;if(g instanceof N){if(7001==g.code)throw g;h=g.severity}throw new N(h,1,1007,g);})}M("shaka.net.NetworkingEngine",bh);bh.prototype.request=bh.prototype.request;bh.prototype.destroy=bh.prototype.destroy;
|
|
217
|
+
bh.makeRequest=fh;bh.defaultRetryParameters=function(){return Ng()};bh.prototype.clearAllResponseFilters=bh.prototype.Je;bh.prototype.unregisterResponseFilter=bh.prototype.Pf;bh.prototype.registerResponseFilter=bh.prototype.yf;bh.prototype.clearAllRequestFilters=bh.prototype.Ie;bh.prototype.unregisterRequestFilter=bh.prototype.Of;bh.prototype.registerRequestFilter=bh.prototype.xf;bh.unregisterScheme=function(a){delete eh[a]};bh.registerScheme=ch;bh.prototype.setForceHTTPS=bh.prototype.Ld;
|
|
218
|
+
function gh(){this.g=0}bh.NumBytesRemainingClass=gh;function hh(a,b,c){Pg.call(this,a,b);this.h=c}ra(hh,Pg);bh.PendingRequest=hh;var lh=1;bh.RequestType={MANIFEST:0,SEGMENT:lh,LICENSE:2,APP:3,TIMING:4};var dh=3;bh.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:dh};var eh={};function mh(){}function nh(a){a=zb(a);return(new je(a)).Ia}function oh(a,b,c){function d(h){tb(f).setUint32(g,h.byteLength,!0);g+=4;f.set(qb(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new N(2,6,6015);var e;"string"==typeof b?e=Bb(b,!0):e=b;a=zb(a);a=Bb(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}M("shaka.util.FairPlayUtils",mh);mh.initDataTransform=oh;mh.defaultGetContentId=nh;function ph(a){for(var b=new Map,c=t(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function qh(a){var b={};a.forEach(function(c,d){b[d]=c});return b}function rh(a,b){if(a||b){if(a&&!b||b&&!a)return!1}else return!0;if(a.size!=b.size)return!1;for(var c=t(a),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;if(!b.has(d))return!1;d=b.get(d);if(d!=e||void 0==d)return!1}return!0};function sh(a,b){var c=this;b=void 0===b?1:b;this.D=a;this.u=new Set;this.g=this.m=null;this.qa=this.L=!1;this.H=0;this.i=null;this.h=new ef;this.j=new Map;this.C=[];this.s=new De;this.o=null;this.l=function(d){c.s.reject(d);a.onError(d)};this.ra=new Map;this.ea=new Map;this.T=new P(function(){return th(c)});this.F=!1;this.I=[];this.O=!1;this.pa=(new P(function(){uh(c)})).Da(b);this.s["catch"](function(){});this.J=new af(function(){return vh(c)});this.Y=!1}q=sh.prototype;q.destroy=function(){return this.J.destroy()};
|
|
219
|
+
function vh(a){return L(function(b){switch(b.g){case 1:return a.h.release(),a.h=null,a.s.reject(),a.pa.stop(),a.pa=null,a.T.stop(),a.T=null,v(b,wh(a),2);case 2:if(!a.g){b.v(3);break}B(b,4);return v(b,a.g.setMediaKeys(null),6);case 6:wa(b,5);break;case 4:F(b);case 5:a.g=null;case 3:a.i=null,a.u.clear(),a.m=null,a.C=[],a.o=null,a.l=function(){},a.D=null,a.Y=!1,z(b)}})}q.configure=function(a){this.o=a};function xh(a,b,c,d){a.qa=!0;a.C=[];a.F=c;return yh(a,b,!!d)}
|
|
220
|
+
function zh(a,b,c,d){a.C=c;a.F=0<c.length;return yh(a,b,!!d)}function Ah(a,b,c,d,e,f){var g=new Map;e={audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:b};e.drmInfos=[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}];g.set(b,e);return Bh(a,g,[],!1)}
|
|
221
|
+
function yh(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,x,w,y;return L(function(C){if(1==C.g){if(d=Ch(a))for(e=t(b),f=e.next();!f.done;f=e.next())g=f.value,g.video&&(g.video.drmInfos=[d]),g.audio&&(g.audio.drmInfos=[d]);h=b.some(function(D){return D.video&&D.video.drmInfos.length||D.audio&&D.audio.drmInfos.length?!0:!1});h||(k=ph(a.o.servers),Dh(b,k));l=t(b);for(f=l.next();!f.done;f=l.next())for(m=f.value,n=Eh(m),p=t(n),r=p.next();!r.done;r=p.next())u=r.value,Fh(u,ph(a.o.servers),ph(a.o.advanced||{}));return c?
|
|
222
|
+
v(C,eg(b,a.F,a.Y),2):(x=Gh(a,b),C.v(2))}w=h||Object.keys(a.o.servers).length;if(!w)return a.L=!0,C["return"](Promise.resolve());y=Bh(a,x,b,c);return C["return"](h?y:y["catch"](function(){}))})}
|
|
223
|
+
q.Pb=function(a){var b=this,c,d;return L(function(e){if(1==e.g){if(!b.m)return b.h.wa(a,"encrypted",function(){b.l(new N(2,6,6010))}),e["return"]();b.g=a;b.h.wa(b.g,"play",function(){for(var f=t(b.I),g=f.next();!g.done;g=f.next())Hh(b,g.value);b.O=!0;b.I=[]});"webkitCurrentPlaybackTargetIsWireless"in b.g&&b.h.B(b.g,"webkitcurrentplaybacktargetiswirelesschanged",function(){return wh(b)});c=b.g.setMediaKeys(b.m);c=c["catch"](function(f){return Promise.reject(new N(2,6,6003,f.message))});return v(e,
|
|
224
|
+
c,2)}bf(b.J);Ih(b);b.i.initData.length||b.C.length||(d=function(f){return Jh(b,f.initDataType,qb(f.initData))},b.h.B(b.g,"encrypted",d));z(e)})};function Kh(a){var b;return L(function(c){if(1==c.g){if(!(a.m&&a.i&&a.i.serverCertificate&&a.i.serverCertificate.length))return c.v(0);B(c,3);return v(c,a.m.setServerCertificate(a.i.serverCertificate),5)}if(3!=c.g)return wa(c,0);b=F(c);throw new N(2,6,6004,b.message);})}
|
|
225
|
+
function Lh(a,b){var c,d,e;return L(function(f){if(1==f.g)return v(f,Ph(a,b),2);if(3!=f.g){c=f.h;if(!c)return f["return"]();d=[];if(e=a.j.get(c))e.Na=new De,d.push(e.Na);d.push(c.remove());return v(f,Promise.all(d),3)}a.j["delete"](c);z(f)})}function Ih(a){for(var b=(a.i?a.i.initData:[])||[],c=t(b),d=c.next();!d.done;d=c.next())d=d.value,Jh(a,d.initDataType,d.initData);c=t(a.C);for(d=c.next();!d.done;d=c.next())Ph(a,d.value);b.length||a.C.length||a.s.resolve();return a.s}
|
|
226
|
+
function Jh(a,b,c){var d=a.j.values();d=t(d);for(var e=d.next();!e.done;e=d.next())if(ob(c,e.value.initData)&&!bc("Tizen 2"))return;Qh(a,b,c)}function Rh(a){return a?a.keySystem:""}function Sh(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function Th(a,b){if(navigator.userAgent.match(/Edge\//))return!0;b=b.toLowerCase();if(cc()&&b.includes('codecs="ac-3"')){var c=b.replace("ac-3","ec-3");return a.u.has(b)||a.u.has(c)}return a.u.has(b)}
|
|
227
|
+
function Uh(a){a=a.j.keys();a=gb(a,function(b){return b.sessionId});return Array.from(a)}q.Tb=function(){var a=Infinity,b=this.j.keys();b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a};q.Bc=function(){return qh(this.ea)};
|
|
228
|
+
function Gh(a,b){for(var c=new Set,d=t(b),e=d.next();!e.done;e=d.next()){var f=t(Eh(e.value));for(e=f.next();!e.done;e=f.next())c.add(e.value)}d=t(c);for(e=d.next();!e.done;e=d.next())Fh(e.value,ph(a.o.servers),ph(a.o.advanced||{}));f=a.F?"required":"optional";var g=a.F?["persistent-license"]:["temporary"];d=new Map;c=t(c);for(e=c.next();!e.done;e=c.next())e=e.value,d.set(e.keySystem,{initDataTypes:["cenc"],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:f,
|
|
229
|
+
sessionTypes:g,label:e.keySystem,drmInfos:[]});c=t(b);for(e=c.next();!e.done;e=c.next())for(e=e.value,f=t([e.audio,e.video]),e=f.next();!e.done;e=f.next())if(g=e.value){var h=Vh(g),k=null;"ac-3"==g.codecs.toLowerCase()&&cc()&&(k=Vh(g,"ec-3"));var l=t(g.drmInfos);for(e=l.next();!e.done;e=l.next()){var m=e.value;e=d.get(m.keySystem);e.drmInfos.push(m);m.initData&&m.initData.length&&(e.initDataTypes=[].concat(ka(new Set(m.initData.map(function(p){return p.initDataType})))));m.distinctiveIdentifierRequired&&
|
|
230
230
|
(e.distinctiveIdentifier="required");m.persistentStateRequired&&(e.persistentState="required");m.sessionType&&(e.sessionTypes=[m.sessionType]);m="audio"==g.type?m.audioRobustness:m.videoRobustness;var n={robustness:m||"",contentType:h};"audio"==g.type?e.audioCapabilities.push(n):e.videoCapabilities.push(n);k&&(m={robustness:m||"",contentType:k},"audio"==g.type?e.audioCapabilities.push(m):e.videoCapabilities.push(m))}}return d}
|
|
231
|
-
function
|
|
232
|
-
function
|
|
233
|
-
D.value;if(H.supported&&H.keySystemAccess){D=e.get(H.keySystemAccess.keySystem);var J=t(D);for(D=J.next();!D.done;D=J.next())if(!!D.value.licenseServerUri==A){f=H.keySystemAccess;break a}}}}f=null}y.v(2);break}return v(y,
|
|
234
|
-
r.next())u=n.value,a.u.add(u.contentType.toLowerCase());if(d){A=g.keySystem;C=e.get(g.keySystem);E=[];D=[];G=[];H=new Set;
|
|
235
|
-
C.next();!E.done;E=C.next())E=E.value,E.distinctiveIdentifierRequired&&(A.distinctiveIdentifierRequired=E.distinctiveIdentifierRequired),E.persistentStateRequired&&(A.persistentStateRequired=E.persistentStateRequired);C=A}else C=g.keySystem,A=b.get(g.keySystem),E=[],D=[],G=[],H=new Set,
|
|
236
|
-
audioRobustness:(A.audioCapabilities?A.audioCapabilities[0].robustness:"")||"",videoRobustness:(A.videoCapabilities?A.videoCapabilities[0].robustness:"")||"",serverCertificate:D[0],initData:G,keyIds:H};a.i=C;if(!a.i.licenseServerUri)throw new N(2,6,6012,a.i.keySystem);return v(y,g.createMediaKeys(),6);case 6:return x=y.h,bf(a.J),a.m=x,a.L=!0,v(y,
|
|
237
|
-
function
|
|
231
|
+
function Vh(a,b){var c=Me(a.mimeType,b||a.codecs);return Ie(c)?Ke(a.type,c):c}
|
|
232
|
+
function Bh(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,x,w;return L(function(y){switch(y.g){case 1:e=new Map;if(d){a:{for(var C=t(c),D=C.next();!D.done;D=C.next()){var A=t(Eh(D.value));for(D=A.next();!D.done;D=A.next()){var E=D.value;e.has(E.keySystem)||e.set(E.keySystem,[]);e.get(E.keySystem).push(E)}}if(1==e.size&&e.has(""))throw new N(2,6,6E3);C=t([!0,!1]);for(A=C.next();!A.done;A=C.next())for(A=A.value,E=t(c),D=E.next();!D.done;D=E.next()){var G=t(D.value.decodingInfos);for(D=G.next();!D.done;D=G.next()){var H=
|
|
233
|
+
D.value;if(H.supported&&H.keySystemAccess){D=e.get(H.keySystemAccess.keySystem);var J=t(D);for(D=J.next();!D.done;D=J.next())if(!!D.value.licenseServerUri==A){f=H.keySystemAccess;break a}}}}f=null}y.v(2);break}return v(y,Wh(a,b),3);case 3:f=y.h;case 2:g=f;if(!g)throw new N(2,6,6001);bf(a.J);B(y,4);a.u.clear();h=g.getConfiguration();k=h.audioCapabilities||[];l=h.videoCapabilities||[];m=t(k);for(n=m.next();!n.done;n=m.next())p=n.value,a.u.add(p.contentType.toLowerCase());r=t(l);for(n=r.next();!n.done;n=
|
|
234
|
+
r.next())u=n.value,a.u.add(u.contentType.toLowerCase());if(d){A=g.keySystem;C=e.get(g.keySystem);E=[];D=[];G=[];H=new Set;Xh(C,E,D,G,H);J=a.F?"persistent-license":"temporary";A={keySystem:A,licenseServerUri:E[0],distinctiveIdentifierRequired:C[0].distinctiveIdentifierRequired,persistentStateRequired:C[0].persistentStateRequired,sessionType:C[0].sessionType||J,audioRobustness:C[0].audioRobustness||"",videoRobustness:C[0].videoRobustness||"",serverCertificate:D[0],initData:G,keyIds:H};C=t(C);for(E=
|
|
235
|
+
C.next();!E.done;E=C.next())E=E.value,E.distinctiveIdentifierRequired&&(A.distinctiveIdentifierRequired=E.distinctiveIdentifierRequired),E.persistentStateRequired&&(A.persistentStateRequired=E.persistentStateRequired);C=A}else C=g.keySystem,A=b.get(g.keySystem),E=[],D=[],G=[],H=new Set,Xh(A.drmInfos,E,D,G,H),C={keySystem:C,licenseServerUri:E[0],distinctiveIdentifierRequired:"required"==A.distinctiveIdentifier,persistentStateRequired:"required"==A.persistentState,sessionType:A.sessionTypes[0]||"temporary",
|
|
236
|
+
audioRobustness:(A.audioCapabilities?A.audioCapabilities[0].robustness:"")||"",videoRobustness:(A.videoCapabilities?A.videoCapabilities[0].robustness:"")||"",serverCertificate:D[0],initData:G,keyIds:H};a.i=C;if(!a.i.licenseServerUri)throw new N(2,6,6012,a.i.keySystem);return v(y,g.createMediaKeys(),6);case 6:return x=y.h,bf(a.J),a.m=x,a.L=!0,v(y,Kh(a),7);case 7:bf(a.J);wa(y,0);break;case 4:w=F(y);bf(a.J,w);a.i=null;a.u.clear();if(w instanceof N)throw w;throw new N(2,6,6002,w.message);}})}
|
|
237
|
+
function Wh(a,b){var c,d,e,f,g,h,k,l,m,n,p,r;return L(function(u){switch(u.g){case 1:if(1==b.size&&b.has(""))throw new N(2,6,6E3);d=t(b.values());for(e=d.next();!e.done;e=d.next())f=e.value,0==f.audioCapabilities.length&&delete f.audioCapabilities,0==f.videoCapabilities.length&&delete f.videoCapabilities;g=t([!0,!1]);h=g.next();case 2:if(h.done){u.v(4);break}k=h.value;l=t(b.keys());m=l.next();case 5:if(m.done){h=g.next();u.v(2);break}n=m.value;p=b.get(n);r=p.drmInfos.some(function(x){return!!x.licenseServerUri});
|
|
238
238
|
if(r!=k){u.v(6);break}B(u,8);return v(u,navigator.requestMediaKeySystemAccess(n,[p]),10);case 10:return c=u.h,u["return"](c);case 8:F(u);case 9:bf(a.J);case 6:m=l.next();u.v(5);break;case 4:return u["return"](c)}})}
|
|
239
|
-
function
|
|
239
|
+
function Ch(a){a=ph(a.o.clearKeys);if(0==a.size)return null;var b=[],c=[];a.forEach(function(e,f){var g=mc(f),h=mc(e);g={kty:"oct",kid:kc(g,!1),k:kc(h,!1)};b.push(g);c.push(g.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:qb(Ab(d)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,
|
|
240
240
|
sessionType:"",initData:d,keyIds:new Set(c)}}
|
|
241
|
-
function
|
|
242
|
-
if(!f)return a.j["delete"](c),a.l(new N(2,6,6013)),h["return"](Promise.resolve());e.loaded=!0;
|
|
243
|
-
function
|
|
244
|
-
var g=f.errorCode;if(g&&g.systemCode){var h=g.systemCode;0>h&&(h+=Math.pow(2,32));h="0x"+h.toString(16)}a.l(new N(2,6,6006,f.message,f,h))}})}function
|
|
245
|
-
function
|
|
246
|
-
l.promise,4);case 4:k=w.h;wa(w,3);break;case 2:return m=F(w),n=new N(2,6,6007,m),a.l(n),d&&d.
|
|
247
|
-
x.V(
|
|
248
|
-
function
|
|
249
|
-
|
|
250
|
-
function
|
|
251
|
-
c],f=new Map,g=function(l){var m,n,p;return L(function(r){switch(r.g){case 1:return B(r,2),v(r,navigator.requestMediaKeySystemAccess(l,e),4);case 4:return m=r.h,p=(n=m.getConfiguration().sessionTypes)?n.includes("persistent-license"):!1,bc("Tizen 3")&&(p=!1),f.set(l,{persistentState:p}),v(r,m.createMediaKeys(),5);case 5:wa(r,0);break;case 2:F(r),f.set(l,null),z(r)}})},h=a.map(function(l){return g(l)}),v(k,Promise.all(h),2)):k["return"](
|
|
252
|
-
function
|
|
253
|
-
function
|
|
254
|
-
function dg(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=
|
|
255
|
-
function
|
|
241
|
+
function Ph(a,b){var c,d,e,f,g;return L(function(h){switch(h.g){case 1:try{c=a.m.createSession("persistent-license")}catch(k){return d=new N(2,6,6005,k.message),a.l(d),h["return"](Promise.reject(d))}a.h.B(c,"message",function(k){a.g&&a.o.delayLicenseRequestUntilPlayed&&a.g.paused&&!a.O?a.I.push(k):Hh(a,k)});a.h.B(c,"keystatuseschange",function(k){return Yh(a,k)});e={initData:null,loaded:!1,zd:Infinity,Na:null,type:"persistent-license"};a.j.set(c,e);B(h,2);return v(h,c.load(b),4);case 4:f=h.h;bf(a.J);
|
|
242
|
+
if(!f)return a.j["delete"](c),a.l(new N(2,6,6013)),h["return"](Promise.resolve());e.loaded=!0;Zh(a)&&a.s.resolve();return h["return"](c);case 2:g=F(h),bf(a.J,g),a.j["delete"](c),a.l(new N(2,6,6005,g.message));case 3:return h["return"](Promise.resolve())}})}
|
|
243
|
+
function Qh(a,b,c){var d=a.i.sessionType;try{var e=a.m.createSession(d)}catch(f){a.l(new N(2,6,6005,f.message));return}a.h.B(e,"message",function(f){a.g&&a.o.delayLicenseRequestUntilPlayed&&a.g.paused&&!a.O?a.I.push(f):Hh(a,f)});a.h.B(e,"keystatuseschange",function(f){return Yh(a,f)});a.j.set(e,{initData:c,loaded:!1,zd:Infinity,Na:null,type:d});try{c=a.o.initDataTransform(c,b,a.i)}catch(f){b=f;f instanceof N||(b=new N(2,6,6016,f));a.l(b);return}a.o.logLicenseExchange&&kc(c);e.generateRequest(b,c)["catch"](function(f){if(!a.J.g){a.j["delete"](e);
|
|
244
|
+
var g=f.errorCode;if(g&&g.systemCode){var h=g.systemCode;0>h&&(h+=Math.pow(2,32));h="0x"+h.toString(16)}a.l(new N(2,6,6006,f.message,f,h))}})}function $h(a,b,c){"skd"==b&&(b=c.serverCertificate,c=nh(a),a=oh(a,c,b));return a}
|
|
245
|
+
function Hh(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,x;L(function(w){switch(w.g){case 1:return c=b.target,a.o.logLicenseExchange&&kc(b.message),d=a.j.get(c),e=a.i.licenseServerUri,f=a.o.advanced[a.i.keySystem],"individualization-request"==b.messageType&&f&&f.individualizationServer&&(e=f.individualizationServer),g=fh([e],a.o.retryParameters),g.body=b.message,g.method="POST",g.licenseRequestType=b.messageType,g.sessionId=c.sessionId,Sh(a.i.keySystem)&&ai(g),h=Date.now(),B(w,2),l=a.D.Cb.request(2,g),v(w,
|
|
246
|
+
l.promise,4);case 4:k=w.h;wa(w,3);break;case 2:return m=F(w),n=new N(2,6,6007,m),a.l(n),d&&d.Na&&d.Na.reject(n),w["return"]();case 3:if(a.J.g)return w["return"]();a.H+=(Date.now()-h)/1E3;a.o.logLicenseExchange&&kc(k.data);B(w,5);return v(w,c.update(k.data),7);case 7:wa(w,6);break;case 5:return p=F(w),r=new N(2,6,6008,p.message),a.l(r),d&&d.Na&&d.Na.reject(r),w["return"]();case 6:u=new R("drmsessionupdate"),a.D.onEvent(u),d&&(d.Na&&d.Na.resolve(),x=new P(function(){d.loaded=!0;Zh(a)&&a.s.resolve()}),
|
|
247
|
+
x.V(bi)),z(w)}})}function ai(a){var b=xb(a.body,!0,!0);if(b.includes("PlayReadyKeyMessage")){b=(new DOMParser).parseFromString(b,"application/xml");for(var c=t(b.getElementsByTagName("HttpHeader")),d=c.next();!d.done;d=c.next())d=d.value,a.headers[d.getElementsByTagName("name")[0].textContent]=d.getElementsByTagName("value")[0].textContent;a.body=lc(b.getElementsByTagName("Challenge")[0].textContent)}else a.headers["Content-Type"]="text/xml; charset=utf-8"}
|
|
248
|
+
function Yh(a,b){var c=b.target,d=a.j.get(c),e=!1;c.keyStatuses.forEach(function(g,h){if("string"==typeof h){var k=h;h=g;g=k}if(Sh(a.i.keySystem)&&16==h.byteLength&&navigator.userAgent.match(/Edge?\//)){k=tb(h);var l=k.getUint32(0,!0),m=k.getUint16(4,!0),n=k.getUint16(6,!0);k.setUint32(0,l,!1);k.setUint16(4,m,!1);k.setUint16(6,n,!1)}"status-pending"!=g&&(d.loaded=!0);"expired"==g&&(e=!0);k=nc(h);a.ra.set(k,g)});var f=c.expiration-Date.now();(0>f||e&&1E3>f)&&d&&!d.Na&&(a.j["delete"](c),c.close()["catch"](function(){}));
|
|
249
|
+
Zh(a)&&(a.s.resolve(),a.T.V(ci))}function th(a){var b=a.ra,c=a.ea;c.clear();b.forEach(function(d,e){return c.set(e,d)});b=Array.from(c.values());b.length&&b.every(function(d){return"expired"==d})&&a.l(new N(2,6,6014));a.D.Ic(qh(c))}
|
|
250
|
+
function di(){var a,b,c,d,e,f,g,h;return L(function(k){return 1==k.g?(a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.recommendation com.apple.fps.3_0 com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" "),b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],c={initDataTypes:["cenc"],videoCapabilities:b},d={videoCapabilities:b,persistentState:"required",sessionTypes:["persistent-license"]},e=[d,
|
|
251
|
+
c],f=new Map,g=function(l){var m,n,p;return L(function(r){switch(r.g){case 1:return B(r,2),v(r,navigator.requestMediaKeySystemAccess(l,e),4);case 4:return m=r.h,p=(n=m.getConfiguration().sessionTypes)?n.includes("persistent-license"):!1,bc("Tizen 3")&&(p=!1),f.set(l,{persistentState:p}),v(r,m.createMediaKeys(),5);case 5:wa(r,0);break;case 2:F(r),f.set(l,null),z(r)}})},h=a.map(function(l){return g(l)}),v(k,Promise.all(h),2)):k["return"](qh(f))})}
|
|
252
|
+
function ei(a){var b;return L(function(c){if(1==c.g)return b=new Promise(function(d,e){(new P(e)).V(fi)}),B(c,2),v(c,Promise.race([Promise.all([a.close(),a.closed]),b]),4);if(2!=c.g)return wa(c,0);F(c);z(c)})}
|
|
253
|
+
function wh(a){var b;return L(function(c){b=Array.from(a.j.entries());a.j.clear();return v(c,Promise.all(b.map(function(d){d=t(d);var e=d.next().value,f=d.next().value;return L(function(g){if(1==g.g)return B(g,2),a.qa||a.C.includes(e.sessionId)||"persistent-license"!==f.type?v(g,ei(e),5):v(g,e.remove(),5);if(2!=g.g)return wa(g,0);F(g);z(g)})})),0)})}
|
|
254
|
+
function dg(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=Vh(c),!Th(a,c))||d&&d.encrypted&&(d=Vh(d),!Th(a,d)))return!1;var e=Rh(a.i);d=Eh(b);return 0==d.length||d.some(function(f){return f.keySystem==e})}
|
|
255
|
+
function gi(a,b){if(!a.length)return b;if(!b.length)return a;for(var c=[],d=t(a),e=d.next();!e.done;e=d.next()){e=e.value;for(var f={},g=t(b),h=g.next();!h.done;f={Fa:f.Fa},h=g.next())if(h=h.value,e.keySystem==h.keySystem){f.Fa=[];f.Fa=f.Fa.concat(e.initData||[]);f.Fa=f.Fa.concat(h.initData||[]);f.Fa=f.Fa.filter(function(k){return function(l,m){return void 0===l.keyId||m===k.Fa.findIndex(function(n){return n.keyId===l.keyId})}}(f));g=e.keyIds&&h.keyIds?new Set([].concat(ka(e.keyIds),ka(h.keyIds))):
|
|
256
256
|
e.keyIds||h.keyIds;c.push({keySystem:e.keySystem,licenseServerUri:e.licenseServerUri||h.licenseServerUri,distinctiveIdentifierRequired:e.distinctiveIdentifierRequired||h.distinctiveIdentifierRequired,persistentStateRequired:e.persistentStateRequired||h.persistentStateRequired,videoRobustness:e.videoRobustness||h.videoRobustness,audioRobustness:e.audioRobustness||h.audioRobustness,serverCertificate:e.serverCertificate||h.serverCertificate,initData:f.Fa,keyIds:g});break}}return c}
|
|
257
|
-
function
|
|
258
|
-
function
|
|
259
|
-
function
|
|
257
|
+
function Eh(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}function uh(a){a.j.forEach(function(b,c){var d=b.zd,e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.D.onExpirationUpdated(c.sessionId,e),b.zd=e)})}function Zh(a){a=a.j.values();return hb(a,function(b){return b.loaded})}
|
|
258
|
+
function Dh(a,b){var c=[];b.forEach(function(f,g){c.push({keySystem:g,licenseServerUri:f,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:new Set})});for(var d=t(a),e=d.next();!e.done;e=d.next())e=e.value,e.video&&(e.video.drmInfos=c),e.audio&&(e.audio.drmInfos=c)}
|
|
259
|
+
function Xh(a,b,c,d,e){var f={};a=t(a);for(var g=a.next();!g.done;f={za:f.za},g=a.next()){f.za=g.value;b.includes(f.za.licenseServerUri)||b.push(f.za.licenseServerUri);f.za.serverCertificate&&(c.some(function(l){return function(m){return ob(m,l.za.serverCertificate)}}(f))||c.push(f.za.serverCertificate));if(f.za.initData){g={};for(var h=t(f.za.initData),k=h.next();!k.done;g={kc:g.kc},k=h.next())g.kc=k.value,d.some(function(l){return function(m){var n=l.kc;return m.keyId&&m.keyId==n.keyId?!0:m.initDataType==
|
|
260
260
|
n.initDataType&&ob(m.initData,n.initData)}}(g))||d.push(g.kc)}if(f.za.keyIds)for(g=t(f.za.keyIds),h=g.next();!h.done;h=g.next())e.add(h.value)}}
|
|
261
|
-
function
|
|
262
|
-
(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType);window.cast&&window.cast.__platform__&&"com.microsoft.playready"==a.keySystem&&(a.keySystem="com.chromecast.playready")}}var
|
|
263
|
-
function
|
|
264
|
-
|
|
265
|
-
function
|
|
266
|
-
|
|
261
|
+
function Fh(a,b,c){if(a.keySystem&&("org.w3.clearkey"!=a.keySystem||!a.licenseServerUri)){b.size&&(b=b.get(a.keySystem)||"",a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(a.keySystem))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.videoRobustness||(a.videoRobustness=c.videoRobustness),a.audioRobustness||(a.audioRobustness=c.audioRobustness),a.serverCertificate||
|
|
262
|
+
(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType);window.cast&&window.cast.__platform__&&"com.microsoft.playready"==a.keySystem&&(a.keySystem="com.chromecast.playready")}}var fi=1,bi=5,ci=.5,hi=new ub(function(){return rb(new Uint8Array([0]))});function ii(){}function ji(a,b,c,d){var e,f,g,h;return L(function(k){if(1==k.g){if(d&&(e=ki[d.toLowerCase()]))return k["return"](e);if(f=li(a))if(g=mi[f])return k["return"](g);return d?k.v(2):v(k,ni(a,b,c),3)}if(2!=k.g&&(d=k.h)&&(h=ki[d]))return k["return"](h);throw new N(2,4,4E3,a);})}
|
|
263
|
+
function ni(a,b,c){var d,e,f;return L(function(g){if(1==g.g)return d=fh([a],c),d.method="HEAD",v(g,b.request(0,d).promise,2);e=g.h;f=e.headers["content-type"];return g["return"](f?f.toLowerCase().split(";").shift():"")})}function li(a){a=(new je(a)).ya.split("/").pop().split(".");return 1==a.length?"":a.pop().toLowerCase()}M("shaka.media.ManifestParser",ii);ii.unregisterParserByMime=function(a){delete ki[a]};ii.registerParserByMime=function(a,b){ki[a]=b};
|
|
264
|
+
ii.registerParserByExtension=function(a,b){mi[a]=b};var ki={},mi={};function oi(a,b,c){this.na=a;this.ka=b;this.fa=c}oi.prototype.Wb=function(){return this.ka};oi.prototype.Sb=function(){return this.fa};function pi(a,b){return a&&b?a.Wb()==b.Wb()&&a.Sb()==b.Sb()&&wc(a.na(),b.na()):a==b}M("shaka.media.InitSegmentReference",oi);oi.prototype.getEndByte=oi.prototype.Sb;oi.prototype.getStartByte=oi.prototype.Wb;
|
|
265
|
+
function qi(a,b,c,d,e,f,g,h,k,l){l=void 0===l?[]:l;this.startTime=a;this.j=this.endTime=b;this.i=c;this.ka=d;this.fa=e;this.h=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.g=l}q=qi.prototype;q.na=function(){return this.i()};q.df=function(){return this.startTime};q.Re=function(){return this.endTime};q.Wb=function(){return this.ka};q.Sb=function(){return this.fa};M("shaka.media.SegmentReference",qi);qi.prototype.getEndByte=qi.prototype.Sb;qi.prototype.getStartByte=qi.prototype.Wb;
|
|
266
|
+
qi.prototype.getEndTime=qi.prototype.Re;qi.prototype.getStartTime=qi.prototype.df;qi.prototype.getUris=qi.prototype.na;function T(a,b,c){this.j=a;this.Lc=b;this.m=this.l=Infinity;this.g=1;this.h=this.i=null;this.s=0;this.u=!0;this.C=0;this.F=void 0===c?!0:c;this.H=0}q=T.prototype;q.getDuration=function(){return this.l};q.Xe=function(){return this.g};q.Ma=function(a){this.l=a};q.cf=function(){return this.j};q.se=function(a){this.s=a};q.ec=function(a){this.u=a};q.Od=function(a){this.m=a};q.Jf=function(a){this.Lc=a};q.Qe=function(){return this.Lc};
|
|
267
267
|
q.Db=function(a){if(0!=a.length){var b=a[a.length-1].endTime;this.xd(a[0].startTime);this.g=a.reduce(function(c,d){return Math.max(c,d.endTime-d.startTime)},this.g);this.h=Math.max(this.h,b);null!=this.j&&this.F&&(this.j=(Date.now()+this.s)/1E3-this.h-this.g)}};q.xd=function(a){this.i=null==this.i?a:Math.min(this.i,a)};q.wd=function(a){this.g=Math.max(this.g,a)};q.offset=function(a){null!=this.i&&(this.i+=a);null!=this.h&&(this.h+=a)};q.Z=function(){return Infinity==this.l&&!this.u};
|
|
268
|
-
q.mb=function(){return Infinity!=this.l&&!this.u};q.ab=function(){return Math.max(this.C,this.ib()-this.m)};q.te=function(a){this.C=a};q.ib=function(){return this.Z()||this.mb()?Math.min(Math.max(0,(Date.now()+this.s)/1E3-this.g-this.j)+this.H,this.l):this.h||this.l};q.Vb=function(a){var b=Math.max(this.i,this.C);return Infinity==this.m?Math.ceil(1E3*b)/1E3:Math.max(b,Math.min(this.ib()-this.m+a,this.
|
|
269
|
-
q.
|
|
268
|
+
q.mb=function(){return Infinity!=this.l&&!this.u};q.ab=function(){return Math.max(this.C,this.ib()-this.m)};q.te=function(a){this.C=a};q.ib=function(){return this.Z()||this.mb()?Math.min(Math.max(0,(Date.now()+this.s)/1E3-this.g-this.j)+this.H,this.l):this.h||this.l};q.Vb=function(a){var b=Math.max(this.i,this.C);return Infinity==this.m?Math.ceil(1E3*b)/1E3:Math.max(b,Math.min(this.ib()-this.m+a,this.Ta()))};q.zb=function(){return this.Vb(0)};
|
|
269
|
+
q.Ta=function(){return Math.max(0,this.ib()-(this.Z()||this.mb()?this.Lc:0))};q.we=function(){return null==this.j||null!=this.h&&this.F?!1:!0};q.re=function(a){this.H=a};M("shaka.media.PresentationTimeline",T);T.prototype.setAvailabilityTimeOffset=T.prototype.re;T.prototype.usingPresentationStartTime=T.prototype.we;T.prototype.getSeekRangeEnd=T.prototype.Ta;T.prototype.getSeekRangeStart=T.prototype.zb;T.prototype.getSafeSeekRangeStart=T.prototype.Vb;T.prototype.getSegmentAvailabilityEnd=T.prototype.ib;
|
|
270
270
|
T.prototype.setUserSeekStart=T.prototype.te;T.prototype.getSegmentAvailabilityStart=T.prototype.ab;T.prototype.isInProgress=T.prototype.mb;T.prototype.isLive=T.prototype.Z;T.prototype.offset=T.prototype.offset;T.prototype.notifyMaxSegmentDuration=T.prototype.wd;T.prototype.notifyMinSegmentStartTime=T.prototype.xd;T.prototype.notifySegments=T.prototype.Db;T.prototype.getDelay=T.prototype.Qe;T.prototype.setDelay=T.prototype.Jf;T.prototype.setSegmentAvailabilityDuration=T.prototype.Od;
|
|
271
|
-
T.prototype.setStatic=T.prototype.ec;T.prototype.setClockOffset=T.prototype.se;T.prototype.getPresentationStartTime=T.prototype.cf;T.prototype.setDuration=T.prototype.
|
|
272
|
-
function
|
|
273
|
-
c||0==c&&!a.m||(d=b.start(c),d>=a.C.
|
|
274
|
-
function
|
|
275
|
-
function
|
|
276
|
-
function
|
|
277
|
-
l-3);h<k&&(h=
|
|
278
|
-
function
|
|
279
|
-
function
|
|
271
|
+
T.prototype.setStatic=T.prototype.ec;T.prototype.setClockOffset=T.prototype.se;T.prototype.getPresentationStartTime=T.prototype.cf;T.prototype.setDuration=T.prototype.Ma;T.prototype.getMaxSegmentDuration=T.prototype.Xe;T.prototype.getDuration=T.prototype.getDuration;function ri(a,b){this.j=a;this.m=si(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.h=!1;this.s=b;this.i=function(){}}ri.prototype.release=function(){this.j=null;this.i=function(){}};function ti(a,b){a.i=b}function ui(a){this.g=a}function si(a){if(a.g.paused||0==a.g.playbackRate||0==a.g.buffered.length)var b=!1;else a:{b=a.g.currentTime;a=t(ge(a.g.buffered));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(b<c.start-.1||b>c.end-.5)){b=!0;break a}b=!1}return b};function vi(a,b,c,d,e){var f=this;this.g=a;this.C=b;this.o=c;this.u=e;this.h=new ef;this.s=!1;this.F=a.readyState;this.j=!1;this.i=d;this.m=!1;this.h.B(a,"waiting",function(){return wi(f)});this.l=(new P(function(){wi(f)})).Da(.25)}vi.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.l&&(this.l.stop(),this.l=null);this.i&&(this.i.release(),this.i=null);this.g=this.C=this.u=null};vi.prototype.Bd=function(){this.m=!0;wi(this)};
|
|
272
|
+
function wi(a){if(0!=a.g.readyState){if(a.g.seeking){if(!a.s)return}else a.s=!1;if(!a.g.paused||0==a.g.currentTime&&(a.g.autoplay||0!=a.g.currentTime)){a.g.readyState!=a.F&&(a.j=!1,a.F=a.g.readyState);var b;if(!(b=!a.i)){b=a.i;var c=b.j,d=si(c),e=c.g.currentTime,f=Date.now()/1E3;if(b.g!=e||b.m!=d)b.l=f,b.g=e,b.m=d,b.h=!1;e=f-b.l;if(d=e>=b.s&&d&&!b.h)b.i(b.g,e),b.h=!0,b.g=c.g.currentTime;b=!d}if(b){e=a.o.smallGapLimit;var g=a.g.currentTime;b=a.g.buffered;c=he(b,g,a.o.gapDetectionThreshold);if(!(null==
|
|
273
|
+
c||0==c&&!a.m||(d=b.start(c),d>=a.C.Ta()))){var h=d-g;e=h<=e;f=!1;.001>h||(e||a.j||(a.j=!0,g=(new Map).set("currentTime",g).set("gapSize",h),g=new R("largegap",g),g.cancelable=!0,a.u(g),a.o.jumpLargeGaps&&!g.defaultPrevented&&(f=!0)),!e&&!f)||(0!=c&&b.end(c-1),a.g.currentTime=d)}}}}};function xi(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=yi.value().get(b),c.wa(a,b,d))}var yi=new ub(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function zi(a,b,c){var d=this;this.g=a;this.l=b;this.j=c;this.m=!1;this.h=new ef;this.i=new Ai(a);xi(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){Bi(d,d.j)})}zi.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.i&&(this.i.release(),this.i=null);this.l=function(){};this.g=null};function Ci(a){return a.m?a.g.currentTime:a.j}function Di(a,b){0<a.g.readyState?Ei(a.i,b):xi(a.g,HTMLMediaElement.HAVE_METADATA,a.h,function(){Bi(a,a.j)})}
|
|
274
|
+
function Bi(a,b){.001>Math.abs(a.g.currentTime-b)?Fi(a):(a.h.wa(a.g,"seeking",function(){Fi(a)}),Ei(a.i,0==a.g.currentTime?b:a.g.currentTime))}function Fi(a){a.m=!0;a.h.B(a.g,"seeking",function(){return a.l()})}function Ai(a){var b=this;this.h=a;this.m=10;this.l=this.j=this.i=0;this.g=new P(function(){0>=b.i?b.g.stop():b.h.currentTime!=b.j?b.g.stop():(b.h.currentTime=b.l,b.i--)})}Ai.prototype.release=function(){this.g&&(this.g.stop(),this.g=null);this.h=null};
|
|
275
|
+
function Ei(a,b){a.j=a.h.currentTime;a.l=b;a.i=a.m;a.h.currentTime=b;a.g.Da(.1)};function Gi(a){function b(){null==c.i||0==c.i?c.j=!0:(c.h.wa(c.g,"seeking",function(){c.j=!0}),c.g.currentTime=Math.max(0,c.g.currentTime+c.i))}var c=this;this.g=a;this.j=!1;this.i=null;this.h=new ef;xi(this.g,HTMLMediaElement.HAVE_CURRENT_DATA,this.h,function(){b()})}Gi.prototype.release=function(){this.h&&(this.h.release(),this.h=null);this.g=null};Gi.prototype.m=function(a){this.i=this.j?this.i:a};Gi.prototype.l=function(){return(this.j?this.g.currentTime:this.i)||0};Gi.prototype.F=function(){};
|
|
276
|
+
function Hi(a,b,c,d,e,f){var g=this;this.i=a;this.g=b.presentationTimeline;this.H=b.minBufferTime||0;this.o=c;this.C=e;this.u=null;this.j=new vi(a,b.presentationTimeline,c,Ii(a,c),f);this.h=new zi(a,function(){a:{var h=g.j;h.s=!0;h.m=!1;h.j=!1;var k=Ci(g.h);h=Ji(g,k);if(.001<Math.abs(h-k)&&(k=Date.now()/1E3,!g.u||g.u<k-1)){g.u=k;Di(g.h,h);h=void 0;break a}g.C();h=void 0}return h},Ki(this,d));this.s=(new P(function(){if(0!=g.i.readyState&&!g.i.paused){var h=Ci(g.h),k=g.g.zb(),l=g.g.Ta();3>l-k&&(k=
|
|
277
|
+
l-3);h<k&&(h=Ji(g,h),g.i.currentTime=h)}})).Da(.25)}Hi.prototype.release=function(){this.h&&(this.h.release(),this.h=null);this.j&&(this.j.release(),this.j=null);this.s&&(this.s.stop(),this.s=null);this.i=this.h=this.g=this.o=null;this.C=function(){}};Hi.prototype.m=function(a){Di(this.h,a)};Hi.prototype.l=function(){var a=Ci(this.h);return 0<this.i.readyState&&!this.i.paused?Li(this,a):a};
|
|
278
|
+
function Ki(a,b){null==b?b=Infinity>a.g.getDuration()?a.g.zb():a.g.Ta():0>b&&(b=a.g.Ta()+b);return Mi(a,Li(a,b))}Hi.prototype.F=function(){this.j.Bd()};function Mi(a,b){var c=a.g.getDuration();return b>=c?c-a.o.durationBackoff:b}function Ji(a,b){var c=Math.max(a.H,a.o.rebufferingGoal),d=a.o.safeSeekOffset,e=a.g.zb(),f=a.g.Ta(),g=a.g.getDuration();3>f-e&&(e=f-3);var h=a.g.Vb(c),k=a.g.Vb(d);c=a.g.Vb(c+d);return b>=g?Mi(a,b):b>f?f:b<e?ee(a.i.buffered,k)?k:c:b>=h||ee(a.i.buffered,b)?b:c}
|
|
279
|
+
function Li(a,b){var c=a.g.zb();if(b<c)return c;c=a.g.Ta();return b>c?c:b}function Ii(a,b){if(!b.stallEnabled)return null;var c=b.stallSkip,d=new ri(new ui(a),b.stallThreshold);ti(d,function(){c?a.currentTime+=c:(a.pause(),a.play())});return d};function U(a){this.M=a;this.g=null;this.h=0;this.i=!1}q=U.prototype;q.destroy=function(){Gb("shaka.media.SegmentIndex","Please use release() instead of destroy().");this.release();return Promise.resolve()};q.release=function(){this.i||(this.M=[],this.g&&this.g.stop(),this.g=null)};q.nf=function(){this.i=!0};
|
|
280
280
|
q.find=function(a){for(var b=this.M.length-1,c=b;0<=c;--c){var d=this.M[c],e=c<b?this.M[c+1].startTime:d.endTime;if(a>=d.startTime&&a<e)return c+this.h}return this.M.length&&a<this.M[0].startTime?this.h:null};q.get=function(a){if(0==this.M.length)return null;a-=this.h;return 0>a||a>=this.M.length?null:this.M[a]};q.offset=function(a){if(!this.i)for(var b=t(this.M),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.timestampOffset+=a};
|
|
281
281
|
q.Gc=function(a){!this.i&&a.length&&(this.M=this.M.filter(function(b){return b.startTime<a[0].startTime}),this.M.push.apply(this.M,ka(a)))};q.Bb=function(a,b){var c=this;a=a.filter(function(d){return d.endTime>b&&(0==c.M.length||d.endTime>c.M[0].startTime)});this.Gc(a);this.gb(b)};q.gb=function(a){if(!this.i){var b=this.M.length;this.M=this.M.filter(function(c){return c.endTime>a});this.h+=b-this.M.length}};
|
|
282
|
-
q.$a=function(a,b,c){c=void 0===c?!1:c;if(!this.i){for(;this.M.length;)if(this.M[this.M.length-1].startTime>=b)this.M.pop();else break;for(;this.M.length;)if(this.M[0].endTime<=a)this.M.shift(),c||this.h++;else break;0!=this.M.length&&(a=this.M[this.M.length-1],this.M[this.M.length-1]=new
|
|
283
|
-
q.Oc=function(a,b){var c=this;this.i||(this.g&&this.g.stop(),this.g=new P(function(){var d=b();d?c.M.push.apply(c.M,ka(d)):(c.g.stop(),c.g=null)}),this.g.Da(a))};U.prototype[Symbol.iterator]=function(){return this.yb(0)};U.prototype.yb=function(a){var b=this.find(a);if(null==b)return null;b--;var c=this.get(b+1),d=-1;if(c&&0<c.g.length)for(var e=c.g.length-1;0<=e;--e){var f=c.g[e];if(a>=f.startTime&&a<f.endTime){b++;d=e-1;break}}return new
|
|
284
|
-
function
|
|
285
|
-
U.prototype.release=U.prototype.release;U.prototype.destroy=U.prototype.destroy;function
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
q.get=function(a){for(var b=0,c=t(this.j),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;b+=d.h+d.M.length}return null};q.offset=function(){};q.Gc=function(){};q.gb=function(){};q.Bb=function(){};q.$a=function(){};q.Oc=function(){};M("shaka.media.MetaSegmentIndex",
|
|
289
|
-
|
|
290
|
-
function
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
function
|
|
294
|
-
function
|
|
295
|
-
function
|
|
296
|
-
function
|
|
297
|
-
f=8*h/k<(g||0)-f-Math.max(a.A.minBufferTime||0,a.o.rebufferingGoal)||b.xa.h.g>h?!0:!1):f=!1;f&&b.xa.abort();z(e)})}function
|
|
298
|
-
function
|
|
299
|
-
(m=
|
|
300
|
-
|
|
301
|
-
8);case 8:return h["return"]();case 7:f=Array.from(b.g.values());if(!b.m||!f.every(function(k){return k.endOfStream})){h.v(0);break}return v(h,b.D.S.endOfStream(),10);case 10:bf(b.J),g=b.D.S.getDuration(),0!=g&&g<b.A.presentationTimeline.getDuration()&&b.A.presentationTimeline.
|
|
302
|
-
function
|
|
303
|
-
g.next();!h.done;h=g.next())h=h.value,
|
|
304
|
-
function
|
|
305
|
-
function
|
|
306
|
-
A=n.subarray(0,D);n=n.subarray(D);return v(E,
|
|
307
|
-
e.ba&&a.o.ignoreTextStreamFailures)a.g["delete"](e.ba),w.v(0);else if(3017==x.code)
|
|
308
|
-
function
|
|
309
|
-
function
|
|
282
|
+
q.$a=function(a,b,c){c=void 0===c?!1:c;if(!this.i){for(;this.M.length;)if(this.M[this.M.length-1].startTime>=b)this.M.pop();else break;for(;this.M.length;)if(this.M[0].endTime<=a)this.M.shift(),c||this.h++;else break;0!=this.M.length&&(a=this.M[this.M.length-1],this.M[this.M.length-1]=new qi(a.startTime,b,a.i,a.ka,a.fa,a.h,a.timestampOffset,a.appendWindowStart,a.appendWindowEnd))}};
|
|
283
|
+
q.Oc=function(a,b){var c=this;this.i||(this.g&&this.g.stop(),this.g=new P(function(){var d=b();d?c.M.push.apply(c.M,ka(d)):(c.g.stop(),c.g=null)}),this.g.Da(a))};U.prototype[Symbol.iterator]=function(){return this.yb(0)};U.prototype.yb=function(a){var b=this.find(a);if(null==b)return null;b--;var c=this.get(b+1),d=-1;if(c&&0<c.g.length)for(var e=c.g.length-1;0<=e;--e){var f=c.g[e];if(a>=f.startTime&&a<f.endTime){b++;d=e-1;break}}return new Ni(this,b,d)};
|
|
284
|
+
function Oi(a,b,c){return new U([new qi(a,a+b,function(){return c},0,null,null,a,a,a+b)])}M("shaka.media.SegmentIndex",U);U.forSingleSegment=Oi;U.prototype.getIteratorForTime=U.prototype.yb;U.prototype.updateEvery=U.prototype.Oc;U.prototype.fit=U.prototype.$a;U.prototype.evict=U.prototype.gb;U.prototype.mergeAndEvict=U.prototype.Bb;U.prototype.merge=U.prototype.Gc;U.prototype.offset=U.prototype.offset;U.prototype.get=U.prototype.get;U.prototype.find=U.prototype.find;U.prototype.markImmutable=U.prototype.nf;
|
|
285
|
+
U.prototype.release=U.prototype.release;U.prototype.destroy=U.prototype.destroy;function Ni(a,b,c){this.i=a;this.h=b;this.g=c}Ni.prototype.seek=function(a){Gb("shaka.media.SegmentIterator","Please use SegmentIndex.getIteratorForTime instead of seek().");(a=this.i.yb(a))?(this.h=a.h,this.g=a.g):(this.h=Number.MAX_VALUE,this.g=0);return this.next().value};
|
|
286
|
+
Ni.prototype.current=function(){var a=this.i.get(this.h);a&&0<a.g.length&&a.na().length&&this.g>=a.g.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&0<a.g.length?a.g[this.g]:a};Ni.prototype.next=function(){var a=this.i.get(this.h);a&&0<a.g.length?(this.g++,a.na().length&&this.g==a.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}};M("shaka.media.SegmentIterator",Ni);Ni.prototype.next=Ni.prototype.next;Ni.prototype.current=Ni.prototype.current;
|
|
287
|
+
Ni.prototype.seek=Ni.prototype.seek;function Pi(){U.call(this,[]);this.j=[]}ra(Pi,U);q=Pi.prototype;q.clone=function(){var a=new Pi;a.j=this.j.slice();return a};q.release=function(){for(var a=t(this.j),b=a.next();!b.done;b=a.next())b.value.release();this.j=[]};q.find=function(a){for(var b=0,c=t(this.j),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.h+d.M.length}return null};
|
|
288
|
+
q.get=function(a){for(var b=0,c=t(this.j),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;b+=d.h+d.M.length}return null};q.offset=function(){};q.Gc=function(){};q.gb=function(){};q.Bb=function(){};q.$a=function(){};q.Oc=function(){};M("shaka.media.MetaSegmentIndex",Pi);Pi.prototype.updateEvery=Pi.prototype.Oc;Pi.prototype.fit=Pi.prototype.$a;Pi.prototype.mergeAndEvict=Pi.prototype.Bb;Pi.prototype.evict=Pi.prototype.gb;Pi.prototype.merge=Pi.prototype.Gc;
|
|
289
|
+
Pi.prototype.offset=Pi.prototype.offset;Pi.prototype.get=Pi.prototype.get;Pi.prototype.find=Pi.prototype.find;Pi.prototype.release=Pi.prototype.release;function Qi(a){var b=this;this.g=a;this.j=!1;this.i=this.g.Dc();this.h=new P(function(){b.g.ie(.25*b.i)})}Qi.prototype.release=function(){this.h&&(this.h.stop(),this.h=null);this.g=null};Qi.prototype.set=function(a){this.i=a;Ri(this)};Qi.prototype.Ac=function(){return this.g.Ac()};function Ri(a){a.h.stop();var b=a.j?0:a.i;if(0<=b)try{a.g.Dc()!=b&&a.g.Nd(b);return}catch(c){}a.h.Da(.25);0!=a.g.Dc()&&a.g.Nd(0)};function Si(a){var b=this;this.h=a;this.g=new Set;this.i=(new P(function(){Ti(b,!1)})).Da(.25)}Si.prototype.release=function(){this.i.stop();for(var a=t(this.g),b=a.next();!b.done;b=a.next())b.value.release();this.g.clear()};
|
|
290
|
+
function Ti(a,b){for(var c=t(a.g),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=a.h.currentTime,f=b,g=t(d.l.g),h=g.next();!h.done;h=g.next()){h=h.value;var k=d.j.get(h),l=e<h.startTime?Ui:e>h.endTime?Vi:Wi;d.j.set(h,l);for(var m=t(d.m),n=m.next();!n.done;n=m.next())n=n.value,n.tb==k&&n.sb==l&&n.lb(h,f)}}};function Xi(a){var b=this;this.h=function(){};this.g=new Set;this.j=a;this.i=(new P(function(){for(var c=b.j(),d=t(b.g),e=d.next();!e.done;e=d.next())e=e.value,e.endTime<c.start&&b.g["delete"](e)})).Da(2)}Xi.prototype.release=function(){this.h=function(){};this.g.clear();this.i.stop()};function Yi(a,b){a.h=b};function Zi(a){var b=this;this.l=a;this.j=new Map;this.g=function(){};this.h=function(){};this.i=function(){};this.m=[{tb:null,sb:Wi,lb:function(c,d){return b.g(c,d)}},{tb:Ui,sb:Wi,lb:function(c,d){return b.g(c,d)}},{tb:Vi,sb:Wi,lb:function(c,d){return b.g(c,d)}},{tb:Wi,sb:Ui,lb:function(c,d){return b.h(c,d)}},{tb:Wi,sb:Vi,lb:function(c,d){return b.h(c,d)}},{tb:Ui,sb:Vi,lb:function(c,d){return b.i(c,d)}},{tb:Vi,sb:Ui,lb:function(c,d){return b.i(c,d)}}]}
|
|
291
|
+
Zi.prototype.release=function(){this.l=null;this.j.clear();this.g=function(){};this.h=function(){};this.i=function(){}};function $i(a,b,c,d){a.g=b;a.h=c;a.i=d}var Ui=1,Wi=2,Vi=3;function aj(a,b,c,d,e){a=fh(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};function bj(a,b){var c=this;this.D=b;this.A=a;this.o=null;this.l=1;this.i=this.h=null;this.g=new Map;this.m=!1;this.s=null;this.j=!1;this.J=new af(function(){return cj(c)})}bj.prototype.destroy=function(){return this.J.destroy()};function cj(a){var b,c,d,e;return L(function(f){if(1==f.g){b=[];c=t(a.g.values());for(d=c.next();!d.done;d=c.next())e=d.value,dj(e),b.push(ej(e));return v(f,Promise.all(b),2)}a.g.clear();a.D=null;a.A=null;a.o=null;z(f)})}
|
|
292
|
+
bj.prototype.configure=function(a){this.o=a;this.s=new Mg({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0)};bj.prototype.start=function(){var a=this;return L(function(b){if(1==b.g)return v(b,fj(a),2);bf(a.J);a.m=!0;z(b)})};
|
|
293
|
+
function gj(a,b){var c,d,e,f,g,h;L(function(k){switch(k.g){case 1:return c=Ce,B(k,2),v(k,Cf(a.D.S,c.ba),4);case 4:wa(k,3);break;case 2:if(d=F(k),a.D)a.D.onError(d);case 3:e=Me(b.mimeType,b.codecs);pf(a.D.S,e);f=a.D.S.m;if(g=f.isTextVisible()||a.o.alwaysStreamText)h=hj(b),a.g.set(c.ba,h),ij(a,h,0);z(k)}})}function jj(a){var b=a.g.get(Be);b&&(dj(b),ej(b)["catch"](function(){}),a.g["delete"](Be));a.i=null}
|
|
294
|
+
function kj(a,b){var c=a.g.get("video");if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;e&&!c.pb&&(lj(a,e,!1,0,!1),c.pb=d)}else if(d=c.pb)c.pb=null,lj(a,d,!0,0,!1)}}function mj(a,b,c,d,e){c=void 0===c?!1:c;d=void 0===d?0:d;e=void 0===e?!1:e;a.h=b;a.m&&(b.video&&lj(a,b.video,c,d,e),b.audio&&lj(a,b.audio,c,d,e))}function nj(a,b){a.i=b;a.m&&lj(a,b,!0,0,!1)}
|
|
295
|
+
function lj(a,b,c,d,e){var f=a.g.get(b.type);f||b.type!=Be?f&&(f.pb&&(b.trickModeVideo?(f.pb=b,b=b.trickModeVideo):f.pb=null),f.stream!=b||e)&&(b.type==Be&&pf(a.D.S,Me(b.mimeType,b.codecs)),f.stream=b,f.da=null,c&&(f.Qb?f.Rc=!0:f.La?(f.rb=!0,f.wc=d,f.Rc=!0):(dj(f),oj(a,f,!0,d)["catch"](function(g){if(a.D)a.D.onError(g)}))),pj(a,f)["catch"](function(g){if(a.D)a.D.onError(g)})):gj(a,b)}
|
|
296
|
+
function pj(a,b){var c,d;return L(function(e){if(1==e.g){if(!b.xa)return e["return"]();c=b.stream;d=b.xa;return c.segmentIndex?e.v(2):v(e,c.createSegmentIndex(),2)}if(b.xa!=d||b.stream!=c)return e["return"]();var f=a.D.Cc();var g=vf(a.D.S,b.type),h=b.stream.segmentIndex.find(b.Ca?b.Ca.endTime:f),k=null==h?null:b.stream.segmentIndex.get(h);h=k?k.fa?k.fa-k.ka:null:null;k&&!h&&(h=(k.endTime-k.startTime)*(b.stream.bandwidth||0)/8);h?((k=k.h)&&(h+=(k.fa?k.fa-k.ka:null)||0),k=a.D.getBandwidthEstimate(),
|
|
297
|
+
f=8*h/k<(g||0)-f-Math.max(a.A.minBufferTime||0,a.o.rebufferingGoal)||b.xa.h.g>h?!0:!1):f=!1;f&&b.xa.abort();z(e)})}function qj(a,b){b.Qb||b.rb||(b.La?(b.rb=!0,b.wc=0):null==tf(a.D.S,b.type)?null==b.Oa&&ij(a,b,0):(dj(b),oj(a,b,!1,0)["catch"](function(c){if(a.D)a.D.onError(c)})))}
|
|
298
|
+
function fj(a){var b,c,d,e,f,g,h,k,l,m;return L(function(n){if(1==n.g){b=Ce;if(!a.h)throw new N(2,5,5006);c=new Map;d=new Set;a.h.audio&&(c.set(b.eb,a.h.audio),d.add(a.h.audio));a.h.video&&(c.set(b.Qa,a.h.video),d.add(a.h.video));a.i&&(c.set(b.ba,a.i),d.add(a.i));e=a.D.S;f=a.o.forceTransmuxTS;return v(n,e.init(c,f),2)}bf(a.J);var p=a.A.presentationTimeline.getDuration();Infinity>p?a.D.S.Ma(p):a.D.S.Ma(Math.pow(2,32));g=t(c.keys());for(h=g.next();!h.done;h=g.next())k=h.value,l=c.get(k),a.g.has(k)||
|
|
299
|
+
(m=hj(l),a.g.set(k,m),ij(a,m,0));z(n)})}function hj(a){return{stream:a,type:a.type,da:null,Ca:null,Fc:null,td:null,sd:null,rd:null,pb:null,endOfStream:!1,La:!1,Oa:null,rb:!1,wc:0,Rc:!1,Qb:!1,Ed:!1,Xb:!1,xa:null}}
|
|
300
|
+
bj.prototype.$b=function(a){var b=this,c,d,e,f,g;return L(function(h){switch(h.g){case 1:bf(b.J);if(a.La||null==a.Oa||a.Qb)return h["return"]();a.Oa=null;if(!a.rb){h.v(2);break}return v(h,oj(b,a,a.Rc,a.wc),3);case 3:return h["return"]();case 2:if(a.stream.segmentIndex){h.v(4);break}c=a.stream;return v(h,a.stream.createSegmentIndex(),5);case 5:if(c!=a.stream)return null==a.Oa&&ij(b,a,0),h["return"]();case 4:B(h,6);d=rj(b,a);null!=d&&(ij(b,a,d),a.Xb=!1);wa(h,7);break;case 6:return e=F(h),v(h,sj(b,e),
|
|
301
|
+
8);case 8:return h["return"]();case 7:f=Array.from(b.g.values());if(!b.m||!f.every(function(k){return k.endOfStream})){h.v(0);break}return v(h,b.D.S.endOfStream(),10);case 10:bf(b.J),g=b.D.S.getDuration(),0!=g&&g<b.A.presentationTimeline.getDuration()&&b.A.presentationTimeline.Ma(g),z(h)}})};
|
|
302
|
+
function rj(a,b){if(tj(b))return Af(a.D.S,b.stream.originalId||""),null;b.type==Be&&Bf(a.D.S);var c=a.D.Cc(),d=b.Ca?b.Ca.endTime:c,e=wf(a.D.S,b.type,c),f=Math.max(a.A.minBufferTime||0,a.o.rebufferingGoal,a.o.bufferingGoal)*a.l;if(1E-6>a.A.presentationTimeline.getDuration()-d)return b.endOfStream=!0,"video"==b.type&&(c=a.g.get(Be))&&tj(c)&&(c.endOfStream=!0),null;b.endOfStream=!1;if(e>=f)return.5;e=vf(a.D.S,b.type);e=uj(a,b,c,e);if(!e)return 1;f=Infinity;var g=Array.from(a.g.values());g=t(g);for(var h=
|
|
303
|
+
g.next();!h.done;h=g.next())h=h.value,tj(h)||h.da&&!h.da.current()||(f=Math.min(f,h.Ca?h.Ca.endTime:c));if(d>=f+a.A.presentationTimeline.g)return 1;vj(a,b,c,e)["catch"](function(){});return null}
|
|
304
|
+
function uj(a,b,c,d){if(b.da)return b.da.current();if(b.Ca||d)return b.da=b.stream.segmentIndex.yb(b.Ca?b.Ca.endTime:d),b.da&&b.da.next().value;a=a.o.inaccurateManifestTolerance;d=Math.max(c-a,0);var e=null;a&&(b.da=b.stream.segmentIndex.yb(d),e=b.da&&b.da.next().value);e||(b.da=b.stream.segmentIndex.yb(c),e=b.da&&b.da.next().value);return e}
|
|
305
|
+
function vj(a,b,c,d){var e,f,g,h,k,l,m,n,p,r,u,x;return L(function(w){switch(w.g){case 1:return e=Ce,f=b.stream,g=b.da,b.La=!0,B(w,2),v(w,wj(a,b,d),4);case 4:bf(a.J);if(a.j)return w["return"]();h="video/mp4"==f.mimeType||"audio/mp4"==f.mimeType;k=window.ReadableStream;if(a.o.lowLatencyMode&&k&&h)return n=new Uint8Array(0),p=function(y){var C,D,A;return L(function(E){bf(a.J);if(a.j)return E["return"]();n=xj(n,y);C=!1;D=0;(new Ob).box("mdat",function(G){D=G.size+G.start;C=!0}).parse(n,!1,!0);if(!C)return E.v(0);
|
|
306
|
+
A=n.subarray(0,D);n=n.subarray(D);return v(E,yj(a,b,c,f,d,A),0)})},v(w,zj(a,b,d,p),6);l=zj(a,b,d);return v(w,l,7);case 7:return m=w.h,bf(a.J),a.j?w["return"]():b.rb?(b.La=!1,ij(a,b,0),w["return"]()):v(w,yj(a,b,c,f,d,m),6);case 6:bf(a.J);if(a.j)return w["return"]();b.Ca=d;g.next();b.La=!1;b.Ed=!1;r=a.D.S.zc();u=r[b.type];cb(JSON.stringify(u));b.rb||a.D.Bd();ij(a,b,0);wa(w,0);break;case 2:x=F(w);bf(a.J,x);if(a.j)return w["return"]();b.La=!1;if(7001==x.code)b.La=!1,b.Oa=null,ij(a,b,0),w.v(0);else if(b.type==
|
|
307
|
+
e.ba&&a.o.ignoreTextStreamFailures)a.g["delete"](e.ba),w.v(0);else if(3017==x.code)Aj(a,b,x),w.v(0);else if(1001==x.code&&x.data&&404==x.data[1])b.La=!1,b.Oa=null,ij(a,b,1),w.v(0);else return b.Xb=!0,x.severity=2,v(w,sj(a,x),0)}})}function xj(a,b){var c=new Uint8Array(a.length+b.length);c.set(a);c.set(b,a.length);return c}
|
|
308
|
+
function Aj(a,b,c){if(!Array.from(a.g.values()).some(function(e){return e!=b&&e.Ed})){var d=Math.round(100*a.l);if(20<d)a.l-=.2;else if(4<d)a.l-=.04;else{b.Xb=!0;a.j=!0;a.D.onError(c);return}b.Ed=!0}ij(a,b,4)}
|
|
309
|
+
function wj(a,b,c){var d,e,f,g,h,k,l;return L(function(m){d=[];e=Math.max(0,c.appendWindowStart-.1);f=c.appendWindowEnd+.01;g=c.timestampOffset;if(g!=b.td||e!=b.sd||f!=b.rd)h=function(){var n;return L(function(p){if(1==p.g)return B(p,2),b.sd=e,b.rd=f,b.td=g,v(p,Df(a.D.S,b.type,g,e,f),4);if(2!=p.g)return wa(p,0);n=F(p);b.sd=null;b.rd=null;b.td=null;throw n;})},d.push(h());!pi(c.h,b.Fc)&&(b.Fc=c.h)&&(k=zj(a,b,c.h),l=function(){var n,p,r;return L(function(u){switch(u.g){case 1:return B(u,2),v(u,k,4);
|
|
310
310
|
case 4:return n=u.h,bf(a.J),p=b.stream.closedCaptions&&0<b.stream.closedCaptions.size,v(u,xf(a.D.S,b.type,n,null,null,p),5);case 5:wa(u,0);break;case 2:throw r=F(u),b.Fc=null,r;}})},d.push(l()));return v(m,Promise.all(d),0)})}
|
|
311
|
-
function
|
|
312
|
-
k=k.reader.bb(k.reader.R.byteLength-k.reader.$());l.includes(m)&&("urn:mpeg:dash:event:2012"==m?a.D.sf():(l=(new Map).set("detail",{startTime:w,endTime:w+u/p,schemeIdUri:m,value:n,timescale:p,presentationTimeDelta:r,eventDuration:u,id:x,messageData:k}),l=new R(
|
|
313
|
-
function
|
|
314
|
-
function
|
|
315
|
-
function
|
|
316
|
-
function
|
|
317
|
-
function
|
|
318
|
-
function
|
|
319
|
-
function
|
|
311
|
+
function yj(a,b,c,d,e,f){var g;return L(function(h){if(1==h.g)return g=d.closedCaptions&&0<d.closedCaptions.size,null!=d.emsgSchemeIdUris&&0<d.emsgSchemeIdUris.length&&(new Ob).U("emsg",function(k){var l=d.emsgSchemeIdUris;if(0===k.version){var m=k.reader.bc();var n=k.reader.bc();var p=k.reader.N();var r=k.reader.N();var u=k.reader.N();var x=k.reader.N();var w=e.startTime+r/p}else p=k.reader.N(),w=k.reader.Hb()/p+e.timestampOffset,r=w-e.startTime,u=k.reader.N(),x=k.reader.N(),m=k.reader.bc(),n=k.reader.bc();
|
|
312
|
+
k=k.reader.bb(k.reader.R.byteLength-k.reader.$());l.includes(m)&&("urn:mpeg:dash:event:2012"==m?a.D.sf():(l=(new Map).set("detail",{startTime:w,endTime:w+u/p,schemeIdUri:m,value:n,timescale:p,presentationTimeDelta:r,eventDuration:u,id:x,messageData:k}),l=new R(Bj,l),a.D.onEvent(l)))}).parse(f),v(h,Cj(a,b,c),2);if(3!=h.g)return bf(a.J),v(h,xf(a.D.S,b.type,f,e.startTime,e.endTime,g),3);bf(a.J);z(h)})}
|
|
313
|
+
function Cj(a,b,c){var d,e,f,g;return L(function(h){if(1==h.g){d=Math.max(a.o.bufferBehind,a.A.presentationTimeline.g);e=tf(a.D.S,b.type);if(null==e)return h["return"]();f=c-e;g=f-d;return.01>=g?h["return"]():v(h,a.D.S.remove(b.type,e,e+g),2)}bf(a.J);z(h)})}function tj(a){return a&&a.type==Be&&("application/cea-608"==a.stream.mimeType||"application/cea-708"==a.stream.mimeType)}
|
|
314
|
+
function zj(a,b,c,d){var e,f,g,h;return L(function(k){if(1==k.g)return e=lh,f=aj(c.na(),c.ka,c.fa,a.o.retryParameters,d),g=a.D.Cb.request(e,f),b.xa=g,v(k,g.promise,2);h=k.h;b.xa=null;return k["return"](h.data)})}
|
|
315
|
+
function oj(a,b,c,d){var e,f;return L(function(g){if(1==g.g)return b.rb=!1,b.Rc=!1,b.wc=0,b.Qb=!0,b.Ca=null,b.Fc=null,b.da=null,d?(e=a.D.Cc(),f=a.D.S.getDuration(),v(g,a.D.S.remove(b.type,e+d,f),3)):v(g,Cf(a.D.S,b.type),4);if(3!=g.g)return bf(a.J),c?v(g,a.D.S.flush(b.type),3):g.v(3);bf(a.J);b.Qb=!1;b.endOfStream=!1;ij(a,b,0);z(g)})}
|
|
316
|
+
function ij(a,b,c){var d=b.type;if(d!=Be||a.g.has(d))b.Oa=(new Xb(function(){var e;return L(function(f){if(1==f.g)return B(f,2),v(f,a.$b(b),4);if(2!=f.g)return wa(f,0);e=F(f);if(a.D)a.D.onError(e);z(f)})})).V(c)}function dj(a){null!=a.Oa&&(a.Oa.stop(),a.Oa=null)}function ej(a){return L(function(b){return a.xa?v(b,a.xa.abort(),0):b.v(0)})}function sj(a,b){return L(function(c){if(1==c.g)return v(c,Og(a.s),2);bf(a.J);a.D.onError(b);b.handled||a.o.failureCallback(b);z(c)})};function Dj(a,b){var c=Ej(),d=this;this.j=b;this.i=a;this.l=c;this.s=null;this.m=[];this.h=this.g=null;this.u=Promise.resolve().then(function(){return Fj(d)});this.J=new af(function(){return Gj(d)})}Dj.prototype.destroy=function(){return this.J.destroy()};function Gj(a){var b,c,d;return L(function(e){if(1==e.g)return a.h&&a.h.abort(),Hj(a),v(e,a.u,2);a.g&&a.g.Ja.nb();b=t(a.m);for(c=b.next();!c.done;c=b.next())d=c.value,d.Ja.nb();a.g=null;a.m=[];a.j=null;z(e)})}
|
|
317
|
+
function Ij(a,b){var c={Eb:function(){},Hc:function(){},nb:function(){},onError:function(){},Jc:function(){},sg:function(){}};a.m.push({create:b,Ja:c});a.h&&a.h.abort();Hj(a);return c}
|
|
318
|
+
function Fj(a){return L(function(b){if(a.J.g)b=b.v(0);else{if(0==a.m.length||a.g&&!a.g.kb)var c=!1;else{a.g&&(a.g.Ja.nb(),a.g=null);c=a.m.shift();var d=c.create(a.l);d?(c.Ja.Eb(),a.g={node:d.node,payload:d.payload,kb:d.kb,Ja:c.Ja}):c.Ja.Jc();c=!0}c?c=Promise.resolve():a.g?c=Jj(a):(a.j.rf(a.i),a.s=new De,c=a.s);b=v(b,c,1)}return b})}
|
|
319
|
+
function Jj(a){var b,c;return L(function(d){switch(d.g){case 1:return a.i=a.j.Ze(a.i,a.l,a.g.node,a.g.payload),B(d,2),a.h=a.j.Ne(a.i,a.l,a.g.payload),v(d,a.h.promise,4);case 4:a.h=null;a.i==a.g.node&&(a.g.Ja.Hc(),a.g=null);wa(d,0);break;case 2:b=F(d);if(7001==b.code)a.g.Ja.nb();else a.g.Ja.onError(b);a.g=null;a.h=null;c=a;return v(d,a.j.handleError(a.l,b),5);case 5:c.i=d.h,z(d)}})}function Hj(a){a.s&&(a.s.resolve(),a.s=null)};function Kj(a){this.g=null;for(var b=t(Array.from(a.textTracks)),c=b.next();!c.done;c=b.next())c=c.value,c.mode="disabled","Shaka Player TextTrack"==c.label&&(this.g=c);this.g||(this.g=a.addTextTrack("subtitles","Shaka Player TextTrack"));this.g.mode="hidden"}q=Kj.prototype;q.remove=function(a,b){if(!this.g)return!1;Lj(this.g,function(c){return c.startTime<b&&c.endTime>a});return!0};
|
|
320
320
|
q.append=function(a){function b(g){var h=[],k=700<=g.fontWeight,l="italic"==g.fontStyle,m=g.textDecoration.includes("underline");k&&h.push("b");l&&h.push("i");m&&h.push("u");k=h.reduce(function(n,p){return n+"<"+p+">"},"");h=h.reduceRight(function(n,p){return n+"</"+p+">"},"");return g.lineBreak||g.spacer?(g.spacer&&Gb("shaka.extern.Cue","Please use lineBreak instead of spacer."),"\n"):g.nestedCues.length?g.nestedCues.map(b).join(""):k+g.payload+h}var c=a.map(function(g){if(g.nestedCues.length){var h=
|
|
321
|
-
g.clone();h.nestedCues=[];h.payload=b(g);return h}return g}),d=[];a=this.g.cues?Array.from(this.g.cues):[];var e={};c=t(c);for(var f=c.next();!f.done;e={ub:e.ub},f=c.next())e.ub=f.value,a.some(function(g){return function(h){return h.startTime==g.ub.startTime&&h.endTime==g.ub.endTime&&h.text==g.ub.payload?!0:!1}}(e))||(f=
|
|
322
|
-
d.indexOf(g):d.indexOf(g)-d.indexOf(h)});a=t(a);for(e=a.next();!e.done;e=a.next())this.g.addCue(e.value)};q.destroy=function(){this.g&&(
|
|
323
|
-
function
|
|
324
|
-
function
|
|
325
|
-
window&&(this.s=new ResizeObserver(function(){
|
|
326
|
-
q.destroy=function(){this.u.removeChild(this.i);this.i=null;this.m=!1;this.l=[];this.C&&this.C.stop();this.j.clear();this.h&&(this.h.release(),this.h=null);this.s&&(this.s.disconnect(),this.s=null)};q.remove=function(a,b){if(!this.i)return!1;var c=this.l.length;this.l=this.l.filter(function(d){return d.startTime<a||d.endTime>=b});
|
|
327
|
-
function
|
|
328
|
-
h=t(h);for(k=h.next();!k.done;k=h.next())d=a.j.get(k.value),c.appendChild(d.Vd)}}function
|
|
329
|
-
function
|
|
330
|
-
function
|
|
331
|
-
"center";else{if(c.nestedCues.length)var
|
|
332
|
-
|
|
333
|
-
(
|
|
334
|
-
|
|
335
|
-
function
|
|
336
|
-
|
|
337
|
-
g.nestedCues=[];g.payload=b(f);return g}return f});a="WEBVTT\n\n";c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=function(f){var g=Math.floor(f/3600),h=Math.floor(f/60%60),k=Math.floor(f%60);f=Math.floor(1E3*f%1E3);return(10>g?"0":"")+g+":"+(10>h?"0":"")+h+":"+(10>k?"0":"")+k+"."+(100>f?10>f?"00":"0":"")+f};a+=e(d.startTime)+" --\x3e "+e(d.endTime)+"\n";a+=d.payload+"\n\n"}return a}M("shaka.text.WebVttGenerator",function(){});function
|
|
338
|
-
function
|
|
339
|
-
k),g=!1)}return g}function
|
|
340
|
-
function
|
|
321
|
+
g.clone();h.nestedCues=[];h.payload=b(g);return h}return g}),d=[];a=this.g.cues?Array.from(this.g.cues):[];var e={};c=t(c);for(var f=c.next();!f.done;e={ub:e.ub},f=c.next())e.ub=f.value,a.some(function(g){return function(h){return h.startTime==g.ub.startTime&&h.endTime==g.ub.endTime&&h.text==g.ub.payload?!0:!1}}(e))||(f=Mj(e.ub))&&d.push(f);a=d.slice().sort(function(g,h){return g.startTime!=h.startTime?g.startTime-h.startTime:g.endTime!=h.endTime?g.endTime-h.startTime:"line"in VTTCue.prototype?d.indexOf(h)-
|
|
322
|
+
d.indexOf(g):d.indexOf(g)-d.indexOf(h)});a=t(a);for(e=a.next();!e.done;e=a.next())this.g.addCue(e.value)};q.destroy=function(){this.g&&(Lj(this.g,function(){return!0}),this.g.mode="disabled");this.g=null;return Promise.resolve()};q.isTextVisible=function(){return"showing"==this.g.mode};q.setTextVisibility=function(a){this.g.mode=a?"showing":"hidden"};
|
|
323
|
+
function Mj(a){if(a.startTime>=a.endTime)return null;var b=new VTTCue(a.startTime,a.endTime,a.payload);b.lineAlign=a.lineAlign;b.positionAlign=a.positionAlign;a.size&&(b.size=a.size);try{b.align=a.textAlign}catch(c){}"center"==a.textAlign&&"center"!=b.align&&(b.align="middle");"vertical-lr"==a.writingMode?b.vertical="lr":"vertical-rl"==a.writingMode&&(b.vertical="rl");1==a.lineInterpretation&&(b.snapToLines=!1);null!=a.line&&(b.line=a.line);null!=a.position&&(b.position=a.position);return b}
|
|
324
|
+
function Lj(a,b){var c=a.mode;a.mode="showing"==c?"showing":"hidden";for(var d=t(Array.from(a.cues)),e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c}M("shaka.text.SimpleTextDisplayer",Kj);Kj.prototype.setTextVisibility=Kj.prototype.setTextVisibility;Kj.prototype.isTextVisible=Kj.prototype.isTextVisible;Kj.prototype.destroy=Kj.prototype.destroy;Kj.prototype.append=Kj.prototype.append;Kj.prototype.remove=Kj.prototype.remove;function Nj(){}function Oj(a){for(;a.firstChild;)a.removeChild(a.firstChild)}M("shaka.util.Dom",Nj);Nj.removeAllChildren=Oj;function Pj(a,b){var c=this;this.m=!1;this.l=[];this.g=a;this.u=b;this.i=document.createElement("div");this.i.classList.add("shaka-text-container");this.i.style.textAlign="center";this.i.style.display="flex";this.i.style.flexDirection="column";this.i.style.alignItems="center";this.i.style.justifyContent="flex-end";this.u.appendChild(this.i);this.C=(new P(function(){Qj(c)})).Da(.25);this.j=new Map;this.h=new ef;this.h.B(document,"fullscreenchange",function(){Qj(c,!0)});this.s=null;"ResizeObserver"in
|
|
325
|
+
window&&(this.s=new ResizeObserver(function(){Qj(c,!0)}),this.s.observe(this.i))}q=Pj.prototype;q.append=function(a){var b=[].concat(ka(this.l)),c={};a=t(a);for(var d=a.next();!d.done;c={ic:c.ic},d=a.next())c.ic=d.value,b.some(function(e){return function(f){return Ic(f,e.ic)}}(c))||this.l.push(c.ic);Qj(this)};
|
|
326
|
+
q.destroy=function(){this.u.removeChild(this.i);this.i=null;this.m=!1;this.l=[];this.C&&this.C.stop();this.j.clear();this.h&&(this.h.release(),this.h=null);this.s&&(this.s.disconnect(),this.s=null)};q.remove=function(a,b){if(!this.i)return!1;var c=this.l.length;this.l=this.l.filter(function(d){return d.startTime<a||d.endTime>=b});Qj(this,c>this.l.length);return!0};q.isTextVisible=function(){return this.m};q.setTextVisibility=function(a){this.m=a};
|
|
327
|
+
function Rj(a,b,c,d,e){var f=!1,g=[],h=[];b=t(b);for(var k=b.next();!k.done;k=b.next()){k=k.value;e.push(k);var l=a.j.get(k),m=k.startTime<=d&&k.endTime>d,n=l?l.ye:null;l&&(g.push(l.Vd),m||(f=!0,a.j["delete"](k),l=null));m&&(h.push(k),l||(Sj(a,k,e),l=a.j.get(k),n=l.ye,f=!0));0<k.nestedCues.length&&n&&Rj(a,k.nestedCues,n,d,e);e.pop()}if(f){d=t(g);for(e=d.next();!e.done;e=d.next())c.removeChild(e.value);h.sort(function(p,r){return p.startTime!=r.startTime?p.startTime-r.startTime:p.endTime-r.endTime});
|
|
328
|
+
h=t(h);for(k=h.next();!k.done;k=h.next())d=a.j.get(k.value),c.appendChild(d.Vd)}}function Qj(a,b){if(a.i){var c=a.g.currentTime;(!a.m||(void 0===b?0:b))&&0<a.j.size&&(Oj(a.i),a.j.clear());if(a.m){for(var d=new Map,e=t(a.j.keys()),f=e.next();!f.done;f=e.next())f=f.value,d.set(f,a.j.get(f));Rj(a,a.l,a.i,c,[])}}}
|
|
329
|
+
function Sj(a,b,c){var d=1<c.length,e=d?"span":"div";if(b.lineBreak||b.spacer)b.spacer&&Gb("shaka.extern.Cue","Please use lineBreak instead of spacer."),e="br";d=!d&&0<b.nestedCues.length;var f=document.createElement(e);"br"!=e&&Tj(a,f,b,c,d);c=f;d&&(c=document.createElement("span"),c.classList.add("shaka-text-wrapper"),c.style.backgroundColor=b.backgroundColor,f.appendChild(c));a.j.set(b,{Vd:f,ye:c})}
|
|
330
|
+
function Tj(a,b,c,d,e){var f=b.style,g=0==c.nestedCues.length,h=1<d.length;f.whiteSpace="pre-wrap";var k=c.payload.replace(/\s+$/g,function(m){return"\u00a0".repeat(m.length)});f.backgroundColor=c.backgroundColor;f.border=c.border;f.color=c.color;f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=Uj(c.linePadding,c,a.u);f.paddingRight=Uj(c.linePadding,c,a.u);if(c.backgroundImage)f.backgroundImage="url('"+c.backgroundImage+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition=
|
|
331
|
+
"center";else{if(c.nestedCues.length)var l=b;else l=document.createElement("span"),b.appendChild(l);c.border&&(l.style.border=c.border);e||((b=Vj(d,function(m){return m.backgroundColor}))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.textContent=k)}h&&!d[d.length-1].isContainer?f.display="inline":(f.display="flex",f.flexDirection="column",f.alignItems="center",f.justifyContent="before"==c.displayAlign?"flex-start":"center"==c.displayAlign?"center":"flex-end");
|
|
332
|
+
g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=c.letterSpacing;f.fontSize=Uj(c.fontSize,c,a.u);c.line?1==c.lineInterpretation&&(f.position="absolute",f.left="0",f.top="0",c.writingMode==Cc?(f.width="100%",c.lineAlign==Ec?f.top=c.line+"%":"end"==c.lineAlign&&(f.bottom=c.line+"%")):"vertical-lr"==c.writingMode?(f.height="100%",c.lineAlign==Ec?f.left=c.line+"%":"end"==c.lineAlign&&(f.right=c.line+"%")):(f.height="100%",c.lineAlign==
|
|
333
|
+
Ec?f.right=c.line+"%":"end"==c.lineAlign&&(f.left=c.line+"%"))):c.region&&c.region.id&&(a=c.region.widthUnits==Pc?"%":"px",d=c.region.viewportAnchorUnits==Pc?"%":"px",f.height=c.region.height+(c.region.heightUnits==Pc?"%":"px"),f.width=c.region.width+a,f.position="absolute",f.top=c.region.viewportAnchorY+d,f.left=c.region.viewportAnchorX+d);f.lineHeight=c.lineHeight;c.position&&(c.writingMode==Cc?f.paddingLeft=c.position:f.paddingTop=c.position);"line-left"==c.positionAlign?f.cssFloat="left":"line-right"==
|
|
334
|
+
c.positionAlign&&(f.cssFloat="right");f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==Cc?f.width=c.size+"%":f.height=c.size+"%")}
|
|
335
|
+
function Uj(a,b,c){var d=(d=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(d[1]),Nf:d[2]}:null;if(!d)return a;var e=d.value;switch(d.Nf){case "%":return e/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*e/b.cellResolution.rows+"px";default:return a}}function Vj(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null}M("shaka.text.UITextDisplayer",Pj);Pj.prototype.setTextVisibility=Pj.prototype.setTextVisibility;
|
|
336
|
+
Pj.prototype.isTextVisible=Pj.prototype.isTextVisible;Pj.prototype.remove=Pj.prototype.remove;Pj.prototype.destroy=Pj.prototype.destroy;Pj.prototype.append=Pj.prototype.append;function Wj(a){function b(f){var g=[],h=700<=f.fontWeight,k="italic"==f.fontStyle,l=f.textDecoration.includes("underline");h&&g.push("b");k&&g.push("i");l&&g.push("u");h=g.reduce(function(m,n){return m+"<"+n+">"},"");g=g.reduceRight(function(m,n){return m+"</"+n+">"},"");return f.lineBreak||f.spacer?(f.spacer&&Gb("shaka.text.Cue","Please use lineBreak instead of spacer."),"\n"):f.nestedCues.length?f.nestedCues.map(b).join(""):h+f.payload+g}var c=a.map(function(f){if(f.nestedCues.length){var g=f.clone();
|
|
337
|
+
g.nestedCues=[];g.payload=b(f);return g}return f});a="WEBVTT\n\n";c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=function(f){var g=Math.floor(f/3600),h=Math.floor(f/60%60),k=Math.floor(f%60);f=Math.floor(1E3*f%1E3);return(10>g?"0":"")+g+":"+(10>h?"0":"")+h+":"+(10>k?"0":"")+k+"."+(100>f?10>f?"00":"0":"")+f};a+=e(d.startTime)+" --\x3e "+e(d.endTime)+"\n";a+=d.payload+"\n\n"}return a}M("shaka.text.WebVttGenerator",function(){});function Xj(){}
|
|
338
|
+
function Yj(a,b,c,d,e){var f=e in d,g=!0,h;for(h in b){var k=e+"."+h,l=f?d[e]:c[h];f||h in c?void 0===b[h]?void 0===l||f?delete a[h]:a[h]=Yg(l):l.constructor==Object&&b[h]&&b[h].constructor==Object?(a[h]||(a[h]=Yg(l)),k=Yj(a[h],b[h],l,d,k),g=g&&k):typeof b[h]!=typeof l||null==b[h]||"function"!=typeof b[h]&&b[h].constructor!=l.constructor?(Va("Invalid config, wrong type for "+k),g=!1):("function"==typeof c[h]&&c[h].length!=b[h].length&&Wa("Unexpected number of arguments for "+k),a[h]=b[h]):(Va("Invalid config, unrecognized key "+
|
|
339
|
+
k),g=!1)}return g}function Zj(a,b){for(var c={},d=c,e=0,f=0;;){e=a.indexOf(".",e);if(0>e)break;if(0==e||"\\"!=a[e-1])f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}M("shaka.util.ConfigUtils",Xj);Xj.convertToConfigObject=Zj;Xj.mergeConfigObjects=Yj;function ak(){}
|
|
340
|
+
function bk(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&(a=360);var b={retryParameters:Ng(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:$h,logLicenseExchange:!1,updateExpirationTime:1},c={retryParameters:Ng(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,defaultPresentationDelay:0,dash:{clockSyncUri:"",ignoreDrmInfo:!1,disableXlinkProcessing:!1,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,
|
|
341
341
|
autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"}},
|
|
342
|
-
hls:{ignoreTextStreamFailures:!1,useFullSegmentsForStartTime:!1}},d={retryParameters:
|
|
342
|
+
hls:{ignoreTextStreamFailures:!1,useFullSegmentsForStartTime:!1}},d={retryParameters:Ng(),failureCallback:function(g){return[g]},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,
|
|
343
343
|
forceHTTPS:!1,preferNativeHls:!1};if(navigator.userAgent.match(/Edge\//)||cc()||dc())d.gapDetectionThreshold=.5;if(bc("Web0S")||cc()||dc())d.stallSkip=0;var e={trackSelectionCallback:function(g){return L(function(h){return h["return"](g)})},downloadSizeCallback:function(g){var h;return L(function(k){if(1==k.g)return navigator.storage&&navigator.storage.estimate?v(k,navigator.storage.estimate(),3):k["return"](!0);h=k.h;return k["return"](h.usage+g<.95*h.quota)})},progressCallback:function(g,h){return[g,
|
|
344
|
-
h]},usePersistentLicense:!0},f={drm:b,manifest:c,streaming:d,offline:e,abrFactory:function(){return new
|
|
345
|
-
preferredAudioChannelCount:2,preferForcedSubs:!1,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},playRangeStart:0,playRangeEnd:Infinity,useMediaCapabilities:!1,textDisplayFactory:function(){return null}};e.trackSelectionCallback=function(g){return L(function(h){return h["return"](
|
|
346
|
-
function
|
|
347
|
-
function
|
|
348
|
-
2);d.sort(function(h,k){return h.bandwidth-k.bandwidth});c.push(d[g])}d=t(a);for(g=d.next();!g.done;g=d.next())g=g.value,g.type!=Be&&"image"!=g.type||c.push(g);return c}M("shaka.util.PlayerConfiguration",
|
|
349
|
-
function
|
|
350
|
-
this.ed=[];b&&b(this);this.P=
|
|
351
|
-
function(e){e.G&&(c.h.Ea(e.G,"error"),e.G=null);c.H&&c.H.release();c.g=null;e=Promise.resolve();return
|
|
352
|
-
e,f)});this.ea=new
|
|
353
|
-
e.name)));return d.get(e)(f,g)},handleError:function(e){return L(function(f){return 1==f.g?v(f,
|
|
354
|
-
q.destroy=function(){var a=this,b;return L(function(c){switch(c.g){case 1:if(a.l==
|
|
355
|
-
null,z(c)}})};q.Pb=function(a,b){b=void 0===b?!0:b;if(this.l==
|
|
356
|
-
q.Rd=function(a){var b=this;a=void 0===a?!0:a;if(this.l==
|
|
357
|
-
q.load=function(a,b,c){var d=this;if(this.l==
|
|
344
|
+
h]},usePersistentLicense:!0},f={drm:b,manifest:c,streaming:d,offline:e,abrFactory:function(){return new wg},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",
|
|
345
|
+
preferredAudioChannelCount:2,preferForcedSubs:!1,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},playRangeStart:0,playRangeEnd:Infinity,useMediaCapabilities:!1,textDisplayFactory:function(){return null}};e.trackSelectionCallback=function(g){return L(function(h){return h["return"](ck(g,f.preferredAudioLanguage))})};return f}
|
|
346
|
+
function dk(a,b,c){var d={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),individualizationServer:""}};return Yj(a,b,c||bk(),d,"")}
|
|
347
|
+
function ck(a,b){var c=a.filter(function(h){return"variant"==h.type}),d=[],e=Of(b,c.map(function(h){return h.language}));e&&(d=c.filter(function(h){return If(h.language)==e}));0==d.length&&(d=c.filter(function(h){return h.primary}));0==d.length&&(c.map(function(h){return h.language}),d=c);var f=d.filter(function(h){return h.height&&480>=h.height});f.length&&(f.sort(function(h,k){return k.height-h.height}),d=f.filter(function(h){return h.height==f[0].height}));c=[];if(d.length){var g=Math.floor(d.length/
|
|
348
|
+
2);d.sort(function(h,k){return h.bandwidth-k.bandwidth});c.push(d[g])}d=t(a);for(g=d.next();!g.done;g=d.next())g=g.value,g.type!=Be&&"image"!=g.type||c.push(g);return c}M("shaka.util.PlayerConfiguration",ak);ak.mergeConfigObjects=dk;function ek(){this.g=null;this.h=[]}function fk(a,b){if(null==a.g)a.g={timestamp:Date.now()/1E3,state:b,duration:0};else{var c=Date.now()/1E3;a.g.duration=c-a.g.timestamp;a.g.state!=b&&(a.h.push(a.g),a.g={timestamp:c,state:b,duration:0})}}function gk(a,b){var c=0;a.g&&a.g.state==b&&(c+=a.g.duration);for(var d=t(a.h),e=d.next();!e.done;e=d.next())e=e.value,c+=e.state==b?e.duration:0;return c}
|
|
349
|
+
function hk(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=t(a.h),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.g&&c.push(b(a.g));return c};function ik(){this.i=this.h=null;this.g=[]}function jk(a,b,c){a.h!=b&&(a.h=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}))}function kk(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function lk(){this.s=this.u=this.I=this.F=this.m=this.j=this.H=this.l=this.i=this.L=this.O=this.T=this.C=this.Y=NaN;this.h=new ek;this.g=new ik};function V(a,b){Xg.call(this);var c=this;this.l=mk;this.pc=this.g=null;this.Y=!1;this.h=new ef;this.dd=this.u=this.Ya=this.A=this.tc=this.s=this.i=this.hc=this.I=this.qc=this.F=this.Ha=this.C=this.L=this.m=this.P=null;this.ld=1E9;this.o=nk(this);this.kd={width:Infinity,height:Infinity};this.j=null;this.pa=new Eg(this.o.preferredAudioLanguage,this.o.preferredVariantRole,this.o.preferredAudioChannelCount);this.qa=this.o.preferredTextLanguage;this.Nb=this.o.preferredTextRole;this.Za=this.o.preferForcedSubs;
|
|
350
|
+
this.ed=[];b&&b(this);this.P=ok(this);this.P.Ld(this.o.streaming.forceHTTPS);this.H=null;pk&&(this.H=Nb(pk));this.h.B(window,"online",function(){c.Fd()});this.ta={name:"detach"};this.Ra={name:"attach"};this.T={name:"unload"};this.nd={name:"manifest-parser"};this.jd={name:"manifest"};this.ra={name:"media-source"};this.gd={name:"drm-engine"};this.O={name:"load"};this.od={name:"src-equals-drm-engine"};this.Pa={name:"src-equals"};var d=new Map;d.set(this.Ra,function(e,f){return Tg(qk(c,e,f))});d.set(this.ta,
|
|
351
|
+
function(e){e.G&&(c.h.Ea(e.G,"error"),e.G=null);c.H&&c.H.release();c.g=null;e=Promise.resolve();return Tg(e)});d.set(this.T,function(e){return Tg(rk(c,e))});d.set(this.ra,function(e){e=sk(c,e);return Tg(e)});d.set(this.nd,function(e,f){var g=tk(c,e,f);return Tg(g)});d.set(this.jd,function(e){return uk(c,e)});d.set(this.gd,function(e){e=vk(c,e);return Tg(e)});d.set(this.O,function(e,f){return Tg(wk(c,e,f))});d.set(this.od,function(e,f){var g=xk(c,e,f);return Tg(g)});d.set(this.Pa,function(e,f){return yk(c,
|
|
352
|
+
e,f)});this.ea=new Dj(this.ta,{Ze:function(e,f,g,h){var k=null;e==c.ta&&(k=g==c.ta?c.ta:c.Ra);e==c.Ra&&(k=g==c.ta||f.G!=h.G?c.ta:g==c.Ra?c.Ra:g==c.ra||g==c.O?c.ra:g==c.Pa?c.od:null);e==c.ra&&(k=g==c.O&&f.G==h.G?c.nd:c.T);e==c.nd&&(k=zk(c.O,c.jd,c.T,g,f,h));e==c.jd&&(k=zk(c.O,c.gd,c.T,g,f,h));e==c.gd&&(k=zk(c.O,c.O,c.T,g,f,h));e==c.od&&(k=g==c.Pa&&f.G==h.G?c.Pa:c.T);if(e==c.O||e==c.Pa)k=c.T;e==c.T&&(k=h.G&&f.G==h.G?c.Ra:c.ta);return k},Ne:function(e,f,g){c.dispatchEvent(Ak(Bk,(new Map).set("state",
|
|
353
|
+
e.name)));return d.get(e)(f,g)},handleError:function(e){return L(function(f){return 1==f.g?v(f,rk(c,e),2):f["return"](e.G?c.Ra:c.ta)})},rf:function(e){c.dispatchEvent(Ak(Ck,(new Map).set("state",e.name)))}});a&&this.Pb(a,!0)}ra(V,Xg);function Ak(a,b){return new R(a,b)}q=V.prototype;
|
|
354
|
+
q.destroy=function(){var a=this,b;return L(function(c){switch(c.g){case 1:if(a.l==Dk)return c["return"]();a.l=Dk;b=Ij(a.ea,function(){return{node:a.ta,payload:Ej(),kb:!1}});return v(c,new Promise(function(d){b.Eb=function(){};b.Hc=function(){d()};b.nb=function(){d()};b.onError=function(){d()};b.Jc=function(){d()}}),2);case 2:return v(c,a.ea.destroy(),3);case 3:a.h&&(a.h.release(),a.h=null);a.dd=null;a.u=null;a.o=null;a.j=null;a.pc=null;if(!a.P){c.v(0);break}return v(c,a.P.destroy(),5);case 5:a.P=
|
|
355
|
+
null,z(c)}})};q.Pb=function(a,b){b=void 0===b?!0:b;if(this.l==Dk)return Promise.reject(Ek());var c=Ej();c.G=a;Yb()||(b=!1);var d=b?this.ra:this.Ra,e=Ij(this.ea,function(){return{node:d,payload:c,kb:!1}});e.Eb=function(){};return Fk(e)};q.detach=function(){var a=this;if(this.l==Dk)return Promise.reject(Ek());var b=Ij(this.ea,function(){return{node:a.ta,payload:Ej(),kb:!1}});b.Eb=function(){};return Fk(b)};
|
|
356
|
+
q.Rd=function(a){var b=this;a=void 0===a?!0:a;if(this.l==Dk)return Promise.reject(Ek());Yb()||(a=!1);var c=Ej(),d=Ij(this.ea,function(e){var f=e.G&&a?b.ra:e.G?b.Ra:b.ta;c.G=e.G;return{node:f,payload:c,kb:!1}});d.Eb=function(){};return Fk(d)};
|
|
357
|
+
q.load=function(a,b,c){var d=this;if(this.l==Dk)return Promise.reject(Ek());this.dispatchEvent(Ak(Gk));var e=Ej();e.uri=a;e.Pd=Date.now()/1E3;c&&(e.mimeType=c);void 0!==b&&(e.startTime=b);var f=Hk(this,e)?this.Pa:this.O,g=Ij(this.ea,function(h){if(null==h.G)return null;e.G=h.G;return{node:f,payload:e,kb:!0}});this.j=new lk;g.Eb=function(){};return new Promise(function(h,k){g.Jc=function(){return k(new N(2,7,7002))};g.Hc=function(){h();d.dispatchEvent(Ak(Ik))};g.nb=function(){return k(Ek())};g.onError=
|
|
358
358
|
function(l){return k(l)}})};
|
|
359
|
-
function
|
|
360
|
-
function
|
|
361
|
-
function
|
|
359
|
+
function Hk(a,b){if(!Yb())return!0;var c=b.mimeType,d=b.uri||"";c||(c={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"}[li(d)]);if(c){if(""==(b.G||$b()).canPlayType(c))return!1;if(!Yb()||!(c in ki||li(d)in mi)||a.o.streaming.preferNativeHls)return!0;if(ec())return a.o.streaming.useNativeHlsOnSafari}return!1}
|
|
360
|
+
function qk(a,b,c){null==b.G&&(b.G=c.G,a.h.B(b.G,"error",function(){var d=Jk(a);d&&Kk(a,d)}));a.g=b.G;return Promise.resolve()}
|
|
361
|
+
function rk(a,b){var c,d,e,f,g,h,k,l,m;return L(function(n){switch(n.g){case 1:return a.l!=Dk&&(a.l=mk),c=a.ed.map(function(p){return p()}),a.ed=[],v(n,Promise.all(c),2);case 2:a.dispatchEvent(Ak(Lk));b.mimeType=null;b.startTime=null;b.uri=null;b.G&&(a.h.Ea(b.G,"loadedmetadata"),a.h.Ea(b.G,"playing"),a.h.Ea(b.G,"pause"),a.h.Ea(b.G,"ended"),a.h.Ea(b.G,"ratechange"));a.Ha&&(a.Ha.release(),a.Ha=null);a.qc&&(a.qc.stop(),a.qc=null);if(!a.s){n.v(3);break}return v(n,a.s.stop(),4);case 4:a.s=null,a.tc=null;
|
|
362
362
|
case 3:if(!a.u){n.v(5);break}return v(n,a.u.stop(),5);case 5:if(!a.i){n.v(7);break}return v(n,a.i.destroy(),8);case 8:a.i=null;case 7:a.F&&(a.F.release(),a.F=null);a.C&&(a.C.release(),a.C=null);if(!a.L){n.v(9);break}return v(n,a.L.destroy(),10);case 10:a.L=null;case 9:if(a.H)a.H.onAssetUnload();if(!b.G||!b.G.src){n.v(11);break}return v(n,new Promise(function(p){return(new P(p)).V(.1)}),12);case 12:for(b.G.removeAttribute("src"),b.G.load();b.G.lastChild;)b.G.removeChild(b.G.firstChild);case 11:if(!a.m){n.v(13);
|
|
363
|
-
break}return v(n,a.m.destroy(),14);case 14:a.m=null;case 13:a.Ya=null;a.I=null;if(a.A){d=t(a.A.variants);for(e=d.next();!e.done;e=d.next())for(f=e.value,g=t([f.audio,f.video]),h=g.next();!h.done;h=g.next())(k=h.value)&&k.segmentIndex&&k.segmentIndex.release();l=t(a.A.textStreams);for(h=l.next();!h.done;h=l.next())m=h.value,m.segmentIndex&&m.segmentIndex.release()}a.A=null;a.j=new
|
|
364
|
-
function
|
|
365
|
-
function
|
|
366
|
-
function
|
|
367
|
-
l;break a}k=null}null==k&&(h.g.add(g),h.h(g))},onEvent:function(g){return a.dispatchEvent(g)},onError:function(g){return
|
|
368
|
-
a.A.variants.length)throw new N(2,4,4036);
|
|
369
|
-
function
|
|
370
|
-
function
|
|
371
|
-
(Gb("AbrManager","Please use an AbrManager with playbackRateChanged function."),a.u.playbackRateChanged=function(){}),a.u.configure(a.o.abr));a.pa=new
|
|
372
|
-
a.C
|
|
373
|
-
r||((u=
|
|
374
|
-
function
|
|
375
|
-
"video/mp4",codecs:c.mimeType?Re(c.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.
|
|
376
|
-
function
|
|
377
|
-
function(){a.j.l=Date.now()/1E3-c.Pd});a.g.audioTracks&&(a.h.B(a.g.audioTracks,"addtrack",function(){return
|
|
378
|
-
var e=new De;
|
|
379
|
-
e.resolve());a.h.wa(a.g,"error",function(){e.reject(
|
|
380
|
-
function
|
|
381
|
-
function
|
|
382
|
-
function
|
|
383
|
-
|
|
384
|
-
function
|
|
385
|
-
function
|
|
386
|
-
q.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=
|
|
387
|
-
0),void 0==a.streaming.rebufferingGoal&&(a.streaming.rebufferingGoal=.01));var c=
|
|
388
|
-
function
|
|
389
|
-
|
|
363
|
+
break}return v(n,a.m.destroy(),14);case 14:a.m=null;case 13:a.Ya=null;a.I=null;if(a.A){d=t(a.A.variants);for(e=d.next();!e.done;e=d.next())for(f=e.value,g=t([f.audio,f.video]),h=g.next();!h.done;h=g.next())(k=h.value)&&k.segmentIndex&&k.segmentIndex.release();l=t(a.A.textStreams);for(h=l.next();!h.done;h=l.next())m=h.value,m.segmentIndex&&m.segmentIndex.release()}a.A=null;a.j=new lk;a.hd=null;Mk(a);z(n)}})}
|
|
364
|
+
function sk(a,b){var c,d,e,f;return L(function(g){if(1==g.g)return c=new be,d=a.o.textDisplayFactory,e=Nb(d),a.hd=d,f=Nk(b.G,c,e,function(h,k,l){h=t(h);for(var m=h.next();!m.done;m=h.next())if(m=m.value,m.data&&m.cueTime&&m.frames){for(var n=m.cueTime+k,p=l,r=t(m.frames),u=r.next();!u.done;u=r.next())Ok(a,n,p,"ID3",u.value);if(a.H)a.H.onHlsTimedMetadata(m,n)}}),v(g,f.F,2);a.L=f;z(g)})}
|
|
365
|
+
function tk(a,b,c){var d,e,f,g;return L(function(h){if(1==h.g)return b.mimeType=c.mimeType,b.uri=c.uri,d=b.uri,e=a.P,a.Ya=d,f=a,v(h,ji(d,e,a.o.manifest.retryParameters,b.mimeType),2);f.tc=h.h;a.s=Nb(a.tc);g=Yg(a.o.manifest);c.G&&"AUDIO"===c.G.nodeName&&(g.disableVideo=!0);a.s.configure(g);z(h)})}
|
|
366
|
+
function uk(a,b){var c=b.uri,d=a.P;a.hc=new Xi(function(){return a.Hd()});Yi(a.hc,function(g){Pk(a,Qk,g);if(a.H)a.H.onDashTimedMetadata(g)});var e={networkingEngine:d,filter:function(g){return L(function(h){return h["return"](a.yc(g))})},makeTextStreamsForClosedCaptions:function(g){return Rk(a,g)},onTimelineRegionAdded:function(g){var h=a.hc;a:{var k=t(h.g);for(var l=k.next();!l.done;l=k.next())if(l=l.value,l.schemeIdUri==g.schemeIdUri&&l.id==g.id&&l.startTime==g.startTime&&l.endTime==g.endTime){k=
|
|
367
|
+
l;break a}k=null}null==k&&(h.g.add(g),h.h(g))},onEvent:function(g){return a.dispatchEvent(g)},onError:function(g){return Kk(a,g)},isLowLatencyMode:function(){return a.o.streaming.lowLatencyMode},isAutoLowLatencyMode:function(){return a.o.streaming.autoLowLatencyMode},enableLowLatencyMode:function(){a.configure("streaming.lowLatencyMode",!0)}},f=Date.now()/1E3;return new Pg(function(){var g,h,k,l;return L(function(m){if(1==m.g)return g=a,v(m,a.s.start(c,e),2);g.A=m.h;h=Ak(Sk);a.dispatchEvent(h);if(0==
|
|
368
|
+
a.A.variants.length)throw new N(2,4,4036);Tk(a.A);k=Date.now()/1E3;l=k-f;a.j.H=l;z(m)})}(),function(){return a.s.stop()})}
|
|
369
|
+
function vk(a,b){var c,d;return L(function(e){return 1==e.g?(c=Date.now()/1E3,d=!0,a.m=Uk(a,{Cb:a.P,onError:function(f){Kk(a,f)},Ic:function(f){Vk(a,f)},onExpirationUpdated:function(f,g){Wk(a,f,g)},onEvent:function(f){a.dispatchEvent(f);f.type==Xk&&d&&(d=!1,a.j.j=Date.now()/1E3-c)}}),a.o.useMediaCapabilities||Zf(a.A),a.m.configure(a.o.drm),v(e,zh(a.m,a.A.variants,a.A.offlineSessionIds,a.o.useMediaCapabilities),2)):3!=e.g?v(e,a.m.Pb(b.G),3):v(e,a.yc(a.A),0)})}
|
|
370
|
+
function wk(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u;return L(function(x){switch(x.g){case 1:b.startTime=c.startTime;d=b.G;e=b.uri;a.Ya=e;a.F=new Qi({Dc:function(){return b.G.playbackRate},Ac:function(){return b.G.defaultPlaybackRate},Nd:function(w){b.G.playbackRate=w},ie:function(w){b.G.currentTime+=w}});f=function(){return Yk(a)};g=function(){return Zk(a)};a.h.B(d,"playing",f);a.h.B(d,"pause",f);a.h.B(d,"ended",f);a.h.B(d,"ratechange",g);h=a.o.abrFactory;a.u&&a.dd==h||(a.dd=h,a.u=Nb(h),"function"!=typeof a.u.playbackRateChanged&&
|
|
371
|
+
(Gb("AbrManager","Please use an AbrManager with playbackRateChanged function."),a.u.playbackRateChanged=function(){}),a.u.configure(a.o.abr));a.pa=new Eg(a.o.preferredAudioLanguage,a.o.preferredVariantRole,a.o.preferredAudioChannelCount);a.qa=a.o.preferredTextLanguage;a.Nb=a.o.preferredTextRole;a.Za=a.o.preferForcedSubs;$k(a.A.presentationTimeline,a.o.playRangeStart,a.o.playRangeEnd);a.u.init(function(w,y,C){y=void 0===y?!1:y;C=void 0===C?0:C;a.i&&w!=a.i.h&&(jk(a.j.g,w,!0),mj(a.i,w,y,C),al(a))});
|
|
372
|
+
a.C=bl(a,b.startTime);a.Ha=cl(a);k=Math.max(a.A.minBufferTime,a.o.streaming.rebufferingGoal);dl(a,k);Pf(a.A,a.o.preferredAudioChannelCount);a.i=el(a);a.i.configure(a.o.streaming);a.l=fl;a.dispatchEvent(Ak(gl));l=null;if(m=a.Ec().find(function(w){return w.active})){x.v(2);break}l=hl(a)?a.u.chooseVariant():null;il(a,l,!0,!1,0);if(!a.o.streaming.startAtSegmentBoundary){x.v(3);break}n=a.C.l();return v(x,jl(l,n),4);case 4:p=x.h,a.C.m(p);case 3:al(a);case 2:return r=a.jb().find(function(w){return w.active}),
|
|
373
|
+
r||((u=tg(a.A.textStreams,a.qa,a.Nb,a.Za)[0]||null)&&kk(a.j.g,u,!0),l&&(u?(l.audio&&kl(a,l.audio,u)&&(a.Y=!0),a.Y&&a.L.m.setTextVisibility(!0),ll(a)):a.Y=!1),u&&(a.o.streaming.alwaysStreamText||a.qd())&&nj(a.i,u)),v(x,a.i.start(),5);case 5:a.o.abr.enabled&&(a.u.enable(),ml(a)),ag(a.i?a.i.h:null,a.A),nl(a.A),ol(a),hl(a),a.A.variants.some(function(w){return w.primary}),a.h.wa(d,"loadedmetadata",function(){a.j.l=Date.now()/1E3-c.Pd}),z(x)}})}
|
|
374
|
+
function xk(a,b,c){var d,e,f,g;return L(function(h){return 1==h.g?(d=Ce,e=Date.now()/1E3,f=!0,a.m=Uk(a,{Cb:a.P,onError:function(k){Kk(a,k)},Ic:function(k){Vk(a,k)},onExpirationUpdated:function(k,l){Wk(a,k,l)},onEvent:function(k){a.dispatchEvent(k);k.type==Xk&&f&&(f=!1,a.j.j=Date.now()/1E3-e)}}),a.m.configure(a.o.drm),g={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:c.mimeType?c.mimeType.split(";")[0]:
|
|
375
|
+
"video/mp4",codecs:c.mimeType?Re(c.mimeType):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",label:null,type:d.Qa,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null},bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},a.m.Y=!0,v(h,zh(a.m,[g],[]),2)):v(h,a.m.Pb(b.G),0)})}
|
|
376
|
+
function yk(a,b,c){function d(){return Yk(a)}b.uri=c.uri;b.startTime=c.startTime;a.Ya=b.uri;a.C=new Gi(b.G);null!=b.startTime&&a.C.m(b.startTime);a.F=new Qi({Dc:function(){return b.G.playbackRate},Ac:function(){return b.G.defaultPlaybackRate},Nd:function(g){b.G.playbackRate=g},ie:function(g){b.G.currentTime+=g}});dl(a,a.o.streaming.rebufferingGoal);a.h.B(b.G,"playing",d);a.h.B(b.G,"pause",d);a.h.B(b.G,"ended",d);a.h.B(b.G,"ratechange",function(){return Zk(a)});"none"!=a.g.preload&&a.h.wa(a.g,"loadedmetadata",
|
|
377
|
+
function(){a.j.l=Date.now()/1E3-c.Pd});a.g.audioTracks&&(a.h.B(a.g.audioTracks,"addtrack",function(){return ol(a)}),a.h.B(a.g.audioTracks,"removetrack",function(){return ol(a)}),a.h.B(a.g.audioTracks,"change",function(){return ol(a)}));a.g.textTracks&&(a.h.B(a.g.textTracks,"addtrack",function(g){ol(a);pl(a,g)}),a.h.B(a.g.textTracks,"removetrack",function(){return ol(a)}),a.h.B(a.g.textTracks,"change",function(){return ol(a)}));b.G.src=b.uri;(cc()||bc("Web0S"))&&b.G.load();a.l=ql;a.dispatchEvent(Ak(gl));
|
|
378
|
+
var e=new De;xi(a.g,HTMLMediaElement.HAVE_METADATA,a.h,function(){e.resolve()});var f=!1;a.ed.push(function(){f=!0});xi(a.g,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,function(){var g;return L(function(h){if(1==h.g){if(f)return h["return"]();rl(a);g=sl(a);return g.find(function(k){return"disabled"!=k.mode})?h.v(2):v(h,new Promise(function(k){a.h.wa(a.g.textTracks,"change",k);(new P(k)).V(1)}),2)}if(f)return h["return"]();tl(a);z(h)})});a.g.error?e.reject(Jk(a)):"none"==a.g.preload&&(Wa('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),
|
|
379
|
+
e.resolve());a.h.wa(a.g,"error",function(){e.reject(Jk(a))});return new Pg(e,function(){e.reject(new N(2,7,7001));return Promise.resolve()})}function rl(a){var b=a.o.preferredAudioLanguage;if(""!=b){a.Id(b);var c=a.o.preferredVariantRole;""!=c&&a.Id(b,c)}}function tl(a){var b=a.o.preferredTextLanguage,c=a.o.preferForcedSubs;if(""!=b){a.Jd(b,"",c);var d=a.o.preferredTextRole;""!=d&&a.Jd(b,d,c)}}
|
|
380
|
+
function pl(a,b){var c=b.track;"metadata"==c.kind&&(c.mode="hidden",a.h.B(c,"cuechange",function(){if(c.activeCues)for(var d=t(c.activeCues),e=d.next();!e.done;e=d.next())if(e=e.value,Ok(a,e.startTime,e.endTime,e.type,e.value),a.H)a.H.onCueMetadataChange(e.value)}),(new P(function(){var d=ul(a);d=t(d);for(var e=d.next();!e.done;e=d.next())e.value.mode="hidden"})).fc().V(.5))}
|
|
381
|
+
function Ok(a,b,c,d,e){b=(new Map).set("startTime",b).set("endTime",c).set("metadataType",d).set("payload",e);a.dispatchEvent(Ak(vl,b))}function Tk(a){function b(c){return c.video&&c.audio||c.video&&c.video.codecs.includes(",")}a.variants.some(b)&&(a.variants=a.variants.filter(b))}function Uk(a,b){return new sh(b,a.o.drm.updateExpirationTime)}function ok(a){return new bh(function(b,c){a.u&&a.u.segmentDownloaded(b,c)})}
|
|
382
|
+
function bl(a,b){return new Hi(a.g,a.A,a.o.streaming,b,function(){a.Ha&&Ti(a.Ha,!0);if(a.i)for(var c=a.i,d=c.D.Cc(),e=c.o.smallGapLimit,f=t(c.g.keys()),g=f.next();!g.done;g=f.next()){g=g.value;var h=c.g.get(g);h.da=null;var k=c.D.S;g==Be?(k=k.i,k=null==k.g||null==k.h?!1:d>=k.g&&d<k.h):(k=uf(k,g),k=ee(k,d,e));if(!k&&((null!=vf(c.D.S,g)||h.La)&&qj(c,h),h.xa&&(h.xa.abort(),h.xa=null),g===Be))for(g=c.D.S.C.g,g.l=0,g.h=[],g.g=[],h=g.i,h.i=[],h.h=[],h.g=0,Pd(g),g=t(g.j.values()),h=g.next();!h.done;h=g.next())ld(h.value)}a.I&&
|
|
383
|
+
wl(a)},function(c){return a.dispatchEvent(c)})}function cl(a){var b=new Zi(a.hc);$i(b,function(d){Pk(a,xl,d)},function(d){Pk(a,yl,d)},function(d,e){e||(Pk(a,xl,d),Pk(a,yl,d))});var c=new Si(a.g);c.g.add(b);return c}function dl(a,b){a.I=new Ig;a.I.g=Kg;Lg(a.I,b,Math.min(.5,b/2));Mk(a);a.qc=(new P(function(){wl(a)})).Da(.25)}
|
|
384
|
+
function wl(a){switch(a.l){case ql:if(a.g.ended)var b=!0;else{var c=de(a.g.buffered);b=null!=c&&c>=a.g.duration-1}break;case fl:a:if(a.g.ended||sf(a.L))b=!0;else{if(a.A.presentationTimeline.Z()){c=a.A.presentationTimeline.ib();var d=de(a.g.buffered);if(null!=d&&d>=c){b=!0;break a}}b=!1}break;default:b=!1}d=fe(a.g.buffered,a.g.currentTime);c=a.I;var e=b,f=c.h.get(c.g);b=c.g;d=e||d>=f?Jg:Kg;c.g=d;b!=d&&Mk(a)}function Nk(a,b,c,d){return new kf(a,b,c,d)}
|
|
385
|
+
function el(a){return new bj(a.A,{Cc:function(){return a.C.l()},getBandwidthEstimate:function(){return a.u.getBandwidthEstimate()},S:a.L,Cb:a.P,onError:function(b){return Kk(a,b)},onEvent:function(b){return a.dispatchEvent(b)},sf:function(){a.s&&a.s.update&&a.s.update()},Bd:function(){a.C&&a.C.F();wl(a)}})}
|
|
386
|
+
q.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=Zj(a,b));a.manifest&&a.manifest.dash&&"defaultPresentationDelay"in a.manifest.dash&&(Gb("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),a.manifest.defaultPresentationDelay=a.manifest.dash.defaultPresentationDelay,delete a.manifest.dash.defaultPresentationDelay);a.streaming&&a.streaming.lowLatencyMode&&(void 0==a.streaming.inaccurateManifestTolerance&&(a.streaming.inaccurateManifestTolerance=
|
|
387
|
+
0),void 0==a.streaming.rebufferingGoal&&(a.streaming.rebufferingGoal=.01));var c=dk(this.o,a,nk(this));zl(this);return c};
|
|
388
|
+
function zl(a){if(a.s){var b=Yg(a.o.manifest);a.g&&"AUDIO"===a.g.nodeName&&(b.disableVideo=!0);a.s.configure(b)}a.m&&a.m.configure(a.o.drm);if(a.i){a.i.configure(a.o.streaming);try{Al(a,a.A)}catch(f){Kk(a,f)}a.u&&hl(a);b=a.i.h;!b||b.allowedByApplication&&b.allowedByKeySystem||Bl(a)}a.P&&a.P.Ld(a.o.streaming.forceHTTPS);if(a.L&&(b=a.o.textDisplayFactory,a.hd!=b)){var c=Nb(b),d=a.L,e=d.m;d.m=c;e&&(c.setTextVisibility(e.isTextVisible()),e.destroy());d.i&&(d.i.i=c);a.hd=b;a.i&&(b=a.i,(c=b.g.get(Be))&&
|
|
389
|
+
lj(b,c.stream,!0,0,!0))}a.u&&(a.u.configure(a.o.abr),a.o.abr.enabled?a.u.enable():a.u.disable(),ml(a));a.I&&(b=a.o.streaming.rebufferingGoal,a.A&&(b=Math.max(b,a.A.minBufferTime)),Lg(a.I,b,Math.min(.5,b/2)));a.A&&$k(a.A.presentationTimeline,a.o.playRangeStart,a.o.playRangeEnd)}q.getConfiguration=function(){var a=nk(this);dk(a,this.o,nk(this));return a};q.Df=function(){for(var a in this.o)delete this.o[a];dk(this.o,nk(this),nk(this));zl(this)};q.Ue=function(){return this.l};q.Ye=function(){return this.g};
|
|
390
390
|
q.Ub=function(){return this.P};q.md=function(){return this.Ya};q.ae=function(){return this.H?this.H:null};q.Z=function(){return this.A?this.A.presentationTimeline.Z():this.g&&this.g.src?Infinity==this.g.duration:!1};q.mb=function(){return this.A?this.A.presentationTimeline.mb():!1};q.lf=function(){if(this.A){var a=this.A.variants;return a.length?!a[0].video:!1}return this.g&&this.g.src?this.g.videoTracks?0==this.g.videoTracks.length:0==this.g.videoHeight:!1};
|
|
391
|
-
q.Hd=function(){if(this.A){var a=this.A.presentationTimeline;return{start:a.zb(),end:a.
|
|
392
|
-
q.Mf=function(a){0==a?Wa("A trick play rate of 0 is unsupported!"):(this.g.paused&&this.g.play(),this.F.set(a),this.l==
|
|
393
|
-
q.Ec=function(){if(this.A){for(var a=this.i?this.i.h:null,b=[],c=0,d=t(this.A.variants),e=d.next();!e.done;e=d.next())if(e=e.value,
|
|
394
|
-
q.jb=function(){if(this.A){for(var a=this.i?this.i.i:null,b=[],c=t(this.A.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=
|
|
395
|
-
q.Se=function(){return this.A?this.A.imageStreams.map(function(a){return
|
|
391
|
+
q.Hd=function(){if(this.A){var a=this.A.presentationTimeline;return{start:a.zb(),end:a.Ta()}}return this.g&&this.g.src&&(a=this.g.seekable,a.length)?{start:a.start(0),end:a.end(a.length-1)}:{start:0,end:0}};q.keySystem=function(){return Rh(this.drmInfo())};q.drmInfo=function(){return this.m?this.m.i:null};q.Tb=function(){return this.m?this.m.Tb():Infinity};q.Bc=function(){return this.m?this.m.Bc():{}};q.pd=function(){return this.I?this.I.g==Kg:!1};q.$e=function(){return this.g?this.F?this.F.i:1:0};
|
|
392
|
+
q.Mf=function(a){0==a?Wa("A trick play rate of 0 is unsupported!"):(this.g.paused&&this.g.play(),this.F.set(a),this.l==fl&&(this.u.playbackRateChanged(a),kj(this.i,1<Math.abs(a))))};q.Ge=function(){var a=this.F.Ac();this.l==ql&&this.F.set(a);this.l==fl&&(this.F.set(a),this.u.playbackRateChanged(a),kj(this.i,!1))};
|
|
393
|
+
q.Ec=function(){if(this.A){for(var a=this.i?this.i.h:null,b=[],c=0,d=t(this.A.variants),e=d.next();!e.done;e=d.next())if(e=e.value,rg(e)){var f=kg(e);f.active=e==a;f.active||1==c||null==a||e.video!=a.video||e.audio!=a.audio||(f.active=!0);f.active&&c++;b.push(f)}return b}return this.g&&this.g.audioTracks?Array.from(this.g.audioTracks).map(function(g){return pg(g)}):[]};
|
|
394
|
+
q.jb=function(){if(this.A){for(var a=this.i?this.i.i:null,b=[],c=t(this.A.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=lg(d);e.active=d==a;b.push(e)}return b}return this.g&&this.g.src&&this.g.textTracks?sl(this).map(function(f){var g=qg(f);g.active="disabled"!=f.mode;g.type="text";g.originalTextId=f.id;"captions"==f.kind&&(g.mimeType="application/cea-608");f.kind&&(g.roles=[f.kind]);"forced"==f.kind&&(g.forced=!0);return g}):[]};
|
|
395
|
+
q.Se=function(){return this.A?this.A.imageStreams.map(function(a){return mg(a)}):[]};
|
|
396
396
|
q.hf=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,r,u,x,w,y,C,D;return L(function(A){if(1==A.g)return c.A?(d=c.A.imageStreams.find(function(E){return E.id==a}))?d.segmentIndex?A.v(3):v(A,d.createSegmentIndex(),3):A["return"](null):A.v(2);if(2!=A.g){e=d.segmentIndex.find(b);if(null==e)return A["return"](null);f=d.segmentIndex.get(e);g=/(\d+)x(\d+)/.exec(d.tilesLayout);if(!g)return A["return"](null);h=d.width||0;k=d.height||0;l=parseInt(g[1],10);m=parseInt(g[2],10);n=h/l;p=k/m;r=l*m;u=f.j-f.startTime;
|
|
397
397
|
x=u/r;w=f.startTime;C=y=0;1<r&&(D=Math.floor((b-f.startTime)/x),w=f.startTime+D*x,y=D%l*n,C=Math.floor(D/l)*p);return A["return"]({height:p,positionX:y,positionY:C,startTime:w,duration:x,uris:f.na(),width:n})}return A["return"](null)})};
|
|
398
|
-
q.pe=function(a){if(this.A&&this.i){var b=this.A.textStreams.find(function(d){return d.id==a.id});b&&b!=this.i.i&&(
|
|
399
|
-
q.qe=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;if(this.A&&this.i){this.o.abr.enabled&&Wa("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var d=this.A.variants.find(function(e){return e.id==a.id});d&&
|
|
400
|
-
|
|
401
|
-
q.Id=function(a,b){if(this.A&&this.C){this.pa=new
|
|
402
|
-
c=If(a);f=d=null;e=t(e);for(g=e.next();!g.done;g=e.next()){g=g.value;var h=
|
|
403
|
-
q.Jd=function(a,b,c){c=void 0===c?!1:c;if(this.A&&this.C){if(this.qa=a,this.Nb=b||"",this.Za=c,(a=
|
|
404
|
-
q.Ef=function(a){if(this.A&&this.C){for(var b=null,c=t(this.A.variants),d=c.next();!d.done;d=c.next())if(d=d.value,d.audio.label==a){b=d;break}null!=b&&(this.pa=new
|
|
405
|
-
function
|
|
406
|
-
q.Kf=function(a){a=!!a;if(this.Y!=a){this.Y=a;if(this.l==
|
|
398
|
+
q.pe=function(a){if(this.A&&this.i){var b=this.A.textStreams.find(function(d){return d.id==a.id});b&&b!=this.i.i&&(kk(this.j.g,b,!1),nj(this.i,b),Cl(this),this.qa=b.language)}else if(this.g&&this.g.src&&this.g.textTracks){b=sl(this);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,ng(c)==a.id?c.mode=this.Y?"showing":"hidden":c.mode="disabled";Cl(this)}};
|
|
399
|
+
q.qe=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;if(this.A&&this.i){this.o.abr.enabled&&Wa("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var d=this.A.variants.find(function(e){return e.id==a.id});d&&rg(d)&&(il(this,d,!1,b,c),this.pa=new Dg(d),hl(this))}else if(this.g&&this.g.audioTracks)for(b=Array.from(this.g.audioTracks),b=t(b),c=b.next();!c.done;c=b.next())if(c=c.value,
|
|
400
|
+
ng(c)==a.id){Dl(this,c);break}};q.Pe=function(){return El(this.Ec())};q.gf=function(){return El(this.jb())};q.Oe=function(){return Array.from(Fl(this.Ec()))};q.ff=function(){return Array.from(Fl(this.jb()))};
|
|
401
|
+
q.Id=function(a,b){if(this.A&&this.C){this.pa=new Eg(a,b||"",0,"");if(!this.o.abr.enabled){var c=function(k,l){return k.video||l.video?k.video&&l.video?Math.abs((k.video.height||0)-(l.video.height||0))+Math.abs((k.video.width||0)-(l.video.width||0)):Infinity:0},d=this.i.h,e=this.pa.create(this.A.variants),f=null;e=t(e.values());for(var g=e.next();!g.done;g=e.next())if(g=g.value,!f||c(f,d)>c(g,d))f=g;if(f){c=kg(f);this.qe(c,!0);return}}Bl(this)}else if(this.g&&this.g.audioTracks){e=Array.from(this.g.audioTracks);
|
|
402
|
+
c=If(a);f=d=null;e=t(e);for(g=e.next();!g.done;g=e.next()){g=g.value;var h=pg(g);If(h.language)==c&&(d=g,b?h.roles.includes(b)&&(f=g):0==h.roles.length&&(f=g))}f?Dl(this,f):d&&Dl(this,d)}};
|
|
403
|
+
q.Jd=function(a,b,c){c=void 0===c?!1:c;if(this.A&&this.C){if(this.qa=a,this.Nb=b||"",this.Za=c,(a=tg(this.A.textStreams,this.qa,this.Nb,this.Za)[0]||null)&&a!=this.i.i&&(kk(this.j.g,a,!1),this.o.streaming.alwaysStreamText||this.qd()))nj(this.i,a),Cl(this)}else{var d=If(a);(a=this.jb().find(function(e){return If(e.language)==d&&(!b||e.roles.includes(b))&&e.forced==c}))&&this.pe(a)}};
|
|
404
|
+
q.Ef=function(a){if(this.A&&this.C){for(var b=null,c=t(this.A.variants),d=c.next();!d.done;d=c.next())if(d=d.value,d.audio.label==a){b=d;break}null!=b&&(this.pa=new Eg(b.language,"",0,a),Bl(this))}};q.qd=function(){var a=this.Y;return this.L?this.L.m.isTextVisible():this.g&&this.g.src&&this.g.textTracks?sl(this).some(function(b){return"showing"==b.mode}):a};
|
|
405
|
+
function sl(a){return Array.from(a.g.textTracks).filter(function(b){return"metadata"!=b.kind&&"chapters"!=b.kind&&"Shaka Player TextTrack"!=b.label})}function ul(a){return Array.from(a.g.textTracks).filter(function(b){return"metadata"==b.kind})}
|
|
406
|
+
q.Kf=function(a){a=!!a;if(this.Y!=a){this.Y=a;if(this.l==fl)this.L.m.setTextVisibility(a),this.o.streaming.alwaysStreamText||(a?this.i.i||(a=tg(this.A.textStreams,this.qa,this.Nb,this.Za),0<a.length&&(nj(this.i,a[0]),Cl(this))):jj(this.i));else if(this.g&&this.g.src&&this.g.textTracks){var b=sl(this);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,"disabled"!=c.mode&&(c.mode=a?"showing":"hidden")}ll(this)}};
|
|
407
407
|
q.bf=function(){if(!this.Z())return null;var a=this.ea.l,b=0;if(this.C)b=this.C.l();else if(a){if(null==a.startTime)return new Date;b=a.startTime}return this.A?new Date(1E3*(this.A.presentationTimeline.j+b)):this.g&&this.g.getStartDate?(a=this.g.getStartDate(),isNaN(a.getTime())?null:new Date(a.getTime()+1E3*b)):null};
|
|
408
|
-
q.be=function(){if(!this.Z())return null;if(this.A)return new Date(1E3*this.A.presentationTimeline.j);if(this.g&&this.g.getStartDate){var a=this.g.getStartDate();return isNaN(a.getTime())?null:a}return null};q.zc=function(){if(this.l==
|
|
409
|
-
q.getStats=function(){if(this.l!=
|
|
410
|
-
b:Math.max(c.i,b)}a.getVideoPlaybackQuality&&(a=a.getVideoPlaybackQuality(),c=this.j,b=Number(a.totalVideoFrames),c.T=Number(a.droppedVideoFrames),c.O=b,this.j.L=Number(a.corruptedVideoFrames));this.m?(a=this.m,a=a.H?a.H:NaN):a=NaN;this.j.m=a;if(this.l==
|
|
411
|
-
(this.j.I=this.A.presentationTimeline.g);a=this.u.getBandwidthEstimate();this.j.s=a}var d=this.j;a=d.Y;c=d.C;b=d.u;var e=d.O,f=d.T,g=d.L,h=d.s,k=d.i,l=d.l,m=d.H,n=d.j,p=
|
|
408
|
+
q.be=function(){if(!this.Z())return null;if(this.A)return new Date(1E3*this.A.presentationTimeline.j);if(this.g&&this.g.getStartDate){var a=this.g.getStartDate();return isNaN(a.getTime())?null:a}return null};q.zc=function(){if(this.l==fl)return this.L.zc();var a={total:[],audio:[],video:[],text:[]};this.l==ql&&(a.total=ge(this.g.buffered));return a};
|
|
409
|
+
q.getStats=function(){if(this.l!=fl&&this.l!=ql)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,switchHistory:[],stateHistory:[]};Yk(this);var a=this.g,b=a.currentTime/a.duration;if(!isNaN(b)){var c=this.j;b=Math.round(100*b);c.i=isNaN(c.i)?
|
|
410
|
+
b:Math.max(c.i,b)}a.getVideoPlaybackQuality&&(a=a.getVideoPlaybackQuality(),c=this.j,b=Number(a.totalVideoFrames),c.T=Number(a.droppedVideoFrames),c.O=b,this.j.L=Number(a.corruptedVideoFrames));this.m?(a=this.m,a=a.H?a.H:NaN):a=NaN;this.j.m=a;if(this.l==fl){if(a=this.i.h)this.j.u=(this.F?this.F.i:1)*a.bandwidth;a&&a.video&&(c=this.j,b=a.video.height||NaN,c.Y=a.video.width||NaN,c.C=b);this.Z()&&(a=this.be().valueOf()+1E3*this.Hd().end,this.j.F=(Date.now()-a)/1E3);this.A&&this.A.presentationTimeline&&
|
|
411
|
+
(this.j.I=this.A.presentationTimeline.g);a=this.u.getBandwidthEstimate();this.j.s=a}var d=this.j;a=d.Y;c=d.C;b=d.u;var e=d.O,f=d.T,g=d.L,h=d.s,k=d.i,l=d.l,m=d.H,n=d.j,p=gk(d.h,"playing"),r=gk(d.h,"paused"),u=gk(d.h,"buffering"),x=d.m,w=d.F,y=d.I,C=hk(d.h),D=[];d=t(d.g.g);for(var A=d.next();!A.done;A=d.next())A=A.value,D.push({timestamp:A.timestamp,id:A.id,type:A.type,fromAdaptation:A.fromAdaptation,bandwidth:A.bandwidth});return{width:a,height:c,streamBandwidth:b,decodedFrames:e,droppedFrames:f,corruptedFrames:g,
|
|
412
412
|
estimatedBandwidth:h,completionPercent:k,loadLatency:l,manifestTimeSeconds:m,drmTimeSeconds:n,playTime:p,pauseTime:r,bufferingTime:u,licenseTime:x,liveLatency:w,maxSegmentDuration:y,stateHistory:C,switchHistory:D}};
|
|
413
|
-
q.addTextTrack=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;Gb("addTextTrack","Please use an addTextTrackAsync.");if(this.l!=
|
|
414
|
-
f||"";d.kind=c;d.srclang=b;this.g.getAttribute("crossorigin")||this.g.setAttribute("crossorigin","anonymous");this.g.appendChild(d);if(a=this.jb().find(function(k){return k.language==b&&k.label==(f||"")&&k.kind==c}))return
|
|
415
|
-
keyIds:new Set,language:b,label:f||null,type:Be,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null};if(!Te(Me(a.mimeType,a.codecs)))throw new N(2,2,2014,d);this.A.textStreams.push(a);
|
|
416
|
-
q.Ce=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,p,r,u,x,w,y,C,D;return L(function(A){switch(A.g){case 1:if(h.l!=
|
|
417
|
-
2,2011,k);case 2:if(h.l!=
|
|
418
|
-
A["return"](u);throw new N(1,2,2012);case 7:x=Ce;w=h.A.presentationTimeline.getDuration();if(Infinity==w)throw new N(1,4,4033);y={id:h.ld++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:
|
|
419
|
-
Me(y.mimeType,y.codecs);D=Te(C);if(!D)throw new N(2,2,2014,d);h.A.textStreams.push(y);
|
|
420
|
-
q.Md=function(a,b){this.kd.width=a;this.kd.height=b};q.Fd=function(){if(this.l==
|
|
421
|
-
q.We=function(){return this.tc};function
|
|
422
|
-
function
|
|
423
|
-
segmentIndex:k,mimeType:h,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:e.closedCaptions.get(g),label:null,type:Be,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:e.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null};b.textStreams.push(h);c.add(g)}}q.yc=function(a){var b=this;return L(function(c){if(1==c.g)return v(c,
|
|
424
|
-
function
|
|
425
|
-
function
|
|
426
|
-
f.next())g=g.value,
|
|
427
|
-
function
|
|
428
|
-
function
|
|
429
|
-
function
|
|
430
|
-
function
|
|
431
|
-
function
|
|
432
|
-
function
|
|
433
|
-
function
|
|
434
|
-
(e=!0)}}}e&&
|
|
435
|
-
function
|
|
436
|
-
missingKeys:Array.from(g),restrictedKeyStatuses:Array.from(h)},new N(2,4,4012,c);}function
|
|
437
|
-
function
|
|
438
|
-
h.push({language:l,role:n,label:p})}});return h}function
|
|
413
|
+
q.addTextTrack=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;Gb("addTextTrack","Please use an addTextTrackAsync.");if(this.l!=fl&&this.l!=ql)throw new N(1,7,7004);if(!d){var h=li(a);d={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"}[h];if(!d)throw new N(1,2,2011,h);}if(this.l==ql){if("text/vtt"!=d)throw new N(1,2,2013,d);g&&(c="forced");d=document.createElement("track");d.src=a;d.label=
|
|
414
|
+
f||"";d.kind=c;d.srclang=b;this.g.getAttribute("crossorigin")||this.g.setAttribute("crossorigin","anonymous");this.g.appendChild(d);if(a=this.jb().find(function(k){return k.language==b&&k.label==(f||"")&&k.kind==c}))return ol(this),a;throw new N(1,2,2012);}h=this.A.presentationTimeline.getDuration();if(Infinity==h)throw new N(1,4,4033);a={id:this.ld++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Oi(0,h,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],
|
|
415
|
+
keyIds:new Set,language:b,label:f||null,type:Be,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null};if(!Te(Me(a.mimeType,a.codecs)))throw new N(2,2,2014,d);this.A.textStreams.push(a);ol(this);return lg(a)};
|
|
416
|
+
q.Ce=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,p,r,u,x,w,y,C,D;return L(function(A){switch(A.g){case 1:if(h.l!=fl&&h.l!=ql)throw new N(1,7,7004);if(d){A.v(2);break}k=li(a);if(d={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"}[k]){A.v(3);break}B(A,4);return v(A,ni(a,h.P,h.o.streaming.retryParameters),6);case 6:d=A.h;wa(A,3);break;case 4:F(A);case 3:if(!d)throw new N(1,
|
|
417
|
+
2,2011,k);case 2:if(h.l!=ql){A.v(7);break}if("text/vtt"==d){A.v(8);break}return v(A,Gl(a,h.P,h.o.streaming.retryParameters),9);case 9:l=A.h,m=Hl(h,l,d),n=new Blob([m],{type:"text/vtt"}),a=nf(n),d="text/vtt";case 8:g&&(c="forced");p=document.createElement("track");p.src=a;p.label=f||"";p.kind=c;p.srclang=b;h.g.getAttribute("crossorigin")||h.g.setAttribute("crossorigin","anonymous");h.g.appendChild(p);r=h.jb();if(u=r.find(function(E){return E.language==b&&E.label==(f||"")&&E.kind==c}))return ol(h),
|
|
418
|
+
A["return"](u);throw new N(1,2,2012);case 7:x=Ce;w=h.A.presentationTimeline.getDuration();if(Infinity==w)throw new N(1,4,4033);y={id:h.ld++,originalId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Oi(0,w,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,label:f||null,type:x.ba,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null};C=
|
|
419
|
+
Me(y.mimeType,y.codecs);D=Te(C);if(!D)throw new N(2,2,2014,d);h.A.textStreams.push(y);ol(h);return A["return"](lg(y))}})};function Gl(a,b,c){var d,e,f;return L(function(g){if(1==g.g)return d=lh,e=fh([a],c),e.method="GET",v(g,b.request(d,e).promise,2);f=g.h;return g["return"](f.data)})}function Hl(a,b,c){var d=Ue[c];if(d)return c=d(),a={periodStart:0,segmentStart:0,segmentEnd:a.g.duration},b=qb(b),b=c.parseMedia(b,a),Wj(b);throw new N(2,2,2014,c);}
|
|
420
|
+
q.Md=function(a,b){this.kd.width=a;this.kd.height=b};q.Fd=function(){if(this.l==fl){var a=this.i;if(a.J.g)a=!1;else if(a.j)a=!1;else{for(var b=t(a.g.values()),c=b.next();!c.done;c=b.next())c=c.value,c.Xb&&(c.Xb=!1,ij(a,c,.1));a=!0}}else a=!1;return a};q.Ve=function(){Wa("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for.");return this.A};
|
|
421
|
+
q.We=function(){return this.tc};function nk(a){var b=bk();b.streaming.failureCallback=function(c){var d=[1001,1002,1003];a.Z()&&d.includes(c.code)&&(c.severity=1,a.Fd())};b.textDisplayFactory=function(){return a.pc?new Pj(a.g,a.pc):new Kj(a.g)};return b}q.ue=function(a){this.pc=a};
|
|
422
|
+
function Rk(a,b){for(var c=new Set,d=t(b.textStreams),e=d.next();!e.done;e=d.next())e=e.value,"application/cea-608"!=e.mimeType&&"application/cea-708"!=e.mimeType||c.add(e.originalId);d=t(b.variants);for(e=d.next();!e.done;e=d.next())if((e=e.value.video)&&e.closedCaptions)for(var f=t(e.closedCaptions.keys()),g=f.next();!g.done;g=f.next())if(g=g.value,!c.has(g)){var h=g.startsWith("CC")?"application/cea-608":"application/cea-708",k=new Pi;h={id:a.ld++,originalId:g,createSegmentIndex:function(){return Promise.resolve()},
|
|
423
|
+
segmentIndex:k,mimeType:h,codecs:"",kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:e.closedCaptions.get(g),label:null,type:Be,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:e.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null};b.textStreams.push(h);c.add(g)}}q.yc=function(a){var b=this;return L(function(c){if(1==c.g)return v(c,Il(b,a),2);Al(b,a);z(c)})};
|
|
424
|
+
function Il(a,b){var c;return L(function(d){if(1==d.g)return c=a.i?a.i.h:null,v(d,Xf(a.m,c,b,a.o.useMediaCapabilities),2);nl(b);z(d)})}
|
|
425
|
+
function Al(a,b){if(a.l!=Dk){for(var c=a.o.restrictions,d=a.kd,e=!1,f=t(b.variants),g=f.next();!g.done;g=f.next()){g=g.value;var h=g.allowedByApplication;g.allowedByApplication=Wf(g,c,d);h!=g.allowedByApplication&&(e=!0)}e&&a.i&&ol(a);if((c=a.m?a.m.i:null)&&a.m.m)for(d=t(b.variants),e=d.next();!e.done;e=d.next())for(e=e.value,e=t((e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])),f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem==c.keySystem)for(f=t(f.initData||[]),g=f.next();!g.done;g=
|
|
426
|
+
f.next())g=g.value,Jh(a.m,g.initDataType,g.initData);Jl(a,b)}}
|
|
427
|
+
function jl(a,b){var c,d,e,f,g;return L(function(h){if(1==h.g)return c=a.audio,d=a.video,e=function(k,l){var m,n;return L(function(p){if(1==p.g)return k?v(p,k.createSegmentIndex(),2):p["return"](null);m=k.segmentIndex[Symbol.iterator]().seek(l);if(!m)return p["return"](null);n=m.startTime;return p["return"](n)})},v(h,e(c,b),2);if(3!=h.g)return f=h.h,v(h,e(d,b),3);g=h.h;return null!=g&&null!=f?h["return"](Math.max(g,f)):null!=g?h["return"](g):null!=f?h["return"](f):h["return"](b)})}
|
|
428
|
+
function Mk(a){var b=a.pd();if(a.j&&a.I&&a.C){var c=a.F;c.j=b;Ri(c);Yk(a)}b=(new Map).set("buffering",b);a.dispatchEvent(Ak(Kl,b))}function Zk(a){var b=a.g.playbackRate;0!=b&&(a.F&&a.F.set(b),b=Ak(Ll),a.dispatchEvent(b))}function Yk(a){if(a.j&&a.I){var b=a.j.h;a.I.g==Kg?fk(b,"buffering"):a.g.paused?fk(b,"paused"):a.g.ended?fk(b,"ended"):fk(b,"playing")}}
|
|
429
|
+
function hl(a){try{Jl(a,a.A)}catch(c){return Kk(a,c),!1}var b=a.A.variants.filter(function(c){return rg(c)});b=a.pa.create(b);a.u.setVariants(Array.from(b.values()));return!0}function Bl(a){var b;if(b=hl(a)?a.u.chooseVariant():null)il(a,b,!0,!0,0),al(a)}function il(a,b,c,d,e){var f=a.i.h;b==f?d&&mj(a.i,b,d,e,!0):(jk(a.j.g,b,c),mj(a.i,b,d,e),c=null,f&&(c=kg(f)),b=kg(b),Ml(a,c,b))}
|
|
430
|
+
function Dl(a,b){var c=Array.from(a.g.audioTracks).find(function(e){return e.enabled});b.enabled=!0;b.id!==c.id&&(c.enabled=!1);c=pg(c);var d=pg(b);Ml(a,c,d)}function kl(a,b,c){a=If(a.o.preferredTextLanguage);b=If(b.language);c=If(c.language);return Hf(c,a)&&!Hf(b,c)}function al(a){var b=Ak(Nl);Ol(a,b)}function ol(a){var b=Ak(Pl);Ol(a,b)}function Ml(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=Ak(Ql,b);Ol(a,b)}function Cl(a){var b=Ak(Rl);Ol(a,b)}function ll(a){var b=Ak(Sl);Ol(a,b)}
|
|
431
|
+
function ml(a){var b=(new Map).set("newStatus",a.o.abr.enabled);Ol(a,Ak(Tl,b))}function Kk(a,b){if(a.l!=Dk){var c=Ak(Ul,(new Map).set("detail",b));a.dispatchEvent(c);c.defaultPrevented&&(b.handled=!0)}}function Pk(a,b,c){c=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,eventElement:c.eventElement});a.dispatchEvent(Ak(b,c))}
|
|
432
|
+
function Jk(a){if(!a.g.error)return null;var b=a.g.error.code;if(1==b)return null;var c=a.g.error.msExtendedCode;c&&(0>c&&(c+=Math.pow(2,32)),c=c.toString(16));return new N(2,3,3016,b,c,a.g.error.message)}
|
|
433
|
+
function Vk(a,b){if(a.i){var c=Object.keys(b),d=1==c.length&&"00"==c[0],e=!1;if(c.length){c=t(a.A.variants);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=[];f.audio&&g.push(f.audio);f.video&&g.push(f.video);g=t(g);for(var h=g.next();!h.done;h=g.next()){var k=h.value;h=f.allowedByKeySystem;if(k.keyIds.size){f.allowedByKeySystem=!0;k=t(k.keyIds);for(var l=k.next();!l.done;l=k.next())l=l.value,l=b[d?"00":l],f.allowedByKeySystem=f.allowedByKeySystem&&!!l&&!Vl.includes(l)}h!=f.allowedByKeySystem&&
|
|
434
|
+
(e=!0)}}}e&&hl(a);(d=a.i.h)&&!d.allowedByKeySystem&&Bl(a);e&&ol(a)}}function Wk(a,b,c){if(a.s&&a.s.onExpirationUpdated)a.s.onExpirationUpdated(b,c);b=Ak(Wl);a.dispatchEvent(b)}function $k(a,b,c){0<b&&(a.Z()||a.te(b));b=a.getDuration();c<b&&(a.Z()||a.Ma(c))}
|
|
435
|
+
function Jl(a,b){var c=a.m?a.m.Bc():{},d=Object.keys(c);d=d.length&&"00"==d[0];for(var e=!1,f=!1,g=new Set,h=new Set,k=t(b.variants),l=k.next();!l.done;l=k.next()){l=l.value;var m=[];l.audio&&m.push(l.audio);l.video&&m.push(l.video);m=t(m);for(var n=m.next();!n.done;n=m.next())if(n=n.value,n.keyIds.size){n=t(n.keyIds);for(var p=n.next();!p.done;p=n.next()){p=p.value;var r=c[d?"00":p];r?Vl.includes(r)&&h.add(r):g.add(p)}}l.allowedByApplication?l.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw c={hasAppRestrictions:f,
|
|
436
|
+
missingKeys:Array.from(g),restrictedKeyStatuses:Array.from(h)},new N(2,4,4012,c);}function nl(a){if(!a.variants.some(rg))throw new N(2,4,4032);}function Ol(a,b){L(function(c){if(1==c.g)return v(c,Promise.resolve(),2);a.l!=Dk&&a.dispatchEvent(b);z(c)})}function Fl(a){var b=new Set;a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.language?b.add(If(c.language)):b.add("und");return b}
|
|
437
|
+
function El(a){var b=new Map,c=new Map;a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e="und",f=[];d.language&&(e=If(d.language));"variant"==d.type?f=d.audioRoles:f=d.roles;f&&f.length||(f=[""]);b.has(e)||b.set(e,new Set);f=t(f);for(var g=f.next();!g.done;g=f.next())g=g.value,b.get(e).add(g),d.label&&(c.has(e)||c.set(e,new Map),c.get(e).set(g,d.label))}var h=[];b.forEach(function(k,l){for(var m=t(k),n=m.next();!n.done;n=m.next()){n=n.value;var p=null;c.has(l)&&c.get(l).has(n)&&(p=c.get(l).get(n));
|
|
438
|
+
h.push({language:l,role:n,label:p})}});return h}function Ek(){return new N(2,7,7E3)}function zk(a,b,c,d,e,f){return d==a&&e.G==f.G&&e.uri==f.uri&&e.mimeType==f.mimeType?b:c}function Ej(){return{G:null,mimeType:null,startTime:null,Pd:NaN,uri:null}}function Fk(a){return new Promise(function(b,c){a.nb=function(){return c(Ek())};a.Hc=function(){return b()};a.onError=function(d){return c(d)};a.Jc=function(){return c(Ek())}})}M("shaka.Player",V);V.prototype.setVideoContainer=V.prototype.ue;
|
|
439
439
|
V.prototype.getManifestParserFactory=V.prototype.We;V.prototype.getManifest=V.prototype.Ve;V.prototype.retryStreaming=V.prototype.Fd;V.prototype.setMaxHardwareResolution=V.prototype.Md;V.prototype.addTextTrackAsync=V.prototype.Ce;V.prototype.addTextTrack=V.prototype.addTextTrack;V.prototype.getStats=V.prototype.getStats;V.prototype.getBufferedInfo=V.prototype.zc;V.prototype.getPresentationStartTimeAsDate=V.prototype.be;V.prototype.getPlayheadTimeAsDate=V.prototype.bf;
|
|
440
440
|
V.prototype.setTextTrackVisibility=V.prototype.Kf;V.prototype.isTextTrackVisible=V.prototype.qd;V.prototype.selectVariantsByLabel=V.prototype.Ef;V.prototype.selectTextLanguage=V.prototype.Jd;V.prototype.selectAudioLanguage=V.prototype.Id;V.prototype.getTextLanguages=V.prototype.ff;V.prototype.getAudioLanguages=V.prototype.Oe;V.prototype.getTextLanguagesAndRoles=V.prototype.gf;V.prototype.getAudioLanguagesAndRoles=V.prototype.Pe;V.prototype.selectVariantTrack=V.prototype.qe;
|
|
441
441
|
V.prototype.selectTextTrack=V.prototype.pe;V.prototype.getThumbnails=V.prototype.hf;V.prototype.getImageTracks=V.prototype.Se;V.prototype.getTextTracks=V.prototype.jb;V.prototype.getVariantTracks=V.prototype.Ec;V.prototype.cancelTrickPlay=V.prototype.Ge;V.prototype.trickPlay=V.prototype.Mf;V.prototype.getPlaybackRate=V.prototype.$e;V.prototype.isBuffering=V.prototype.pd;V.prototype.getKeyStatuses=V.prototype.Bc;V.prototype.getExpiration=V.prototype.Tb;V.prototype.drmInfo=V.prototype.drmInfo;
|
|
442
442
|
V.prototype.keySystem=V.prototype.keySystem;V.prototype.seekRange=V.prototype.Hd;V.prototype.isAudioOnly=V.prototype.lf;V.prototype.isInProgress=V.prototype.mb;V.prototype.isLive=V.prototype.Z;V.prototype.getAdManager=V.prototype.ae;V.prototype.getAssetUri=V.prototype.md;V.prototype.getNetworkingEngine=V.prototype.Ub;V.prototype.getMediaElement=V.prototype.Ye;V.prototype.getLoadMode=V.prototype.Ue;V.prototype.resetConfiguration=V.prototype.Df;V.prototype.getConfiguration=V.prototype.getConfiguration;
|
|
443
443
|
V.prototype.configure=V.prototype.configure;V.prototype.load=V.prototype.load;V.prototype.unload=V.prototype.Rd;V.prototype.detach=V.prototype.detach;V.prototype.attach=V.prototype.Pb;
|
|
444
|
-
V.probeSupport=function(a){a=void 0===a?!0:a;var b,c,d,e,f,g;return L(function(h){if(1==h.g)return b={},a?v(h,
|
|
445
|
-
Yb()?!!
|
|
446
|
-
for(l=p.next();!l.done;l=p.next())l=l.value,k[l]=Yb()?Te(l)?!0:MediaSource.isTypeSupported(l)||Ie(l):Zb(l),m=l.split(";")[0],k[m]=k[m]||k[l];d=k;e={manifest:c,media:d,drm:b};f=
|
|
444
|
+
V.probeSupport=function(a){a=void 0===a?!0:a;var b,c,d,e,f,g;return L(function(h){if(1==h.g)return b={},a?v(h,di(),3):h.v(2);2!=h.g&&(b=h.h);var k={};if(Yb()){for(var l in ki)k[l]=!0;for(var m in mi)k[m]=!0}l={mpd:"application/dash+xml",m3u8:"application/x-mpegurl",ism:"application/vnd.ms-sstr+xml"};m=t(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"]);for(var n=m.next();!n.done;n=m.next())n=n.value,k[n]=Yb()?!!ki[n]:Zb(n);for(var p in l)k[p]=
|
|
445
|
+
Yb()?!!mi[p]:Zb(l[p]);c=k;k={};p=t('video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",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",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(","));
|
|
446
|
+
for(l=p.next();!l.done;l=p.next())l=l.value,k[l]=Yb()?Te(l)?!0:MediaSource.isTypeSupported(l)||Ie(l):Zb(l),m=l.split(";")[0],k[m]=k[m]||k[l];d=k;e={manifest:c,media:d,drm:b};f=Xl;for(g in f)e[g]=f[g]();return h["return"](e)})};
|
|
447
447
|
V.isBrowserSupported=function(){window.Promise||Wa("A Promise implementation or polyfill is required");window.TextDecoder&&window.TextEncoder||Wa("A TextDecoder/TextEncoder implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&window.TextDecoder&&window.TextEncoder&&Array.prototype.forEach)||bc("Trident/"))return!1;var a=fc();return a&&12>a||!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)?
|
|
448
|
-
!1:Yb()?!0:Zb("application/x-mpegurl")};V.setAdManagerFactory=function(a){
|
|
449
|
-
var
|
|
450
|
-
dg:
|
|
448
|
+
!1:Yb()?!0:Zb("application/x-mpegurl")};V.setAdManagerFactory=function(a){pk=a};V.registerSupportPlugin=function(a,b){Xl[a]=b};V.prototype.destroy=V.prototype.destroy;
|
|
449
|
+
var Tl="abrstatuschanged",Nl="adaptation",Kl="buffering",Xk="drmsessionupdate",Bj="emsg",Ul="error",Wl="expirationupdated",Ik="loaded",Gk="loading",Sk="manifestparsed",vl="metadata",Bk="onstatechange",Ck="onstateidle",Ll="ratechange",gl="streaming",Rl="textchanged",Sl="texttrackvisibility",Qk="timelineregionadded",xl="timelineregionenter",yl="timelineregionexit",Pl="trackschanged",Lk="unloading",Ql="variantchanged",Yl={Tf:Tl,Uf:Nl,Vf:Kl,Wf:Xk,Yf:Bj,Error:Ul,Zf:Wl,$f:"largegap",ag:Ik,bg:Gk,cg:Sk,Metadata:vl,
|
|
450
|
+
dg:Bk,eg:Ck,fg:Ll,gg:"sessiondata",hg:gl,ig:Rl,jg:Sl,kg:Qk,lg:xl,mg:yl,ng:Pl,og:Lk,pg:Ql},Dk=0,mk=1,fl=2,ql=3;V.LoadMode={DESTROYED:Dk,NOT_LOADED:mk,MEDIA_SOURCE:fl,SRC_EQUALS:ql};V.version="v3.1.5";var Zl=["3","1"];Hb=new function(a){this.g=a;this.i=Ib;this.h=Jb}(new Fb(Number(Zl[0]),Number(Zl[1])));var Vl=["output-restricted","internal-error"],Xl={},pk=null;function $l(){this.h=[];this.j=this.i=this.g=0};function W(a,b){var c=this;this.i=a;this.g=b;this.j=!1;this.l=this.g.getVolume();this.h=new ef;this.h.B(this.g,google.ima.AdEvent.Type.PAUSED,function(){c.j=!0});this.h.B(this.g,google.ima.AdEvent.Type.RESUMED,function(){c.j=!1})}q=W.prototype;q.getDuration=function(){return this.i.getDuration()};q.getMinSuggestedDuration=function(){return this.i.getMinSuggestedDuration()};q.getRemainingTime=function(){return this.g.getRemainingTime()};q.isPaused=function(){return this.j};
|
|
451
451
|
q.isSkippable=function(){return 0<=this.i.getSkipTimeOffset()};q.getTimeUntilSkippable=function(){var a=this.i.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};q.canSkipNow=function(){return this.g.getAdSkippableState()};q.skip=function(){return this.g.skip()};q.pause=function(){return this.g.pause()};q.play=function(){return this.g.resume()};q.getVolume=function(){return this.g.getVolume()};q.setVolume=function(a){return this.g.setVolume(a)};q.isMuted=function(){return 0==this.g.getVolume()};
|
|
452
452
|
q.resize=function(a,b){this.g.resize(a,b,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)};q.setMuted=function(a){a?(this.l=this.getVolume(),this.setVolume(0)):this.setVolume(this.l)};q.getSequenceLength=function(){var a=this.i.getAdPodInfo();return null==a?1:a.getTotalAds()};q.getPositionInSequence=function(){var a=this.i.getAdPodInfo();return null==a?1:a.getAdPosition()};q.release=function(){this.g=this.i=null};M("shaka.ads.ClientSideAd",W);
|
|
453
453
|
W.prototype.release=W.prototype.release;W.prototype.getPositionInSequence=W.prototype.getPositionInSequence;W.prototype.getSequenceLength=W.prototype.getSequenceLength;W.prototype.setMuted=W.prototype.setMuted;W.prototype.resize=W.prototype.resize;W.prototype.isMuted=W.prototype.isMuted;W.prototype.setVolume=W.prototype.setVolume;W.prototype.getVolume=W.prototype.getVolume;W.prototype.play=W.prototype.play;W.prototype.pause=W.prototype.pause;W.prototype.skip=W.prototype.skip;
|
|
454
|
-
W.prototype.canSkipNow=W.prototype.canSkipNow;W.prototype.getTimeUntilSkippable=W.prototype.getTimeUntilSkippable;W.prototype.isSkippable=W.prototype.isSkippable;W.prototype.isPaused=W.prototype.isPaused;W.prototype.getRemainingTime=W.prototype.getRemainingTime;W.prototype.getMinSuggestedDuration=W.prototype.getMinSuggestedDuration;W.prototype.getDuration=W.prototype.getDuration;function
|
|
455
|
-
function(f){
|
|
456
|
-
function
|
|
457
|
-
a.h.B(a.g,"loadeddata",function(){a.i.resize(a.g.offsetWidth,a.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),"ResizeObserver"in window&&(a.u=new ResizeObserver(function(){a.i.resize(a.g.offsetWidth,a.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a.u.observe(a.g)),a.i.start()}catch(f){
|
|
458
|
-
function
|
|
459
|
-
function(c){b(c,"ad-third-quartile")});a.h.B(a.i,google.ima.AdEvent.Type.COMPLETE,function(c){b(c,"ad-complete")});a.h.B(a.i,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(c){
|
|
454
|
+
W.prototype.canSkipNow=W.prototype.canSkipNow;W.prototype.getTimeUntilSkippable=W.prototype.getTimeUntilSkippable;W.prototype.isSkippable=W.prototype.isSkippable;W.prototype.isPaused=W.prototype.isPaused;W.prototype.getRemainingTime=W.prototype.getRemainingTime;W.prototype.getMinSuggestedDuration=W.prototype.getMinSuggestedDuration;W.prototype.getDuration=W.prototype.getDuration;function am(a,b,c,d){var e=this;this.m=a;this.g=b;this.u=null;this.C=NaN;this.j=d;this.s=null;this.h=new ef;google.ima.settings.setLocale(c);a=new google.ima.AdDisplayContainer(this.m,this.g);a.initialize();this.l=new google.ima.AdsLoader(a);this.l.getSettings().setPlayerType("shaka-player");this.l.getSettings().setPlayerVersion("v3.1.5");this.i=null;this.h.wa(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(f){bm(e,f)});this.h.B(this.l,google.ima.AdErrorEvent.Type.AD_ERROR,
|
|
455
|
+
function(f){cm(e,f)});this.g.onended=function(){e.l.contentComplete()}}am.prototype.stop=function(){this.i&&this.i.stop();this.m&&Oj(this.m)};am.prototype.release=function(){this.stop();this.u&&this.u.disconnect();this.h&&this.h.release();this.i&&this.i.destroy();this.l.destroy()};function cm(a,b){b.getError();dm(a,null);a.j(new R("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
|
|
456
|
+
function bm(a,b){a.j(new R("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.C)));a.i=b.getAdsManager(a.g);a.j(new R("ima-ad-manager-loaded",(new Map).set("imaAdManager",a.i)));var c=a.i.getCuePoints();if(c.length){var d=[];c=t(c);for(var e=c.next();!e.done;e=c.next())d.push(new em(e.value));a.j(new R("ad-cue-points-changed",(new Map).set("cuepoints",d)))}fm(a);try{a.i.init(a.g.offsetWidth,a.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL),
|
|
457
|
+
a.h.B(a.g,"loadeddata",function(){a.i.resize(a.g.offsetWidth,a.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),"ResizeObserver"in window&&(a.u=new ResizeObserver(function(){a.i.resize(a.g.offsetWidth,a.g.offsetHeight,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a.u.observe(a.g)),a.i.start()}catch(f){dm(a,null)}}
|
|
458
|
+
function fm(a){function b(c,d){var e=(new Map).set("originalEvent",c);a.j(new R(d,e))}a.h.B(a.i,google.ima.AdErrorEvent.Type.AD_ERROR,function(c){cm(a,c)});a.h.B(a.i,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(c){gm(a,c)});a.h.B(a.i,google.ima.AdEvent.Type.STARTED,function(c){gm(a,c)});a.h.B(a.i,google.ima.AdEvent.Type.FIRST_QUARTILE,function(c){b(c,"ad-first-quartile")});a.h.B(a.i,google.ima.AdEvent.Type.MIDPOINT,function(c){b(c,"ad-midpoint")});a.h.B(a.i,google.ima.AdEvent.Type.THIRD_QUARTILE,
|
|
459
|
+
function(c){b(c,"ad-third-quartile")});a.h.B(a.i,google.ima.AdEvent.Type.COMPLETE,function(c){b(c,"ad-complete")});a.h.B(a.i,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(c){dm(a,c)});a.h.B(a.i,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(c){dm(a,c)});a.h.B(a.i,google.ima.AdEvent.Type.SKIPPED,function(c){b(c,"ad-skipped")});a.h.B(a.i,google.ima.AdEvent.Type.VOLUME_CHANGED,function(c){b(c,"ad-volume-changed")});a.h.B(a.i,google.ima.AdEvent.Type.VOLUME_MUTED,function(c){b(c,"ad-muted")});
|
|
460
460
|
a.h.B(a.i,google.ima.AdEvent.Type.PAUSED,function(c){a.s.j=!0;b(c,"ad-paused")});a.h.B(a.i,google.ima.AdEvent.Type.RESUMED,function(c){a.s.j=!1;b(c,"ad-resumed")});a.h.B(a.i,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,function(c){b(c,"ad-skip-state-changed")});a.h.B(a.i,google.ima.AdEvent.Type.CLICK,function(c){b(c,"ad-clicked")});a.h.B(a.i,google.ima.AdEvent.Type.AD_PROGRESS,function(c){b(c,"ad-progress")});a.h.B(a.i,google.ima.AdEvent.Type.AD_BUFFERING,function(c){b(c,"ad-buffering")});a.h.B(a.i,
|
|
461
461
|
google.ima.AdEvent.Type.IMPRESSION,function(c){b(c,"ad-impression")});a.h.B(a.i,google.ima.AdEvent.Type.DURATION_CHANGE,function(c){b(c,"ad-duration-changed")});a.h.B(a.i,google.ima.AdEvent.Type.USER_CLOSE,function(c){b(c,"ad-closed")});a.h.B(a.i,google.ima.AdEvent.Type.LOADED,function(c){b(c,"ad-loaded")});a.h.B(a.i,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(c){b(c,"all-ads-completed")});a.h.B(a.i,google.ima.AdEvent.Type.LINEAR_CHANGED,function(c){b(c,"ad-linear-changed")});a.h.B(a.i,google.ima.AdEvent.Type.AD_METADATA,
|
|
462
|
-
function(c){b(c,"ad-metadata")});a.h.B(a.i,google.ima.AdEvent.Type.LOG,function(c){b(c,"ad-recoverable-error")});a.h.B(a.i,google.ima.AdEvent.Type.AD_BREAK_READY,function(c){b(c,"ad-break-ready")});a.h.B(a.i,google.ima.AdEvent.Type.INTERACTION,function(c){b(c,"ad-interaction")})}function
|
|
463
|
-
function
|
|
462
|
+
function(c){b(c,"ad-metadata")});a.h.B(a.i,google.ima.AdEvent.Type.LOG,function(c){b(c,"ad-recoverable-error")});a.h.B(a.i,google.ima.AdEvent.Type.AD_BREAK_READY,function(c){b(c,"ad-break-ready")});a.h.B(a.i,google.ima.AdEvent.Type.INTERACTION,function(c){b(c,"ad-interaction")})}function gm(a,b){var c=b.getAd();a.s=new W(c,a.i);c=(new Map).set("ad",a.s).set("sdkAdObject",c).set("originalEvent",b);a.j(new R("ad-started",c));a.m.setAttribute("ad-active","true");a.g.pause()}
|
|
463
|
+
function dm(a,b){a.j(new R("ad-stopped",(new Map).set("originalEvent",b)));a.m.removeAttribute("ad-active");a.g.play()};function X(a,b){this.i=a;this.h=null;this.g=b}q=X.prototype;q.getDuration=function(){return this.h?this.h.duration:-1};q.getMinSuggestedDuration=function(){return this.getDuration()};q.getRemainingTime=function(){return this.h?this.h.duration-this.h.currentTime:-1};q.isPaused=function(){return this.g.paused};q.isSkippable=function(){return this.i.isSkippable()};q.getTimeUntilSkippable=function(){var a=this.i.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};
|
|
464
464
|
q.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};q.skip=function(){this.g.currentTime+=this.getRemainingTime()};q.pause=function(){return this.g.pause()};q.play=function(){return this.g.play()};q.getVolume=function(){return this.g.volume};q.setVolume=function(a){this.g.volume=a};q.isMuted=function(){return this.g.muted};q.resize=function(){};q.setMuted=function(a){this.g.muted=a};q.getSequenceLength=function(){var a=this.i.getAdPodInfo();return null==a?1:a.getTotalAds()};
|
|
465
465
|
q.getPositionInSequence=function(){var a=this.i.getAdPodInfo();return null==a?1:a.getAdPosition()};q.release=function(){this.g=this.h=this.i=null};M("shaka.ads.ServerSideAd",X);X.prototype.release=X.prototype.release;X.prototype.getPositionInSequence=X.prototype.getPositionInSequence;X.prototype.getSequenceLength=X.prototype.getSequenceLength;X.prototype.setMuted=X.prototype.setMuted;X.prototype.resize=X.prototype.resize;X.prototype.isMuted=X.prototype.isMuted;X.prototype.setVolume=X.prototype.setVolume;
|
|
466
466
|
X.prototype.getVolume=X.prototype.getVolume;X.prototype.play=X.prototype.play;X.prototype.pause=X.prototype.pause;X.prototype.skip=X.prototype.skip;X.prototype.canSkipNow=X.prototype.canSkipNow;X.prototype.getTimeUntilSkippable=X.prototype.getTimeUntilSkippable;X.prototype.isSkippable=X.prototype.isSkippable;X.prototype.isPaused=X.prototype.isPaused;X.prototype.getRemainingTime=X.prototype.getRemainingTime;X.prototype.getMinSuggestedDuration=X.prototype.getMinSuggestedDuration;
|
|
467
|
-
X.prototype.getDuration=X.prototype.getDuration;function
|
|
467
|
+
X.prototype.getDuration=X.prototype.getDuration;function hm(a,b,c,d){var e=this;this.u=a;this.g=b;this.l=null;this.I=NaN;this.j=d;this.H=!1;this.C=this.m=this.s=null;this.F="";this.h=new ef;a=new google.ima.dai.api.UiSettings;a.setLocale(c);this.i=new google.ima.dai.api.StreamManager(this.g,this.u,a);this.j(new R("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.i)));this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.LOADED,function(f){im(e,f)});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.ERROR,function(){e.F.length?e.l.resolve(e.F):
|
|
468
468
|
e.l.reject("IMA Stream request returned an error and there was no backup asset uri provided.");e.l=null});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,function(){});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.STARTED,function(f){f=f.getAd();e.m=new X(f,e.g);e.C&&(e.m.h=e.C);e.j(new R("ad-started",(new Map).set("ad",e.m)));e.u.setAttribute("ad-active","true")});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,function(){e.u.removeAttribute("ad-active");
|
|
469
469
|
var f=e.g.currentTime;e.s&&e.s>f&&(e.g.currentTime=e.s,e.s=null)});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(f){e.C=f.getStreamData().adProgressData;e.m&&(e.m.h=e.C)});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){e.j(new R("ad-first-quartile"))});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){e.j(new R("ad-midpoint"))});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){e.j(new R("ad-third-quartile"))});
|
|
470
|
-
this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){e.j(new R("ad-complete"));e.j(new R("ad-stopped"));e.u.removeAttribute("ad-active");e.m=null});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){e.j(new R("ad-skipped"));e.j(new R("ad-stopped"))});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(f){var g=f.getStreamData();f=[];g=t(g.cuepoints);for(var h=g.next();!h.done;h=g.next())h=h.value,f.push(new
|
|
471
|
-
(new Map).set("cuepoints",f)))})}
|
|
472
|
-
function
|
|
473
|
-
q.release=function(){this.h&&(this.h.release(),this.h=null);this.g&&(this.g.release(),this.g=null)};q.onAssetUnload=function(){this.h&&this.h.stop();this.g&&this.g.stop();this.dispatchEvent(new R("ad-stopped"));this.j=new
|
|
474
|
-
q.initServerSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.dai)throw new N(2,10,10002);this.g&&this.g.release();this.g=new
|
|
475
|
-
q.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new N(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Wa('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v3.1.
|
|
476
|
-
(c.H=!0),c.l=new De,c.i.requestStream(a),c.F=d||"",c.I=Date.now()/1E3,c=c.l);return c};q.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new N(1,10,10003);(a.mpt||a.mpv)&&Wa('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.mpt="Shaka Player";a.mpv="v3.1.
|
|
470
|
+
this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){e.j(new R("ad-complete"));e.j(new R("ad-stopped"));e.u.removeAttribute("ad-active");e.m=null});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){e.j(new R("ad-skipped"));e.j(new R("ad-stopped"))});this.h.B(this.i,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(f){var g=f.getStreamData();f=[];g=t(g.cuepoints);for(var h=g.next();!h.done;h=g.next())h=h.value,f.push(new em(h.start,h.end));e.j(new R("ad-cue-points-changed",
|
|
471
|
+
(new Map).set("cuepoints",f)))})}hm.prototype.stop=function(){this.F="";this.s=null};hm.prototype.release=function(){this.stop();this.h&&this.h.release()};hm.prototype.onCueMetadataChange=function(a){if(a.key&&a.data){var b={};b[a.key]=a.data;this.i.onTimedMetadata(b)}};
|
|
472
|
+
function im(a,b){a.j(new R("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.I)));var c=b.getStreamData().url;a.l.resolve(c);a.l=null;a.H||a.h.B(a.g,"seeked",function(){var d=a.g.currentTime;if(0!=d){a.i.streamTimeForContentTime(d);var e=a.i.previousCuePointForStreamTime(d);e&&!e.played&&(a.s=d,a.g.currentTime=e.start)}})};function Y(){Xg.call(this);this.g=this.h=null;this.j=new $l;this.i=navigator.language}ra(Y,Xg);q=Y.prototype;q.setLocale=function(a){this.i=a};q.initClientSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.AdsLoader)throw new N(2,10,1E4);this.h&&this.h.release();this.h=new am(a,b,this.i,function(d){if(d&&d.type)switch(d.type){case "ads-loaded":c.j.h.push(d.loadTime);break;case "ad-started":c.j.g++;break;case "ad-complete":c.j.i++;break;case "ad-skipped":c.j.j++}c.dispatchEvent(d)})};
|
|
473
|
+
q.release=function(){this.h&&(this.h.release(),this.h=null);this.g&&(this.g.release(),this.g=null)};q.onAssetUnload=function(){this.h&&this.h.stop();this.g&&this.g.stop();this.dispatchEvent(new R("ad-stopped"));this.j=new $l};q.requestClientSideAds=function(a){if(!this.h)throw new N(1,10,10001);var b=this.h;b.C=Date.now()/1E3;b.l.requestAds(a)};
|
|
474
|
+
q.initServerSide=function(a,b){var c=this;if(!window.google||!google.ima||!google.ima.dai)throw new N(2,10,10002);this.g&&this.g.release();this.g=new hm(a,b,this.i,function(d){if(d&&d.type)switch(d.type){case "ads-loaded":c.j.h.push(d.loadTime);break;case "ad-started":c.j.g++;break;case "ad-complete":c.j.i++;break;case "ad-skipped":c.j.j++}c.dispatchEvent(d)})};
|
|
475
|
+
q.requestServerSideStream=function(a,b){b=void 0===b?"":b;if(!this.g)throw new N(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&Wa('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v3.1.5";c=this.g;var d=b;c.l?c=Promise.reject(new N(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&
|
|
476
|
+
(c.H=!0),c.l=new De,c.i.requestStream(a),c.F=d||"",c.I=Date.now()/1E3,c=c.l);return c};q.replaceServerSideAdTagParameters=function(a){if(!this.g)throw new N(1,10,10003);(a.mpt||a.mpv)&&Wa('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overriden.');a.mpt="Shaka Player";a.mpv="v3.1.5";this.g.i.replaceAdTagParameters(a)};
|
|
477
477
|
q.getStats=function(){var a=this.j;return{loadTimes:a.h,started:a.g,playedCompletely:a.i,skipped:a.j}};q.onDashTimedMetadata=function(a){if(this.g&&"urn:google:dai:2018"==a.schemeIdUri){var b=a.schemeIdUri,c=a.eventElement?a.eventElement.getAttribute("messageData"):null;this.g.i.processMetadata(b,c,a.startTime)}};q.onHlsTimedMetadata=function(a,b){this.g&&this.g.i.processMetadata("ID3",a.data,b)};q.onCueMetadataChange=function(a){if(this.g)this.g.onCueMetadataChange(a)};M("shaka.ads.AdManager",Y);
|
|
478
478
|
Y.prototype.onCueMetadataChange=Y.prototype.onCueMetadataChange;Y.prototype.onHlsTimedMetadata=Y.prototype.onHlsTimedMetadata;Y.prototype.onDashTimedMetadata=Y.prototype.onDashTimedMetadata;Y.prototype.getStats=Y.prototype.getStats;Y.prototype.replaceServerSideAdTagParameters=Y.prototype.replaceServerSideAdTagParameters;Y.prototype.requestServerSideStream=Y.prototype.requestServerSideStream;Y.prototype.initServerSide=Y.prototype.initServerSide;Y.prototype.requestClientSideAds=Y.prototype.requestClientSideAds;
|
|
479
|
-
Y.prototype.onAssetUnload=Y.prototype.onAssetUnload;Y.prototype.release=Y.prototype.release;Y.prototype.initClientSide=Y.prototype.initClientSide;Y.prototype.setLocale=Y.prototype.setLocale;function
|
|
479
|
+
Y.prototype.onAssetUnload=Y.prototype.onAssetUnload;Y.prototype.release=Y.prototype.release;Y.prototype.initClientSide=Y.prototype.initClientSide;Y.prototype.setLocale=Y.prototype.setLocale;function em(a,b){this.start=a;this.end=void 0===b?null:b}Y.ADS_LOADED="ads-loaded";Y.AD_STARTED="ad-started";Y.AD_FIRST_QUARTILE="ad-first-quartile";Y.AD_MIDPOINT="ad-midpoint";Y.AD_THIRD_QUARTILE="ad-third-quartile";Y.AD_COMPLETE="ad-complete";Y.AD_STOPPED="ad-stopped";Y.AD_SKIPPED="ad-skipped";
|
|
480
480
|
Y.AD_VOLUME_CHANGED="ad-volume-changed";Y.AD_MUTED="ad-muted";Y.AD_PAUSED="ad-paused";Y.AD_RESUMED="ad-resumed";Y.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";Y.CUEPOINTS_CHANGED="ad-cue-points-changed";Y.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";Y.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";Y.AD_CLICKED="ad-clicked";Y.AD_PROGRESS="ad-progress";Y.AD_BUFFERING="ad-buffering";Y.AD_IMPRESSION="ad-impression";Y.AD_DURATION_CHANGED="ad-duration-changed";Y.AD_CLOSED="ad-closed";
|
|
481
|
-
Y.AD_LOADED="ad-loaded";Y.ALL_ADS_COMPLETED="all-ads-completed";Y.AD_LINEAR_CHANGED="ad-linear-changed";Y.AD_METADATA="ad-metadata";Y.AD_RECOVERABLE_ERROR="ad-recoverable-error";Y.AD_BREAK_READY="ad-break-ready";Y.AD_INTERACTION="ad-interaction";
|
|
481
|
+
Y.AD_LOADED="ad-loaded";Y.ALL_ADS_COMPLETED="all-ads-completed";Y.AD_LINEAR_CHANGED="ad-linear-changed";Y.AD_METADATA="ad-metadata";Y.AD_RECOVERABLE_ERROR="ad-recoverable-error";Y.AD_BREAK_READY="ad-break-ready";Y.AD_INTERACTION="ad-interaction";pk=function(){return new Y};function jm(a){return JSON.stringify(a,function(b,c){if("function"!=typeof c){if(c instanceof Event||c instanceof R){var d={};for(f in c){var e=c[f];e&&"object"==typeof e?"detail"==f&&(d[f]=e):f in Event||(d[f]=e)}return d}if(c instanceof Error){var f=new Set(["name","message","stack"]);for(d in c)f.add(d);e=t(Object.getOwnPropertyNames(c));for(d=e.next();!d.done;d=e.next())f.add(d.value);e={};f=t(f);for(d=f.next();!d.done;d=f.next())d=d.value,e[d]=c[d];f={__type__:"Error",contents:e}}else if(c instanceof
|
|
482
482
|
TimeRanges)for(f={__type__:"TimeRanges",length:c.length,start:[],end:[]},d=t(ge(c)),e=d.next();!e.done;e=d.next()){e=e.value;var g=e.end;f.start.push(e.start);f.end.push(g)}else f=c instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(c)}:"number"==typeof c?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c;return f}})}
|
|
483
|
-
function
|
|
484
|
-
function
|
|
485
|
-
var
|
|
486
|
-
getImageTracks:2,getThumbnails:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10},
|
|
487
|
-
|
|
488
|
-
l.code);for(m in l)n[m]=l[m];p.reject(n)}else p.resolve()}};this.g={video:{},player:{}};this.O=0;this.i={};this.l=null;
|
|
489
|
-
q.init=function(){if(this.L.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.j.fc();var a=new chrome.cast.SessionRequest(this.L);a=new chrome.cast.ApiConfig(a,function(b){for(var c=t(
|
|
490
|
-
a):
|
|
491
|
-
q.cast=function(a){var b=this;return L(function(c){if(!b.m)throw new N(1,8,8E3);if(!
|
|
492
|
-
q.get=function(a,b){var c=this;if("video"==a){if(
|
|
493
|
-
[a,b].concat(ka(e)))};if(
|
|
494
|
-
function
|
|
495
|
-
function
|
|
496
|
-
function
|
|
497
|
-
q.destroy=function(a){a&&this.g.wb();this.h&&(this.h.release(),this.h=null);a=[];this.i&&(a.push(this.i.destroy()),this.i=null);this.g&&(a.push(this.g.destroy()),this.g=null);this.u=this.m=this.j=null;return Promise.all(a)};q.jf=function(){return this.m};q.af=function(){return this.u};q.Ee=function(){return this.g.m&&
|
|
498
|
-
q.cast=function(){var a=this,b;return L(function(c){return 1==c.g?(b=
|
|
499
|
-
q.He=function(a){var b=this;return L(function(c){if(1==c.g){if(a==b.F)return c["return"]();b.F=a;b.g.wb();return v(c,b.g.destroy(),2)}b.g=null;b.g=new
|
|
500
|
-
function
|
|
501
|
-
function(f){Object.defineProperty(a.u,f,{configurable:!1,enumerable:!0,get:function(){return
|
|
502
|
-
function
|
|
503
|
-
function
|
|
504
|
-
function
|
|
505
|
-
function
|
|
506
|
-
h.next();!k.done;k=h.next()){var l=k.value;k=l[1];l=a.g.get("player",l[0])();a.i[k](l)}a.j.autoplay=f;e&&a.j.play()}},function(h){h=(new Map).set("detail",h);h=new R(
|
|
507
|
-
function
|
|
508
|
-
function
|
|
509
|
-
if(a.g.ua()){if("getManifest"==b||"drmInfo"==b)return function(){Wa(b+"() does not work while casting!");return null};if("attach"==b||"detach"==b)return function(){Wa(b+"() does not work while casting!");return Promise.resolve()}}return a.g.ua()&&0==Object.keys(a.g.g.video).length&&
|
|
510
|
-
|
|
483
|
+
function km(a){return JSON.parse(a,function(b,c){if("NaN"==c)var d=NaN;else if("-Infinity"==c)d=-Infinity;else if("Infinity"==c)d=Infinity;else if(c&&"object"==typeof c&&"TimeRanges"==c.__type__)d=lm(c);else if(c&&"object"==typeof c&&"Uint8Array"==c.__type__)d=new Uint8Array(c.entries);else if(c&&"object"==typeof c&&"Error"==c.__type__){d=c.contents;var e=Error(d.message),f;for(f in d)e[f]=d[f];d=e}else d=c;return d})}
|
|
484
|
+
function lm(a){return{length:a.length,start:function(b){return a.start[b]},end:function(b){return a.end[b]}}}
|
|
485
|
+
var mm="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),nm="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),om=["loop","playbackRate"],pm=["pause","play"],qm={getAssetUri:2,getAudioLanguages:4,getAudioLanguagesAndRoles:4,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getKeyStatuses:2,getPlaybackRate:2,getTextLanguages:4,getTextLanguagesAndRoles:4,getTextTracks:2,getStats:5,getVariantTracks:2,
|
|
486
|
+
getImageTracks:2,getThumbnails:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10},rm={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},sm=[["getConfiguration","configure"]],tm=[["isTextTrackVisible","setTextTrackVisibility"]],um="addTextTrack addTextTrackAsync cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay".split(" "),
|
|
487
|
+
vm=["attach","detach","load","unload"];function wm(a,b,c,d,e,f){var g=this;this.L=a;this.j=new P(b);this.ea=c;this.C=!1;this.u=d;this.I=e;this.T=f;this.h=this.m=!1;this.Y="";this.s=null;this.F=function(){return xm(g)};this.H=function(h,k){var l=km(k);switch(l.type){case "event":var m=l.targetName;l=Wg(l.event);g.u(m,l);break;case "update":m=l.update;for(var n in m){l=g.g[n]||{};for(var p in m[n])l[p]=m[n][p]}g.C&&(g.ea(),g.C=!1);break;case "asyncComplete":if(n=l.id,l=l.error,p=g.i[n],delete g.i[n],p)if(l){n=new N(l.severity,l.category,
|
|
488
|
+
l.code);for(m in l)n[m]=l[m];p.reject(n)}else p.resolve()}};this.g={video:{},player:{}};this.O=0;this.i={};this.l=null;ym.add(this)}q=wm.prototype;q.destroy=function(){ym["delete"](this);zm(this);Am&&Bm(this);this.j&&(this.j.stop(),this.j=null);this.I=this.u=null;this.h=this.m=!1;this.H=this.F=this.l=this.i=this.g=this.s=null;return Promise.resolve()};q.ua=function(){return this.h};q.Dd=function(){return this.Y};
|
|
489
|
+
q.init=function(){if(this.L.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.j.fc();var a=new chrome.cast.SessionRequest(this.L);a=new chrome.cast.ApiConfig(a,function(b){for(var c=t(ym),d=c.next();!d.done;d=c.next())Cm(d.value,b)},function(b){for(var c=t(ym),d=c.next();!d.done;d=c.next())d=d.value,Dm="available"==b,d.j.fc()},"origin_scoped");chrome.cast.initialize(a,function(){},function(){});Dm&&this.j.V(Em);(a=Am)&&a.status!=chrome.cast.SessionStatus.STOPPED?Cm(this,
|
|
490
|
+
a):Am=null}else window.__onGCastApiAvailable||(window.__onGCastApiAvailable=Fm),window.__onGCastApiAvailable!=Fm&&Wa("A global Cast SDK hook is already installed! Shaka Player will be unable to receive a notification when the Cast SDK is ready.")};q.Kd=function(a){this.s=a;this.h&&Gm(this,{type:"appData",appData:this.s})};
|
|
491
|
+
q.cast=function(a){var b=this;return L(function(c){if(!b.m)throw new N(1,8,8E3);if(!Dm)throw new N(1,8,8001);if(b.h)throw new N(1,8,8002);b.l=new De;chrome.cast.requestSession(function(d){return Hm(b,a,d)},function(d){return Im(b,d)});return v(c,b.l,0)})};function Jm(a){if(a.h){var b=a.T();chrome.cast.requestSession(function(c){return Hm(a,b,c)},function(c){return Im(a,c)})}}q.wb=function(){if(this.h){zm(this);if(Am){Bm(this);try{Am.stop(function(){},function(){})}catch(a){}Am=null}xm(this)}};
|
|
492
|
+
q.get=function(a,b){var c=this;if("video"==a){if(pm.includes(b))return function(d){for(var e=[],f=0;f<arguments.length;++f)e[f]=arguments[f];return c.le.apply(c,[a,b].concat(ka(e)))}}else if("player"==a){if(rm[b]&&!this.get("player","isLive")())return function(){};if(um.includes(b))return function(d){for(var e=[],f=0;f<arguments.length;++f)e[f]=arguments[f];return c.le.apply(c,[a,b].concat(ka(e)))};if(vm.includes(b))return function(d){for(var e=[],f=0;f<arguments.length;++f)e[f]=arguments[f];return c.Af.apply(c,
|
|
493
|
+
[a,b].concat(ka(e)))};if(qm[b])return function(){return c.g[a][b]}}return this.g[a][b]};q.set=function(a,b,c){this.g[a][b]=c;Gm(this,{type:"set",targetName:a,property:b,value:c})};function Hm(a,b,c){Am=c;c.addUpdateListener(a.F);c.addMessageListener("urn:x-cast:com.google.shaka.v2",a.H);xm(a);Gm(a,{type:"init",initState:b,appData:a.s});a.l.resolve()}
|
|
494
|
+
function Im(a,b){var c=8003;switch(b.code){case "cancel":c=8004;break;case "timeout":c=8005;break;case "receiver_unavailable":c=8006}a.l.reject(new N(2,8,c,b))}q.le=function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];Gm(this,{type:"call",targetName:a,methodName:b,args:d})};q.Af=function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];e=new De;var f=this.O.toString();this.O++;this.i[f]=e;try{Gm(this,{type:"asyncCall",targetName:a,methodName:b,args:d,id:f})}catch(g){e.reject(g)}return e};
|
|
495
|
+
function Cm(a,b){var c=a.T();a.l=new De;a.C=!0;Hm(a,c,b)}function Bm(a){var b=Am;b.removeUpdateListener(a.F);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.H)}function xm(a){var b=Am?"connected"==Am.status:!1;if(a.h&&!b){a.I();for(var c in a.g)a.g[c]={};zm(a)}a.h=b;a.Y=b?Am.receiver.friendlyName:"";a.j.fc()}function zm(a){for(var b in a.i){var c=a.i[b];delete a.i[b];c.reject(new N(1,7,7E3))}}
|
|
496
|
+
function Gm(a,b){var c=jm(b),d=Am;try{d.sendMessage("urn:x-cast:com.google.shaka.v2",c,function(){},$a)}catch(e){throw c=new N(2,8,8005,e),d=new R("error",(new Map).set("detail",c)),a.u("player",d),a.wb(),c;}}var Em=.02,Dm=!1,Am=null,ym=new Set;function Fm(a){if(a){a=t(ym);for(var b=a.next();!b.done;b=a.next())b.value.init()}};function Km(a,b,c){Xg.call(this);var d=this;this.j=a;this.i=b;this.h=this.s=this.l=this.u=this.m=null;this.F=c;this.C=new Map;this.g=new wm(c,function(){return Lm(d)},function(){return Mm(d)},function(e,f){return Nm(d,e,f)},function(){return Om(d)},function(){return Pm(d)});Qm(this)}ra(Km,Xg);q=Km.prototype;
|
|
497
|
+
q.destroy=function(a){a&&this.g.wb();this.h&&(this.h.release(),this.h=null);a=[];this.i&&(a.push(this.i.destroy()),this.i=null);this.g&&(a.push(this.g.destroy()),this.g=null);this.u=this.m=this.j=null;return Promise.all(a)};q.jf=function(){return this.m};q.af=function(){return this.u};q.Ee=function(){return this.g.m&&Dm};q.ua=function(){return this.g.ua()};q.Dd=function(){return this.g.Dd()};
|
|
498
|
+
q.cast=function(){var a=this,b;return L(function(c){return 1==c.g?(b=Pm(a),v(c,a.g.cast(b),2)):a.i?v(c,a.i.Rd(),0):c["return"]()})};q.Kd=function(a){this.g.Kd(a)};q.Lf=function(){Jm(this.g)};q.wb=function(){this.g.wb()};
|
|
499
|
+
q.He=function(a){var b=this;return L(function(c){if(1==c.g){if(a==b.F)return c["return"]();b.F=a;b.g.wb();return v(c,b.g.destroy(),2)}b.g=null;b.g=new wm(a,function(){return Lm(b)},function(){return Mm(b)},function(d,e){return Nm(b,d,e)},function(){return Om(b)},function(){return Pm(b)});b.g.init();z(c)})};
|
|
500
|
+
function Qm(a){a.g.init();a.h=new ef;for(var b=t(mm),c=b.next();!c.done;c=b.next())a.h.B(a.j,c.value,function(f){a.g.ua()||(f=Wg(f),a.l.dispatchEvent(f))});for(var d in Yl)a.h.B(a.i,Yl[d],function(f){a.g.ua()||a.s.dispatchEvent(f)});a.m={};b={};for(var e in a.j)b.Jb=e,Object.defineProperty(a.m,b.Jb,{configurable:!1,enumerable:!0,get:function(f){return function(){return Rm(a,f.Jb)}}(b),set:function(f){return function(g){var h=f.Jb;a.g.ua()?a.g.set("video",h,g):a.j[h]=g}}(b)}),b={Jb:b.Jb};a.u={};Sm(a,
|
|
501
|
+
function(f){Object.defineProperty(a.u,f,{configurable:!1,enumerable:!0,get:function(){return Tm(a,f)}})});Um(a);a.l=new Xg;a.l.rc=a.m;a.s=new Xg;a.s.rc=a.u}function Um(a){var b=new Map;Sm(a,function(c,d){if(b.has(d)){var e=b.get(d);c.length<e.length?a.C.set(c,e):a.C.set(e,c)}else b.set(d,c)})}
|
|
502
|
+
function Sm(a,b){function c(l){return"constructor"==l||"function"!=typeof d[l]?!1:!e.has(l)}var d=a.i,e=new Set;for(f in d)c(f)&&(e.add(f),b(f,d[f]));var f=Object.getPrototypeOf(d);for(var g=Object.getPrototypeOf({});f&&f!=g;){for(var h=t(Object.getOwnPropertyNames(f)),k=h.next();!k.done;k=h.next())k=k.value,c(k)&&(e.add(k),b(k,d[k]));f=Object.getPrototypeOf(f)}}
|
|
503
|
+
function Pm(a){var b={video:{},player:{},playerAfterLoad:{},manifest:a.i.md(),startTime:null};a.j.pause();for(var c=t(om),d=c.next();!d.done;d=c.next())d=d.value,b.video[d]=a.j[d];a.j.ended||(b.startTime=a.j.currentTime);c=t(sm);for(d=c.next();!d.done;d=c.next()){var e=d.value;d=e[1];e=a.i[e[0]]();b.player[d]=e}c=t(tm);for(d=c.next();!d.done;d=c.next())e=d.value,d=e[1],e=a.i[e[0]](),b.playerAfterLoad[d]=e;return b}function Lm(a){var b=new R("caststatuschanged");a.dispatchEvent(b)}
|
|
504
|
+
function Mm(a){var b=new R(a.m.paused?"pause":"play");a.l.dispatchEvent(b)}
|
|
505
|
+
function Om(a){for(var b=t(sm),c=b.next();!c.done;c=b.next()){var d=c.value;c=d[1];d=a.g.get("player",d[0])();a.i[c](d)}var e=a.g.get("player","getAssetUri")();c=a.g.get("video","ended");b=Promise.resolve();var f=a.j.autoplay;d=null;c||(d=a.g.get("video","currentTime"));e&&(a.j.autoplay=!1,b=a.i.load(e,d));var g={};c=t(om);for(d=c.next();!d.done;d=c.next())d=d.value,g[d]=a.g.get("video",d);b.then(function(){if(a.j){for(var h=t(om),k=h.next();!k.done;k=h.next())k=k.value,a.j[k]=g[k];h=t(tm);for(k=
|
|
506
|
+
h.next();!k.done;k=h.next()){var l=k.value;k=l[1];l=a.g.get("player",l[0])();a.i[k](l)}a.j.autoplay=f;e&&a.j.play()}},function(h){h=(new Map).set("detail",h);h=new R(Ul,h);a.i.dispatchEvent(h)})}
|
|
507
|
+
function Rm(a,b){if("addEventListener"==b)return function(d,e,f){return a.l.addEventListener(d,e,f)};if("removeEventListener"==b)return function(d,e,f){return a.l.removeEventListener(d,e,f)};if(a.g.ua()&&0==Object.keys(a.g.g.video).length){var c=a.j[b];if("function"!=typeof c)return c}return a.g.ua()?a.g.get("video",b):(c=a.j[b],"function"==typeof c&&(c=c.bind(a.j)),c)}
|
|
508
|
+
function Tm(a,b){a.C.has(b)&&(b=a.C.get(b));if("addEventListener"==b)return function(c,d,e){return a.s.addEventListener(c,d,e)};if("removeEventListener"==b)return function(c,d,e){return a.s.removeEventListener(c,d,e)};if("getMediaElement"==b)return function(){return a.m};if("getSharedConfiguration"==b)return a.g.get("player","getConfiguration");if("getNetworkingEngine"==b)return function(){return a.i.Ub()};if("getAdManager"==b)return function(){return a.i.ae()};if("setVideoContainer"==b)return function(c){return a.i.ue(c)};
|
|
509
|
+
if(a.g.ua()){if("getManifest"==b||"drmInfo"==b)return function(){Wa(b+"() does not work while casting!");return null};if("attach"==b||"detach"==b)return function(){Wa(b+"() does not work while casting!");return Promise.resolve()}}return a.g.ua()&&0==Object.keys(a.g.g.video).length&&qm[b]||!a.g.ua()?a.i[b].bind(a.i):a.g.get("player",b)}function Nm(a,b,c){a.g.ua()&&("video"==b?a.l.dispatchEvent(c):"player"==b&&a.s.dispatchEvent(c))}M("shaka.cast.CastProxy",Km);Km.prototype.changeReceiverId=Km.prototype.He;
|
|
510
|
+
Km.prototype.forceDisconnect=Km.prototype.wb;Km.prototype.suggestDisconnect=Km.prototype.Lf;Km.prototype.setAppData=Km.prototype.Kd;Km.prototype.cast=Km.prototype.cast;Km.prototype.receiverName=Km.prototype.Dd;Km.prototype.isCasting=Km.prototype.ua;Km.prototype.canCast=Km.prototype.Ee;Km.prototype.getPlayer=Km.prototype.af;Km.prototype.getVideo=Km.prototype.jf;Km.prototype.destroy=Km.prototype.destroy;function Vm(a,b,c,d){Xg.call(this);var e=this;this.g=a;this.i=b;this.h=new ef;this.O={video:a,player:b};this.H=c||function(){};this.T=d||function(f){return f};this.j=null;this.I=!1;this.s=!0;this.m=0;this.F=!1;this.C=!0;this.u=this.l=null;this.L=new P(function(){Wm(e)});Xm(this)}ra(Vm,Xg);q=Vm.prototype;q.isConnected=function(){return this.I};q.mf=function(){return this.s};q.Hf=function(a){this.j=a};q.Ke=function(){this.j=null};
|
|
511
511
|
q.If=function(a){this.j||(this.j={metadataType:cast.receiver.media.MetadataType.GENERIC});this.j.title=a};q.Gf=function(a){this.j||(this.j={metadataType:cast.receiver.media.MetadataType.GENERIC});this.j.images=[{url:a}]};q.Ff=function(a){this.j||(this.j={});this.j.artist=a;this.j.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK};
|
|
512
512
|
q.destroy=function(){var a=this,b,c;return L(function(d){if(1==d.g)return a.h&&(a.h.release(),a.h=null),b=[],a.i&&(b.push(a.i.destroy()),a.i=null),a.L&&(a.L.stop(),a.L=null),a.g=null,a.O=null,a.H=null,a.I=!1,a.s=!0,a.l=null,a.u=null,v(d,Promise.all(b),2);c=cast.receiver.CastReceiverManager.getInstance();c.stop();z(d)})};
|
|
513
|
-
function
|
|
514
|
-
e)};a.l=b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");a.l.onMessage=function(e){return
|
|
515
|
-
!1;
|
|
516
|
-
function
|
|
517
|
-
function
|
|
518
|
-
a.i[p](r);a.g.autoplay=f;b.manifest&&(a.g.play(),
|
|
519
|
-
function
|
|
520
|
-
function
|
|
521
|
-
function
|
|
522
|
-
c.methodName;"player"==d&&"load"==e&&(a.m=0,a.F=!1);var g=c.id,h=b.senderId;f=a.O[d];c=f[e].apply(f,c.args);"player"==d&&"load"==e&&(c=c.then(function(){a.C=!0}));c.then(function(){return
|
|
523
|
-
function
|
|
524
|
-
null!=e&&(a.g.muted=e);f==a.g.volume&&g==a.g.muted||
|
|
525
|
-
function
|
|
526
|
-
M("shaka.cast.CastReceiver",
|
|
527
|
-
function
|
|
528
|
-
function
|
|
529
|
-
function
|
|
530
|
-
function
|
|
531
|
-
function
|
|
532
|
-
t(c.value.initData),d=c.next();!d.done;d=c.next())d.value.keyId=g;return{Wd:g,qg:e,drmInfos:a,$d:!0}}function
|
|
533
|
-
function
|
|
534
|
-
function
|
|
535
|
-
function
|
|
536
|
-
function
|
|
537
|
-
function
|
|
538
|
-
var
|
|
513
|
+
function Xm(a){var b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected=function(){return Ym(a)};b.onSenderDisconnected=function(){return Ym(a)};b.onSystemVolumeChanged=function(){var e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();e&&Zm(a,{type:"update",update:{video:{volume:e.level,muted:e.muted}}},a.l);Zm(a,{type:"event",targetName:"video",event:{type:"volumechange"}},a.l)};a.u=b.getCastMessageBus("urn:x-cast:com.google.cast.media");a.u.onMessage=function(e){return hn(a,
|
|
514
|
+
e)};a.l=b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");a.l.onMessage=function(e){return jn(a,e)};b.start();b=t(mm);for(var c=b.next();!c.done;c=b.next())a.h.B(a.g,c.value,function(e){return kn(a,"video",e)});for(var d in Yl)a.h.B(a.i,Yl[d],function(e){return kn(a,"player",e)});cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?a.i.Md(3840,2160):a.i.Md(1920,1080);a.h.B(a.g,"loadeddata",function(){a.F=!0});a.h.B(a.i,"loading",function(){a.s=
|
|
515
|
+
!1;ln(a)});a.h.B(a.g,"playing",function(){a.s=!1;ln(a)});a.h.B(a.g,"pause",function(){ln(a)});a.h.B(a.i,"unloading",function(){a.s=!0;ln(a)});a.h.B(a.g,"ended",function(){(new P(function(){a.g&&a.g.ended&&(a.s=!0,ln(a))})).V(mn)})}function Ym(a){a.m=0;a.C=!0;a.I=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length;ln(a)}
|
|
516
|
+
function ln(a){var b;L(function(c){if(1==c.g)return v(c,Promise.resolve(),2);if(!a.i)return c["return"]();b=new R("caststatuschanged");a.dispatchEvent(b);nn(a)||on(a);z(c)})}
|
|
517
|
+
function pn(a,b,c){var d,e,f,g,h,k,l,m,n,p,r;L(function(u){switch(u.g){case 1:for(d in b.player)e=b.player[d],a.i[d](e);a.H(c);f=a.g.autoplay;return b.manifest?(a.g.autoplay=!1,B(u,5),v(u,a.i.load(b.manifest,b.startTime),7)):v(u,Promise.resolve(),3);case 7:wa(u,3);break;case 5:return g=F(u),h=Ul,k=(new Map).set("detail",g),l=new R(h,k),a.i&&a.i.dispatchEvent(l),u["return"]();case 3:if(!a.i)return u["return"]();for(m in b.video)n=b.video[m],a.g[m]=n;for(p in b.playerAfterLoad)r=b.playerAfterLoad[p],
|
|
518
|
+
a.i[p](r);a.g.autoplay=f;b.manifest&&(a.g.play(),on(a));z(u)}})}function kn(a,b,c){a.i&&(Wm(a),Zm(a,{type:"event",targetName:b,event:c},a.l))}
|
|
519
|
+
function Wm(a){a.L.V(qn);for(var b={video:{},player:{}},c=t(nm),d=c.next();!d.done;d=c.next())d=d.value,b.video[d]=a.g[d];if(a.i.Z())for(var e in rm)0==a.m%rm[e]&&(b.player[e]=a.i[e]());for(var f in qm)0==a.m%qm[f]&&(b.player[f]=a.i[f]());if(c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())b.video.volume=c.level,b.video.muted=c.muted;a.F&&(a.m+=1);Zm(a,{type:"update",update:b},a.l);nn(a)}function nn(a){return a.C&&(a.g.duration||a.i.Z())?(rn(a),a.C=!1,!0):!1}
|
|
520
|
+
function rn(a,b){var c={contentId:a.i.md(),streamType:a.i.Z()?"LIVE":"BUFFERED",contentType:""};a.i.Z()||(c.duration=a.g.duration);a.j&&(c.metadata=a.j);on(a,void 0===b?0:b,c)}
|
|
521
|
+
function jn(a,b){var c=km(b.data);switch(c.type){case "init":a.m=0;a.F=!1;a.C=!0;pn(a,c.initState,c.appData);Wm(a);break;case "appData":a.H(c.appData);break;case "set":var d=c.targetName,e=c.property;c=c.value;if("video"==d){var f=cast.receiver.CastReceiverManager.getInstance();if("volume"==e){f.setSystemVolumeLevel(c);break}else if("muted"==e){f.setSystemVolumeMuted(c);break}}a.O[d][e]=c;break;case "call":d=a.O[c.targetName];d[c.methodName].apply(d,c.args);break;case "asyncCall":d=c.targetName;e=
|
|
522
|
+
c.methodName;"player"==d&&"load"==e&&(a.m=0,a.F=!1);var g=c.id,h=b.senderId;f=a.O[d];c=f[e].apply(f,c.args);"player"==d&&"load"==e&&(c=c.then(function(){a.C=!0}));c.then(function(){return sn(a,h,g,null)},function(k){return sn(a,h,g,k)})}}
|
|
523
|
+
function hn(a,b){var c=km(b.data);switch(c.type){case "PLAY":a.g.play();on(a);break;case "PAUSE":a.g.pause();on(a);break;case "SEEK":var d=c.currentTime,e=c.resumeState;null!=d&&(a.g.currentTime=Number(d));e&&"PLAYBACK_START"==e?(a.g.play(),on(a)):e&&"PLAYBACK_PAUSE"==e&&(a.g.pause(),on(a));break;case "STOP":a.i.Rd().then(function(){a.i&&on(a)});break;case "GET_STATUS":rn(a,Number(c.requestId));break;case "VOLUME":e=c.volume;d=e.level;e=e.muted;var f=a.g.volume,g=a.g.muted;null!=d&&(a.g.volume=Number(d));
|
|
524
|
+
null!=e&&(a.g.muted=e);f==a.g.volume&&g==a.g.muted||on(a);break;case "LOAD":a.m=0;a.F=!1;a.C=!1;d=c.media;e=c.currentTime;f=a.T(d.contentId);g=c.autoplay||!0;a.H(d.customData);g&&(a.g.autoplay=!0);a.i.load(f,e).then(function(){a.i&&rn(a)})["catch"](function(h){var k="LOAD_FAILED";7==h.category&&7E3==h.code&&(k="LOAD_CANCELLED");Zm(a,{requestId:Number(c.requestId),type:k},a.u)});break;default:Zm(a,{requestId:Number(c.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},a.u)}}
|
|
525
|
+
function sn(a,b,c,d){a.i&&Zm(a,{type:"asyncComplete",id:c,error:d},a.l,b)}function Zm(a,b,c,d){a.I&&(a=jm(b),d?c.getCastChannel(d).send(a):c.broadcast(a))}function on(a,b,c){c=void 0===c?null:c;var d={mediaSessionId:0,playbackRate:a.g.playbackRate,playerState:a.s?tn:a.i.pd()?un:a.g.paused?vn:wn,currentTime:a.g.currentTime,supportedMediaCommands:63,volume:{level:a.g.volume,muted:a.g.muted}};c&&(d.media=c);Zm(a,{requestId:void 0===b?0:b,type:"MEDIA_STATUS",status:[d]},a.u)}
|
|
526
|
+
M("shaka.cast.CastReceiver",Vm);Vm.prototype.destroy=Vm.prototype.destroy;Vm.prototype.setContentArtist=Vm.prototype.Ff;Vm.prototype.setContentImage=Vm.prototype.Gf;Vm.prototype.setContentTitle=Vm.prototype.If;Vm.prototype.clearContentMetadata=Vm.prototype.Ke;Vm.prototype.setContentMetadata=Vm.prototype.Hf;Vm.prototype.isIdle=Vm.prototype.mf;Vm.prototype.isConnected=Vm.prototype.isConnected;var qn=.5,mn=5,tn="IDLE",wn="PLAYING",un="BUFFERING",vn="PAUSED";function xn(a){var b=this;this.g=[];this.h=[];this.data=[];(new Ob).box("moov",Sb).U("pssh",function(c){if(!(1<c.version)){var d=qb(c.reader.R,-12,c.size);b.data.push(d);b.g.push(nc(c.reader.bb(16)));if(0<c.version){d=c.reader.N();d=t(jb(d));for(var e=d.next();!e.done;e=d.next())e=nc(c.reader.bb(16)),b.h.push(e)}}}).parse(a)}
|
|
527
|
+
function yn(a,b){var c=a.length,d=b.length+16+c,e=new Uint8Array(d),f=tb(e),g=0;f.setUint32(g,d);g+=4;f.setUint32(g,1886614376);g+=4;f.setUint32(g,0);g+=4;e.set(b,g);g+=b.length;f.setUint32(g,c);e.set(a,g+4);return e}function zn(a){if(!a)return a;var b=new xn(a);if(1>=b.data.length)return a;a=[];var c={};b=t(b.data);for(var d=b.next();!d.done;c={jc:c.jc},d=b.next())c.jc=d.value,a.some(function(e){return function(f){return ob(f,e.jc)}}(c))||a.push(c.jc);return oc.apply(ic,ka(a))};function An(a,b){var c=Bn(a,b);return 1!=c.length?null:c[0]}function Cn(a,b,c){a=Dn(a,b,c);return 1!=a.length?null:a[0]}function Bn(a,b){return Array.from(a.childNodes).filter(function(c){return c instanceof Element&&c.tagName==b})}function En(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})}function Dn(a,b,c){return Array.from(a.childNodes).filter(function(d){return d instanceof Element&&d.localName==c&&d.namespaceURI==b})}
|
|
528
|
+
function Fn(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null}function Gn(a,b,c){b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,a.hasAttributeNS(d,c))return a.getAttributeNS(d,c);return null}function Hn(a){return Array.from(a.childNodes).every(In)?a.textContent.trim():null}function In(a){return a.nodeType==Node.TEXT_NODE||a.nodeType==Node.CDATA_SECTION_NODE}function Jn(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e}
|
|
529
|
+
function Kn(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:Math.floor(a/1E3)}function Ln(a){if(!a)return null;a=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
|
|
530
|
+
function Mn(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function Nn(a){a=Number(a);return 0===a%1?a:null}function On(a){a=Number(a);return 0===a%1&&0<a?a:null}function Pn(a){a=Number(a);return 0===a%1&&0<=a?a:null}function Qn(a){a=Number(a);return isNaN(a)?null:a}function Rn(a){var b;a=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(a)?null:a}
|
|
531
|
+
function Sn(a,b){var c=new DOMParser,d=null,e=null;try{e=c.parseFromString(a,"text/xml")}catch(f){}e&&e.documentElement.tagName==b&&(d=e.documentElement);return d&&0<d.getElementsByTagName("parsererror").length?null:d}function Tn(a,b){try{var c=wb(a);return Sn(c,b)}catch(d){return null}};function Un(a,b,c){var d=Vn(a),e=null;a=[];var f=[],g=new Set(d.map(function(h){return h.keyId}));g["delete"](null);if(1<g.size)throw new N(2,4,4010);b||(f=d.filter(function(h){return"urn:mpeg:dash:mp4protection:2011"==h.oe?(e=h.init||e,!1):!0}),f.length&&(a=Wn(e,f,c),0==a.length&&(a=[xe("",e)])));if(d.length&&(b||!f.length))for(a=[],b=t(Object.values(c)),c=b.next();!c.done;c=b.next())c=c.value,"org.w3.clearkey"!=c&&a.push(xe(c,e));if(g=Array.from(g)[0]||null)for(b=t(a),c=b.next();!c.done;c=b.next())for(c=
|
|
532
|
+
t(c.value.initData),d=c.next();!d.done;d=c.next())d.value.keyId=g;return{Wd:g,qg:e,drmInfos:a,$d:!0}}function Xn(a,b,c,d){var e=Un(a,c,d);if(b.$d){a=1==b.drmInfos.length&&!b.drmInfos[0].keySystem;c=0==e.drmInfos.length;if(0==b.drmInfos.length||a&&!c)b.drmInfos=e.drmInfos;b.$d=!1}else if(0<e.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(function(f){return e.drmInfos.some(function(g){return g.keySystem==f.keySystem})}),0==b.drmInfos.length))throw new N(2,4,4008);return e.Wd||b.Wd}
|
|
533
|
+
function Yn(a){var b=0,c=tb(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+6;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;var e=c.getUint16(a,!0);a+=2;if(0!=(e&1)||e+a>c.byteLength){c=[];break a}var f=qb(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}
|
|
534
|
+
function Zn(a){a=t(a.getElementsByTagName("DATA"));for(var b=a.next();!b.done;b=a.next()){b=t(b.value.childNodes);for(var c=b.next();!c.done;c=b.next())if(c=c.value,c instanceof Element&&"LA_URL"==c.tagName)return c.textContent}return""}function $n(a){a=Cn(a.node,"urn:microsoft:playready","pro");if(!a)return"";a=lc(a.textContent);a=Yn(a).filter(function(b){return b.type===ao})[0];if(!a)return"";a=xb(a.value,!0);return(a=Sn(a,"WRMHEADER"))?Zn(a):""}
|
|
535
|
+
function Wn(a,b,c){var d=[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=c[e.oe];if(f){var g;if(g=Cn(e.node,"urn:microsoft:playready","pro")){g=lc(g.textContent);var h=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);g=[{initData:yn(g,h),initDataType:"cenc",keyId:e.keyId}]}else g=null;g=xe(f,e.init||a||g);if(f=bo.get(f))g.licenseServerUri=f(e);d.push(g)}}return d}
|
|
536
|
+
function Vn(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=co(c.value))&&b.push(c);return b}
|
|
537
|
+
function co(a){var b=a.getAttribute("schemeIdUri"),c=Fn(a,"urn:mpeg:cenc:2013","default_KID"),d=Dn(a,"urn:mpeg:cenc:2013","pssh").map(Hn);if(!b)return null;b=b.toLowerCase();if(c&&(c=c.replace(/-/g,"").toLowerCase(),c.includes(" ")))throw new N(2,4,4009);var e=[];try{e=d.map(function(f){return{initDataType:"cenc",initData:lc(f),keyId:null}})}catch(f){throw new N(2,4,4007);}return{node:a,oe:b,keyId:c,init:0<e.length?e:null}}
|
|
538
|
+
var ao=1,bo=(new Map).set("com.widevine.alpha",function(a){return(a=Cn(a.node,"urn:microsoft","laurl"))?a.getAttribute("licenseUrl")||"":""}).set("com.microsoft.playready",$n).set("com.microsoft.playready.recommendation",$n).set("com.microsoft.playready.software",$n).set("com.microsoft.playready.hardware",$n);function eo(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(g,h,k,l){if("$$"==g)return"$";var m=f[h];if(null==m)return g;"RepresentationID"==h&&k&&(k=void 0);"Time"==h&&(m=Math.round(m));switch(l){case void 0:case "d":case "i":case "u":g=m.toString();break;case "o":g=m.toString(8);break;case "x":g=m.toString(16);break;case "X":g=m.toString(16).toUpperCase();break;default:g=m.toString()}k=
|
|
539
539
|
window.parseInt(k,10)||1;return Array(Math.max(0,k-g.length)+1).join("0")+g})}
|
|
540
|
-
function
|
|
541
|
-
u&&(u-=e);if(!n)break;p=null!=u?u:m;u=x||0;if(0>u)if(r){r=
|
|
542
|
-
function
|
|
543
|
-
function
|
|
544
|
-
for(;a.childNodes.length;)a.removeChild(a.childNodes[0]);for(;n.childNodes.length;){var p=n.childNodes[0];n.removeChild(p);a.appendChild(p)}n=t(Array.from(n.attributes));for(p=n.next();!p.done;p=n.next())a.setAttributeNode(p.value.cloneNode(!1));return
|
|
545
|
-
function
|
|
546
|
-
function
|
|
547
|
-
return h};function
|
|
548
|
-
function
|
|
549
|
-
a.g.$(),b);a.g.skip(b);return new
|
|
550
|
-
function
|
|
551
|
-
function
|
|
552
|
-
function
|
|
553
|
-
function
|
|
554
|
-
J=new
|
|
555
|
-
function
|
|
556
|
-
Infinity,d);return{xb:function(){return Promise.resolve(e)}}}function
|
|
557
|
-
function
|
|
558
|
-
function
|
|
559
|
-
p,!0),l.Bb(m,a.presentationTimeline.ab())):(l=new U(m),d&&a.fb&&(c[d]=l));a.presentationTimeline.Db(m);r&&l.$a(n,p);return{xb:function(){return Promise.resolve(l)}}}function
|
|
560
|
-
function
|
|
561
|
-
function
|
|
540
|
+
function fo(a,b){var c=go(a,b,"timescale"),d=1;c&&(d=On(c)||1);var e=go(a,b,"duration");c=On(e||"");"image"==a.K.contentType&&(c=Qn(e||""));c&&(c/=d);var f=go(a,b,"startNumber");e=Number(go(a,b,"presentationTimeOffset"))||0;var g=Pn(f||"");if(null==f||null==g)g=1;var h=ho(a,b,"SegmentTimeline");f=null;if(h){f=d;var k=a.W.duration||Infinity,l=Bn(h,"S");h=[];var m=-e;l=t(mb(l));for(var n=l.next();!n.done;n=l.next()){n=n.value;var p=n.item,r=n.next,u=Jn(p,"t",Pn);n=Jn(p,"d",Pn);var x=Jn(p,"r",Nn);null!=
|
|
541
|
+
u&&(u-=e);if(!n)break;p=null!=u?u:m;u=x||0;if(0>u)if(r){r=Jn(r,"t",Pn);if(null==r)break;else if(p>=r)break;u=Math.ceil((r-p)/n)-1}else{if(Infinity==k)break;else if(p/f>=k)break;u=Math.ceil((k*f-p)/n)-1}0<h.length&&p!=m&&(h[h.length-1].end=p/f);r=t(jb(u+1));for(u=r.next();!u.done;u=r.next())m=p+n,h.push({start:p/f,end:m/f,Qf:p}),p=m}f=h}return{timescale:d,ja:c,Ib:g,Va:e/d||0,Sd:e,timeline:f}}
|
|
542
|
+
function go(a,b,c){return[b(a.K),b(a.la),b(a.ha)].filter(Mb).map(function(d){return d.getAttribute(c)}).reduce(function(d,e){return d||e})}function ho(a,b,c){return[b(a.K),b(a.la),b(a.ha)].filter(Mb).map(function(d){return An(d,c)}).reduce(function(d,e){return d||e})}
|
|
543
|
+
function io(a,b,c,d,e,f){for(var g=Fn(a,"http://www.w3.org/1999/xlink","href"),h=Fn(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest",k=t(Array.from(a.attributes)),l=k.next();!l.done;l=k.next())l=l.value,"http://www.w3.org/1999/xlink"==l.namespaceURI&&a.removeAttributeNS(l.namespaceURI,l.localName);if(5<=f)return Qg(new N(2,4,4028));if("onLoad"!=h)return Qg(new N(2,4,4027));var m=we([d],[g]);return e.request(0,fh(m,b)).ca(function(n){n=Tn(n.data,a.tagName);if(!n)return Qg(new N(2,4,4001,g));
|
|
544
|
+
for(;a.childNodes.length;)a.removeChild(a.childNodes[0]);for(;n.childNodes.length;){var p=n.childNodes[0];n.removeChild(p);a.appendChild(p)}n=t(Array.from(n.attributes));for(p=n.next();!p.done;p=n.next())a.setAttributeNode(p.value.cloneNode(!1));return jo(a,b,c,m[0],e,f+1)})}
|
|
545
|
+
function jo(a,b,c,d,e,f){f=void 0===f?0:f;if(Fn(a,"http://www.w3.org/1999/xlink","href")){var g=io(a,b,c,d,e,f);c&&(g=g.ca(void 0,function(){return jo(a,b,c,d,e,f)}));return g}g=[];for(var h=t(Array.from(a.childNodes)),k=h.next();!k.done;k=h.next())k=k.value,k instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==Fn(k,"http://www.w3.org/1999/xlink","href")?a.removeChild(k):"SegmentTimeline"!=k.tagName&&g.push(jo(k,b,c,d,e,f)));return Ug(g).ca(function(){return a})};function ko(a,b,c,d,e,f,g){var h,k=(new Ob).U("sidx",function(l){h=lo(b,d,e,f,g,c,l)});a&&k.parse(a);if(h)return h;throw new N(2,3,3004);}
|
|
546
|
+
function lo(a,b,c,d,e,f,g){var h=[];g.reader.skip(4);var k=g.reader.N();if(0==k)throw new N(2,3,3005);if(0==g.version){var l=g.reader.N();var m=g.reader.N()}else l=g.reader.Hb(),m=g.reader.Hb();g.reader.skip(2);var n=g.reader.Gb();a=a+g.size+m;n=t(jb(n));for(m=n.next();!m.done;m=n.next()){var p=g.reader.N();m=(p&2147483648)>>>31;p&=2147483647;var r=g.reader.N();g.reader.skip(4);if(1==m)throw new N(2,3,3006);h.push(new qi(l/k+c,(l+r)/k+c,function(){return f},a,a+p-1,b,c,d,e));l+=r;a+=p}g.parser.stop();
|
|
547
|
+
return h};function mo(a){this.h=tb(a);this.g=new Cb(this.h,0)}mo.prototype.oa=function(){return this.g.oa()};
|
|
548
|
+
function no(a){var b=oo(a);if(7<b.length)throw new N(2,3,3002);var c=0;b=t(b);for(var d=b.next();!d.done;d=b.next())c=256*c+d.value;b=oo(a);a:{d=t(po);for(var e=d.next();!e.done;e=d.next())if(ob(b,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)b=a.h.byteLength-a.g.$();else{if(8==b.length&&b[1]&224)throw new N(2,3,3001);d=0;e=t(mb(b));for(var f=e.next();!f.done;f=e.next()){f=f.value;var g=f.item;d=0==f.ga?g&(1<<8-b.length)-1:256*d+g}b=d}b=a.g.$()+b<=a.h.byteLength?b:a.h.byteLength-a.g.$();d=tb(a.h,
|
|
549
|
+
a.g.$(),b);a.g.skip(b);return new qo(c,d)}function oo(a){var b=a.g.$(),c=a.g.aa();if(0==c)throw new N(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return qb(a.h,b,c)}var po=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function qo(a,b){this.id=a;this.g=b}
|
|
550
|
+
function ro(a){if(8<a.g.byteLength)throw new N(2,3,3002);if(8==a.g.byteLength&&a.g.getUint8(0)&224)throw new N(2,3,3001);for(var b=0,c=t(jb(a.g.byteLength)),d=c.next();!d.done;d=c.next())d=a.g.getUint8(d.value),b=256*b+d;return b};function so(a,b,c,d,e,f,g,h,k){function l(){return e}var m=[];a=new mo(a.g);for(var n=null,p=null;a.oa();){var r=no(a);if(187==r.id){var u=to(r);u&&(r=c*u.Rf,u=b+u.zf,null!=n&&m.push(new qi(n+g,r+g,l,p,u-1,f,g,h,k)),n=r,p=u)}}null!=n&&m.push(new qi(n+g,d+g,l,p,null,f,g,h,k));return m}
|
|
551
|
+
function to(a){var b=new mo(a.g);a=no(b);if(179!=a.id)throw new N(2,3,3013);a=ro(a);b=no(b);if(183!=b.id)throw new N(2,3,3012);b=new mo(b.g);for(var c=0;b.oa();){var d=no(b);if(241==d.id){c=ro(d);break}}return{Rf:a,zf:c}};function uo(a,b){var c=ho(a,b,"Initialization");if(!c)return null;var d=a.K.Aa,e=c.getAttribute("sourceURL");e&&(d=we(a.K.Aa,[e]));e=0;var f=null;if(c=Jn(c,"range",Mn))e=c.start,f=c.end;return new oi(function(){return d},e,f)}
|
|
552
|
+
function vo(a,b){var c=Number(go(a,wo,"presentationTimeOffset"))||0,d=go(a,wo,"timescale"),e=1;d&&(e=On(d)||1);var f=c/e||0,g=uo(a,wo);xo(a,g);var h=Zg(a);return{xb:function(){var k=ho(h,wo,"RepresentationIndex"),l=h.K.Aa;k&&(k=k.getAttribute("sourceURL"))&&(l=we(h.K.Aa,[k]));k=yo(h);return zo(h,b,g,l,k.start,k.end,f)}}}
|
|
553
|
+
function zo(a,b,c,d,e,f,g){var h,k,l,m,n,p,r,u,x,w,y,C,D,A,E;return L(function(G){if(1==G.g)return h=a.presentationTimeline,k=!a.fb||!a.W.ee,l=a.W.start,m=a.W.duration,n=a.K.mimeType.split("/")[1],p=b,r=null,u=[p(d,e,f),"webm"==n?p(c.na(),c.ka,c.fa):null],p=null,v(G,Promise.all(u),2);x=G.h;w=x[0];y=x[1]||null;C=null;D=l-g;A=l;E=m?l+m:Infinity;if("mp4"==n)var H=ko(w,e,d,c,D,A,E);else{H=new mo(y);if(440786851!=no(H).id)throw new N(2,3,3008);var J=no(H);if(408125543!=J.id)throw new N(2,3,3009);H=J.g.byteOffset;
|
|
554
|
+
J=new mo(J.g);for(var I=null;J.oa();){var K=no(J);if(357149030==K.id){I=K;break}}if(!I)throw new N(2,3,3010);I=new mo(I.g);K=1E6;for(J=null;I.oa();){var O=no(I);if(2807729==O.id)K=ro(O);else if(17545==O.id)if(4==O.g.byteLength)J=O.g.getFloat32(0);else if(8==O.g.byteLength)J=O.g.getFloat64(0);else throw new N(2,3,3003);}if(null==J)throw new N(2,3,3011);I=K/1E9;J*=I;K=no(new mo(w));if(475249515!=K.id)throw new N(2,3,3007);H=so(K,H,I,J,d,c,D,A,E)}C=H;h.Db(C);r=new U(C);k&&r.$a(A,E,!0);return G["return"](r)})}
|
|
555
|
+
function wo(a){return a.cc}function yo(a){var b=ho(a,wo,"RepresentationIndex");a=go(a,wo,"indexRange");a=Mn(a||"");b&&(a=Jn(b,"range",Mn,a));return a}function xo(a,b){Ao(a,b);if(!yo(a))throw new N(2,4,4002);}function Ao(a,b){var c=a.K.mimeType.split("/")[1];if(a.K.contentType!=Be&&"mp4"!=c&&"webm"!=c)throw new N(2,4,4006);if("webm"==c&&!b)throw new N(2,4,4005);};function Bo(a,b){var c=uo(a,Co),d=Do(a);if(!d.ja&&!d.timeline&&1<d.Ab.length)throw new N(2,4,4002);if(!d.ja&&!a.W.duration&&!d.timeline&&1==d.Ab.length)throw new N(2,4,4002);if(d.timeline&&0==d.timeline.length)throw new N(2,4,4002);var e=null,f=null;a.ha.id&&a.K.id&&(f=a.ha.id+","+a.K.id,e=b[f]);c=Eo(a.W.start,a.W.duration,a.K.Aa,d,c);d=!e;e?e.Bb(c,a.presentationTimeline.ab()):(e=new U(c),f&&a.fb&&(b[f]=e));a.presentationTimeline.Db(c);a.fb&&a.W.ee||e.$a(a.W.start,a.W.duration?a.W.start+a.W.duration:
|
|
556
|
+
Infinity,d);return{xb:function(){return Promise.resolve(e)}}}function Co(a){return a.cb}function Do(a){var b=Fo(a);a=fo(a,Co);var c=a.Ib;0==c&&(c=1);var d=0;a.ja?d=a.ja*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{ja:a.ja,startTime:d,Ib:c,Va:a.Va,timeline:a.timeline,Ab:b}}
|
|
557
|
+
function Eo(a,b,c,d,e){var f=d.Ab.length;d.timeline&&d.timeline.length!=d.Ab.length&&(f=Math.min(d.timeline.length,d.Ab.length));var g=a-d.Va,h=b?a+b:Infinity,k=[],l=d.startTime,m={};f=t(jb(f));for(var n=f.next();!n.done;m={Wc:m.Wc},n=f.next()){n=n.value;var p=d.Ab[n];m.Wc=we(c,[p.qf]);var r=void 0;r=null!=d.ja?l+d.ja:d.timeline?d.timeline[n].end:l+b;k.push(new qi(a+l,a+r,function(u){return function(){return u.Wc}}(m),p.start,p.end,e,g,a,h));l=r}return k}
|
|
558
|
+
function Fo(a){return[a.K.cb,a.la.cb,a.ha.cb].filter(Mb).map(function(b){return Bn(b,"SegmentURL")}).reduce(function(b,c){return 0<b.length?b:c}).map(function(b){b.getAttribute("indexRange")&&!a.ce&&(a.ce=!0);var c=b.getAttribute("media");b=Jn(b,"mediaRange",Mn,{start:0,end:null});return{qf:c,start:b.start,end:b.end}})};function Go(a,b,c,d,e,f){var g=Ho(a),h=Io(a);Jo(h);var k=Zg(a);if(h.Yb)return Ao(a,g),{xb:function(){var u=eo(h.Yb,k.K.id,null,k.bandwidth||null,null);u=we(k.K.Aa,[u]);return zo(k,b,g,u,0,null,h.Va)}};if(h.ja)return d||(a.presentationTimeline.wd(h.ja),a.presentationTimeline.xd(a.W.start)),{xb:function(){return Ko(k,h,e,g,f)}};var l=null;d=null;a.ha.id&&a.K.id&&(d=a.ha.id+","+a.K.id,l=c[d]);var m=Lo(k,h,g),n=a.W.start,p=a.W.duration?a.W.start+a.W.duration:Infinity,r=Infinity!=p;l?(r&&(new U(m)).$a(n,
|
|
559
|
+
p,!0),l.Bb(m,a.presentationTimeline.ab())):(l=new U(m),d&&a.fb&&(c[d]=l));a.presentationTimeline.Db(m);r&&l.$a(n,p);return{xb:function(){return Promise.resolve(l)}}}function Mo(a){return a.dc}function Io(a){var b=fo(a,Mo),c=go(a,Mo,"media");a=go(a,Mo,"index");return{ja:b.ja,timescale:b.timescale,Ib:b.Ib,Va:b.Va,Sd:b.Sd,timeline:b.timeline,vd:c,Yb:a}}
|
|
560
|
+
function Jo(a){var b=a.Yb?1:0;b+=a.timeline?1:0;b+=a.ja?1:0;if(0==b)throw new N(2,4,4002);1!=b&&(a.Yb&&(a.timeline=null),a.ja=null);if(!a.Yb&&!a.vd)throw new N(2,4,4002);}
|
|
561
|
+
function Ko(a,b,c,d,e){function f(I){var K=(I-r)*p,O=K+b.Va,Q=K+l;K=Q+p;var S=Math.min(K,h());Q=new qi(Q,S,function(){var ba=eo(x,y,I,w,O*u);return we(C,[ba])},0,null,d,D,l,h());Q.j=K;return Q}function g(){var I=[Math.max(k.ab(),l),Math.min(k.ib(),h())].map(function(K){return K-l});return[Math.ceil(I[0]/p),Math.ceil(I[1]/p)-1].map(function(K){return K+r})}function h(){var I=null!=m&&e[m]||n;return I?l+I:Infinity}var k=a.presentationTimeline,l=a.W.start,m=a.ha.id,n=a.W.duration,p=b.ja,r=b.Ib,u=b.timescale,
|
|
562
562
|
x=b.vd,w=a.bandwidth||null,y=a.K.id,C=a.K.Aa,D=l-b.Va,A=g();a=a.fb?Math.max(A[0],A[1]-c+1):A[0];A=A[1];c=[];for(var E=a;E<=A;++E){var G=f(E);c.push(G)}var H=new U(c);c=k.ib()<h();E=k.Z();if(c||E){var J=Math.max(a,A+1);H.Oc(p,function(){var I=k.ab();H.gb(I);var K=t(g());K.next();K=K.next().value;for(var O=[];J<=K;){var Q=f(J);O.push(Q);J++}return I>h()&&!O.length?null:O})}return Promise.resolve(H)}
|
|
563
|
-
function
|
|
564
|
-
function
|
|
565
|
-
function
|
|
566
|
-
x=b.map(function(
|
|
567
|
-
Ba.drmInfos),da.drmInfos.length&&Ba.drmInfos.length&&!
|
|
568
|
-
allowedByKeySystem:!0,decodingInfos:[]});a.l=H;z(
|
|
569
|
-
function
|
|
570
|
-
function
|
|
571
|
-
function
|
|
572
|
-
function
|
|
573
|
-
function
|
|
574
|
-
k.push(
|
|
563
|
+
function Lo(a,b,c){var d=a.W.start,e=a.W.duration,f=d-b.Va;e=e?d+e:Infinity;for(var g=[],h={},k=t(mb(b.timeline)),l=k.next();!l.done;h={Vc:h.Vc,Yc:h.Yc,ad:h.ad,Sc:h.Sc,cd:h.cd,Tc:h.Tc},l=k.next()){l=l.value;var m=l.item,n=m.start,p=m.Qf;m=m.end;h.ad=l.ga+b.Ib;h.cd=p+b.Sd;h.Yc=a.K.id;h.Sc=a.bandwidth||null;h.Vc=b.vd;h.Tc=a.K.Aa;g.push(new qi(d+n,d+m,function(r){return function(){var u=eo(r.Vc,r.Yc,r.ad,r.Sc||null,r.cd);return we(r.Tc,[u]).map(function(x){return x.toString()})}}(h),0,null,c,f,d,e))}return g}
|
|
564
|
+
function Ho(a){var b=go(a,Mo,"initialization");if(!b)return null;var c=a.K.id,d=a.bandwidth||null,e=a.K.Aa;return new oi(function(){var f=eo(b,c,null,d,null);return we(e,[f])},0,null)};function No(){this.l=[];this.g=[];this.h=[];this.j=[];this.i=[];this.m=new Set}No.prototype.release=function(){for(var a=t(this.g.concat(this.h,this.j,this.i)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.g=[];this.h=[];this.j=[];this.i=[];this.l=[]};
|
|
565
|
+
function Oo(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q,S,ba,da,ea,Ia,Ba,kb,Pa;return L(function(Xa){switch(Xa.g){case 1:d=Ce;Po(b);Qo(b);Ro(b);So(b);if(!c&&1==b.length){e=b[0];a.g=e.uc;a.h=e.Qc;a.j=e.textStreams;a.i=e.imageStreams;Xa.v(2);break}f=-1;g=t(mb(b));for(h=g.next();!h.done;h=g.next())l=k=h.value,m=l.ga,n=l.item,a.m.has(n.id)||(a.m.add(n.id),-1==f&&(f=m));if(-1==f)return Xa["return"]();p=b.map(function(Qa){return Qa.uc});r=b.map(function(Qa){return Qa.Qc});u=b.map(function(Qa){return Qa.textStreams});
|
|
566
|
+
x=b.map(function(Qa){return Qa.imageStreams});w=t(u);for(y=w.next();!y.done;y=w.next())C=y.value,C.push(To(d.ba));D=t(x);for(A=D.next();!A.done;A=D.next())E=A.value,E.push(To(d.oc));return v(Xa,Uo(a.g,p,f,Vo,Wo),3);case 3:return v(Xa,Uo(a.h,r,f,Vo,Wo),4);case 4:return v(Xa,Uo(a.j,u,f,Vo,Wo),5);case 5:return v(Xa,Uo(a.i,x,f,Vo,Wo),2);case 2:G=0;H=[];if(a.h.length&&a.g.length)for(S=t(a.g),ba=S.next();!ba.done;ba=S.next())for(da=ba.value,ea=t(a.h),Ia=ea.next();!Ia.done;Ia=ea.next())Ba=Ia.value,kb=gi(da.drmInfos,
|
|
567
|
+
Ba.drmInfos),da.drmInfos.length&&Ba.drmInfos.length&&!kb.length||(Pa=G++,H.push({id:Pa,language:da.language,primary:da.primary,audio:da,video:Ba,bandwidth:(da.bandwidth||0)+(Ba.bandwidth||0),drmInfos:kb,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(J=a.h.concat(a.g),I=t(J),K=I.next();!K.done;K=I.next())O=K.value,Q=G++,H.push({id:Q,language:O.language,primary:O.primary,audio:O.type==d.eb?O:null,video:O.type==d.Qa?O:null,bandwidth:O.bandwidth||0,drmInfos:O.drmInfos,allowedByApplication:!0,
|
|
568
|
+
allowedByKeySystem:!0,decodingInfos:[]});a.l=H;z(Xa)}})}
|
|
569
|
+
function Po(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.uc),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.channelsCount==h.channelsCount&&e.language==h.language&&e.bandwidth==h.bandwidth&&e.label==h.label&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&vc(e.roles,h.roles)&&e.audioSamplingRate==h.audioSamplingRate&&e.primary==h.primary&&(f=!0);f||c.push(e)}b.uc=c}}
|
|
570
|
+
function Ro(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.textStreams),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.language==h.language&&e.label==h.label&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&vc(e.roles,h.roles)&&(f=!0);f||c.push(e)}b.textStreams=c}}
|
|
571
|
+
function Qo(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.Qc),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.width==h.width&&e.frameRate==h.frameRate&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&e.label==h.label&&vc(e.roles,h.roles)&&rh(e.closedCaptions,h.closedCaptions)&&e.bandwidth==h.bandwidth&&(f=!0);f||c.push(e)}b.Qc=c}}
|
|
572
|
+
function So(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;for(var c=[],d=t(b.imageStreams),e=d.next();!e.done;e=d.next()){e=e.value;for(var f=!1,g=t(c),h=g.next();!h.done;h=g.next())h=h.value,e.id!=h.id&&e.width==h.width&&e.codecs==h.codecs&&e.mimeType==h.mimeType&&(f=!0);f||c.push(e)}b.imageStreams=c}}
|
|
573
|
+
function Xo(a){var b,c,d,e,f,g,h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O;return L(function(Q){switch(Q.g){case 1:b=Ce;if(1==a.length)return Q["return"](a[0]);c=a.map(function(S){return S.filter(function(ba){return ba.type==b.eb})});d=a.map(function(S){return S.filter(function(ba){return ba.type==b.Qa})});e=a.map(function(S){return S.filter(function(ba){return ba.type==b.ba})});f=a.map(function(S){return S.filter(function(ba){return ba.type==b.oc})});g=t(e);for(h=g.next();!h.done;h=g.next())k=h.value,
|
|
574
|
+
k.push(Yo(b.ba));l=t(f);for(m=l.next();!m.done;m=l.next())n=m.value,n.push(Yo(b.oc));return v(Q,Uo([],c,0,Zo,$o),2);case 2:return p=Q.h,v(Q,Uo([],d,0,Zo,$o),3);case 3:return r=Q.h,v(Q,Uo([],e,0,Zo,$o),4);case 4:return u=Q.h,v(Q,Uo([],f,0,Zo,$o),5);case 5:x=Q.h;w=0;if(r.length&&p.length)for(E=t(p),G=E.next();!G.done;G=E.next())for(H=G.value,J=t(r),I=J.next();!I.done;I=J.next())K=I.value,O=w++,K.variantIds.push(O),H.variantIds.push(O);else for(y=r.concat(p),C=t(y),D=C.next();!D.done;D=C.next())A=D.value,
|
|
575
575
|
A.variantIds=[w++];return Q["return"](r.concat(p).concat(u).concat(x))}})}
|
|
576
|
-
function
|
|
577
|
-
y.next();da.v(6);break}G=E.value;return v(da,
|
|
578
|
-
function
|
|
579
|
-
function
|
|
580
|
-
function
|
|
581
|
-
function
|
|
582
|
-
(a.closedCaptions=new Map);c=t(b.closedCaptions);for(var d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}}a.segmentIndex.j.push(b.segmentIndex);b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=
|
|
583
|
-
function
|
|
584
|
-
function
|
|
585
|
-
function
|
|
586
|
-
function
|
|
587
|
-
d=
|
|
588
|
-
function
|
|
589
|
-
function
|
|
590
|
-
a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function
|
|
591
|
-
function
|
|
592
|
-
function
|
|
593
|
-
q.stop=function(){for(var a=t(Object.values(this.m)),b=a.next();!b.done;b=a.next())b.value.release();this.g&&this.g.release();this.o=this.D=null;this.h=[];this.A=null;this.m={};this.g=null;null!=this.u&&(this.u.stop(),this.u=null);return this.i.destroy()};q.update=function(){var a=this,b;return L(function(c){if(1==c.g)return B(c,2),v(c,
|
|
594
|
-
function
|
|
595
|
-
function
|
|
596
|
-
function
|
|
597
|
-
x=null;u||(x=
|
|
598
|
-
profiles:I.split(",")};O=
|
|
599
|
-
null==r&&(r=Infinity);D.Od(r);D.wd(y||1);return v(Ba,
|
|
600
|
-
function
|
|
576
|
+
function Uo(a,b,c,d,e){var f,g,h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q,S,ba;return L(function(da){switch(da.g){case 1:f=Ce;g=[];h=t(mb(b));for(k=h.next();!k.done;k=h.next())m=l=k.value,n=m.ga,p=m.item,n>=c?g.push(new Set(p)):g.push(new Set);r=t(a);u=r.next();case 2:if(u.done){da.v(4);break}x=u.value;return v(da,ap(x,b,c,e,g),5);case 5:w=da.h;if(!w)throw new N(2,4,4037);u=r.next();da.v(2);break;case 4:y=t(g),C=y.next();case 6:if(C.done){da.v(8);break}D=C.value;A=t(D);E=A.next();case 9:if(E.done){C=
|
|
577
|
+
y.next();da.v(6);break}G=E.value;return v(da,bp(G,b,d,e,g),12);case 12:(H=da.h)&&a.push(H);E=A.next();da.v(9);break;case 8:J=t(g);for(C=J.next();!C.done;C=J.next())for(I=C.value,K={},O=t(I),E=O.next();!E.done;K={Xa:K.Xa},E=O.next())if(K.Xa=E.value,Q=K.Xa.type==f.ba&&!K.Xa.language,S=K.Xa.type==f.oc&&!K.Xa.tilesLayout,!Q&&!S&&(ba=a.some(function(ea){return function(Ia){return Ia.mimeType==ea.Xa.mimeType&&Qe(Ia.codecs)==Qe(ea.Xa.codecs)}}(K))))throw new N(2,4,4037);return da["return"](a)}})}
|
|
578
|
+
function ap(a,b,c,d,e){var f;return L(function(g){if(1==g.g)return(f=cp(b,a))?v(g,dp(f),2):g["return"](!1);ep(a,f,c,d,e);return g["return"](!0)})}function dp(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,b.push(c.createSegmentIndex()),c.trickModeVideo&&!c.trickModeVideo.segmentIndex&&b.push(c.trickModeVideo.createSegmentIndex());return Promise.all(b)}
|
|
579
|
+
function bp(a,b,c,d,e){var f,g;return L(function(h){if(1==h.g)return f=c(a),(g=cp(b,f))?f.createSegmentIndex?v(h,dp(g),2):h.v(2):h["return"](null);ep(f,g,0,d,e);return h["return"](f)})}function ep(a,b,c,d,e){b=t(mb(b));for(var f=b.next();!f.done;f=b.next()){var g=f.value;f=g.ga;g=g.item;if(f>=c){d(a,g);var h=!0;"audio"==a.type&&0==Mf(a.language,g.language)&&(h=!1);h&&e[f]["delete"](g)}}}
|
|
580
|
+
function Vo(a){a=Object.assign({},a);a.originalId=null;a.createSegmentIndex=function(){return Promise.resolve()};a.segmentIndex=new Pi;a.emsgSchemeIdUris=[];a.keyIds=new Set;a.closedCaptions=null;a.trickModeVideo=null;return a}function Zo(a){a=Object.assign({},a);a.keyIds=new Set;a.segments=[];a.variantIds=[];a.closedCaptions=null;return a}
|
|
581
|
+
function Wo(a,b){a.roles=Array.from(new Set(a.roles.concat(b.roles)));b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=Array.from(new Set(a.emsgSchemeIdUris.concat(b.emsgSchemeIdUris))));var c=b.keyIds;c=new Set([].concat(ka(a.keyIds),ka(c)));a.keyIds=c;null==a.originalId?a.originalId=b.originalId:a.originalId+=","+(b.originalId||"");c=gi(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new N(2,4,4038);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions){a.closedCaptions||
|
|
582
|
+
(a.closedCaptions=new Map);c=t(b.closedCaptions);for(var d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}}a.segmentIndex.j.push(b.segmentIndex);b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=Vo(b.trickModeVideo),a.trickModeVideo.segmentIndex=a.segmentIndex.clone()),Wo(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&Wo(a.trickModeVideo,b)}
|
|
583
|
+
function $o(a,b){a.roles=Array.from(new Set(a.roles.concat(b.roles)));var c=b.keyIds;c=new Set([].concat(ka(a.keyIds),ka(c)));a.keyIds=c;a.encrypted=a.encrypted&&b.encrypted;a.segments.push.apply(a.segments,ka(b.segments));if(b.closedCaptions){a.closedCaptions||(a.closedCaptions=new Map);c=t(b.closedCaptions);for(var d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}}}
|
|
584
|
+
function cp(a,b){for(var c=[],d=t(a),e=d.next();!e.done;e=d.next()){var f=b,g={audio:fp,video:fp,text:gp,image:hp}[f.type],h={audio:ip,video:jp,text:kp,image:lp}[f.type],k=null;e=t(e.value);for(var l=e.next();!l.done;l=e.next())l=l.value,!g(f,l)||k&&!h(f,k,l)||(k=l);f=k;if(!f)return null;c.push(f)}return c}function fp(a,b){var c;if(!(c=b.mimeType!=a.mimeType||Qe(b.codecs)!=Qe(a.codecs))&&(c=a.drmInfos)){c=a.drmInfos;var d=b.drmInfos;c=!(c.length&&d.length?0<gi(c,d).length:1)}return c?!1:!0}
|
|
585
|
+
function gp(a,b){return a.language?b.language?0==Mf(a.language,b.language)||b.kind!=a.kind?!1:!0:!0:!1}function hp(a){return a.tilesLayout?!0:!1}
|
|
586
|
+
function ip(a,b,c){if(a.id==c.id)return!0;var d=Mf(a.language,b.language),e=Mf(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(a.roles.length)return d=b.roles.filter(function(f){return a.roles.includes(f)}),e=c.roles.filter(function(f){return a.roles.includes(f)}),e.length>d.length?!0:e.length<d.length?!1:c.roles.length<b.roles.length;if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1;
|
|
587
|
+
d=mp(a.channelsCount,b.channelsCount,c.channelsCount);if(d==np)return!0;if(d==op)return!1;d=mp(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==np?!0:d==op?!1:a.bandwidth&&pp(a.bandwidth,b.bandwidth,c.bandwidth)==np?!0:!1}
|
|
588
|
+
function jp(a,b,c){if(a.id==c.id)return!0;var d=mp(a.width*a.height,b.width*b.height,c.width*c.height);if(d==np)return!0;if(d==op)return!1;if(a.frameRate){d=mp(a.frameRate,b.frameRate,c.frameRate);if(d==np)return!0;if(d==op)return!1}return a.bandwidth&&pp(a.bandwidth,b.bandwidth,c.bandwidth)==np?!0:!1}
|
|
589
|
+
function kp(a,b,c){if(a.id==c.id)return!0;var d=Mf(a.language,b.language),e=Mf(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=
|
|
590
|
+
a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function lp(a,b,c){return a.id==c.id?!0:mp(a.width*a.height,b.width*b.height,c.width*c.height)==np?!0:!1}function Yo(a){return{id:0,originalId:"",primary:!1,type:a,mimeType:"",codecs:"",language:"",label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null}}
|
|
591
|
+
function To(a){return{id:0,originalId:"",createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new U([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",label:null,type:a,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null}}
|
|
592
|
+
function mp(a,b,c){if(b==a&&a!=c)return op;if(c==a&&a!=b)return np;if(b>a){if(c<=a||c-a<b-a)return np;if(c-a>b-a)return op}else{if(c>a)return op;if(a-c<a-b)return np;if(a-c>a-b)return op}return qp}function pp(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?np:b<a?op:qp}var np=1,qp=0,op=-1;function rp(){var a=this;this.D=this.o=null;this.h=[];this.A=null;this.F=1;this.m={};this.L={};this.g=new No;this.C=0;this.H=new Oa(5);this.u=new P(function(){a.$b()});this.i=new $g;this.j=null;this.I=[];this.l=Infinity;this.s=!1}q=rp.prototype;q.configure=function(a){this.o=a};q.start=function(a,b){var c=this,d;return L(function(e){if(1==e.g)return c.s=b.isLowLatencyMode(),c.h=[a],c.D=b,v(e,sp(c),2);d=e.h;c.D&&tp(c,d);if(!c.D)throw new N(2,7,7001);return e["return"](c.A)})};
|
|
593
|
+
q.stop=function(){for(var a=t(Object.values(this.m)),b=a.next();!b.done;b=a.next())b.value.release();this.g&&this.g.release();this.o=this.D=null;this.h=[];this.A=null;this.m={};this.g=null;null!=this.u&&(this.u.stop(),this.u=null);return this.i.destroy()};q.update=function(){var a=this,b;return L(function(c){if(1==c.g)return B(c,2),v(c,sp(a),4);if(2!=c.g)return wa(c,0);b=F(c);if(!a.D||!b)return c["return"]();a.D.onError(b);z(c)})};q.onExpirationUpdated=function(){};
|
|
594
|
+
function sp(a){var b,c,d,e,f,g,h;return L(function(k){if(1==k.g)return b=fh(a.h,a.o.retryParameters),c=a.D.networkingEngine,d=Date.now(),e=c.request(0,b),ah(a.i,e),v(k,e.promise,2);if(3!=k.g){f=k.h;if(!a.D)return k["return"](0);f.uri&&!a.h.includes(f.uri)&&a.h.unshift(f.uri);return v(k,up(a,f.data,f.uri),3)}g=Date.now();h=(g-d)/1E3;Ra(a.H,1,h);return k["return"](h)})}
|
|
595
|
+
function up(a,b,c){var d,e,f,g,h;return L(function(k){if(1==k.g){d=Tn(b,"MPD");if(!d)throw new N(2,4,4001,c);if(e=a.o.dash.disableXlinkProcessing)return k["return"](vp(a,d,c));f=a.o.dash.xlinkFailGracefully;g=jo(d,a.o.retryParameters,f,c,a.D.networkingEngine);ah(a.i,g);return v(k,g.promise,2)}h=k.h;return k["return"](vp(a,h,c))})}
|
|
596
|
+
function vp(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q,S,ba,da,ea,Ia;return L(function(Ba){switch(Ba.g){case 1:d=[c];e=Bn(b,"Location").map(Hn).filter(Mb);0<e.length&&(f=we(d,e),d=a.h=f);g=Bn(b,"BaseURL");h=g.map(Hn);k=we(d,h);l=0;g&&g.length&&(l=Jn(g[0],"availabilityTimeOffset",Qn)||0);m=a.o.dash.ignoreMinBufferTime;n=0;m||(n=Jn(b,"minBufferTime",Ln)||0);a.C=Jn(b,"minimumUpdatePeriod",Ln,-1);p=Jn(b,"availabilityStartTime",Kn);r=Jn(b,"timeShiftBufferDepth",Ln);u=a.o.dash.ignoreSuggestedPresentationDelay;
|
|
597
|
+
x=null;u||(x=Jn(b,"suggestedPresentationDelay",Ln));w=a.o.dash.ignoreMaxSegmentDuration;y=null;w||(y=Jn(b,"maxSegmentDuration",Ln));C=b.getAttribute("type")||"static";if(a.A)for(D=a.A.presentationTimeline,A=t(Object.values(a.m)),E=A.next();!E.done;E=A.next())G=E.value,G.gb(D.ab());else H=a.o.defaultPresentationDelay||1.5*n,J=null!=x?x:H,D=new T(p,J,a.o.dash.autoCorrectDrift);I=b.getAttribute("profiles")||"";K={fb:"static"!=C,presentationTimeline:D,ha:null,W:null,la:null,K:null,bandwidth:0,ce:!1,vb:l,
|
|
598
|
+
profiles:I.split(",")};O=wp(a,K,k,b);Q=O.duration;S=O.periods;D.ec("static"==C);"static"!=C&&O.Yd||D.Ma(Q||Infinity);a.l&&!a.s&&(ba=a.D.isAutoLowLatencyMode())&&(a.D.enableLowLatencyMode(),a.s=a.D.isLowLatencyMode());a.s?D.re(a.l):a.l&&Wa("Low-latency DASH live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details.");(da=D.Z())&&!isNaN(a.o.availabilityWindowOverride)&&(r=a.o.availabilityWindowOverride);
|
|
599
|
+
null==r&&(r=Infinity);D.Od(r);D.wd(y||1);return v(Ba,Oo(a.g,S,K.fb),2);case 2:if(a.A){a.A.variants=a.g.l;a.A.textStreams=a.g.j.slice();a.A.imageStreams=a.g.i;a.D.filter(a.A);Ba.v(3);break}a.A={presentationTimeline:D,variants:a.g.l,textStreams:a.g.j.slice(),imageStreams:a.g.i,offlineSessionIds:[],minBufferTime:n||0};if(!D.we()){Ba.v(3);break}ea=Bn(b,"UTCTiming");return v(Ba,xp(a,k,ea),5);case 5:Ia=Ba.h;if(!a.D)return Ba["return"]();D.se(Ia);case 3:a.D.makeTextStreamsForClosedCaptions(a.A),z(Ba)}})}
|
|
600
|
+
function wp(a,b,c,d){var e=Jn(d,"mediaPresentationDuration",Ln),f=[],g=0;d=Bn(d,"Period");for(var h=t(mb(d)),k=h.next();!k.done;k=h.next()){var l=k.value;k=l.ga;var m=l.item,n=l.next;l=Jn(m,"start",Ln,g);var p=m.id,r=Jn(m,"duration",Ln),u=null;if(n){var x=Jn(n,"start",Ln);null!=x&&(u=x-l)}else null!=e&&(u=e-l);null==u&&(u=r);if(!(null!==a.j&&null!==p&&null!==l&&l<a.j)||a.I.includes(p)||k+1==d.length){null!==l&&(null===a.j||l>a.j)&&(a.j=l);g=yp(a,b,c,{start:l,duration:u,node:m,ee:null==u||!n});f.push(g);
|
|
601
601
|
b.ha.id&&u&&(a.L[b.ha.id]=u);if(null==u){g=null;break}g=l+u}}a.I=f.map(function(w){return w.id});return null!=e?{periods:f,duration:e,Yd:!1}:{periods:f,duration:g,Yd:!0}}
|
|
602
|
-
function
|
|
603
|
-
c=c.filter(function(m){return m.Qd});c=t(c);for(e=c.next();!e.done;e=c.next()){e=e.value;f=e.Qd.split(" ");g=t(d);for(var h=g.next();!h.done;h=g.next()){var k=h.value;if(f.includes(k.id)){h={};k=t(k.streams);for(var l=k.next();!l.done;h={nc:h.nc},l=k.next())h.nc=l.value,h.nc.trickModeVideo=e.streams.find(function(m){return function(n){return Qe(m.nc.codecs)==Qe(n.codecs)}}(h))}}}e=a.o.disableAudio?[]:
|
|
604
|
-
[]:
|
|
605
|
-
function
|
|
606
|
-
function
|
|
607
|
-
l}}var n;m=
|
|
608
|
-
10)));m=
|
|
609
|
-
1,null!=r)for(r=t(r.split(";")),w=r.next();!w.done;w=r.next())w=w.value,y=x=void 0,w.includes("=")?(w=w.split("="),x="svc"+w[0],y=w[1].split(",")[0].split(":").pop()):(x="svc"+p,p++,y=w),u.set(x,If(y));else u.set("svc1","und");else"urn:mpeg:dash:role:2011"==p&&null!=r&&(g.push(r),"captions"==r&&(h="caption"));if(l)return null;l=
|
|
610
|
-
(l=l[0],l.textContent&&(E=l.textContent));l=
|
|
602
|
+
function yp(a,b,c,d){b.ha=zp(d.node,null,c);b.W=d;b.ha.vb=b.vb;b.ha.id||(b.ha.id="__shaka_period_"+d.start);c=Bn(d.node,"EventStream");c=t(c);for(var e=c.next();!e.done;e=c.next())Ap(a,d.start,d.duration,e.value);c=Bn(d.node,"AdaptationSet").map(function(m){return Bp(a,b,m)}).filter(Mb);if(b.fb){d=[];e=t(c);for(var f=e.next();!f.done;f=e.next()){f=t(f.value.Cf);for(var g=f.next();!g.done;g=f.next())d.push(g.value)}if(d.length!=(new Set(d)).size)throw new N(2,4,4018);}d=c.filter(function(m){return!m.Qd});
|
|
603
|
+
c=c.filter(function(m){return m.Qd});c=t(c);for(e=c.next();!e.done;e=c.next()){e=e.value;f=e.Qd.split(" ");g=t(d);for(var h=g.next();!h.done;h=g.next()){var k=h.value;if(f.includes(k.id)){h={};k=t(k.streams);for(var l=k.next();!l.done;h={nc:h.nc},l=k.next())h.nc=l.value,h.nc.trickModeVideo=e.streams.find(function(m){return function(n){return Qe(m.nc.codecs)==Qe(n.codecs)}}(h))}}}e=a.o.disableAudio?[]:Cp(d,"audio");g=a.o.disableVideo?[]:Cp(d,"video");f=a.o.disableText?[]:Cp(d,Be);c=a.o.disableThumbnails?
|
|
604
|
+
[]:Cp(d,"image");if(!g.length&&!e.length)throw new N(2,4,4004);d=[];e=t(e);for(h=e.next();!h.done;h=e.next())d.push.apply(d,ka(h.value.streams));e=[];g=t(g);for(h=g.next();!h.done;h=g.next())e.push.apply(e,ka(h.value.streams));g=[];f=t(f);for(h=f.next();!h.done;h=f.next())g.push.apply(g,ka(h.value.streams));f=[];c=t(c);for(h=c.next();!h.done;h=c.next())f.push.apply(f,ka(h.value.streams));return{id:b.ha.id,uc:d,Qc:e,textStreams:g,imageStreams:f}}
|
|
605
|
+
function Cp(a,b){return a.filter(function(c){return c.contentType==b})}
|
|
606
|
+
function Bp(a,b,c){function d(G){switch(G){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}b.la=zp(c,b.ha,null);var e=!1,f=Bn(c,"Role"),g=f.map(function(G){return G.getAttribute("value")}).filter(Mb),h=void 0,k=b.la.contentType==Be;k&&(h="subtitle");f=t(f);for(var l=f.next();!l.done;l=f.next()){l=l.value;var m=l.getAttribute("schemeIdUri");if(null==m||"urn:mpeg:dash:role:2011"==m)switch(l=l.getAttribute("value"),l){case "main":e=!0;break;case "caption":case "subtitle":h=
|
|
607
|
+
l}}var n;m=Bn(c,"EssentialProperty");f=null;l=!1;m=t(m);for(var p=m.next();!p.done;p=m.next()){p=p.value;var r=p.getAttribute("schemeIdUri");"http://dashif.org/guidelines/trickmode"==r?f=p.getAttribute("value"):"urn:mpeg:mpegB:cicp:TransferCharacteristics"==r?n=d(parseInt(p.getAttribute("value"),10)):l=!0}m=Bn(c,"SupplementalProperty");m=t(m);for(p=m.next();!p.done;p=m.next())p=p.value,"urn:mpeg:mpegB:cicp:TransferCharacteristics"==p.getAttribute("schemeIdUri")&&(n=d(parseInt(p.getAttribute("value"),
|
|
608
|
+
10)));m=Bn(c,"Accessibility");var u=new Map;m=t(m);for(p=m.next();!p.done;p=m.next())if(r=p.value,p=r.getAttribute("schemeIdUri"),r=r.getAttribute("value"),"urn:scte:dash:cc:cea-608:2015"==p)if(p=1,null!=r){r=r.split(";");for(var x=t(r),w=x.next();!w.done;w=x.next()){var y=w.value,C=w=void 0;y.includes("=")?(y=y.split("="),w=y[0].startsWith("CC")?y[0]:"CC"+y[0],C=y[1]||"und"):(w="CC"+p,2==r.length?p+=2:p++,C=y);u.set(w,If(C))}}else u.set("CC1","und");else if("urn:scte:dash:cc:cea-708:2015"==p)if(p=
|
|
609
|
+
1,null!=r)for(r=t(r.split(";")),w=r.next();!w.done;w=r.next())w=w.value,y=x=void 0,w.includes("=")?(w=w.split("="),x="svc"+w[0],y=w[1].split(",")[0].split(":").pop()):(x="svc"+p,p++,y=w),u.set(x,If(y));else u.set("svc1","und");else"urn:mpeg:dash:role:2011"==p&&null!=r&&(g.push(r),"captions"==r&&(h="caption"));if(l)return null;l=Bn(c,"ContentProtection");var D=Un(l,a.o.dash.ignoreDrmInfo,a.o.dash.keySystemsByURI),A=If(c.getAttribute("lang")||"und"),E=c.getAttribute("label");(l=Bn(c,"Label"))&&l.length&&
|
|
610
|
+
(l=l[0],l.textContent&&(E=l.textContent));l=Bn(c,"Representation");c=l.map(function(G){if(G=Dp(a,b,D,h,A,E,e,g,u,G))G.hdr=G.hdr||n;return G}).filter(function(G){return!!G});if(0==c.length){f="image"==b.la.contentType;if(a.o.dash.ignoreEmptyAdaptationSet||k||f)return null;throw new N(2,4,4003);}if(!b.la.contentType||"application"==b.la.contentType)for(b.la.contentType=Ep(c[0].mimeType,c[0].codecs),k=t(c),m=k.next();!m.done;m=k.next())m.value.type=b.la.contentType;k=t(c);for(m=k.next();!m.done;m=k.next())for(m=
|
|
611
611
|
m.value,p=t(D.drmInfos),r=p.next();!r.done;r=p.next())r=r.value,r.keyIds=r.keyIds&&m.keyIds?new Set([].concat(ka(r.keyIds),ka(m.keyIds))):r.keyIds||m.keyIds;k=l.map(function(G){return G.getAttribute("id")}).filter(Mb);return{id:b.la.id||"__fake__"+a.F++,contentType:b.la.contentType,language:A,rg:e,streams:c,drmInfos:D.drmInfos,Qd:f,Cf:k}}
|
|
612
|
-
function
|
|
613
|
-
throw G;}r=
|
|
614
|
-
(D=l.getAttribute("value")),!D))return null;var A;l=b.K.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(A="PQ");var E={id:a.F++,originalId:b.K.id,createSegmentIndex:function(){var G;return L(function(H){if(1==H.g){if(E.segmentIndex)return H.v(0);G=E;return v(H,u.xb(),3)}G.segmentIndex=H.h;z(H)})},segmentIndex:null,
|
|
615
|
-
bandwidth:b.bandwidth,width:b.K.width,height:b.K.height,kind:d,encrypted:0<c.drmInfos.length,drmInfos:c.drmInfos,keyIds:r,language:e,label:f,type:b.la.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.K.emsgSchemeIdUris,roles:h,forced:C,channelsCount:b.K.yd,audioSamplingRate:b.K.audioSamplingRate,spatialAudio:y,closedCaptions:k,hdr:A,tilesLayout:D};return E}
|
|
616
|
-
q.$b=function(){var a=this,b,c;return L(function(d){switch(d.g){case 1:return b=0,B(d,2),v(d,
|
|
617
|
-
function
|
|
618
|
-
m.next())p=p.value.getAttribute("schemeIdUri"),n.includes(p)||n.push(p);m=
|
|
619
|
-
"height",
|
|
620
|
-
function
|
|
621
|
-
parseInt(c,16);if(!b)continue;for(a=0;b;)b&1&&++a,b>>=1;return a;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(b=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(c=parseInt(c,10))&&0<c&&c<b.length)return b[c]}}return null}function
|
|
622
|
-
function
|
|
623
|
-
function
|
|
624
|
-
case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),n["return"](isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":Wa("NTP UTCTiming scheme is not supported");break;default:Wa("Unrecognized scheme in UTCTiming element",k)}n.v(9);break;case 7:return v(n,
|
|
612
|
+
function Dp(a,b,c,d,e,f,g,h,k,l){b.K=zp(l,b.la,null);a.l=Math.min(a.l,b.K.vb);if(!Fp(b.K))return null;var m=b.W.start;b.bandwidth=Jn(l,"bandwidth",On)||0;var n=b.K.contentType,p=n==Be||"application"==n;n="image"==n;try{var r=function(G,H,J){return Gp(a,G,H,J)};if(b.K.cc)var u=vo(b,r);else if(b.K.cb)u=Bo(b,a.m);else if(b.K.dc)u=Go(b,r,a.m,!!a.A,a.o.dash.initialSegmentLimit,a.L);else{var x=b.K.Aa,w=b.W.duration||0;u={xb:function(){return Promise.resolve(Oi(m,w,x))}}}}catch(G){if((p||n)&&4002==G.code)return null;
|
|
613
|
+
throw G;}r=Bn(l,"ContentProtection");r=Xn(r,c,a.o.dash.ignoreDrmInfo,a.o.dash.keySystemsByURI);r=new Set(r?[r]:[]);var y=!1;Bn(l,"SupplementalProperty").some(function(G){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==G.getAttribute("schemeIdUri")&&"JOC"==G.getAttribute("value")})&&(b.K.mimeType="audio/eac3-joc",y=!0);var C=!1;p&&(C=h.includes("forced_subtitle")||h.includes("forced-subtitle"));var D;if(n&&((l=Bn(l,"EssentialProperty").find(function(G){return["http://dashif.org/thumbnail_tile",
|
|
614
|
+
"http://dashif.org/guidelines/thumbnail_tile"].includes(G.getAttribute("schemeIdUri"))}))&&(D=l.getAttribute("value")),!D))return null;var A;l=b.K.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(A="PQ");var E={id:a.F++,originalId:b.K.id,createSegmentIndex:function(){var G;return L(function(H){if(1==H.g){if(E.segmentIndex)return H.v(0);G=E;return v(H,u.xb(),3)}G.segmentIndex=H.h;z(H)})},segmentIndex:null,
|
|
615
|
+
mimeType:b.K.mimeType,codecs:b.K.codecs,frameRate:b.K.frameRate,pixelAspectRatio:b.K.pixelAspectRatio,bandwidth:b.bandwidth,width:b.K.width,height:b.K.height,kind:d,encrypted:0<c.drmInfos.length,drmInfos:c.drmInfos,keyIds:r,language:e,label:f,type:b.la.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.K.emsgSchemeIdUris,roles:h,forced:C,channelsCount:b.K.yd,audioSamplingRate:b.K.audioSamplingRate,spatialAudio:y,closedCaptions:k,hdr:A,tilesLayout:D};return E}
|
|
616
|
+
q.$b=function(){var a=this,b,c;return L(function(d){switch(d.g){case 1:return b=0,B(d,2),v(d,sp(a),4);case 4:b=d.h;wa(d,3);break;case 2:c=F(d),a.D&&(c.severity=1,a.D.onError(c));case 3:if(!a.D)return d["return"]();tp(a,b);z(d)}})};function tp(a,b){0>a.C||a.u.V(Math.max(3,a.C-b,Sa(a.H)))}
|
|
617
|
+
function zp(a,b,c){b=b||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,yd:null,audioSamplingRate:null,vb:0};c=c||b.Aa;var d=Bn(a,"BaseURL"),e=d.map(Hn),f=a.getAttribute("contentType")||b.contentType,g=a.getAttribute("mimeType")||b.mimeType,h=a.getAttribute("codecs")||b.codecs,k=Jn(a,"frameRate",Rn)||b.frameRate,l=a.getAttribute("sar")||b.pixelAspectRatio,m=Bn(a,"InbandEventStream"),n=b.emsgSchemeIdUris.slice();m=t(m);for(var p=m.next();!p.done;p=
|
|
618
|
+
m.next())p=p.value.getAttribute("schemeIdUri"),n.includes(p)||n.push(p);m=Bn(a,"AudioChannelConfiguration");m=Hp(m)||b.yd;p=Jn(a,"audioSamplingRate",Pn)||b.audioSamplingRate;f||(f=Ep(g,h));var r=An(a,"SegmentBase"),u=An(a,"SegmentTemplate"),x=r?Jn(r,"availabilityTimeOffset",Qn)||0:0,w=u?Jn(u,"availabilityTimeOffset",Qn)||0:0;d=d&&d.length?Jn(d[0],"availabilityTimeOffset",Qn)||0:0;d=b.vb+d+x+w;return{Aa:we(c,e),cc:r||b.cc,cb:An(a,"SegmentList")||b.cb,dc:u||b.dc,width:Jn(a,"width",Pn)||b.width,height:Jn(a,
|
|
619
|
+
"height",Pn)||b.height,contentType:f,mimeType:g,codecs:h,frameRate:k,pixelAspectRatio:l,emsgSchemeIdUris:n,id:a.getAttribute("id"),yd:m,audioSamplingRate:p,vb:d}}
|
|
620
|
+
function Hp(a){a=t(a);for(var b=a.next();!b.done;b=a.next()){var c=b.value;if(b=c.getAttribute("schemeIdUri"))if(c=c.getAttribute("value"))switch(b){case "urn:mpeg:dash:outputChannelPositionList:2012":return c.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":b=parseInt(c,10);if(!b)continue;return b;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":b=
|
|
621
|
+
parseInt(c,16);if(!b)continue;for(a=0;b;)b&1&&++a,b>>=1;return a;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(b=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(c=parseInt(c,10))&&0<c&&c<b.length)return b[c]}}return null}function Fp(a){var b=a.cc?1:0;b+=a.cb?1:0;b+=a.dc?1:0;if(0==b)return a.contentType==Be||"application"==a.contentType?!0:!1;1!=b&&(a.cc&&(a.cb=null),a.dc=null);return!0}
|
|
622
|
+
function Ip(a,b,c,d){var e,f,g,h,k,l;return L(function(m){if(1==m.g)return e=we(b,[c]),f=fh(e,a.o.retryParameters),f.method=d,g=a.D.networkingEngine.request(4,f),ah(a.i,g),v(m,g.promise,2);h=m.h;if("HEAD"==d){if(!h.headers||!h.headers.date)return m["return"](0);k=h.headers.date}else k=wb(h.data);l=Date.parse(k);return isNaN(l)?m["return"](0):m["return"](l-Date.now())})}
|
|
623
|
+
function xp(a,b,c){var d,e,f,g,h,k,l,m;return L(function(n){switch(n.g){case 1:d=c.map(function(p){return{scheme:p.getAttribute("schemeIdUri"),value:p.getAttribute("value")}}),e=a.o.dash.clockSyncUri,!d.length&&e&&d.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:e}),f=t(d),g=f.next();case 2:if(g.done){n.v(4);break}h=g.value;B(n,5);k=h.scheme;l=h.value;switch(k){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return n.v(7);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 n.v(8);
|
|
624
|
+
case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),n["return"](isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":Wa("NTP UTCTiming scheme is not supported");break;default:Wa("Unrecognized scheme in UTCTiming element",k)}n.v(9);break;case 7:return v(n,Ip(a,b,l,"HEAD"),10);case 10:return n["return"](n.h);case 8:return v(n,Ip(a,b,l,"GET"),11);case 11:return n["return"](n.h);
|
|
625
625
|
case 9:wa(n,3);break;case 5:F(n);case 3:g=f.next();n.v(2);break;case 4:return Wa("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),n["return"](0)}})}
|
|
626
|
-
function
|
|
627
|
-
function
|
|
628
|
-
|
|
629
|
-
function
|
|
630
|
-
l);if(
|
|
631
|
-
g.push(l),e.push(new
|
|
632
|
-
var
|
|
633
|
-
M("shaka.net.DataUriPlugin",
|
|
634
|
-
q.start=function(a,b){var c=this,d,e;return L(function(f){if(1==f.g)return c.D=b,c.i=b.isLowLatencyMode(),v(f,
|
|
635
|
-
q.update=function(){var a=this,b,c,d;return L(function(e){if(1==e.g){if(a.j==
|
|
636
|
-
function
|
|
637
|
-
1];if(u=
|
|
638
|
-
function
|
|
639
|
-
p),r&&u.set("value",r),x=new R("sessiondata",u),a.D)a.D.onEvent(x);return v(
|
|
640
|
-
(a.g=new T(null,0),a.g.ec(!0));
|
|
641
|
-
|
|
642
|
-
function
|
|
643
|
-
function
|
|
644
|
-
t(m),p=n.next();!p.done;p=n.next())r=p.value,r.stream.codecs=l;return u["return"](e.filter(function(x){return x}))})}function
|
|
645
|
-
function
|
|
646
|
-
void 0,A.frameRate=Number(h)||void 0,A.hdr=r||void 0;D=a.o.disableAudio;if(!y.length||D)y=[null];D=a.o.disableVideo;if(!C.length||D)C=[null];D=[];y=t(y);for(A=y.next();!A.done;A=y.next()){A=A.value;for(var E=t(C),G=E.next();!G.done;G=E.next()){var H=G.value;G=A?A.stream:null;var J=H?H.stream:null,I=A?A.stream.drmInfos:null,K=H?H.stream.drmInfos:null;H=(H?H.Pc:"")+" - "+(A?A.Pc:"");G&&J&&I.length&&K.length&&!(0<
|
|
626
|
+
function Ap(a,b,c,d){var e=d.getAttribute("schemeIdUri")||"",f=d.getAttribute("value")||"",g=Jn(d,"timescale",Pn)||1;d=t(Bn(d,"Event"));for(var h=d.next();!h.done;h=d.next()){h=h.value;var k=Jn(h,"presentationTime",Pn)||0,l=Jn(h,"duration",Pn)||0;k=k/g+b;l=k+l/g;null!=c&&(k=Math.min(k,b+c),l=Math.min(l,b+c));h={schemeIdUri:e,value:f,startTime:k,endTime:l,id:h.getAttribute("id")||"",eventElement:h};a.D.onTimelineRegionAdded(h)}}
|
|
627
|
+
function Gp(a,b,c,d){var e,f,g,h,k;return L(function(l){if(1==l.g)return e=lh,f=aj(b,c,d,a.o.retryParameters),g=a.D.networkingEngine,h=g.request(e,f),ah(a.i,h),v(l,h.promise,2);k=l.h;return l["return"](k.data)})}function Ep(a,b){return Te(Me(a,b))?Be:a.split("/")[0]}M("shaka.dash.DashParser",rp);mi.mpd=function(){return new rp};ki["application/dash+xml"]=function(){return new rp};ki["video/vnd.mpeg.dash.mpd"]=function(){return new rp};function Jp(a,b,c,d){this.g=a;this.type=b;this.X=c;this.segments=d||null}function Kp(a,b,c,d){this.id=a;this.name=b;this.g=c;this.value=void 0===d?null:d}Kp.prototype.toString=function(){function a(d){return d.name+"="+(isNaN(Number(d.value))?'"'+d.value+'"':d.value)}var b="#"+this.name,c=this.g?this.g.map(a):[];this.value&&c.unshift(this.value);0<c.length&&(b+=":"+c.join(","));return b};
|
|
628
|
+
Kp.prototype.getAttribute=function(a){var b=this.g.filter(function(c){return c.name==a});return b.length?b[0]:null};function Z(a,b,c){return(a=a.getAttribute(b))?a.value:c||null}function Lp(a,b){var c=a.getAttribute(b);if(!c)throw new N(2,4,4023,b);return c.value}function Mp(a,b,c){c=void 0===c?[]:c;this.X=b;this.g=a;this.h=c}function Np(a,b){this.name=a;this.value=b};function Op(a,b){return a.filter(function(c){return c.name==b})}function Pp(a,b){return a.filter(function(c){return Lp(c,"TYPE")==b})}function Qp(a,b){var c=Op(a,b);return c.length?c[0]:null}function Rp(a,b,c){c=void 0===c?0:c;return(a=Qp(a,b))?Number(a.value):c};function Sp(a){this.h=a;this.g=0}function Tp(a){Up(a,/[ \t]+/gm)}function Up(a,b){b.lastIndex=a.g;var c=b.exec(a.h);c=null==c?null:{position:c.index,length:c[0].length,results:c};if(a.g==a.h.length||null==c||c.position!=a.g)return null;a.g+=c.length;return c.results}function Vp(a){return a.g==a.h.length?null:(a=Up(a,/[^ \t\n]*/gm))?a[0]:null};function Wp(){this.g=0}
|
|
629
|
+
function Xp(a,b,c){b=wb(b);b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var d=b.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(d[0]))throw new N(2,4,4015);b=0;for(var e=!0,f=t(d),g=f.next();!g.done;g=f.next())if(g=g.value,/^#(?!EXT)/m.test(g)||e)e=!1;else if(g=Yp(a.g++,g),--a.g,Zp.includes(g.name)){b=1;break}else"EXT-X-STREAM-INF"==g.name&&(e=!0);f=[];e=!0;g=t(mb(d));for(var h=g.next();!h.done;h=g.next()){var k=h.value;h=k.ga;var l=k.item;k=k.next;if(/^#(?!EXT)/m.test(l)||e)e=!1;else{l=Yp(a.g++,
|
|
630
|
+
l);if($p.includes(l.name)){if(1!=b)throw new N(2,4,4017);k=d.splice(h,d.length-h);d=c;e=[];g=[];h=[];l=null;k=t(k);for(var m=k.next();!m.done;m=k.next())m=m.value,/^(#EXT)/.test(m)?(m=Yp(a.g++,m),Zp.includes(m.name)?f.push(m):"EXT-X-MAP"==m.name?l=m:"EXT-X-PART"==m.name?h.push(m):"EXT-X-PRELOAD-HINT"==m.name?"PART"==Z(m,"TYPE")?h.push(m):"MAP"==Z(m,"TYPE")&&(m.name="EXT-X-MAP",l=m):g.push(m)):/^#(?!EXT)/m.test(m)||(m=we([d],[m.trim()])[0],l&&g.push(l),e.push(new Mp(m,g,h)),g=[],h=[]);h.length&&(l&&
|
|
631
|
+
g.push(l),e.push(new Mp("",g,h)));return new Jp(c,b,f,e)}f.push(l);"EXT-X-STREAM-INF"==l.name&&(l.g.push(new Np("URI",k)),e=!0)}}return new Jp(c,b,f)}function Yp(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new N(2,4,4016,b);var d=c[1],e=c[2];c=[];var f;if(e){e=new Sp(e);var g;(g=Up(e,/^([^,=]+)(?:,|$)/g))&&(f=g[1]);for(var h=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;g=Up(e,h);)c.push(new Np(g[1],g[2]||g[3]))}return new Kp(a,d,c,f)}
|
|
632
|
+
var Zp="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP".split(" "),$p="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP".split(" ");function aq(){}function bq(a){try{var b=cq(a);return Sg({uri:a,je:a,data:b.data,headers:{"content-type":b.contentType}})}catch(c){return Qg(c)}}function cq(a){var b=a.split(":");if(2>b.length||"data"!=b[0])throw new N(2,1,1004,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw new N(2,1,1004,a);var c=b[0];a=window.decodeURIComponent(b.slice(1).join(","));b=c.split(";");c=b[0];var d=!1;1<b.length&&"base64"==b[b.length-1]&&(d=!0,b.pop());var e;d?e=lc(a):e=Ab(a);return{data:e,contentType:c}}
|
|
633
|
+
M("shaka.net.DataUriPlugin",aq);aq.parse=bq;ch("data",bq);function dq(){var a=this;this.o=this.D=null;this.Pa=1;this.u=new Map;this.m=new Map;this.Ha=new Set;this.h=new Map;this.g=null;this.L="";this.ea=new Wp;this.ra=0;this.s=new P(function(){a.$b()});this.j=eq;this.A=null;this.qa=0;this.F=Infinity;this.Y=this.Za=0;this.C=new $g;this.T=[];this.I=new Map;this.Ya=!1;this.l=new Map;this.O=null;this.pa=new Map;this.H=new Map;this.i=!1}q=dq.prototype;q.configure=function(a){this.o=a};
|
|
634
|
+
q.start=function(a,b){var c=this,d,e;return L(function(f){if(1==f.g)return c.D=b,c.i=b.isLowLatencyMode(),v(f,fq(c,fh([a],c.o.retryParameters),0),2);if(3!=f.g)return d=f.h,c.L=d.uri,v(f,gq(c,d.data),3);e=c.ra;0<e&&c.s.V(e);return f["return"](c.A)})};q.stop=function(){this.s&&(this.s.stop(),this.s=null);var a=[];this.C&&(a.push(this.C.destroy()),this.C=null);this.o=this.D=null;this.Ha.clear();this.A=null;this.h.clear();this.m.clear();this.l.clear();this.u.clear();return Promise.all(a)};
|
|
635
|
+
q.update=function(){var a=this,b,c,d;return L(function(e){if(1==e.g){if(a.j==eq)return e["return"]();b=[];a.O=null;c=Array.from(a.h.values());return c.length?v(e,hq(a,c[0]),2):e.v(2)}for(d=1;d<c.length;d++)b.push(hq(a,c[d]));return v(e,Promise.all(b),0)})};
|
|
636
|
+
function hq(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u;return L(function(x){if(1==x.g)return c=iq,d=b.Be,e=new je(d),a.i&&b.Fe&&me(e,new oe("_HLS_skip=YES")),v(x,fq(a,fh([e.toString()],a.o.retryParameters),0),2);if(3!=x.g){f=x.h;g=Xp(a.ea,f.data,f.uri);if(1!=g.type)throw new N(2,4,4017);h=Op(g.X,"EXT-X-DEFINE");k=jq(a,h);l=b.stream;return v(x,kq(a,b.Pc,g,l.mimeType,b.ud,k,b.Me),3)}m=x.h;l.segmentIndex.Bb(m,a.g.ab());m.length&&(n=Rp(g.X,"EXT-X-MEDIA-SEQUENCE",0),p=b.ud.get(n),l.segmentIndex.gb(p));r=m[m.length-
|
|
637
|
+
1];if(u=Qp(g.X,"EXT-X-ENDLIST"))lq(a,c.Ae),a.g.Ma(r.endTime);z(x)})}q.onExpirationUpdated=function(){};
|
|
638
|
+
function gq(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q,S,ba,da,ea,Ia,Ba,kb;return L(function(Pa){switch(Pa.g){case 1:c=Xp(a.ea,b,a.L);if(0!=c.type)throw new N(2,4,4022);d=Op(c.X,"EXT-X-DEFINE");mq(a,d);e=Op(c.X,"EXT-X-MEDIA");f=Op(c.X,"EXT-X-STREAM-INF");nq(a,f);g=Op(c.X,"EXT-X-SESSION-DATA");h=t(g);for(k=h.next();!k.done;k=h.next())if(l=k.value,m=Z(l,"DATA-ID"),n=Z(l,"URI"),p=Z(l,"LANGUAGE"),r=Z(l,"VALUE"),u=(new Map).set("id",m),n&&u.set("uri",we([a.L],[n])[0]),p&&u.set("language",
|
|
639
|
+
p),r&&u.set("value",r),x=new R("sessiondata",u),a.D)a.D.onEvent(x);return v(Pa,oq(a,e),2);case 2:return pq(a,e),v(Pa,qq(a,f),3);case 3:return w=Pa.h,v(Pa,rq(a,e),4);case 4:y=Pa.h;if(!a.D)throw new N(2,7,7001);if(a.Ya&&0==w.length)throw new N(2,4,4034);D=C=Infinity;A=t(a.h.values());for(E=A.next();!E.done;E=A.next())G=E.value,C=Math.min(C,G.he),"text"!=G.stream.type&&(D=Math.min(D,G.pf-G.he));a.j!=eq?(a.g=new T(0,a.o.defaultPresentationDelay?a.o.defaultPresentationDelay:a.Y?a.Y:3*a.qa),a.g.ec(!1)):
|
|
640
|
+
(a.g=new T(null,0),a.g.ec(!0));sq(a);if(a.j!=eq)a.ra=a.F,H=iq,a.j==H.ze&&(J=a.g.Lc,isNaN(a.o.availabilityWindowOverride)||(J=a.o.availabilityWindowOverride),a.g.Od(J));else for(a.g.Ma(D),a.g.offset(-C),I=t(a.h.values()),E=I.next();!E.done;E=I.next())K=E.value,K.stream.segmentIndex.offset(-C),K.stream.segmentIndex.$a(0,D);a.T=[];O=[];Q=t(w);for(S=Q.next();!S.done;S=Q.next())for(ba=S.value,da=t([ba.video,ba.audio]),ea=da.next();!ea.done;ea=da.next())(Ia=ea.value)&&O.push(Ia);return v(Pa,Promise.all(O.map(function(Xa){return L(function(Qa){return v(Qa,
|
|
641
|
+
Xa.createSegmentIndex(),0)})})),5);case 5:Ba=t(O);for(ea=Ba.next();!ea.done;ea=Ba.next())kb=ea.value,a.T.push(kb.segmentIndex.M);sq(a);a.A={presentationTimeline:a.g,variants:w,textStreams:y,imageStreams:[],offlineSessionIds:[],minBufferTime:0};a.D.makeTextStreamsForClosedCaptions(a.A);z(Pa)}})}function mq(a,b){for(var c=t(b),d=c.next();!d.done;d=c.next()){var e=d.value;d=Z(e,"NAME");e=Z(e,"VALUE");d&&e&&(a.u.has(d)||a.u.set(d,e))}}
|
|
642
|
+
function jq(a,b){for(var c=new Map,d=t(b),e=d.next();!e.done;e=d.next()){var f=e.value;e=Z(f,"NAME");var g=Z(f,"VALUE");f=Z(f,"IMPORT");e&&g&&c.set(e,g);f&&(e=a.u.get(f))&&c.set(f,e)}return c}function nq(a,b){for(var c=t(b),d=c.next();!d.done;d=c.next()){var e=d.value,f=Z(e,"AUDIO");d=Z(e,"VIDEO");var g=Z(e,"SUBTITLES");e=tq(a,e);if(g){var h=ze(Be,e);a.l.set(g,h);uc(e,h)}f&&(g=ye("audio",e),a.l.set(f,g));d&&(f=ye("video",e),a.l.set(d,f))}}
|
|
643
|
+
function rq(a,b){var c,d,e,f,g,h,k,l,m,n,p,r;return L(function(u){if(1==u.g)return c=Pp(b,"SUBTITLES"),d=c.map(function(x){var w,y,C;return L(function(D){if(1==D.g){if(w=a.o.disableText)return D["return"](null);B(D,2);return v(D,uq(a,x),4)}if(2!=D.g)return y=D.h,D["return"](y.stream);C=F(D);if(a.o.hls.ignoreTextStreamFailures)return D["return"](null);throw C;})}),v(u,Promise.all(d),2);e=u.h;f=t(c);for(g=f.next();!g.done;g=f.next())if(h=g.value,k=Lp(h,"GROUP-ID"),l=a.l.get(k))if(m=a.m.get(k))for(n=
|
|
644
|
+
t(m),p=n.next();!p.done;p=n.next())r=p.value,r.stream.codecs=l;return u["return"](e.filter(function(x){return x}))})}function oq(a,b){var c;return L(function(d){if(1==d.g)return b=b.filter(function(e){var f=Z(e,"URI")||"";return"SUBTITLES"!=Z(e,"TYPE")&&""!=f}),b.length?v(d,uq(a,b[0]),2):d.v(2);c=b.slice(1).map(function(e){return uq(a,e)});return v(d,Promise.all(c),0)})}
|
|
645
|
+
function qq(a,b){var c,d,e;return L(function(f){if(1==f.g)return c=b.map(function(g){var h,k,l,m,n,p,r,u;return L(function(x){if(1==x.g)return h=Z(g,"FRAME-RATE"),k=Number(Z(g,"AVERAGE-BANDWIDTH"))||Number(Lp(g,"BANDWIDTH")),l=Z(g,"RESOLUTION"),m=t(l?l.split("x"):[null,null]),n=m.next().value,p=m.next().value,r=Z(g,"VIDEO-RANGE"),v(x,vq(a,g),2);if(u=x.h){for(var w=x["return"],y=u.audio,C=u.video,D=t(C),A=D.next();!A.done;A=D.next())if(A=A.value.stream)A.width=Number(n)||void 0,A.height=Number(p)||
|
|
646
|
+
void 0,A.frameRate=Number(h)||void 0,A.hdr=r||void 0;D=a.o.disableAudio;if(!y.length||D)y=[null];D=a.o.disableVideo;if(!C.length||D)C=[null];D=[];y=t(y);for(A=y.next();!A.done;A=y.next()){A=A.value;for(var E=t(C),G=E.next();!G.done;G=E.next()){var H=G.value;G=A?A.stream:null;var J=H?H.stream:null,I=A?A.stream.drmInfos:null,K=H?H.stream.drmInfos:null;H=(H?H.Pc:"")+" - "+(A?A.Pc:"");G&&J&&I.length&&K.length&&!(0<gi(I,K).length)||a.Ha.has(H)||(G={id:a.Pa++,language:G?G.language:"und",primary:!!G&&G.primary||
|
|
647
647
|
!!J&&J.primary,audio:G,video:J,bandwidth:k,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},D.push(G),a.Ha.add(H))}}x=w.call(x,D)}else x=x["return"]([]);return x})}),v(f,Promise.all(c),2);d=f.h;e=d.reduce(Kb,[]);e=e.filter(function(g){return null!=g});return f["return"](e)})}
|
|
648
|
-
function
|
|
649
|
-
|
|
650
|
-
function
|
|
651
|
-
function
|
|
652
|
-
u="YES"==r;return v(w,
|
|
653
|
-
function
|
|
654
|
-
function
|
|
655
|
-
H.next())if(I=J.value,K=
|
|
656
|
-
F(
|
|
657
|
-
drmInfos:E,keyIds:G,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:
|
|
658
|
-
function
|
|
659
|
-
function
|
|
660
|
-
function
|
|
661
|
-
C,D,b,f,0,Infinity))}}else if(!m)throw new N(2,4,4024,"EXTINF");m?g=e+Number(m.value.split(",")[0]):g=r[r.length-1].endTime;(h=
|
|
662
|
-
function
|
|
663
|
-
function
|
|
664
|
-
g.set(w,p),n))for(;g.has(w+1)&&g.get(w+1)<p;)w++;y=a.H.get(w)||0;C=[];D=function(Ia){return mb(Ia)};A=t(D(h));E=A.next();case 5:if(E.done){ea.v(7);break}H=G=E.value;J=H.ga;I=H.item;K=C[C.length-1];O=0==J?r:K.endTime;p=l+n+J;e.set(p,O);k=
|
|
665
|
-
(da=
|
|
666
|
-
function
|
|
667
|
-
function
|
|
668
|
-
e.uris[0]);return v(k,
|
|
669
|
-
function
|
|
670
|
-
w.h,r=p[0],u=p[1]||p[0],w["return"](
|
|
671
|
-
function
|
|
672
|
-
function
|
|
673
|
-
f.Gb();var l=f.Gb();return(1073741824*((c&14)>>1)+((k&65534)<<14|(l&65534)>>1))/9E4}else d()}}function
|
|
674
|
-
function
|
|
675
|
-
q.$b=function(){var a=this,b,c;return L(function(d){if(1==d.g){if(!a.D)return d["return"]();B(d,2);return v(d,a.update(),4)}if(2!=d.g)return b=a.ra,a.s.V(b),wa(d,0);c=F(d);if(!a.D)return d["return"]();c.severity=1;a.D.onError(c);a.s.V(.1);z(d)})};function
|
|
676
|
-
var
|
|
677
|
-
vtt:"text/vtt",ttml:"application/ttml+xml"}},
|
|
678
|
-
a=qb(a.data);b=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);a=
|
|
679
|
-
function
|
|
680
|
-
f(H.value),5);case 5:J=Date.now();if(100<J-p||H.done)e(J-p,m-n,x-m),n=m,p=J;H.done?E.close():(E.enqueue(H.value),G());z(I)}})}G()},new h({start:w}),v(A,k.arrayBuffer(),5);case 5:l=A.h;wa(A,3);break;case 2:y=F(A);if(d.Td)throw new N(1,1,7001,a,b);if(d.ve)throw new N(1,1,1003,a,b);throw new N(1,1,1002,a,y,b);case 3:return C={},D=k.headers,D.forEach(function(E,G){C[G.trim()]=E}),A["return"](
|
|
681
|
-
function
|
|
682
|
-
function
|
|
683
|
-
c);k(x)}catch(w){l(w)}};e.onerror=function(n){l(new N(1,1,1002,a,n,c))};e.ontimeout=function(){l(new N(1,1,1003,a,c))};e.onprogress=function(n){var p=Date.now();if(100<p-f||n.lengthComputable&&n.loaded==n.total)d(p-f,n.loaded-g,n.total-n.loaded),g=n.loaded,f=p};for(var m in b.headers)e.setRequestHeader(m.toLowerCase(),b.headers[m]);e.send(b.body)});return new
|
|
684
|
-
|
|
685
|
-
function
|
|
686
|
-
function
|
|
687
|
-
function
|
|
688
|
-
q.updateManifestExpiration=function(a,b){var c=
|
|
689
|
-
q.getAllManifests=function(){var a=this,b,c;return L(function(d){return 1==d.g?(b=
|
|
690
|
-
q.add=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){if(1==m.g){d=
|
|
691
|
-
function
|
|
692
|
-
function
|
|
693
|
-
|
|
694
|
-
function
|
|
695
|
-
function
|
|
696
|
-
function
|
|
697
|
-
|
|
698
|
-
function
|
|
699
|
-
function
|
|
700
|
-
dataKey:h,initSegmentKey:d,appendWindowStart:b,appendWindowEnd:f,timestampOffset:e}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}}
|
|
701
|
-
function
|
|
702
|
-
f=t(b),d=f.next();!d.done;d=f.next())d.value.variantIds.push(e);if(a.length&&b.length)for(b=t(b),d=b.next();!d.done;d=b.next())for(d=d.value,e=t(a),f=e.next();!f.done;f=e.next()){f=f.value;var g=c++;d.variantIds.push(g);f.variantIds.push(g)}}};function
|
|
703
|
-
|
|
648
|
+
function vq(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,x;return L(function(w){if(1==w.g)return c=Ce,d=tq(a,b),e=Z(b,"AUDIO"),f=Z(b,"VIDEO"),h=(g=e||f)&&a.m.has(g)?a.m.get(g):[],k={audio:e?h:[],video:f?h:[]},m=!1,n=Lp(b,"URI"),p=k.audio.find(function(y){return y&&y.Pc==n}),r=ze(c.Qa,d),(u=ze(c.eb,d))&&!r?l=c.eb:!h.length&&u&&r?(l=c.Qa,d=[[r,u].join()]):k.audio.length&&p?(l=c.eb,m=!0):l=k.video.length?c.eb:c.Qa,m?w.v(2):v(w,wq(a,b,d,l),3);2!=w.g&&(x=w.h);if(x)k[x.stream.type]=[x];else if(null===x)return w["return"](null);
|
|
649
|
+
xq(k);return w["return"](k)})}function tq(a,b){var c=[];a.o.disableVideo||c.push("avc1.42E01E");a.o.disableAudio||c.push("mp4a.40.2");var d=Z(b,"CODECS",c.join(",")).split(/\s*,\s*/);c=new Set;var e=[];d=t(d);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=Qe(f);c.has(g)||(e.push(f),c.add(g))}return e}function yq(a){a=Z(a,"LANGUAGE")||"und";return If(a)}
|
|
650
|
+
function xq(a){a=t(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next())if(b=b.value){var c=b.stream.codecs.split(",");c=c.filter(function(d){return"mp4a.40.34"!=d});b.stream.codecs=c.join(",")}}function pq(a,b){var c=Pp(b,"CLOSED-CAPTIONS");c=t(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value;d=yq(e);var f=Lp(e,"GROUP-ID");e=Lp(e,"INSTREAM-ID");a.I.get(f)||a.I.set(f,new Map);a.I.get(f).set(e,d)}}
|
|
651
|
+
function uq(a,b){var c,d,e,f,g,h,k,l,m,n,p,r,u,x;return L(function(w){if(1==w.g){c=Lp(b,"GROUP-ID");d="";var y=Lp(b,"TYPE").toLowerCase();"subtitles"==y&&(y=Be);e=y;e!=Be&&c&&a.l.has(c)&&(d=a.l.get(c));f=zq(Lp(b,"URI"),a.u);if(a.h.has(f))return w["return"](a.h.get(f));g=yq(b);h=Z(b,"NAME");k=Z(b,"DEFAULT");l="YES"==k;"audio"==e?y=(y=Z(b,"CHANNELS"))?parseInt(y.split("/")[0],10):null:y=null;m=y;"audio"==e?y=(y=Z(b,"CHANNELS"))?y.includes("/JOC"):!1:y=!1;n=y;p=Z(b,"CHARACTERISTICS");r=Z(b,"FORCED");
|
|
652
|
+
u="YES"==r;return v(w,Aq(a,f,d,e,g,l,h,m,null,p,u,n),2)}x=w.h;a.m.has(c)?a.m.get(c).push(x):a.m.set(c,[x]);if(null==x)return w["return"](null);if(a.h.has(f))return w["return"](a.h.get(f));a.h.set(f,x);return w["return"](x)})}
|
|
653
|
+
function wq(a,b,c,d){var e,f,g,h;return L(function(k){if(1==k.g){e=zq(Lp(b,"URI"),a.u);if(a.h.has(e))return k["return"](a.h.get(e));var l=Z(b,"CLOSED-CAPTIONS");f="video"==d&&l&&"NONE"!=l?a.I.get(l):null;g=ye(d,c);return v(k,Aq(a,e,g,d,"und",!1,null,null,f,null,!1,!1),2)}h=k.h;if(null==h)return k["return"](null);if(a.h.has(e))return k["return"](a.h.get(e));a.h.set(e,h);return k["return"](h)})}
|
|
654
|
+
function Aq(a,b,c,d,e,f,g,h,k,l,m,n){var p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q,S,ba,da,ea,Ia,Ba,kb,Pa,Xa,Qa,Mh,$m,an,bn,cn,Nh,Oh,rf,dn,en,fn,gn;return L(function(bb){switch(bb.g){case 1:return p=we([a.L],[b])[0],v(bb,fq(a,fh([p],a.o.retryParameters),0),2);case 2:r=bb.h;p=r.uri;u=Xp(a.ea,r.data,p);if(1!=u.type)throw new N(2,4,4017);x=[];if(u.segments)for(w=t(u.segments),y=w.next();!y.done;y=w.next())C=y.value,D=Op(C.X,"EXT-X-KEY"),x.push.apply(x,ka(D));A=!1;E=[];G=new Set;H=t(x);for(J=H.next();!J.done;J=
|
|
655
|
+
H.next())if(I=J.value,K=Lp(I,"METHOD"),"NONE"!=K){A=!0;if("AES-128"==K)return a.Ya=!0,bb["return"](null);O=Lp(I,"KEYFORMAT");if(S=(Q=Bq[O])?Q(I):null){if(S.keyIds)for(ba=t(S.keyIds),da=ba.next();!da.done;da=ba.next())ea=da.value,G.add(ea);E.push(S)}}if(A&&!E.length)throw new N(2,4,4026);Ia=Op(u.X,"EXT-X-DEFINE");Ba=jq(a,Ia);Cq(a,u);return v(bb,Dq(a,d,c,u,Ba),3);case 3:return kb=bb.h,Eq.includes(kb)&&(c=""),Pa=new Map,Xa=new Map,B(bb,4),v(bb,kq(a,b,u,kb,Pa,Ba,Xa),6);case 6:Qa=bb.h;wa(bb,5);break;case 4:Mh=
|
|
656
|
+
F(bb);if(4035==Mh.code)return Wa("Skipping unsupported HLS stream",kb,b),bb["return"](null);throw Mh;case 5:$m=Qa[0].startTime;an=Qa[Qa.length-1].endTime;bn=new U(Qa);cn=d==Be?"subtitle":void 0;Nh=[];if(l)for(Oh=t(l.split(",")),rf=Oh.next();!rf.done;rf=Oh.next())dn=rf.value,Nh.push(dn);fn=(en=Qp(u.X,"EXT-X-SERVER-CONTROL"))?null!=en.getAttribute("CAN-SKIP-UNTIL"):!1;gn={id:a.Pa++,originalId:g,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:bn,mimeType:kb,codecs:c,kind:cn,encrypted:A,
|
|
657
|
+
drmInfos:E,keyIds:G,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:Nh,forced:m,channelsCount:h,audioSamplingRate:null,spatialAudio:n,closedCaptions:k,hdr:void 0,tilesLayout:void 0};return bb["return"]({stream:gn,Pc:b,Be:p,he:$m,pf:an,ud:Pa,Me:Xa,Fe:fn})}})}
|
|
658
|
+
function Cq(a,b){var c=Qp(b.X,"EXT-X-PLAYLIST-TYPE"),d=Qp(b.X,"EXT-X-ENDLIST");d=c&&"VOD"==c.value||d;c=c&&"EVENT"==c.value&&!d;c=!d&&!c;if(d)lq(a,eq);else{c?lq(a,Fq):lq(a,Gq);d=Qp(b.X,"EXT-X-TARGETDURATION");if(!d)throw new N(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);c=Qp(b.X,"EXT-X-PART-INF");a.i&&c?(a.Za=Number(Lp(c,"PART-TARGET")),a.F=Math.min(a.Za,a.F),c=Qp(b.X,"EXT-X-SERVER-CONTROL"),a.Y=c?Number(Lp(c,"PART-HOLD-BACK")):0):a.F=Math.min(d,a.F);a.qa=Math.max(d,a.qa)}}
|
|
659
|
+
function Hq(a,b,c,d){c=Qp(c,"EXT-X-MAP");if(!c)return null;var e=Lp(c,"URI");d=zq(we([b],[e])[0],d);b=[d,Z(c,"BYTERANGE","")].join("-");a.pa.has(b)||(c=Iq(d,c),a.pa.set(b,c));return a.pa.get(b)}function Iq(a,b){var c=0,d=null,e=Z(b,"BYTERANGE");e&&(c=e.split("@"),d=Number(c[0]),c=Number(c[1]),d=c+d-1);return new oi(function(){return[a]},c,d)}
|
|
660
|
+
function Jq(a,b,c,d,e,f,g,h){var k=d.X,l=zq(d.g,g),m=Qp(k,"EXTINF"),n=g=0,p=null,r=[];if(a.i&&d.h.length){a={};d=t(mb(d.h));for(var u=d.next();!u.done;a={Xc:a.Xc},u=d.next()){u=u.value;var x=u.ga;u=u.item;var w=0==x?c:r[r.length-1];x=0==x?e:w.endTime;var y=Number(Z(u,"DURATION"));y=x+y;var C=0,D=null;"EXT-X-PRELOAD-HINT"==u.name?C=(w=Z(u,"BYTERANGE-START"))?Number(w):0:(C=Z(u,"BYTERANGE"),w=t(Kq(w,C)),C=w.next().value,D=w.next().value);u=Z(u,"URI");a.Xc=we([h],[u])[0];r.push(new qi(x,y,function(A){return function(){return[A.Xc]}}(a),
|
|
661
|
+
C,D,b,f,0,Infinity))}}else if(!m)throw new N(2,4,4024,"EXTINF");m?g=e+Number(m.value.split(",")[0]):g=r[r.length-1].endTime;(h=Qp(k,"EXT-X-BYTERANGE"))?(c=t(Kq(c,h.value)),n=c.next().value,p=c.next().value):r.length&&(n=r[0].ka,p=r[r.length-1].fa);return new qi(e,g,function(){return l.length?[l]:[]},n,p,b,f,0,Infinity,r)}function Kq(a,b){var c=0,d=null;b&&(c=b.split("@"),d=Number(c[0]),c=c[1]?Number(c[1]):a.fa+1,d=c+d-1);return[c,d]}
|
|
662
|
+
function sq(a){if(a.g){for(var b=t(a.T),c=b.next();!c.done;c=b.next())a.g.Db(c.value);a.T=[]}}
|
|
663
|
+
function kq(a,b,c,d,e,f,g){var h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q,S,ba,da;return L(function(ea){switch(ea.g){case 1:h=c.segments;l=Rp(c.X,"EXT-X-MEDIA-SEQUENCE",0);n=(m=Qp(c.X,"EXT-X-SKIP"))?Number(Z(m,"SKIPPED-SEGMENTS")):0;p=l+n;if(a.j!=eq&&e.has(p)){r=e.get(p);ea.v(2);break}if(null!=a.O){ea.v(3);break}k=Hq(a,c.g,h[0].X,f);u=a;return v(ea,Lq(a,b,k,d,p,!1,h[0],f),4);case 4:u.O=ea.h;case 3:r=a.O;case 2:x=h[0].g;ab(x.split("/").pop());w=Rp(c.X,"EXT-X-DISCONTINUITY-SEQUENCE");if(a.i&&(g.has(w)||
|
|
664
|
+
g.set(w,p),n))for(;g.has(w+1)&&g.get(w+1)<p;)w++;y=a.H.get(w)||0;C=[];D=function(Ia){return mb(Ia)};A=t(D(h));E=A.next();case 5:if(E.done){ea.v(7);break}H=G=E.value;J=H.ga;I=H.item;K=C[C.length-1];O=0==J?r:K.endTime;p=l+n+J;e.set(p,O);k=Hq(a,c.g,I.X,f);Q=Qp(I.X,"EXT-X-DISCONTINUITY");if(!Q){ea.v(8);break}w++;g.set(w,p);return v(ea,Mq(a,w,b,k,d,p,I,f,O),9);case 9:y=ea.h;case 8:!a.i&&(S=a.D.isAutoLowLatencyMode())&&(a.D.enableLowLatencyMode(),a.i=a.D.isLowLatencyMode());ba=Qp(I.X,"EXTINF");a.i||ba?
|
|
665
|
+
(da=Jq(a,k,K,I,O,y,f,c.g),C.push(da)):a.i||Wa("Low-latency HLS live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details.");E=A.next();ea.v(5);break;case 7:return ea["return"](C)}})}
|
|
666
|
+
function Mq(a,b,c,d,e,f,g,h,k){var l,m;return L(function(n){if(1==n.g)return l=0,a.H.has(b)?(l=a.H.get(b),n.v(2)):v(n,Lq(a,c,d,e,f,!0,g,h),3);2!=n.g&&(m=n.h,l=k-m,a.H.set(b,l));return n["return"](l)})}
|
|
667
|
+
function Nq(a,b){var c,d,e,f,g,h;return L(function(k){switch(k.g){case 1:c=lh;d=aj(b.na(),b.ka,b.fa,a.o.retryParameters);if(a.o.hls.useFullSegmentsForStartTime)return k["return"](fq(a,d,c));e=aj(b.na(),b.ka,b.ka+2048-1,a.o.retryParameters);B(k,2);return v(k,fq(a,e,c),4);case 4:return f=k.h,k["return"](f);case 2:g=F(k);if(7001==g.code)throw g;Wa("Unable to fetch the starting part of HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",
|
|
668
|
+
e.uris[0]);return v(k,fq(a,d,c),5);case 5:return h=k.h,k["return"](h)}})}
|
|
669
|
+
function Lq(a,b,c,d,e,f,g,h){var k,l,m,n,p,r,u,x;return L(function(w){switch(w.g){case 1:k=Jq(a,c,null,g,0,0,h,"");if(a.A&&!f&&(l=a.h.get(b),m=l.ud.get(e),void 0!=m))return w["return"](m);d=d.toLowerCase();if(Eq.includes(d))throw Wa("Raw formats are not yet supported. Skipping "+d),new N(1,4,4035);if("video/webm"==d)throw Wa("WebM in HLS is not yet supported. Skipping."),new N(1,4,4035);if("video/mp4"!=d&&"audio/mp4"!=d){w.v(2);break}n=[Nq(a,k)];c&&n.push(Nq(a,c));return v(w,Promise.all(n),3);case 3:return p=
|
|
670
|
+
w.h,r=p[0],u=p[1]||p[0],w["return"](Oq(b,r.uri,r.data,u.data));case 2:if("video/mp2t"!=d){w.v(4);break}return v(w,Nq(a,k),5);case 5:return x=w.h,w["return"](Pq(b,x.uri,x.data));case 4:throw new N(2,4,4030,b);}})}
|
|
671
|
+
function Oq(a,b,c,d){var e=0;(new Ob).box("moov",Sb).box("trak",Sb).box("mdia",Sb).U("mdhd",function(h){e=Zd(h.reader,h.version).timescale;h.parser.stop()}).parse(d,!0);if(!e)throw new N(2,4,4030,a,b);var f=0,g=!1;(new Ob).box("moof",Sb).box("traf",Sb).U("tfdt",function(h){f=Yd(h.reader,h.version).fd/e;g=!0;h.parser.stop()}).parse(c,!0);if(!g)throw new N(2,4,4030,a,b);return f}
|
|
672
|
+
function Pq(a,b,c){function d(){f.seek(g+188);h=f.aa();71!=h&&(f.seek(g+192),h=f.aa());71!=h&&(f.seek(g+204),h=f.aa());71!=h&&e();f.me(1)}function e(){throw new N(2,4,4030,a,b);}var f=new Cb(c,0),g=0,h=0;for(c=Math.min(f.R.byteLength-188,940);;){g=f.$();h=f.aa();if(71!=h){if(0<c){--c;continue}e()}c=0;var k=f.Gb();if(8191==(k&8191))d();else if(k&16384)if(k=(f.aa()&48)>>4,0!=k&&2!=k||e(),3==k&&(k=f.aa(),f.skip(k)),1!=f.N()>>8)d();else{f.skip(3);c=f.aa()>>6;0!=c&&1!=c||e();0==f.aa()&&e();c=f.aa();k=
|
|
673
|
+
f.Gb();var l=f.Gb();return(1073741824*((c&14)>>1)+((k&65534)<<14|(l&65534)>>1))/9E4}else d()}}function zq(a,b){var c=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}"),d=c.match(/{\$\w*}/g);if(d){d=t(d);for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=e.slice(2,e.length-1),g=b.get(f);if(g)c=c.replace(e,g);else throw new N(2,4,4039,f);}}return c}
|
|
674
|
+
function Dq(a,b,c,d,e){var f,g,h,k,l,m,n,p,r,u,x;return L(function(w){if(1==w.g){f=Ce;g=lh;h=zq(d.segments[0].g,e);k=new je(h);l=k.ya.split(".").pop();m=Qq[b];if(n=m[l])return w["return"](n);if(b==f.ba)return c&&"vtt"!=c&&"wvtt"!=c?w["return"]("application/mp4"):w["return"]("text/vtt");p=fh([h],a.o.retryParameters);p.method="HEAD";return v(w,fq(a,p,g),2)}r=w.h;u=r.headers["content-type"];return u?w["return"](u.split(";")[0]):(x=m.mp4,w["return"](x))})}
|
|
675
|
+
q.$b=function(){var a=this,b,c;return L(function(d){if(1==d.g){if(!a.D)return d["return"]();B(d,2);return v(d,a.update(),4)}if(2!=d.g)return b=a.ra,a.s.V(b),wa(d,0);c=F(d);if(!a.D)return d["return"]();c.severity=1;a.D.onError(c);a.s.V(.1);z(d)})};function lq(a,b){a.j=b;a.g&&a.g.ec(a.j==eq);a.j!=eq||a.s.stop()}function fq(a,b,c){if(!a.C)throw new N(2,7,7001);b=a.D.networkingEngine.request(c,b);ah(a.C,b);return b.promise}M("shaka.hls.HlsParser",dq);
|
|
676
|
+
var Eq=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"],Qq={audio:{mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t",aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},video:{mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",
|
|
677
|
+
vtt:"text/vtt",ttml:"application/ttml+xml"}},Bq={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=Lp(a,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b))return null;b=Lp(a,"URI");b=cq(b);b=qb(b.data);b=xe("com.widevine.alpha",[{initDataType:"cenc",initData:b}]);if(a=Z(a,"KEYID"))b.keyIds=new Set([a.toLowerCase().substr(2)]);return b},"com.microsoft.playready":function(a){var b=Lp(a,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b))return null;a=Lp(a,"URI");a=cq(a);
|
|
678
|
+
a=qb(a.data);b=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);a=yn(a,b);return xe("com.microsoft.playready",[{initDataType:"cenc",initData:a}])}},eq="VOD",Gq="EVENT",Fq="LIVE",iq={Ae:eq,Xf:Gq,ze:Fq};mi.m3u8=function(){return new dq};ki["application/x-mpegurl"]=function(){return new dq};ki["application/vnd.apple.mpegurl"]=function(){return new dq};function Rq(a,b,c,d,e,f){if(200<=c&&299>=c&&202!=c)return{uri:e||d,je:d,data:b,headers:a,fromCache:!!a["x-shaka-from-cache"]};e=null;try{e=zb(b)}catch(g){}throw new N(401==c||403==c?2:1,1,1001,d,c,e,a,f);};function Sq(){}function Tq(a,b,c,d){var e=new Uq;ph(b.headers).forEach(function(k,l){e.append(l,k)});var f=new Vq,g={Td:!1,ve:!1};a=Wq(a,c,{body:b.body||void 0,headers:e,method:b.method,signal:f.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},g,d,b.streamDataCallback);a=new Pg(a,function(){g.Td=!0;f.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var h=new P(function(){g.ve=!0;f.abort()});h.V(b/1E3);a["finally"](function(){h.stop()})}return a}
|
|
679
|
+
function Wq(a,b,c,d,e,f){var g,h,k,l,m,n,p,r,u,x,w,y,C,D;return L(function(A){switch(A.g){case 1:return g=Xq,h=Yq,n=m=0,p=Date.now(),B(A,2),v(A,g(a,c),4);case 4:return k=A.h,r=k.clone().body.getReader(),x=(u=k.headers.get("Content-Length"))?parseInt(u,10):0,w=function(E){function G(){var H,J;return L(function(I){switch(I.g){case 1:return B(I,2),v(I,r.read(),4);case 4:H=I.h;wa(I,3);break;case 2:return F(I),I["return"]();case 3:if(H.done){I.v(5);break}m+=H.value.byteLength;if(!f){I.v(5);break}return v(I,
|
|
680
|
+
f(H.value),5);case 5:J=Date.now();if(100<J-p||H.done)e(J-p,m-n,x-m),n=m,p=J;H.done?E.close():(E.enqueue(H.value),G());z(I)}})}G()},new h({start:w}),v(A,k.arrayBuffer(),5);case 5:l=A.h;wa(A,3);break;case 2:y=F(A);if(d.Td)throw new N(1,1,7001,a,b);if(d.ve)throw new N(1,1,1003,a,b);throw new N(1,1,1002,a,y,b);case 3:return C={},D=k.headers,D.forEach(function(E,G){C[G.trim()]=E}),A["return"](Rq(C,l,k.status,a,k.url,b))}})}
|
|
681
|
+
function Zq(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;return!(!window.fetch||!window.AbortController)}M("shaka.net.HttpFetchPlugin",Sq);Sq.isSupported=Zq;Sq.parse=Tq;var Xq=window.fetch,Vq=window.AbortController,Yq=window.ReadableStream,Uq=window.Headers;Zq()&&(ch("http",Tq,2,!0),ch("https",Tq,2,!0));function $q(){}
|
|
682
|
+
function ar(a,b,c,d){var e=new br,f=Date.now(),g=0,h=new Promise(function(k,l){e.open(b.method,a,!0);e.responseType="arraybuffer";e.timeout=b.retryParameters.timeout;e.withCredentials=b.allowCrossSiteCredentials;e.onabort=function(){l(new N(1,1,7001,a,c))};e.onload=function(n){n=n.target;var p=n.getAllResponseHeaders().trim().split("\r\n"),r={};p=t(p);for(var u=p.next();!u.done;u=p.next())u=u.value.split(": "),r[u[0].toLowerCase()]=u.slice(1).join(": ");try{var x=Rq(r,n.response,n.status,a,n.responseURL,
|
|
683
|
+
c);k(x)}catch(w){l(w)}};e.onerror=function(n){l(new N(1,1,1002,a,n,c))};e.ontimeout=function(){l(new N(1,1,1003,a,c))};e.onprogress=function(n){var p=Date.now();if(100<p-f||n.lengthComputable&&n.loaded==n.total)d(p-f,n.loaded-g,n.total-n.loaded),g=n.loaded,f=p};for(var m in b.headers)e.setRequestHeader(m.toLowerCase(),b.headers[m]);e.send(b.body)});return new Pg(h,function(){e.abort();return Promise.resolve()})}M("shaka.net.HttpXHRPlugin",$q);$q.parse=ar;var br=window.XMLHttpRequest;
|
|
684
|
+
ch("http",ar,1,!0);ch("https",ar,1,!0);function cr(){this.h=this.j=this.i=0;this.g=new Map;this.l=0}function dr(a,b){a.i+=b;var c=a.l;a.l++;a.g.set(c,b);return c}cr.prototype.close=function(a,b){if(this.g.has(a)){var c=this.g.get(a);this.g["delete"](a);this.j+=c;this.h+=b}};function er(a){var b=this;this.P=a;this.g=new Map;this.J=new af(function(){var c=Array.from(b.g.values());return Promise.all(c.map(function(d){return d["catch"](function(){})}))});this.h=[];this.ge=function(){};this.fe=function(){};this.Ob=new cr}er.prototype.destroy=function(){return this.J.destroy()};function fr(a,b,c){a.ge=b;a.fe=c}function gr(a){var b=a.h.map(function(c){return c()});a.h=[];return Promise.all(b)}
|
|
685
|
+
function hr(a,b,c,d,e,f){bf(a.J);var g=dr(a.Ob,d);d=(a.g.get(b)||Promise.resolve()).then(function(){var h,k,l,m,n,p,r;return L(function(u){if(1==u.g)return v(u,ir(a,c),2);h=u.h;if(a.J.g)throw new N(2,9,7001);if(e)for(m in k=qb(h),l=new xn(k),l.data)n=Number(m),p=l.data[n],r=l.g[n],a.fe(p,r);a.Ob.close(g,h.byteLength);var x=a.Ob;a.ge(0==x.i?0:x.j/x.i,a.Ob.h);return u["return"](f(h))})});a.g.set(b,d);return d}
|
|
686
|
+
function jr(a,b,c){bf(a.J);var d=(a.g.get(b)||Promise.resolve()).then(function(){return L(function(e){return v(e,c(),0)})});a.g.set(b,d)}function kr(a){return L(function(b){return 1==b.g?v(b,Promise.all(a.g.values()),2):b["return"](a.Ob.h)})}function ir(a,b){var c,d,e,f;return L(function(g){if(1==g.g)return c=lh,d=a.P.request(c,b),e=function(){return d.abort()},a.h.push(e),v(g,d.promise,2);f=g.h;uc(a.h,e);return g["return"](f.data)})};function lr(a,b){var c=this;this.i=a;this.h=a.objectStore(b);this.g=new De;a.onabort=function(d){d.preventDefault();c.g.reject()};a.onerror=function(d){d.preventDefault();c.g.reject()};a.oncomplete=function(){c.g.resolve()}}lr.prototype.abort=function(){var a=this;return L(function(b){if(1==b.g){try{a.i.abort()}catch(c){}B(b,2);return v(b,a.g,4)}if(2!=b.g)return wa(b,0);F(b);z(b)})};
|
|
687
|
+
function mr(a,b){return new Promise(function(c,d){var e=a.h.openCursor();e.onerror=d;e.onsuccess=function(){var f;return L(function(g){if(1==g.g){if(null==e.result)return c(),g["return"]();f=e.result;return v(g,b(f.key,f.value,f),2)}f["continue"]();z(g)})}})}lr.prototype.store=function(){return this.h};lr.prototype.promise=function(){return this.g};function nr(a){this.h=a;this.g=[]}nr.prototype.destroy=function(){return Promise.all(this.g.map(function(a){return a.abort()}))};function or(a,b){return pr(a,b,"readwrite")}function pr(a,b,c){c=a.h.transaction([b],c);var d=new lr(c,b);a.g.push(d);d.promise().then(function(){uc(a.g,d)},function(){uc(a.g,d)});return d};function qr(a,b,c){this.g=new nr(a);this.i=b;this.h=c}q=qr.prototype;q.destroy=function(){return this.g.destroy()};q.hasFixedKeySpace=function(){return!0};q.addSegments=function(){return rr(this.i)};q.removeSegments=function(a,b){return sr(this,this.i,a,b)};q.getSegments=function(a){var b=this,c;return L(function(d){if(1==d.g)return v(d,tr(b,b.i,a),2);c=d.h;return d["return"](c.map(function(e){return b.Ud(e)}))})};q.addManifests=function(){return rr(this.h)};
|
|
688
|
+
q.updateManifestExpiration=function(a,b){var c=or(this.g,this.h),d=c.store();d.get(a).onsuccess=function(e){if(e=e.target.result)e.expiration=b,d.put(e,a)};return c.promise()};q.removeManifests=function(a,b){return sr(this,this.h,a,b)};q.getManifests=function(a){var b=this,c;return L(function(d){if(1==d.g)return v(d,tr(b,b.h,a),2);c=d.h;return d["return"](Promise.all(c.map(function(e){return b.Rb(e)})))})};
|
|
689
|
+
q.getAllManifests=function(){var a=this,b,c;return L(function(d){return 1==d.g?(b=pr(a.g,a.h,"readonly"),c=new Map,v(d,mr(b,function(e,f){var g;return L(function(h){if(1==h.g)return v(h,a.Rb(f),2);g=h.h;c.set(e,g);z(h)})}),2)):3!=d.g?v(d,b.promise(),3):d["return"](c)})};q.Ud=function(a){return a};q.Rb=function(a){return Promise.resolve(a)};function rr(a){return Promise.reject(new N(2,9,9011,"Cannot add new value to "+a))}
|
|
690
|
+
q.add=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){if(1==m.g){d=or(c.g,a);e=d.store();f=[];g={};h=t(b);for(k=h.next();!k.done;g={mc:g.mc},k=h.next())l=k.value,g.mc=e.add(l),g.mc.onsuccess=function(n){return function(){f.push(n.mc.result)}}(g);return v(m,d.promise(),2)}return m["return"](f)})};
|
|
691
|
+
function sr(a,b,c,d){a=or(a.g,b);b=a.store();var e={};c=t(c);for(var f=c.next();!f.done;e={lc:e.lc},f=c.next())e.lc=f.value,b["delete"](e.lc).onsuccess=function(g){return function(){return d(g.lc)}}(e);return a.promise()}
|
|
692
|
+
function tr(a,b,c){var d,e,f,g,h,k,l;return L(function(m){if(1==m.g){d=pr(a.g,b,"readonly");e=d.store();f={};g=[];h={};k=t(c);for(l=k.next();!l.done;h={Mb:h.Mb,Kb:h.Kb},l=k.next())h.Kb=l.value,h.Mb=e.get(h.Kb),h.Mb.onsuccess=function(n){return function(){void 0==n.Mb.result&&g.push(n.Kb);f[n.Kb]=n.Mb.result}}(h);return v(m,d.promise(),2)}if(g.length)throw new N(2,9,9012,"Could not find values for "+g);return m["return"](c.map(function(n){return f[n]}))})};function ur(a){this.g=new nr(a)}ur.prototype.destroy=function(){return this.g.destroy()};ur.prototype.getAll=function(){var a=this,b,c;return L(function(d){return 1==d.g?(b=pr(a.g,"session-ids","readonly"),c=[],v(d,mr(b,function(e,f){c.push(f)}),2)):3!=d.g?v(d,b.promise(),3):d["return"](c)})};ur.prototype.add=function(a){var b=or(this.g,"session-ids"),c=b.store();a=t(a);for(var d=a.next();!d.done;d=a.next())c.add(d.value);return b.promise()};
|
|
693
|
+
ur.prototype.remove=function(a){var b=this,c;return L(function(d){return 1==d.g?(c=or(b.g,"session-ids"),v(d,mr(c,function(e,f,g){a.includes(f.sessionId)&&g["delete"]()}),2)):v(d,c.promise(),0)})};function vr(){this.g=new Map}vr.prototype.destroy=function(){for(var a=[],b=t(this.g.values()),c=b.next();!c.done;c=b.next())a.push(c.value.destroy());this.g.clear();return Promise.all(a)};vr.prototype.init=function(){var a=this;wr.forEach(function(e,f){var g=e();g&&a.g.set(f,g)});for(var b=[],c=t(this.g.values()),d=c.next();!d.done;d=c.next())b.push(d.value.init());return Promise.all(b)};
|
|
694
|
+
function xr(a){var b=null;a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){e.hasFixedKeySpace()||b||(b={path:{Ka:d,ma:f},ma:e})})});if(b)return b;throw new N(2,9,9013,"Could not find a cell that supports add-operations");}function yr(a,b){a.g.forEach(function(c,d){c.getCells().forEach(function(e,f){b({Ka:d,ma:f},e)})})}
|
|
695
|
+
function zr(a,b,c){a=a.g.get(b);if(!a)throw new N(2,9,9013,"Could not find mechanism with name "+b);b=a.getCells().get(c);if(!b)throw new N(2,9,9013,"Could not find cell with name "+c);return b}function Ar(a,b){a.g.forEach(function(c){b(c.getEmeSessionCell())})}function Br(a){var b=Array.from(a.g.keys());if(!b.length)throw new N(2,9,9E3,"No supported storage mechanisms found");return a.g.get(b[0]).getEmeSessionCell()}
|
|
696
|
+
function Cr(a){var b,c,d;return L(function(e){return 1==e.g?(b=Array.from(a.g.values()),c=0<b.length,c||(d=wr,d.forEach(function(f){(f=f())&&b.push(f)})),v(e,Promise.all(b.map(function(f){return f.erase()})),2)):c?e.v(0):v(e,Promise.all(b.map(function(f){return f.destroy()})),0)})}function Dr(a,b){wr.set(a,b)}M("shaka.offline.StorageMuxer",vr);vr.unregister=function(a){wr["delete"](a)};vr.register=Dr;vr.prototype.destroy=vr.prototype.destroy;var wr=new Map;function Er(){qr.apply(this,arguments)}ra(Er,qr);Er.prototype.updateManifestExpiration=function(a,b){var c=this,d,e,f;return L(function(g){d=or(c.g,c.h);e=d.store();f=new De;e.get(a).onsuccess=function(h){(h=h.target.result)?(h.expiration=b,e.put(h),f.resolve()):f.reject(new N(2,9,9012,"Could not find values for "+a))};return v(g,Promise.all([d.promise(),f]),0)})};
|
|
697
|
+
Er.prototype.Rb=function(a){var b,c,d,e,f,g;return L(function(h){if(1==h.g){b=[];for(c=0;c<a.periods.length;++c)d=c==a.periods.length-1?a.duration:a.periods[c+1].startTime,e=d-a.periods[c].startTime,f=Fr(a.periods[c],e),b.push(f);return v(h,Xo(b),2)}g=h.h;return h["return"]({creationTime:0,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,expiration:null==a.expiration?Infinity:a.expiration,streams:g,sessionIds:a.sessionIds,drmInfo:a.drmInfo,appMetadata:a.appMetadata})})};
|
|
698
|
+
function Fr(a,b){Gr(a);for(var c=t(a.streams),d=c.next();!d.done;d=c.next());return a.streams.map(function(e){return Hr(e,a.startTime,b)})}
|
|
699
|
+
function Hr(a,b,c){var d=a.initSegmentUri?Ir(a.initSegmentUri):null,e=b+a.presentationTimeOffset,f=b+c;return{id:a.id,originalId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:void 0,hdr:void 0,kind:a.kind,language:a.language,label:a.label,width:a.width,height:a.height,initSegmentKey:d,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(function(g){var h=Ir(g.uri);return{startTime:b+g.startTime,endTime:b+g.endTime,
|
|
700
|
+
dataKey:h,initSegmentKey:d,appendWindowStart:b,appendWindowEnd:f,timestampOffset:e}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}}Er.prototype.Ud=function(a){return{data:a.data}};function Ir(a){var b;if((b=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a))||(b=/^offline:segment\/([0-9]+)$/.exec(a)))return Number(b[1]);throw new N(2,9,9004,"Could not parse uri "+a);}
|
|
701
|
+
function Gr(a){var b=a.streams.filter(function(h){return"audio"==h.contentType});a=a.streams.filter(function(h){return"video"==h.contentType});if(!b.every(function(h){return h.variantIds})||!a.every(function(h){return h.variantIds})){for(var c=t(b),d=c.next();!d.done;d=c.next())d.value.variantIds=[];c=t(a);for(d=c.next();!d.done;d=c.next())d.value.variantIds=[];c=0;if(a.length&&!b.length){var e=c++,f=t(a);for(d=f.next();!d.done;d=f.next())d.value.variantIds.push(e)}if(!a.length&&b.length)for(e=c++,
|
|
702
|
+
f=t(b),d=f.next();!d.done;d=f.next())d.value.variantIds.push(e);if(a.length&&b.length)for(b=t(b),d=b.next();!d.done;d=b.next())for(d=d.value,e=t(a),f=e.next();!f.done;f=e.next()){f=f.value;var g=c++;d.variantIds.push(g);f.variantIds.push(g)}}};function Jr(){qr.apply(this,arguments)}ra(Jr,qr);
|
|
703
|
+
Jr.prototype.Rb=function(a){var b,c,d,e,f,g;return L(function(h){if(1==h.g){b=[];for(c=0;c<a.periods.length;++c){d=c==a.periods.length-1?a.duration:a.periods[c+1].startTime;e=d-a.periods[c].startTime;for(var k=a.periods[c],l=[],m=t(k.streams),n=m.next();!n.done;n=m.next())n=n.value,0!=n.variantIds.length&&l.push(Kr(n,k.startTime,k.startTime+e));f=l;b.push(f)}return v(h,Xo(b),2)}g=h.h;return h["return"]({appMetadata:a.appMetadata,creationTime:0,drmInfo:a.drmInfo,duration:a.duration,expiration:null==
|
|
704
704
|
a.expiration?Infinity:a.expiration,originalManifestUri:a.originalManifestUri,sessionIds:a.sessionIds,size:a.size,streams:g})})};
|
|
705
|
-
function
|
|
706
|
-
dataKey:d.dataKey}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}};function
|
|
707
|
-
q.init=function(){var a=this,b=new De,c=window.indexedDB.open("shaka_offline_db",5);c.onsuccess=function(){var d=c.result;a.l=d;var e=d.objectStoreNames;e=e.contains("manifest")&&e.contains("segment")?new
|
|
708
|
-
e=e.contains("manifest-v5")&&e.contains("segment-v5")?new
|
|
705
|
+
function Kr(a,b,c){return{id:a.id,originalId:a.originalId,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:a.pixelAspectRatio,hdr:void 0,kind:a.kind,language:a.language,label:a.label,width:a.width,height:a.height,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(function(d){return{startTime:b+d.startTime,endTime:b+d.endTime,initSegmentKey:a.initSegmentKey,appendWindowStart:b,appendWindowEnd:c,timestampOffset:b-a.presentationTimeOffset,
|
|
706
|
+
dataKey:d.dataKey}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}};function Lr(){qr.apply(this,arguments)}ra(Lr,qr);Lr.prototype.hasFixedKeySpace=function(){return!1};Lr.prototype.addSegments=function(a){return this.add(this.i,a)};Lr.prototype.addManifests=function(a){return this.add(this.h,a)};Lr.prototype.Rb=function(a){null==a.expiration&&(a.expiration=Infinity);return Promise.resolve(a)};function Mr(){this.m=this.j=this.i=this.h=this.g=this.l=null}q=Mr.prototype;
|
|
707
|
+
q.init=function(){var a=this,b=new De,c=window.indexedDB.open("shaka_offline_db",5);c.onsuccess=function(){var d=c.result;a.l=d;var e=d.objectStoreNames;e=e.contains("manifest")&&e.contains("segment")?new Er(d,"segment","manifest"):null;a.g=e;e=d.objectStoreNames;e=e.contains("manifest-v2")&&e.contains("segment-v2")?new Jr(d,"segment-v2","manifest-v2"):null;a.h=e;e=d.objectStoreNames;e=e.contains("manifest-v3")&&e.contains("segment-v3")?new Jr(d,"segment-v3","manifest-v3"):null;a.i=e;e=d.objectStoreNames;
|
|
708
|
+
e=e.contains("manifest-v5")&&e.contains("segment-v5")?new Lr(d,"segment-v5","manifest-v5"):null;a.j=e;d=d.objectStoreNames.contains("session-ids")?new ur(d):null;a.m=d;b.resolve()};c.onupgradeneeded=function(){for(var d=c.result,e=t(["segment-v5","manifest-v5","session-ids"]),f=e.next();!f.done;f=e.next())f=f.value,d.objectStoreNames.contains(f)||d.createObjectStore(f,{autoIncrement:!0})};c.onerror=function(d){b.reject(new N(2,9,9001,c.error));d.preventDefault()};return b};
|
|
709
709
|
q.destroy=function(){var a=this;return L(function(b){switch(b.g){case 1:if(!a.g){b.v(2);break}return v(b,a.g.destroy(),2);case 2:if(!a.h){b.v(4);break}return v(b,a.h.destroy(),4);case 4:if(!a.i){b.v(6);break}return v(b,a.i.destroy(),6);case 6:if(!a.j){b.v(8);break}return v(b,a.j.destroy(),8);case 8:if(!a.m){b.v(10);break}return v(b,a.m.destroy(),10);case 10:a.l&&a.l.close(),z(b)}})};
|
|
710
710
|
q.getCells=function(){var a=new Map;this.g&&a.set("v1",this.g);this.h&&a.set("v2",this.h);this.i&&a.set("v3",this.i);this.j&&a.set("v5",this.j);return a};q.getEmeSessionCell=function(){return this.m};
|
|
711
|
-
q.erase=function(){var a=this;return L(function(b){switch(b.g){case 1:if(!a.g){b.v(2);break}return v(b,a.g.destroy(),2);case 2:if(!a.h){b.v(4);break}return v(b,a.h.destroy(),4);case 4:if(!a.i){b.v(6);break}return v(b,a.i.destroy(),6);case 6:if(!a.j){b.v(8);break}return v(b,a.j.destroy(),8);case 8:return a.l&&a.l.close(),v(b,
|
|
712
|
-
function
|
|
713
|
-
function
|
|
714
|
-
function
|
|
711
|
+
q.erase=function(){var a=this;return L(function(b){switch(b.g){case 1:if(!a.g){b.v(2);break}return v(b,a.g.destroy(),2);case 2:if(!a.h){b.v(4);break}return v(b,a.h.destroy(),4);case 4:if(!a.i){b.v(6);break}return v(b,a.i.destroy(),6);case 6:if(!a.j){b.v(8);break}return v(b,a.j.destroy(),8);case 8:return a.l&&a.l.close(),v(b,Nr(),10);case 10:return a.l=null,a.g=null,a.h=null,a.i=null,a.j=null,v(b,a.init(),0)}})};
|
|
712
|
+
function Nr(){var a=new De,b=window.indexedDB.deleteDatabase("shaka_offline_db");b.onblocked=function(){};b.onsuccess=function(){a.resolve()};b.onerror=function(c){a.reject(new N(2,9,9001,b.error));c.preventDefault()};return a}Dr("idb",function(){return dc()||!window.indexedDB?null:new Mr});function Or(a,b,c,d){this.g=a;this.i=b;this.h=c;this.l=d;this.j=["offline:",a,"/",b,"/",c,"/",d].join("")}Or.prototype.Ka=function(){return this.i};Or.prototype.ma=function(){return this.h};Or.prototype.key=function(){return this.l};Or.prototype.toString=function(){return this.j};
|
|
713
|
+
function Pr(a){a=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(a);if(null==a)return null;var b=a[1];if("manifest"!=b&&"segment"!=b)return null;var c=a[2];if(!c)return null;var d=a[3];return d&&null!=b?new Or(b,c,d,Number(a[4])):null};function Qr(a,b){this.h=a;this.g=b}
|
|
714
|
+
function Rr(a,b){var c=new T(null,0);c.Ma(b.duration);var d=b.streams.filter(function(l){return"audio"==l.type}),e=b.streams.filter(function(l){return"video"==l.type});d=Sr(a,d,e,c);e=b.streams.filter(function(l){return l.type==Be}).map(function(l){return Tr(a,l,c)});var f=b.streams.filter(function(l){return"image"==l.type}).map(function(l){return Tr(a,l,c)}),g=b.drmInfo?[b.drmInfo]:[];if(b.drmInfo)for(var h=t(d.values()),k=h.next();!k.done;k=h.next())k=k.value,k.audio&&k.audio.encrypted&&(k.audio.drmInfos=
|
|
715
715
|
g),k.video&&k.video.encrypted&&(k.video.drmInfos=g);return{presentationTimeline:c,minBufferTime:2,offlineSessionIds:b.sessionIds,variants:Array.from(d.values()),textStreams:e,imageStreams:f}}
|
|
716
|
-
function
|
|
717
|
-
e.value,g=
|
|
718
|
-
function
|
|
719
|
-
roles:b.roles,forced:b.forced,channelsCount:b.channelsCount,audioSamplingRate:b.audioSamplingRate,spatialAudio:b.spatialAudio,closedCaptions:b.closedCaptions,tilesLayout:b.tilesLayout}}function
|
|
720
|
-
function
|
|
721
|
-
q.start=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:d=
|
|
722
|
-
q.update=function(){};q.onExpirationUpdated=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:return d=c.g,e=new
|
|
723
|
-
|
|
724
|
-
function
|
|
725
|
-
function
|
|
726
|
-
9);case 9:return f["return"]([]);case 7:return e=[],v(f,Promise.all(c.sessionIds.map(function(g){return L(function(h){if(1==h.g)return B(h,2),v(h,
|
|
727
|
-
function
|
|
728
|
-
function
|
|
729
|
-
4);case 4:b.o=null,b.P=null,z(k)}})})}function
|
|
730
|
-
q.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=
|
|
731
|
-
q.store=function(a,b,c){var d=this,e=this.getConfiguration(),f=new
|
|
732
|
-
return g.promise.then(h)};return
|
|
733
|
-
function
|
|
734
|
-
h,n,b,c,e,f),11);case 11:r=y.h;
|
|
735
|
-
q.yc=function(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q;return L(function(S){switch(S.g){case 1:d={width:Infinity,height:Infinity};Vf(a,c.restrictions,d);c.useMediaCapabilities?$f(a,c.offline.usePersistentLicense):(Zf(a),Yf(a,b));e=[];f=c.preferredAudioChannelCount;Pf(a,f);g=t(a.variants);for(h=g.next();!h.done;h=g.next())k=h.value,e.push(
|
|
736
|
-
r.value,e.push(
|
|
737
|
-
Q.type&&I.add(Q.id),"image"==Q.type&&K.add(Q.id);a.variants=a.variants.filter(function(ba){return J.has(ba.id)});a.textStreams=a.textStreams.filter(function(ba){return I.has(ba.id)});a.imageStreams=a.imageStreams.filter(function(ba){return K.has(ba.id)});
|
|
738
|
-
function
|
|
739
|
-
G.initData.length})}),u=p&&!r,x=null,u&&(w=c.i,x=
|
|
740
|
-
function
|
|
741
|
-
function
|
|
742
|
-
function
|
|
743
|
-
function
|
|
744
|
-
q.list=function(){return
|
|
745
|
-
function
|
|
746
|
-
function(m){return m.createSegmentIndex()})),3);
|
|
747
|
-
function
|
|
748
|
-
n.set(null,Promise.resolve(null));m=new Map;p=
|
|
749
|
-
expiration:d.Tb(),streams:a,sessionIds:h?
|
|
750
|
-
function
|
|
751
|
-
tilesLayout:f.tilesLayout},m=f.id;
|
|
752
|
-
function
|
|
753
|
-
function
|
|
754
|
-
function
|
|
755
|
-
function
|
|
756
|
-
function
|
|
757
|
-
function
|
|
758
|
-
function
|
|
759
|
-
|
|
760
|
-
var
|
|
761
|
-
|
|
762
|
-
function
|
|
763
|
-
Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",
|
|
764
|
-
function
|
|
765
|
-
function
|
|
716
|
+
function Sr(a,b,c,d){for(var e=new Set,f=t(b),g=f.next();!g.done;g=f.next()){var h=t(g.value.variantIds);for(g=h.next();!g.done;g=h.next())e.add(g.value)}f=t(c);for(g=f.next();!g.done;g=f.next())for(h=t(g.value.variantIds),g=h.next();!g.done;g=h.next())e.add(g.value);f=new Map;e=t(e);for(g=e.next();!g.done;g=e.next())g=g.value,f.set(g,{id:g,language:"",primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});b=t(b);for(e=b.next();!e.done;e=b.next())for(e=
|
|
717
|
+
e.value,g=Tr(a,e,d),h=t(e.variantIds),e=h.next();!e.done;e=h.next())e=f.get(e.value),e.language=g.language,e.primary=e.primary||g.primary,e.audio=g;c=t(c);for(b=c.next();!b.done;b=c.next())for(e=b.value,b=Tr(a,e,d),g=t(e.variantIds),e=g.next();!e.done;e=g.next())e=f.get(e.value),e.primary=e.primary||b.primary,e.video=b;return f}
|
|
718
|
+
function Tr(a,b,c){var d=b.segments.map(function(e){return Ur(a,e)});c.Db(d);return{id:b.id,originalId:b.originalId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new U(d),mimeType:b.mimeType,codecs:b.codecs,width:b.width||void 0,height:b.height||void 0,frameRate:b.frameRate,pixelAspectRatio:b.pixelAspectRatio,hdr:b.hdr,kind:b.kind,encrypted:b.encrypted,drmInfos:[],keyIds:b.keyIds,language:b.language,label:b.label,type:b.type,primary:b.primary,trickModeVideo:null,emsgSchemeIdUris:null,
|
|
719
|
+
roles:b.roles,forced:b.forced,channelsCount:b.channelsCount,audioSamplingRate:b.audioSamplingRate,spatialAudio:b.spatialAudio,closedCaptions:b.closedCaptions,tilesLayout:b.tilesLayout}}function Ur(a,b){var c=new Or("segment",a.h,a.g,b.dataKey);return new qi(b.startTime,b.endTime,function(){return[c.toString()]},0,null,null!=b.initSegmentKey?Vr(a,b.initSegmentKey):null,b.timestampOffset,b.appendWindowStart,b.appendWindowEnd)}
|
|
720
|
+
function Vr(a,b){var c=new Or("segment",a.h,a.g,b);return new oi(function(){return[c.toString()]},0,null)};function Wr(){this.g=null}q=Wr.prototype;q.configure=function(){};
|
|
721
|
+
q.start=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:d=Pr(a);c.g=d;if(null==d||"manifest"!=d.g)throw new N(2,1,9004,a);e=new vr;va(m);return v(m,e.init(),4);case 4:return v(m,zr(e,d.Ka(),d.ma()),5);case 5:return f=m.h,v(m,f.getManifests([d.key()]),6);case 6:return g=m.h,h=g[0],k=new Qr(d.Ka(),d.ma()),l=Rr(k,h),b.makeTextStreamsForClosedCaptions(l),m["return"](l);case 2:return xa(m),v(m,e.destroy(),7);case 7:ya(m,0)}})};q.stop=function(){return Promise.resolve()};
|
|
722
|
+
q.update=function(){};q.onExpirationUpdated=function(a,b){var c=this,d,e,f,g,h,k,l;return L(function(m){switch(m.g){case 1:return d=c.g,e=new vr,B(m,2,3),v(m,e.init(),5);case 5:return v(m,zr(e,d.Ka(),d.ma()),6);case 6:return f=m.h,v(m,f.getManifests([d.key()]),7);case 7:g=m.h;h=g[0];k=h.sessionIds.includes(a);l=void 0==h.expiration||h.expiration>b;if(!k||!l){m.v(3);break}return v(m,f.updateManifestExpiration(d.key(),b),3);case 3:return xa(m),v(m,e.destroy(),10);case 10:ya(m,0);break;case 2:F(m),m.v(3)}})};
|
|
723
|
+
ki["application/x-offline-manifest"]=function(){return new Wr};function Xr(){}function Yr(a){var b=Pr(a);b&&"manifest"==b.g?(a={uri:a,je:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}},a=Sg(a)):a=b&&"segment"==b.g?Zr(b.key(),b):Qg(new N(2,1,9004,a));return a}
|
|
724
|
+
function Zr(a,b){var c=new vr;return Sg(void 0).ca(function(){return c.init()}).ca(function(){return zr(c,b.Ka(),b.ma())}).ca(function(d){return d.getSegments([b.key()])}).ca(function(d){return{uri:b,data:d[0].data,headers:{}}})["finally"](function(){return c.destroy()})}M("shaka.offline.OfflineScheme",Xr);Xr.plugin=Yr;ch("offline",Yr);function $r(a,b,c){var d,e,f,g,h,k;return L(function(l){switch(l.g){case 1:d=[];for(var m=[],n=t(c),p=n.next();!p.done;p=n.next()){p=p.value;for(var r=!1,u=t(m),x=u.next();!x.done;x=u.next())if(x=x.value,as(x.info,p)){x.sessionIds.push(p.sessionId);r=!0;break}r||m.push({info:p,sessionIds:[p.sessionId]})}e=t(m);f=e.next();case 2:if(f.done){l.v(4);break}g=f.value;h=bs(a,b,g);return v(l,h,5);case 5:k=l.h;d=d.concat(k);f=e.next();l.v(2);break;case 4:return l["return"](d)}})}
|
|
725
|
+
function bs(a,b,c){var d,e;return L(function(f){switch(f.g){case 1:return d=new sh({Cb:b,onError:function(){},Ic:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),B(f,2),d.configure(a),v(f,Ah(d,c.info.keySystem,c.info.licenseUri,c.info.serverCertificate,c.info.audioCapabilities,c.info.videoCapabilities),4);case 4:wa(f,3);break;case 2:return F(f),v(f,d.destroy(),5);case 5:return f["return"]([]);case 3:return B(f,6),v(f,Kh(d),8);case 8:wa(f,7);break;case 6:return F(f),v(f,d.destroy(),
|
|
726
|
+
9);case 9:return f["return"]([]);case 7:return e=[],v(f,Promise.all(c.sessionIds.map(function(g){return L(function(h){if(1==h.g)return B(h,2),v(h,Lh(d,g),4);if(2!=h.g)return e.push(g),wa(h,0);F(h);z(h)})})),10);case 10:return v(f,d.destroy(),11);case 11:return f["return"](e)}})}
|
|
727
|
+
function as(a,b){function c(d,e){return d.robustness==e.robustness&&d.contentType==e.contentType}return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&vc(a.audioCapabilities,b.audioCapabilities,c)&&vc(a.videoCapabilities,b.videoCapabilities,c)};function cs(a,b,c){var d=b.presentationTimeline.getDuration();b=ds(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c}}function es(a,b){var c=Rr(new Qr(a.Ka(),a.ma()),b),d=b.appMetadata||{};c=ds(c);return{offlineUri:a.toString(),originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:b.expiration,tracks:c,appMetadata:d}}
|
|
728
|
+
function ds(a){var b=[],c=sg(a.variants);c=t(c);for(var d=c.next();!d.done;d=c.next())b.push(kg(d.value));a=t(a.textStreams);for(c=a.next();!c.done;c=a.next())b.push(lg(c.value));return b};function fs(){this.g={}}function gs(a,b,c){c=c.endTime-c.startTime;return hs(a,b)*c}function hs(a,b){var c=a.g[b];null==c&&(c=0);return c};function is(a){var b=this;if(a&&a.constructor!=V)throw new N(2,9,9008);this.P=this.o=null;a?(this.o=a.o,this.P=a.Ub()):(this.o=bk(),this.P=new bh);this.Nc=[];this.ac=[];this.Cd=[];var c=!a;this.J=new af(function(){var d,e,f,g,h;return L(function(k){switch(k.g){case 1:return v(k,Promise.all(b.Cd.map(function(l){return gr(l)})),2);case 2:d=function(){};e=[];f=t(b.ac);for(g=f.next();!g.done;g=f.next())h=g.value,e.push(h.then(d,d));return v(k,Promise.all(e),3);case 3:if(!c){k.v(4);break}return v(k,b.P.destroy(),
|
|
729
|
+
4);case 4:b.o=null,b.P=null,z(k)}})})}function js(){if(Yb())a:{var a=t(wr.values());for(var b=a.next();!b.done;b=a.next())if(b=b.value,b=b()){b.destroy();a=!0;break a}a=!1}else a=!1;return a}q=is.prototype;q.destroy=function(){return this.J.destroy()};
|
|
730
|
+
q.configure=function(a,b){2==arguments.length&&"string"==typeof a&&(a=Zj(a,b));a.manifest&&a.manifest.dash&&"defaultPresentationDelay"in a.manifest.dash&&(Gb("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),a.manifest.defaultPresentationDelay=a.manifest.dash.defaultPresentationDelay,delete a.manifest.dash.defaultPresentationDelay);return dk(this.o,a)};q.getConfiguration=function(){var a=bk();dk(a,this.o,bk());return a};q.Ub=function(){return this.P};
|
|
731
|
+
q.store=function(a,b,c){var d=this,e=this.getConfiguration(),f=new er(this.P);this.Cd.push(f);b=ks(this,a,b||{},function(){var h;return L(function(k){if(1==k.g)return v(k,ji(a,d.P,e.manifest.retryParameters,c||null),2);h=k.h;return k["return"](Nb(h))})},e,f);var g=new Pg(b,function(){return gr(f)});g["finally"](function(){uc(d.Cd,f)});g.then=function(h){Gb("shaka.offline.Storage.store.then","Storage operations now return a shaka.util.AbortableOperation, rather than a promise. Please update to conform to this new API; you can use the |chain| method instead.");
|
|
732
|
+
return g.promise.then(h)};return ls(this,g)};q.ef=function(){Gb("shaka.offline.Storage.getStoreInProgress","Multiple concurrent downloads are now supported.");return!1};
|
|
733
|
+
function ks(a,b,c,d,e,f){var g,h,k,l,m,n,p,r,u,x,w;return L(function(y){switch(y.g){case 1:return ms(),h=g=null,k=new vr,m=l=null,B(y,2,3),v(y,d(),5);case 5:return g=y.h,v(y,ns(a,b,g,e),6);case 6:n=y.h;os(a);p=!n.presentationTimeline.Z()&&!n.presentationTimeline.mb();if(!p)throw new N(2,9,9005,b);return v(y,ps(a,n,function(C){m=m||C},e),7);case 7:h=y.h;os(a);if(m)throw m;return v(y,a.yc(n,h,e),8);case 8:return v(y,k.init(),9);case 9:return os(a),v(y,xr(k),10);case 10:return l=y.h,os(a),v(y,qs(a,l.ma,
|
|
734
|
+
h,n,b,c,e,f),11);case 11:r=y.h;os(a);if(m)throw m;return v(y,l.ma.addManifests([r]),12);case 12:return u=y.h,os(a),x=new Or("manifest",l.path.Ka,l.path.ma,u[0]),y["return"](es(x,r));case 3:return xa(y),a.Nc=[],v(y,k.destroy(),13);case 13:if(!g){y.v(14);break}return v(y,g.stop(),14);case 14:if(!h){y.v(16);break}return v(y,h.destroy(),16);case 16:ya(y,0);break;case 2:w=F(y);if(!l){y.v(18);break}return v(y,l.ma.removeSegments(a.Nc,function(){}),18);case 18:throw m||w;}})}
|
|
735
|
+
q.yc=function(a,b,c){var d,e,f,g,h,k,l,m,n,p,r,u,x,w,y,C,D,A,E,G,H,J,I,K,O,Q;return L(function(S){switch(S.g){case 1:d={width:Infinity,height:Infinity};Vf(a,c.restrictions,d);c.useMediaCapabilities?$f(a,c.offline.usePersistentLicense):(Zf(a),Yf(a,b));e=[];f=c.preferredAudioChannelCount;Pf(a,f);g=t(a.variants);for(h=g.next();!h.done;h=g.next())k=h.value,e.push(kg(k));l=t(a.textStreams);for(m=l.next();!m.done;m=l.next())n=m.value,e.push(lg(n));p=t(a.imageStreams);for(r=p.next();!r.done;r=p.next())u=
|
|
736
|
+
r.value,e.push(mg(u));return v(S,c.offline.trackSelectionCallback(e),2);case 2:x=S.h;w=a.presentationTimeline.getDuration();y=0;C=t(x);for(D=C.next();!D.done;D=C.next())A=D.value,E=A.bandwidth*w/8,y+=E;B(S,3);return v(S,c.offline.downloadSizeCallback(y),5);case 5:G=S.h;if(!G)throw new N(2,9,9014);wa(S,4);break;case 3:H=F(S);if(H instanceof N)throw H;throw new N(2,9,9015);case 4:J=new Set;I=new Set;K=new Set;O=t(x);for(D=O.next();!D.done;D=O.next())Q=D.value,"variant"==Q.type&&J.add(Q.id),"text"==
|
|
737
|
+
Q.type&&I.add(Q.id),"image"==Q.type&&K.add(Q.id);a.variants=a.variants.filter(function(ba){return J.has(ba.id)});a.textStreams=a.textStreams.filter(function(ba){return I.has(ba.id)});a.imageStreams=a.imageStreams.filter(function(ba){return K.has(ba.id)});rs(a);z(S)}})};
|
|
738
|
+
function qs(a,b,c,d,e,f,g,h){var k,l,m,n,p,r,u,x,w,y,C,D;return L(function(A){switch(A.g){case 1:return k=cs(e,d,f),l=g.offline.progressCallback,m=function(E,G){k.size=G;l(k,E)},n=function(E,G){u&&g.offline.usePersistentLicense&&x==G&&Jh(c,"cenc",E)},fr(h,m,n),p=d.variants.some(function(E){var G=E.audio&&E.audio.encrypted;return E.video&&E.video.encrypted||G}),r=d.variants.some(function(E){return(E.video?E.video.drmInfos:[]).concat(E.audio?E.audio.drmInfos:[]).some(function(G){return G.initData&&
|
|
739
|
+
G.initData.length})}),u=p&&!r,x=null,u&&(w=c.i,x=ss.get(w.keySystem)),va(A),C=y=ts(a,h,b,c,d,e,f,g),v(A,kr(h),4);case 4:C.size=A.h;y.expiration=c.Tb();D=Uh(c);y.sessionIds=g.offline.usePersistentLicense?D:[];if(p&&g.offline.usePersistentLicense&&!D.length)throw new N(2,9,9007);return A["return"](y);case 2:return xa(A),v(A,h.destroy(),5);case 5:ya(A,0)}})}q.remove=function(a){return us(this,vs(this,a))};
|
|
740
|
+
function vs(a,b){var c,d,e,f,g,h;return L(function(k){switch(k.g){case 1:ms();c=Pr(b);if(null==c||"manifest"!=c.g)throw new N(2,9,9004,b);d=c;e=new vr;va(k);return v(k,e.init(),4);case 4:return v(k,zr(e,d.Ka(),d.ma()),5);case 5:return f=k.h,v(k,f.getManifests([d.key()]),6);case 6:return g=k.h,h=g[0],v(k,Promise.all([ws(a,h,e),xs(f,d,h)]),2);case 2:return xa(k),v(k,e.destroy(),8);case 8:ya(k,0)}})}
|
|
741
|
+
function ys(a,b){for(var c=[],d=t(a.streams),e=d.next();!e.done;e=d.next())e=e.value,b&&"video"==e.type?c.push({contentType:Me(e.mimeType,e.codecs),robustness:a.drmInfo.videoRobustness}):b||"audio"!=e.type||c.push({contentType:Me(e.mimeType,e.codecs),robustness:a.drmInfo.audioRobustness});return c}function ws(a,b,c){return L(function(d){return v(d,zs(a.P,a.o.drm,c,b),0)})}
|
|
742
|
+
function xs(a,b,c){function d(){}var e=As(c);es(b,c);return Promise.all([a.removeSegments(e,d),a.removeManifests([b.key()],d)])}q.Bf=function(){return us(this,Bs(this))};
|
|
743
|
+
function Bs(a){var b,c,d,e,f,g,h,k,l,m;return L(function(n){switch(n.g){case 1:return ms(),b=a.P,c=a.o.drm,d=new vr,e=!1,va(n),v(n,d.init(),4);case 4:f=[],Ar(d,function(p){return f.push(p)}),g=t(f),h=g.next();case 5:if(h.done){n.v(2);break}k=h.value;return v(n,k.getAll(),8);case 8:return l=n.h,v(n,$r(c,b,l),9);case 9:return m=n.h,v(n,k.remove(m),10);case 10:m.length!=l.length&&(e=!0);h=g.next();n.v(5);break;case 2:return xa(n),v(n,d.destroy(),11);case 11:ya(n,3);break;case 3:return n["return"](!e)}})}
|
|
744
|
+
q.list=function(){return us(this,Cs())};function Cs(){var a,b,c;return L(function(d){switch(d.g){case 1:return ms(),a=[],b=new vr,va(d),v(d,b.init(),4);case 4:return c=Promise.resolve(),yr(b,function(e,f){c=c.then(function(){var g;return L(function(h){if(1==h.g)return v(h,f.getAllManifests(),2);g=h.h;g.forEach(function(k,l){var m=es(new Or("manifest",e.Ka,e.ma,l),k);a.push(m)});z(h)})})}),v(d,c,2);case 2:return xa(d),v(d,b.destroy(),6);case 6:ya(d,3);break;case 3:return d["return"](a)}})}
|
|
745
|
+
function ns(a,b,c,d){var e,f,g,h,k;return L(function(l){if(1==l.g)return e=null,f=a.P,g={networkingEngine:f,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(m){e=m},isLowLatencyMode:function(){return!1},isAutoLowLatencyMode:function(){return!1},enableLowLatencyMode:function(){}},c.configure(d.manifest),os(a),v(l,c.start(b,g),2);if(3!=l.g)return h=l.h,os(a),k=Ds(h),v(l,Promise.all(gb(k,
|
|
746
|
+
function(m){return m.createSegmentIndex()})),3);os(a);if(e)throw e;return l["return"](h)})}function ps(a,b,c,d){var e;return L(function(f){switch(f.g){case 1:return e=new sh({Cb:a.P,onError:c,Ic:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),e.configure(d.drm),v(f,xh(e,b.variants,d.offline.usePersistentLicense,d.useMediaCapabilities),2);case 2:return v(f,Kh(e),3);case 3:return v(f,Ih(e),4);case 4:return f["return"](e)}})}
|
|
747
|
+
function ts(a,b,c,d,e,f,g,h){for(var k=new fs,l=t(e.variants),m=l.next();!m.done;m=l.next()){var n=k;m=m.value;var p=m.audio,r=m.video;p&&!r&&(n.g[p.id]=p.bandwidth||m.bandwidth);!p&&r&&(n.g[r.id]=r.bandwidth||m.bandwidth);if(p&&r){var u=p.bandwidth||393216,x=r.bandwidth||m.bandwidth-u;0>=x&&(x=m.bandwidth);n.g[p.id]=u;n.g[r.id]=x}}l=t(e.textStreams);for(n=l.next();!n.done;n=l.next())k.g[n.value.id]=52;l=t(e.imageStreams);for(n=l.next();!n.done;n=l.next())n=n.value,k.g[n.id]=n.bandwidth||2048;n=new Map;
|
|
748
|
+
n.set(null,Promise.resolve(null));m=new Map;p=Ds(e);l=new Map;p=t(p);for(r=p.next();!r.done;r=p.next())r=r.value,u=Es(a,b,c,k,e,r,h,n,m),l.set(r.id,u);a=t(e.variants);for(m=a.next();!m.done;m=a.next())b=m.value,b.audio&&l.get(b.audio.id).variantIds.push(b.id),b.video&&l.get(b.video.id).variantIds.push(b.id);a=Array.from(l.values());h=h.offline.usePersistentLicense;(b=d.i)&&h&&(b.initData=[]);return{creationTime:Date.now(),originalManifestUri:f,duration:e.presentationTimeline.getDuration(),size:0,
|
|
749
|
+
expiration:d.Tb(),streams:a,sessionIds:h?Uh(d):[],drmInfo:b,appMetadata:g}}
|
|
750
|
+
function Es(a,b,c,d,e,f,g,h,k){var l={id:f.id,originalId:f.originalId,primary:f.primary,type:f.type,mimeType:f.mimeType,codecs:f.codecs,frameRate:f.frameRate,pixelAspectRatio:f.pixelAspectRatio,hdr:f.hdr,kind:f.kind,language:f.language,label:f.label,width:f.width||null,height:f.height||null,encrypted:f.encrypted,keyIds:f.keyIds,segments:[],variantIds:[],roles:f.roles,forced:f.forced,channelsCount:f.channelsCount,audioSamplingRate:f.audioSamplingRate,spatialAudio:f.spatialAudio,closedCaptions:f.closedCaptions,
|
|
751
|
+
tilesLayout:f.tilesLayout},m=f.id;Fs(f,e.presentationTimeline.ab(),function(n){var p=Gs(a,b,m,f.id,c,d,n.h,g,h),r=Hs(a,b,m,f.id,c,d,n,g,k);jr(b,m,function(){var u,x;return L(function(w){if(1==w.g)return v(w,p,2);if(3!=w.g)return u=w.h,v(w,r,3);x=w.h;l.segments.push({initSegmentKey:u,startTime:n.startTime,endTime:n.endTime,appendWindowStart:n.appendWindowStart,appendWindowEnd:n.appendWindowEnd,timestampOffset:n.timestampOffset,dataKey:x});z(w)})})});return l}
|
|
752
|
+
function Gs(a,b,c,d,e,f,g,h,k){if(k.has(g))return k.get(g);h=aj(g.na(),g.ka,g.fa,h.streaming.retryParameters);b=hr(b,c,h,.5*hs(f,d),!0,function(l){var m;return L(function(n){if(1==n.g)return v(n,e.addSegments([{data:l}]),2);m=n.h;a.Nc.push(m[0]);return n["return"](m[0])})});k.set(g,b);return b}
|
|
753
|
+
function Hs(a,b,c,d,e,f,g,h,k){var l=[g.na()[0],g.ka,g.fa].join("-");if(k.has(l))return k.get(l);h=aj(g.na(),g.ka,g.fa,h.streaming.retryParameters);b=hr(b,c,h,gs(f,d,g),!1,function(m){var n;return L(function(p){if(1==p.g)return v(p,e.addSegments([{data:m}]),2);n=p.h;a.Nc.push(n[0]);return p["return"](n[0])})});k.set(l,b);return b}function Fs(a,b,c){b=a.segmentIndex.find(b);if(null!=b)for(var d=a.segmentIndex.get(b);d;)c(d),d=a.segmentIndex.get(++b)}function os(a){if(a.J.g)throw new N(2,9,7001);}
|
|
754
|
+
function ms(){if(!js())throw new N(2,9,9E3);}function us(a,b){return L(function(c){if(1==c.g)return a.ac.push(b),va(c),v(c,b,4);if(2!=c.g)return c["return"](c.h);xa(c);uc(a.ac,b);return ya(c,0)})}function ls(a,b){var c=b.promise;a.ac.push(c);return b["finally"](function(){uc(a.ac,c)})}
|
|
755
|
+
function As(a){var b=[];a=t(a.streams);for(var c=a.next();!c.done;c=a.next()){c=t(c.value.segments);for(var d=c.next();!d.done;d=c.next())d=d.value,null!=d.initSegmentKey&&b.push(d.initSegmentKey),b.push(d.dataKey)}return b}
|
|
756
|
+
function zs(a,b,c,d){var e,f,g;return L(function(h){if(1==h.g){if(!d.drmInfo)return h["return"]();e=Br(c);f=d.sessionIds.map(function(k){return{sessionId:k,keySystem:d.drmInfo.keySystem,licenseUri:d.drmInfo.licenseServerUri,serverCertificate:d.drmInfo.serverCertificate,audioCapabilities:ys(d,!1),videoCapabilities:ys(d,!0)}});return v(h,$r(b,a,f),2)}return 3!=h.g?(g=h.h,v(h,e.remove(g),3)):v(h,e.add(f.filter(function(k){return!g.includes(k.sessionId)})),0)})}
|
|
757
|
+
function Ds(a){for(var b=new Set,c=t(a.textStreams),d=c.next();!d.done;d=c.next())b.add(d.value);c=t(a.imageStreams);for(d=c.next();!d.done;d=c.next())b.add(d.value);a=t(a.variants);for(c=a.next();!c.done;c=a.next())c=c.value,c.audio&&b.add(c.audio),c.video&&b.add(c.video);return b}
|
|
758
|
+
function rs(a){a.variants.map(function(f){return f.video});var b=new Set(a.variants.map(function(f){return f.audio}));a=a.textStreams;for(var c=t(b),d=c.next();!d.done;d=c.next()){d=t(b);for(var e=d.next();!e.done;e=d.next());}b=t(a);for(c=b.next();!c.done;c=b.next())for(c=t(a),d=c.next();!d.done;d=c.next());}M("shaka.offline.Storage",is);is.deleteAll=function(){var a;return L(function(b){return 1==b.g?(a=new vr,va(b),v(b,Cr(a),2)):5!=b.g?(xa(b),v(b,a.destroy(),5)):ya(b,0)})};is.prototype.list=is.prototype.list;
|
|
759
|
+
is.prototype.removeEmeSessions=is.prototype.Bf;is.prototype.remove=is.prototype.remove;is.prototype.getStoreInProgress=is.prototype.ef;is.prototype.store=is.prototype.store;is.prototype.getNetworkingEngine=is.prototype.Ub;is.prototype.getConfiguration=is.prototype.getConfiguration;is.prototype.configure=is.prototype.configure;is.prototype.destroy=is.prototype.destroy;is.support=js;
|
|
760
|
+
var ss=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.adobe.primetime","f239e769efa348509c16a903c6932efb");
|
|
761
|
+
Xl.offline=js;function Is(){}function Js(a,b){for(var c={priority:b||0,De:a},d=t(mb(Ks)),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.ga;if(e.item.priority<c.priority){Ks.splice(f,0,c);return}}Ks.push(c)}M("shaka.polyfill",Is);Is.register=Js;Is.installAll=function(){for(var a=t(Ks),b=a.next();!b.done;b=a.next()){b=b.value;try{b.De()}catch(c){Wa("Error installing polyfill!",c)}}};var Ks=[];function Ls(){}function Ms(){Ns()}Is.EncryptionScheme=Ls;Ls.install=Ms;Js(Ms,-2);function Os(){}
|
|
762
|
+
function Ps(){if(window.Document){var a=Element.prototype;a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||a.webkitRequestFullscreen;a=Document.prototype;a.exitFullscreen=a.exitFullscreen||a.mozCancelFullScreen||a.msExitFullscreen||a.webkitCancelFullScreen;"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}}),
|
|
763
|
+
Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",Qs);document.addEventListener("webkitfullscreenerror",Qs);document.addEventListener("mozfullscreenchange",Qs);document.addEventListener("mozfullscreenerror",Qs);document.addEventListener("MSFullscreenChange",Qs);document.addEventListener("MSFullscreenError",Qs)}}
|
|
764
|
+
function Qs(a){var b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),c=document.createEvent("Event");c.initEvent(b,a.bubbles,a.cancelable);a.target.dispatchEvent(c)}Is.Fullscreen=Os;Os.install=Ps;Js(Ps);function Rs(){}function Ss(){}Is.MathRound=Rs;Rs.install=Ss;Js(Ss);function Ts(){}function Us(){if(dc()||ec()||bc("PlayStation 5")||!navigator.mediaCapabilities)navigator.mediaCapabilities||(navigator.mediaCapabilities={}),Vs=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=Ws}
|
|
765
|
+
function Ws(a){var b,c,d,e,f,g,h,k,l,m,n,p,r,u,x,w;return L(function(y){switch(y.g){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};if(!a)return y["return"](b);if("media-source"==a.type){if(!Yb()||a.video&&(c=a.video.contentType,d=MediaSource.isTypeSupported(c),!d)||a.audio&&(e=a.audio.contentType,f=MediaSource.isTypeSupported(e),!f))return y["return"](b)}else if("file"==a.type){if(a.video&&(g=a.video.contentType,h=Zb(g),!h)||a.audio&&(k=a.audio.contentType,
|
|
766
766
|
l=Zb(k),!l))return y["return"](b)}else return y["return"](b);if(!a.keySystemConfiguration)return b.supported=!0,y["return"](Promise.resolve(b));m=a.keySystemConfiguration;n=[];p=[];m.audio&&(r={robustness:m.audio.robustness||"",contentType:a.audio.contentType},n.push(r));m.video&&(u={robustness:m.video.robustness||"",contentType:a.video.contentType},p.push(u));x={initDataTypes:[m.initDataType],distinctiveIdentifier:m.distinctiveIdentifier,persistentState:m.persistentState,sessionTypes:m.sessionTypes};
|
|
767
|
-
n.length&&(x.audioCapabilities=n);p.length&&(x.videoCapabilities=p);B(y,3);return v(y,navigator.requestMediaKeySystemAccess(m.keySystem,[x]),5);case 5:w=y.h;wa(y,4);break;case 3:F(y);case 4:w&&(b.supported=!0,b.keySystemAccess=w);case 2:return y["return"](b)}})}
|
|
768
|
-
function
|
|
769
|
-
function
|
|
770
|
-
function
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
function
|
|
775
|
-
function
|
|
767
|
+
n.length&&(x.audioCapabilities=n);p.length&&(x.videoCapabilities=p);B(y,3);return v(y,navigator.requestMediaKeySystemAccess(m.keySystem,[x]),5);case 5:w=y.h;wa(y,4);break;case 3:F(y);case 4:w&&(b.supported=!0,b.keySystemAccess=w);case 2:return y["return"](b)}})}Is.MediaCapabilities=Ts;Ts.install=Us;var Vs=null;Ts.originalMcap=Vs;Js(Us,-1);function Xs(){}function Ys(){var a=fc();window.MediaSource&&(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType?Zs():a?($s(),12>=a?(at(),bt()):at()):(bc("Tizen 2")||bc("Tizen 3")||bc("Tizen 4"))&&ct());window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&dt()}
|
|
768
|
+
function at(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];c=a.apply(this,c);c.abort=function(){};return c}}function bt(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}function $s(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"==b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}}
|
|
769
|
+
function ct(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!=Qe(b)&&a(b)}}function Zs(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */);c.shift();return c.some(function(d){return d.startsWith("codecs=")})?cast.__platform__.canDisplayType(b):a(b)}}
|
|
770
|
+
function dt(){var a=MediaSource.isTypeSupported;bc("Web0S")||(MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */),d=c.findIndex(function(g){return g.startsWith("codecs=")});if(0>d)return a(b);var e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(function(g){return g.startsWith("vp09")});0<=f&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}Is.MediaSource=Xs;Xs.install=Ys;Js(Ys);function et(){}function ft(){screen.orientation||void 0!=window.orientation&>()}function gt(){function a(){switch(window.orientation){case -90:b.type="landscape-secondary";b.angle=270;break;case 0:b.type="portrait-primary";b.angle=0;break;case 90:b.type="landscape-primary";b.angle=90;break;case 180:b.type="portrait-secondary",b.angle=180}}var b=new ht;screen.orientation=b;a();window.addEventListener("orientationchange",function(){a();var c=new R("change");b.dispatchEvent(c)})}Is.Orientation=et;
|
|
771
|
+
et.install=ft;function ht(){Xg.call(this);this.type="";this.angle=0}ra(ht,Xg);
|
|
772
|
+
ht.prototype.lock=function(a){function b(d){return screen.lockOrientation?screen.lockOrientation(d):screen.mozLockOrientation?screen.mozLockOrientation(d):screen.msLockOrientation?screen.msLockOrientation(d):!1}var c=!1;switch(a){case "natural":c=b("default");break;case "any":c=!0;this.unlock();break;default:c=b(a)}if(c)return Promise.resolve();a=Error("screen.orientation.lock() is not available on this device");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;return Promise.reject(a)};
|
|
773
|
+
ht.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()};Js(ft);function it(){}function jt(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=kt,window.MediaKeys=lt,window.MediaKeySystemAccess=mt,navigator.requestMediaKeySystemAccess=nt)}function nt(a,b){try{var c=new mt(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}
|
|
774
|
+
function kt(a){var b=this.mediaKeys;b&&b!=a&&ot(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?ot(a,this):Promise.resolve()}function pt(a){a=qb(a.initData);if(tb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=xb(a.subarray(4),!0);a=Ab(a);var b=new Event("encrypted");b.initDataType="skd";b.initData=rb(a);this.dispatchEvent(b)}Is.PatchedMediaKeysApple=it;it.install=jt;
|
|
775
|
+
function mt(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(var c=t(b),d=c.next();!d.done;d=c.next()){var e=d.value;if("required"==e.persistentState)d=null;else{d={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label};var f=!1,g=!1;if(e.audioCapabilities)for(var h=t(e.audioCapabilities),k=h.next();!k.done;k=h.next())k=k.value,k.contentType&&(f=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,
|
|
776
776
|
k.contentType.split(";")[0])&&(d.audioCapabilities.push(k),g=!0));if(e.videoCapabilities)for(e=t(e.videoCapabilities),k=e.next();!k.done;k=e.next())h=k.value,h.contentType&&(f=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,h.contentType.split(";")[0])&&(d.videoCapabilities.push(h),g=!0));f||(g=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));d=g?d:null}if(d){this.g=d;return}}c=Error("Unsupported keySystem");c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}
|
|
777
|
-
|
|
778
|
-
function
|
|
779
|
-
q.generateRequest=function(a,b){var c=this;this.g=new De;try{var d=this.l.createSession("video/mp4",qb(b));this.j=d;this.sessionId=d.sessionId||"";this.h.B(this.j,"webkitkeymessage",function(e){c.g&&(c.g.resolve(),c.g=null);e=(new Map).set("messageType",void 0==c.keyStatuses.g?"license-request":"license-renewal").set("message",rb(e.message));e=new R("message",e);c.dispatchEvent(e)});this.h.B(d,"webkitkeyadded",function(){c.i&&(
|
|
780
|
-
Error("EME PatchedMediaKeysApple key error");e.errorCode=c.j.error;if(null!=c.g)c.g.reject(e),c.g=null;else if(null!=c.i)c.i.reject(e),c.i=null;else switch(c.j.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:
|
|
781
|
-
q.update=function(a){this.i=new De;try{this.j.update(qb(a))}catch(b){this.i.reject(b)}return this.i};q.close=function(){try{this.j.close(),this.closed.resolve(),this.h.ob()}catch(a){this.closed.reject(a)}return this.closed};q.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function
|
|
782
|
-
function
|
|
783
|
-
function
|
|
784
|
-
function
|
|
777
|
+
mt.prototype.createMediaKeys=function(){var a=new lt(this.keySystem);return Promise.resolve(a)};mt.prototype.getConfiguration=function(){return this.g};function lt(a){this.g=new WebKitMediaKeys(a);this.h=new ef}lt.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new qt(this.g,a)};lt.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
|
|
778
|
+
function ot(a,b){a.h.ob();if(!b)return Promise.resolve();a.h.B(b,"webkitneedkey",pt);try{return xi(b,HTMLMediaElement.HAVE_METADATA,a.h,function(){b.webkitSetMediaKeys(a.g)}),Promise.resolve()}catch(c){return Promise.reject(c)}}function qt(a){Xg.call(this);this.j=null;this.l=a;this.i=this.g=null;this.h=new ef;this.sessionId="";this.expiration=NaN;this.closed=new De;this.keyStatuses=new rt}ra(qt,Xg);q=qt.prototype;
|
|
779
|
+
q.generateRequest=function(a,b){var c=this;this.g=new De;try{var d=this.l.createSession("video/mp4",qb(b));this.j=d;this.sessionId=d.sessionId||"";this.h.B(this.j,"webkitkeymessage",function(e){c.g&&(c.g.resolve(),c.g=null);e=(new Map).set("messageType",void 0==c.keyStatuses.g?"license-request":"license-renewal").set("message",rb(e.message));e=new R("message",e);c.dispatchEvent(e)});this.h.B(d,"webkitkeyadded",function(){c.i&&(st(c,"usable"),c.i.resolve(),c.i=null)});this.h.B(d,"webkitkeyerror",function(){var e=
|
|
780
|
+
Error("EME PatchedMediaKeysApple key error");e.errorCode=c.j.error;if(null!=c.g)c.g.reject(e),c.g=null;else if(null!=c.i)c.i.reject(e),c.i=null;else switch(c.j.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:st(c,"output-not-allowed");break;default:st(c,"internal-error")}});st(this,"status-pending")}catch(e){this.g.reject(e)}return this.g};q.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
|
|
781
|
+
q.update=function(a){this.i=new De;try{this.j.update(qb(a))}catch(b){this.i.reject(b)}return this.i};q.close=function(){try{this.j.close(),this.closed.resolve(),this.h.ob()}catch(a){this.closed.reject(a)}return this.closed};q.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function st(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;c=new R("keystatuseschange");a.dispatchEvent(c)}
|
|
782
|
+
function rt(){this.size=0;this.g=void 0}q=rt.prototype;q.forEach=function(a){this.g&&a(this.g,hi.value())};q.get=function(a){if(this.has(a))return this.g};q.has=function(a){var b=hi.value();return this.g&&ob(a,b)?!0:!1};q.entries=function(){};q.keys=function(){};q.values=function(){};Js(jt);function tt(){}function ut(){!window.HTMLVideoElement||!window.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,window.MediaKeys=vt,window.MediaKeySystemAccess=wt,navigator.requestMediaKeySystemAccess=xt,HTMLMediaElement.prototype.setMediaKeys=yt)}function xt(a,b){try{var c=new wt(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}
|
|
783
|
+
function zt(a){if(a.initData){var b=new CustomEvent("encrypted");b.initDataType="cenc";b.initData=rb(zn(a.initData));this.dispatchEvent(b)}}Is.PatchedMediaKeysMs=tt;tt.install=ut;
|
|
784
|
+
function wt(a,b){this.keySystem=a;for(var c=!1,d=t(b),e=d.next();!e.done;e=d.next()){e=e.value;var f={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label},g=!1;if(e.audioCapabilities)for(var h=t(e.audioCapabilities),k=h.next();!k.done;k=h.next())k=k.value,k.contentType&&(g=!0,MSMediaKeys.isTypeSupported(this.keySystem,k.contentType.split(";")[0])&&(f.audioCapabilities.push(k),c=
|
|
785
785
|
!0));if(e.videoCapabilities)for(h=t(e.videoCapabilities),k=h.next();!k.done;k=h.next())k=k.value,k.contentType&&(g=!0,MSMediaKeys.isTypeSupported(this.keySystem,k.contentType.split(";")[0])&&(f.videoCapabilities.push(k),c=!0));g||(c=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));"required"==e.persistentState&&(c=!1);if(c){this.g=f;return}}c=Error("Unsupported keySystem");c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
function
|
|
789
|
-
q.generateRequest=function(a,b){var c=this;this.g=new De;try{this.j=this.l.createSession("video/mp4",qb(b),null),this.h.B(this.j,"mskeymessage",function(d){c.g&&(c.g.resolve(),c.g=null);d=(new Map).set("messageType",void 0==c.keyStatuses.g?"license-request":"license-renewal").set("message",rb(d.message));d=new R("message",d);c.dispatchEvent(d)}),this.h.B(this.j,"mskeyadded",function(){c.g?(
|
|
790
|
-
function(){var d=Error("EME PatchedMediaKeysMs key error");d.errorCode=c.j.error;if(null!=c.g)c.g.reject(d),c.g=null;else if(null!=c.i)c.i.reject(d),c.i=null;else switch(c.j.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:
|
|
791
|
-
q.update=function(a){this.i=new De;try{this.j.update(qb(a))}catch(b){this.i.reject(b)}return this.i};q.close=function(){try{this.j.close(),this.closed.resolve(),this.h.ob()}catch(a){this.closed.reject(a)}return this.closed};q.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function
|
|
792
|
-
function
|
|
793
|
-
function
|
|
794
|
-
function
|
|
795
|
-
function
|
|
786
|
+
wt.prototype.createMediaKeys=function(){var a=new vt(this.keySystem);return Promise.resolve(a)};wt.prototype.getConfiguration=function(){return this.g};function yt(a){var b=this.mediaKeys;b&&b!=a&&At(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?At(a,this):Promise.resolve()}function vt(a){this.g=new MSMediaKeys(a);this.h=new ef}
|
|
787
|
+
vt.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");return new Bt(this.g,a)};vt.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function At(a,b){a.h.ob();if(!b)return Promise.resolve();a.h.B(b,"msneedkey",zt);try{return xi(b,HTMLMediaElement.HAVE_METADATA,a.h,function(){b.msSetMediaKeys(a.g)}),Promise.resolve()}catch(c){return Promise.reject(c)}}
|
|
788
|
+
function Bt(a){Xg.call(this);this.j=null;this.l=a;this.i=this.g=null;this.h=new ef;this.sessionId="";this.expiration=NaN;this.closed=new De;this.keyStatuses=new Ct}ra(Bt,Xg);q=Bt.prototype;
|
|
789
|
+
q.generateRequest=function(a,b){var c=this;this.g=new De;try{this.j=this.l.createSession("video/mp4",qb(b),null),this.h.B(this.j,"mskeymessage",function(d){c.g&&(c.g.resolve(),c.g=null);d=(new Map).set("messageType",void 0==c.keyStatuses.g?"license-request":"license-renewal").set("message",rb(d.message));d=new R("message",d);c.dispatchEvent(d)}),this.h.B(this.j,"mskeyadded",function(){c.g?(Dt(c,"usable"),c.g.resolve(),c.g=null):c.i&&(Dt(c,"usable"),c.i.resolve(),c.i=null)}),this.h.B(this.j,"mskeyerror",
|
|
790
|
+
function(){var d=Error("EME PatchedMediaKeysMs key error");d.errorCode=c.j.error;if(null!=c.g)c.g.reject(d),c.g=null;else if(null!=c.i)c.i.reject(d),c.i=null;else switch(c.j.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:Dt(c,"output-not-allowed");break;default:Dt(c,"internal-error")}}),Dt(this,"status-pending")}catch(d){this.g.reject(d)}return this.g};q.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
|
|
791
|
+
q.update=function(a){this.i=new De;try{this.j.update(qb(a))}catch(b){this.i.reject(b)}return this.i};q.close=function(){try{this.j.close(),this.closed.resolve(),this.h.ob()}catch(a){this.closed.reject(a)}return this.closed};q.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function Dt(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;c=new R("keystatuseschange");a.dispatchEvent(c)}
|
|
792
|
+
function Ct(){this.size=0;this.g=void 0}q=Ct.prototype;q.forEach=function(a){this.g&&a(this.g,hi.value())};q.get=function(a){if(this.has(a))return this.g};q.has=function(a){var b=hi.value();return this.g&&ob(a,b)?!0:!1};q.entries=function(){};q.keys=function(){};q.values=function(){};Js(ut);function Et(){}function Ft(){!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=Gt,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ht,window.MediaKeys=It,window.MediaKeySystemAccess=Jt)}function Gt(){return Promise.reject(Error("The key system specified is not supported."))}
|
|
793
|
+
function Ht(a){return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}Is.PatchedMediaKeysNop=Et;Et.install=Ft;function It(){throw new TypeError("Illegal constructor.");}It.prototype.createSession=function(){};It.prototype.setServerCertificate=function(){};function Jt(){this.keySystem="";throw new TypeError("Illegal constructor.");}Jt.prototype.getConfiguration=function(){};Jt.prototype.createMediaKeys=function(){};Js(Ft,-10);function Kt(){}function Lt(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)Mt="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=Nt;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=Ot;window.MediaKeys=Pt;window.MediaKeySystemAccess=Qt}}
|
|
794
|
+
function Rt(a){var b=Mt;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function Nt(a,b){try{var c=new Qt(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function Ot(a){var b=this.mediaKeys;b&&b!=a&&St(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&St(a,this);return Promise.resolve()}Is.PatchedMediaKeysWebkit=Kt;Kt.install=Lt;
|
|
795
|
+
function Qt(a,b){this.g=this.keySystem=a;var c=!1;"org.w3.clearkey"==a&&(this.g="webkit-org.w3.clearkey",c=!1);var d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");for(var f=t(b),g=f.next();!g.done;g=f.next()){g=g.value;var h={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:g.initDataTypes,sessionTypes:["temporary"],label:g.label},k=!1;if(g.audioCapabilities)for(var l=t(g.audioCapabilities),
|
|
796
796
|
m=l.next();!m.done;m=l.next())m=m.value,m.contentType&&(k=!0,e.canPlayType(m.contentType.split(";")[0],this.g)&&(h.audioCapabilities.push(m),d=!0));if(g.videoCapabilities)for(l=t(g.videoCapabilities),m=l.next();!m.done;m=l.next())m=m.value,m.contentType&&(k=!0,e.canPlayType(m.contentType,this.g)&&(h.videoCapabilities.push(m),d=!0));k||(d=e.canPlayType("video/mp4",this.g)||e.canPlayType("video/webm",this.g));"required"==g.persistentState&&(c?(h.persistentState="required",h.sessionTypes=["persistent-license"]):
|
|
797
|
-
d=!1);if(d){this.h=h;return}}c="Unsupported keySystem";if("org.w3.clearkey"==a||"com.widevine.alpha"==a)c="None of the requested configurations were supported.";c=Error(c);c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}
|
|
798
|
-
function
|
|
799
|
-
d.g&&d.g.resolve(),d.g=null}),a.h.B(b,c+"keyerror",function(d){var e=
|
|
800
|
-
function
|
|
801
|
-
q.handleError=function(a){var b=Error("EME v0.1b key error"),c=a.errorCode;c.systemCode=a.systemCode;b.errorCode=c;!a.sessionId&&this.h?(45==a.systemCode&&(b.message="Unsupported session type."),this.h.reject(b),this.h=null):a.sessionId&&this.g?(this.g.reject(b),this.g=null):(b=a.systemCode,a.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?
|
|
802
|
-
function
|
|
803
|
-
function
|
|
804
|
-
function
|
|
805
|
-
q.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=
|
|
806
|
-
q.has=function(a){var b=
|
|
807
|
-
function
|
|
808
|
-
function
|
|
809
|
-
function
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
function
|
|
820
|
-
f))a.backgroundColor=g;if(g=
|
|
821
|
-
d=d.textContent.trim();"PNG"==g&&"Base64"==h&&d&&(a.backgroundImage="data:image/png;base64,"+d)}(d=
|
|
822
|
-
function
|
|
823
|
-
a.textDecoration.push("overline");break;case "noOverline":a.textDecoration.includes("overline")&&uc(a.textDecoration,"overline")}}function
|
|
824
|
-
function
|
|
825
|
-
function
|
|
826
|
-
function
|
|
827
|
-
function
|
|
828
|
-
function
|
|
829
|
-
var
|
|
830
|
-
{left:"line-left",center:"center",right:"line-right"},
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
[];e=t(d[0].split("\n"));for(var g=e.next();!g.done;g=e.next())if(g=g.value,/^Region:/.test(g)){g=new
|
|
834
|
-
(l.viewportAnchorX=Number(k[1]),l.viewportAnchorY=Number(k[2])):/^scroll=up$/.exec(m)&&(l.scroll="up");
|
|
797
|
+
d=!1);if(d){this.h=h;return}}c="Unsupported keySystem";if("org.w3.clearkey"==a||"com.widevine.alpha"==a)c="None of the requested configurations were supported.";c=Error(c);c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}Qt.prototype.createMediaKeys=function(){var a=new Pt(this.g);return Promise.resolve(a)};Qt.prototype.getConfiguration=function(){return this.h};function Pt(a){this.l=a;this.g=null;this.h=new ef;this.i=[];this.j=new Map}
|
|
798
|
+
function St(a,b){a.g=b;a.h.ob();var c=Mt;b&&(a.h.B(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=rb(d.initData);a.g.dispatchEvent(e)}),a.h.B(b,c+"keymessage",function(d){var e=Tt(a,d.sessionId);e&&(d=(new Map).set("messageType",void 0==e.keyStatuses.g?"licenserequest":"licenserenewal").set("message",d.message),d=new R("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.h.B(b,c+"keyadded",function(d){if(d=Tt(a,d.sessionId))Ut(d,"usable"),
|
|
799
|
+
d.g&&d.g.resolve(),d.g=null}),a.h.B(b,c+"keyerror",function(d){var e=Tt(a,d.sessionId);e&&e.handleError(d)}))}Pt.prototype.createSession=function(a){a=a||"temporary";if("temporary"!=a&&"persistent-license"!=a)throw new TypeError("Session type "+a+" is unsupported on this platform.");var b=this.g||document.createElement("video");b.src||(b.src="about:blank");a=new Vt(b,this.l,a);this.i.push(a);return a};Pt.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
|
|
800
|
+
function Tt(a,b){var c=a.j.get(b);return c?c:(c=a.i.shift())?(c.sessionId=b,a.j.set(b,c),c):null}function Vt(a,b,c){Xg.call(this);this.j=a;this.m=!1;this.g=this.h=null;this.i=b;this.l=c;this.sessionId="";this.expiration=NaN;this.closed=new De;this.keyStatuses=new Wt}ra(Vt,Xg);q=Vt.prototype;
|
|
801
|
+
q.handleError=function(a){var b=Error("EME v0.1b key error"),c=a.errorCode;c.systemCode=a.systemCode;b.errorCode=c;!a.sessionId&&this.h?(45==a.systemCode&&(b.message="Unsupported session type."),this.h.reject(b),this.h=null):a.sessionId&&this.g?(this.g.reject(b),this.g=null):(b=a.systemCode,a.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Ut(this,"output-restricted"):1==b?Ut(this,"expired"):Ut(this,"internal-error"))};
|
|
802
|
+
function Xt(a,b,c){if(a.m)return Promise.reject(Error("The session is already initialized."));a.m=!0;try{if("persistent-license"==a.l)if(c)var d=qb(Ab("LOAD_SESSION|"+c));else{var e=Ab("PERSISTENT|");d=oc(e,b)}else d=qb(b)}catch(g){return Promise.reject(g)}a.h=new De;var f=Rt("generateKeyRequest");try{a.j[f](a.i,d)}catch(g){if("InvalidStateError"!=g.name)return a.h=null,Promise.reject(g);(new P(function(){try{a.j[f](a.i,d)}catch(h){a.h.reject(h),a.h=null}})).V(.01)}return a.h}
|
|
803
|
+
function Yt(a,b,c){if(a.g)a.g.then(function(){return Yt(a,b,c)})["catch"](function(){return Yt(a,b,c)});else{a.g=b;if("webkit-org.w3.clearkey"==a.i){var d=wb(c);var e=JSON.parse(d);"oct"!=e.keys[0].kty&&(a.g.reject(Error("Response is not a valid JSON Web Key Set.")),a.g=null);d=lc(e.keys[0].k);e=lc(e.keys[0].kid)}else d=qb(c),e=null;var f=Rt("addKey");try{a.j[f](a.i,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}}
|
|
804
|
+
function Ut(a,b){var c=a.keyStatuses;c.size=void 0==b?0:1;c.g=b;c=new R("keystatuseschange");a.dispatchEvent(c)}q.generateRequest=function(a,b){return Xt(this,b,null)};q.load=function(a){return"persistent-license"==this.l?Xt(this,null,a):Promise.reject(Error("Not a persistent session."))};q.update=function(a){var b=new De;Yt(this,b,a);return b};
|
|
805
|
+
q.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var a=Rt("cancelKeyRequest");try{this.j[a](this.i,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed};q.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()};function Wt(){this.size=0;this.g=void 0}q=Wt.prototype;q.forEach=function(a){this.g&&a(this.g,hi.value())};q.get=function(a){if(this.has(a))return this.g};
|
|
806
|
+
q.has=function(a){var b=hi.value();return this.g&&ob(a,b)?!0:!1};q.entries=function(){};q.keys=function(){};q.values=function(){};var Mt="";Js(Lt);function Zt(){}function $t(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=au,Object.defineProperty(a,"disablePictureInPicture",{get:bu,set:cu,enumerable:!0,configurable:!0}),document.exitPictureInPicture=du,document.addEventListener("webkitpresentationmodechanged",eu,!0))}}
|
|
807
|
+
function eu(a){a=a.target;if("picture-in-picture"==a.webkitPresentationMode){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement==a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)}
|
|
808
|
+
function au(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function du(){var a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}
|
|
809
|
+
function bu(){return this.hasAttribute("disablePictureInPicture")?!0:!this.webkitSupportsPresentationMode("picture-in-picture")}function cu(a){a?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}Is.PiPWebkit=Zt;Zt.install=$t;Js($t);function fu(){}function gu(){navigator.storage&&navigator.storage.estimate||!navigator.webkitTemporaryStorage||!navigator.webkitTemporaryStorage.queryUsageAndQuota||("storage"in navigator||(navigator.storage={}),navigator.storage.estimate=hu)}function hu(){return new Promise(function(a,b){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(c,d){a({usage:c,quota:d})},b)})}Is.StorageEstimate=fu;fu.install=gu;Js(gu);function iu(){}function ju(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b["catch"](function(){});return b}}}Is.VideoPlayPromise=iu;iu.install=ju;Js(ju);function ku(){}function lu(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=mu)}}function mu(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}Is.VideoPlaybackQuality=ku;ku.install=lu;Js(lu);function nu(){}function ou(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(3==b)a=pu;else if(6==b)a=qu;else{try{var c=!!pu(1,2,"")}catch(d){c=!1}c&&(a=pu)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function pu(a,b,c){return new window.TextTrackCue(a,b,c)}function qu(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}Is.VTTCue=nu;nu.install=ou;Js(ou);function ru(){}ru.prototype.parseInit=function(){};ru.prototype.parseMedia=function(a,b){var c=null,d=[],e=wb(a).split(/\r?\n/);e=t(e);for(var f=e.next();!f.done;f=e.next())if((f=f.value)&&!/^\s+$/.test(f)&&(f=su.exec(f))){var g=tu.exec(f[1]);g=60*parseInt(g[1],10)+parseFloat(g[2].replace(",","."));f=new xc(g,b.segmentEnd?b.segmentEnd:g+2,f[2]);c&&(c.endTime=g,d.push(c));c=f}c&&d.push(c);return d};M("shaka.text.LrcTextParser",ru);ru.prototype.parseMedia=ru.prototype.parseMedia;
|
|
810
|
+
ru.prototype.parseInit=ru.prototype.parseInit;var su=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,tu=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;Ue["application/x-subtitle-lrc"]=function(){return new ru};function uu(){}uu.prototype.parseInit=function(){};
|
|
811
|
+
uu.prototype.parseMedia=function(a,b){var c=wb(a),d=[],e=new DOMParser,f=null;if(""==c)return d;try{f=e.parseFromString(c,"text/xml")}catch(D){throw new N(2,2,2005,"Failed to parse TTML.");}if(f){if(c=f.getElementsByTagName("parsererror")[0])throw new N(2,2,2005,c.textContent);var g=f.getElementsByTagName("tt")[0];if(!g)throw new N(2,2,2005,"TTML does not contain <tt> tag.");f=g.getElementsByTagName("body")[0];if(!f)return[];var h=Gn(g,vu,"frameRate"),k=Gn(g,vu,"subFrameRate"),l=Gn(g,vu,"frameRateMultiplier"),
|
|
812
|
+
m=Gn(g,vu,"tickRate"),n=Gn(g,vu,"cellResolution");c=g.getAttribute("xml:space")||"default";e=Gn(g,wu,"extent");if("default"!=c&&"preserve"!=c)throw new N(2,2,2005,"Invalid xml:space value: "+c);c="default"==c;h=new xu(h,k,l,m);n=n?(n=/^(\d+) (\d+)$/.exec(n))?{columns:parseInt(n[1],10),rows:parseInt(n[2],10)}:null:null;k=(k=g.getElementsByTagName("metadata")[0])?En(k):[];l=Array.from(g.getElementsByTagName("style"));g=Array.from(g.getElementsByTagName("region"));m=[];for(var p=t(g),r=p.next();!r.done;r=
|
|
813
|
+
p.next()){var u=r.value;r=new zc;var x=u.getAttribute("xml:id");if(x){r.id=x;var w=null;e&&(w=yu.exec(e)||zu.exec(e));x=w?Number(w[1]):null;w=w?Number(w[2]):null;var y,C;if(y=Au(u,l,"extent"))y=(C=yu.exec(y))||zu.exec(y),null!=y&&(r.width=Number(y[1]),r.height=Number(y[2]),C||(null!=x&&(r.width=100*r.width/x),null!=w&&(r.height=100*r.height/w)),r.widthUnits=C||null!=x?Pc:0,r.heightUnits=C||null!=w?Pc:0);if(u=Au(u,l,"origin"))y=(C=yu.exec(u))||zu.exec(u),null!=y&&(r.viewportAnchorX=Number(y[1]),r.viewportAnchorY=
|
|
814
|
+
Number(y[2]),C||(null!=w&&(r.viewportAnchorY=100*r.viewportAnchorY/w),null!=x&&(r.viewportAnchorX=100*r.viewportAnchorX/x)),r.viewportAnchorUnits=C||null!=x?Pc:0)}else r=null;r&&m.push(r)}if(Bn(f,"p").length)throw new N(2,2,2001,"<p> can only be inside <div> in TTML");e=t(Bn(f,"div"));for(p=e.next();!p.done;p=e.next())if(Bn(p.value,"span").length)throw new N(2,2,2001,"<span> can only be inside <p> in TTML");(f=Bu(f,b.periodStart,h,k,l,g,m,c,n,null,!1))&&d.push(f)}return d};
|
|
815
|
+
function Bu(a,b,c,d,e,f,g,h,k,l,m){var n=a.parentNode;if(a.nodeType==Node.COMMENT_NODE)return null;if(a.nodeType==Node.TEXT_NODE){if(!m)return null;var p=document.createElement("span");p.textContent=a.textContent}else p=a;for(var r=null,u=t(Cu),x=u.next();!x.done&&!(r=Du(p,"backgroundImage",d,"#",x.value)[0]);x=u.next());u=m;if("p"==a.nodeName||r)m=!0;h="default"==(p.getAttribute("xml:space")||(h?"default":"preserve"));x=Array.from(p.childNodes).every(function(A){return A.nodeType==Node.TEXT_NODE});
|
|
816
|
+
a=[];if(!x)for(var w=t(p.childNodes),y=w.next();!y.done;y=w.next())(y=Bu(y.value,b,c,d,e,f,g,h,k,p,m))&&a.push(y);d=null!=l;w=/\S/.test(p.textContent);var C=p.hasAttribute("begin")||p.hasAttribute("end")||p.hasAttribute("dur");if(!(C||w||"br"==p.tagName||0!=a.length||d&&!h))return null;y=Eu(p,c);w=y.start;for(y=y.end;n&&n.nodeType==Node.ELEMENT_NODE&&"tt"!=n.tagName;)y=Fu(n,c,w,y),w=y.start,y=y.end,n=n.parentNode;null==w&&(w=0);w+=b;y=null==y?Infinity:y+b;if(!C&&0<a.length)for(w=Infinity,y=0,b=t(a),
|
|
817
|
+
c=b.next();!c.done;c=b.next())c=c.value,w=Math.min(w,c.startTime),y=Math.max(y,c.endTime);if("br"==p.tagName)return e=new xc(w,y,""),e.lineBreak=!0,e;b="";x&&(b=p.textContent,h&&(b=b.trim(),b=b.replace(/\s+/g," ")));b=new xc(w,y,b);b.nestedCues=a;m||(b.isContainer=!0);k&&(b.cellResolution=k);k=Du(p,"region",f,"")[0];if(p.hasAttribute("region")&&k&&k.getAttribute("xml:id")){var D=k.getAttribute("xml:id");b.region=g.filter(function(A){return A.id==D})[0]}g=k;l&&d&&!p.getAttribute("region")&&!p.getAttribute("style")&&
|
|
818
|
+
(g=Du(l,"region",f,"")[0]);Gu(b,p,g,r,e,u,0==a.length);return b}
|
|
819
|
+
function Gu(a,b,c,d,e,f,g){f=f||g;"rtl"==Hu(b,c,e,"direction",f)&&(a.direction="rtl");g=Hu(b,c,e,"writingMode",f);"tb"==g||"tblr"==g?a.writingMode="vertical-lr":"tbrl"==g?a.writingMode="vertical-rl":"rltb"==g||"rl"==g?a.direction="rtl":g&&(a.direction=yc);(g=Hu(b,c,e,"textAlign",!0))?(a.positionAlign=Iu[g],a.lineAlign=Ju[g],a.textAlign=Jc[g.toUpperCase()]):a.textAlign="start";if(g=Hu(b,c,e,"displayAlign",!0))a.displayAlign=Kc[g.toUpperCase()];if(g=Hu(b,c,e,"color",f))a.color=g;if(g=Hu(b,c,e,"backgroundColor",
|
|
820
|
+
f))a.backgroundColor=g;if(g=Hu(b,c,e,"border",f))a.border=g;if(g=Hu(b,c,e,"fontFamily",f))a.fontFamily=g;(g=Hu(b,c,e,"fontWeight",f))&&"bold"==g&&(a.fontWeight=700);g=Hu(b,c,e,"wrapOption",f);a.wrapLine=g&&"noWrap"==g?!1:!0;(g=Hu(b,c,e,"lineHeight",f))&&g.match(Ku)&&(a.lineHeight=g);(g=Hu(b,c,e,"fontSize",f))&&(g.match(Ku)||g.match(Lu))&&(a.fontSize=g);if(g=Hu(b,c,e,"fontStyle",f))a.fontStyle=Oc[g.toUpperCase()];if(d){g=d.getAttribute("imageType")||d.getAttribute("imagetype");var h=d.getAttribute("encoding");
|
|
821
|
+
d=d.textContent.trim();"PNG"==g&&"Base64"==h&&d&&(a.backgroundImage="data:image/png;base64,"+d)}(d=Hu(b,c,e,"letterSpacing",f))&&d.match(Ku)&&(a.letterSpacing=d);(d=Hu(b,c,e,"linePadding",f))&&d.match(Ku)&&(a.linePadding=d);if(f=Hu(b,c,e,"opacity",f))a.opacity=parseFloat(f);(c=Au(c,e,"textDecoration"))&&Mu(a,c);(b=Nu(b,e,"textDecoration"))&&Mu(a,b)}
|
|
822
|
+
function Mu(a,b){for(var c=t(b.split(" ")),d=c.next();!d.done;d=c.next())switch(d.value){case "underline":a.textDecoration.includes("underline")||a.textDecoration.push("underline");break;case "noUnderline":a.textDecoration.includes("underline")&&uc(a.textDecoration,"underline");break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&uc(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||
|
|
823
|
+
a.textDecoration.push("overline");break;case "noOverline":a.textDecoration.includes("overline")&&uc(a.textDecoration,"overline")}}function Hu(a,b,c,d,e){e=void 0===e?!0:e;return(a=Nu(a,c,d))?a:e?Au(b,c,d):null}function Au(a,b,c){if(!a)return null;var d=Gn(a,wu,c);return d?d:Ou(a,b,c)}function Nu(a,b,c){var d=Gn(a,wu,c);return d?d:Ou(a,b,c)}
|
|
824
|
+
function Ou(a,b,c){a=Du(a,"style",b,"");for(var d=null,e=0;e<a.length;e++){var f=Fn(a[e],"urn:ebu:tt:style",c);f||(f=Gn(a[e],wu,c));f||(f=Nu(a[e],b,c));f&&(d=f)}return d}
|
|
825
|
+
function Du(a,b,c,d,e){var f=[];if(!a||1>c.length)return f;var g=a;for(a=null;g&&!(a=e?Fn(g,e,b):g.getAttribute(b))&&(g=g.parentNode,g instanceof Element););if(b=a)for(b=t(b.split(" ")),e=b.next();!e.done;e=b.next())for(e=e.value,a=t(c),g=a.next();!g.done;g=a.next())if(g=g.value,d+g.getAttribute("xml:id")==e){f.push(g);break}return f}function Fu(a,b,c,d){a=Eu(a,b);null==c?c=a.start:null!=a.start&&(c+=a.start);null==d?d=a.end:null!=a.start&&(d+=a.start);return{start:c,end:d}}
|
|
826
|
+
function Eu(a,b){var c=Pu(a.getAttribute("begin"),b),d=Pu(a.getAttribute("end"),b),e=Pu(a.getAttribute("dur"),b);null==d&&null!=e&&(d=c+e);return{start:c,end:d}}
|
|
827
|
+
function Pu(a,b){var c=null;if(Qu.test(a)){c=Qu.exec(a);var d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]);g+=(Number(c[5])||0)/b.h;f+=g/b.frameRate;c=f+60*e+3600*d}else if(Ru.test(a))c=Su(Ru,a);else if(Tu.test(a))c=Su(Tu,a);else if(Uu.test(a))c=Uu.exec(a),c=Number(c[1])/b.frameRate;else if(Vu.test(a))c=Vu.exec(a),c=Number(c[1])/b.g;else if(Wu.test(a))c=Su(Wu,a);else if(a)throw new N(2,2,2001,"Could not parse cue time range in TTML");return c}
|
|
828
|
+
function Su(a,b){var c=a.exec(b);return null==c||""==c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)}M("shaka.text.TtmlTextParser",uu);uu.prototype.parseMedia=uu.prototype.parseMedia;uu.prototype.parseInit=uu.prototype.parseInit;function xu(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);0==this.g&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))}
|
|
829
|
+
var yu=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Lu=/^(\d{1,2}(?:\.\d+)?|100)%$/,Ku=/^(\d+px|\d+em|\d*\.?\d+c)$/,zu=/^(\d+)px (\d+)px$/,Qu=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ru=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Tu=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Uu=/^(\d*(?:\.\d*)?)f$/,Vu=/^(\d*(?:\.\d*)?)t$/,Wu=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Ju={left:Ec,center:"center",right:"end",start:Ec,end:"end"},Iu=
|
|
830
|
+
{left:"line-left",center:"center",right:"line-right"},vu=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],wu=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],Cu=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Ue["application/ttml+xml"]=function(){return new uu};function Xu(){this.s=new uu}Xu.prototype.parseInit=function(a){var b=!1;(new Ob).box("moov",Sb).box("trak",Sb).box("mdia",Sb).box("minf",Sb).box("stbl",Sb).U("stsd",Ub).box("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new N(2,2,2007);};Xu.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[];(new Ob).box("mdat",Vb(function(f){d=!0;e=e.concat(c.s.parseMedia(f,b))})).parse(a,!1);if(!d)throw new N(2,2,2007);return e};M("shaka.text.Mp4TtmlParser",Xu);Xu.prototype.parseMedia=Xu.prototype.parseMedia;
|
|
831
|
+
Xu.prototype.parseInit=Xu.prototype.parseInit;Ue['application/mp4; codecs="stpp"']=function(){return new Xu};Ue['application/mp4; codecs="stpp.ttml"']=function(){return new Xu};Ue['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new Xu};Ue['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new Xu};function Yu(){}Yu.prototype.parseInit=function(){};
|
|
832
|
+
Yu.prototype.parseMedia=function(a,b){var c=wb(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new N(2,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Zu(new Sp(e[1]));if(null==c)throw new N(2,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+f/9E4-c}}f=
|
|
833
|
+
[];e=t(d[0].split("\n"));for(var g=e.next();!g.done;g=e.next())if(g=g.value,/^Region:/.test(g)){g=new Sp(g);var h=new zc;Vp(g);Tp(g);for(var k=Vp(g);k;){var l=h,m=k;(k=/^id=(.*)$/.exec(m))?l.id=k[1]:(k=/^width=(\d{1,2}|100)%$/.exec(m))?l.width=Number(k[1]):(k=/^lines=(\d+)$/.exec(m))?(l.height=Number(k[1]),l.heightUnits=2):(k=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(m))?(l.regionAnchorX=Number(k[1]),l.regionAnchorY=Number(k[2])):(k=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(m))?
|
|
834
|
+
(l.viewportAnchorX=Number(k[1]),l.viewportAnchorY=Number(k[2])):/^scroll=up$/.exec(m)&&(l.scroll="up");Tp(g);k=Vp(g)}f.push(h)}e=new Map;$u(e);g=[];d=t(d.slice(1));for(h=d.next();!h.done;h=d.next()){h=h.value.split("\n");if((1!=h.length||h[0])&&!/^NOTE($|[ \t])/.test(h[0])&&"STYLE"==h[0]&&h[1].includes("::cue")){l="global";(k=h[1].match(/\((.*)\)/))&&(l=k.pop());k=h.slice(2,-1);h[1].includes("}")&&(m=/\{(.*?)\}/.exec(h[1]))&&(k=m[1].split(";"));m=new xc(0,0,"");for(var n=!1,p=0;p<k.length;p++){var r=
|
|
835
835
|
/^\s*([^:]+):\s*(.*)/.exec(k[p]);if(r){var u=r[2].trim().replace(";","");switch(r[1].trim()){case "background-color":n=!0;m.backgroundColor=u;break;case "color":n=!0;m.color=u;break;case "font-family":n=!0;m.fontFamily=u;break;case "font-size":n=!0;m.fontSize=u;break;case "font-weight":700<=parseInt(u,10)&&(n=!0,m.fontWeight=700);break;case "font-style":switch(u){case "normal":n=!0;m.fontStyle=Hc;break;case "italic":n=!0;m.fontStyle="italic";break;case "oblique":n=!0,m.fontStyle="oblique"}break;case "opacity":n=
|
|
836
|
-
!0;m.opacity=parseFloat(u);break;case "white-space":n=!0,m.wrapLine="noWrap"!=u}}}n&&e.set(l,m)}p=c;if(1==h.length&&!h[0]||/^NOTE($|[ \t])/.test(h[0])||"STYLE"==h[0])h=null;else{l=null;h[0].includes("--\x3e")||(l=h[0],h.splice(0,1));k=new
|
|
837
|
-
""):h=new xc(m,n,"");
|
|
838
|
-
function
|
|
839
|
-
function
|
|
840
|
-
function
|
|
841
|
-
"italic";break;case "u":e.textDecoration.push("underline")}}if(
|
|
842
|
-
function
|
|
843
|
-
b?"line-right":"center");else if(d=/^region:(.*)$/.exec(b)){if(b
|
|
844
|
-
function
|
|
845
|
-
|
|
846
|
-
c+r.Mc:m;m=x+(u||0);var w=0;do{var y=n.N();w+=y;var C=n.N(),D=null;"vttc"==Wb(C)?8<y&&(D=n.bb(y-8)):n.skip(y-8);u&&D&&(y=
|
|
847
|
-
function
|
|
848
|
-
function
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
[];b=null;e={};c=t(c.split(/\r?\n/));for(f=c.next();!f.done;e={bd:e.bd},f=c.next())if(f=f.value,!/^\s*;/.test(f)&&(g=
|
|
852
|
-
function
|
|
836
|
+
!0;m.opacity=parseFloat(u);break;case "white-space":n=!0,m.wrapLine="noWrap"!=u}}}n&&e.set(l,m)}p=c;if(1==h.length&&!h[0]||/^NOTE($|[ \t])/.test(h[0])||"STYLE"==h[0])h=null;else{l=null;h[0].includes("--\x3e")||(l=h[0],h.splice(0,1));k=new Sp(h[0]);m=Zu(k);r=Up(k,/[ \t]+--\x3e[ \t]+/g);n=Zu(k);if(null==m||null==r||null==n)throw new N(2,2,2001,"Could not parse cue time range in WebVTT");m+=p;n+=p;p=h.slice(1).join("\n").trim();e.has("global")?(h=e.get("global").clone(),h.startTime=m,h.endTime=n,h.payload=
|
|
837
|
+
""):h=new xc(m,n,"");av(p,h,e);Tp(k);for(m=Vp(k);m;)bv(h,m,f),Tp(k),m=Vp(k);null!=l&&(h.id=l)}h&&g.push(h)}return g};function $u(a){for(var b=t(Object.entries(Mc)),c=b.next();!c.done;c=b.next()){var d=t(c.value);c=d.next().value;d=d.next().value;var e=new xc(0,0,"");e.color=d;a.set(c,e)}b=t(Object.entries(Nc));for(c=b.next();!c.done;c=b.next())d=t(c.value),c=d.next().value,d=d.next().value,e=new xc(0,0,""),e.backgroundColor=d,a.set(c,e)}
|
|
838
|
+
function av(a,b,c){0===c.size&&$u(c);a=cv(a);var d=Sn("<span>"+a+"</span>","span");if(d){var e=[];d=d.childNodes;if(1==d.length){var f=d[0];if(f.nodeType==Node.TEXT_NODE||f.nodeType==Node.CDATA_SECTION_NODE){b.payload=a;return}}a=t(d);for(d=a.next();!d.done;d=a.next())dv(d.value,b,e,c);b.nestedCues=e}else b.payload=a}
|
|
839
|
+
function cv(a){for(var b=[],c=-1,d="",e=0;e<a.length;e++)if("/"===a[e]){var f=a.indexOf(">",e);if(f<=e)return a;f=a.substring(e+1,f);var g=b.pop();if(f&&g){if(g===f)d+="/"+f+">";else{if(!g.startsWith("c.")||"c"!==f)return a;d+="/"+g+">"}e+=f.length+1}else return a}else"<"===a[e]?c=e+1:">"===a[e]&&0<c&&(b.push(a.substr(c,e-c)),c=-1),d+=a[e];return d}function ev(a,b){return a&&0<a.length?a:b}
|
|
840
|
+
function dv(a,b,c,d){var e=b.clone();if(a.nodeType===Node.ELEMENT_NODE&&a.nodeName)for(var f=t(a.nodeName.split(/[ .]+/)),g=f.next();!g.done;g=f.next()){g=g.value;if(d.has(g)){var h=d.get(g);h&&(e.backgroundColor=ev(h.backgroundColor,e.backgroundColor),e.color=ev(h.color,e.color),e.fontFamily=ev(h.fontFamily,e.fontFamily),e.fontSize=ev(h.fontSize,e.fontSize),e.fontWeight=h.fontWeight,e.fontStyle=h.fontStyle,e.opacity=h.opacity,e.wrapLine=h.wrapLine)}switch(g){case "b":e.fontWeight=700;break;case "i":e.fontStyle=
|
|
841
|
+
"italic";break;case "u":e.textDecoration.push("underline")}}if(In(a))for(f=!0,d=t(a.textContent.split("\n")),a=d.next();!a.done;a=d.next())a=a.value,f||(f=b.clone(),f.lineBreak=!0,c.push(f)),0<a.length&&(f=e.clone(),f.payload=a,c.push(f)),f=!1;else for(b=t(a.childNodes),a=b.next();!a.done;a=b.next())dv(a.value,e,c,d)}
|
|
842
|
+
function bv(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=Bc:a.textAlign=Jc[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?"vertical-lr":"vertical-rl";else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign="line-left"==b||"start"==b?"line-left":"line-right"==b||"end"==
|
|
843
|
+
b?"line-right":"center");else if(d=/^region:(.*)$/.exec(b)){if(b=fv(c,d[1]))a.region=b}else if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),c[2]&&(a.lineAlign=Lc[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=Dc,a.line=Number(c[1]),c[2]&&(a.lineAlign=Lc[c[2].toUpperCase()])}function fv(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:null}
|
|
844
|
+
function Zu(a){a=Up(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)}M("shaka.text.VttTextParser",Yu);Yu.prototype.parseMedia=Yu.prototype.parseMedia;Yu.prototype.parseInit=Yu.prototype.parseInit;Ue["text/vtt"]=function(){return new Yu};Ue['text/vtt; codecs="vtt"']=function(){return new Yu};Ue['text/vtt; codecs="wvtt"']=function(){return new Yu};function gv(){this.g=null}gv.prototype.parseInit=function(a){var b=this,c=!1;(new Ob).box("moov",Sb).box("trak",Sb).box("mdia",Sb).U("mdhd",function(d){d=Zd(d.reader,d.version);b.g=d.timescale}).box("minf",Sb).box("stbl",Sb).U("stsd",Ub).box("wvtt",function(){c=!0}).parse(a);if(!this.g)throw new N(2,2,2008);if(!c)throw new N(2,2,2008);};
|
|
845
|
+
gv.prototype.parseMedia=function(a,b){if(!this.g)throw new N(2,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,k=!1,l=null;(new Ob).box("moof",Sb).box("traf",Sb).U("tfdt",function(A){g=!0;c=Yd(A.reader,A.version).fd}).U("tfhd",function(A){l=Xd(A.reader,A.flags).Xd}).U("trun",function(A){h=!0;d=$d(A.reader,A.version,A.flags).ne}).box("mdat",Vb(function(A){k=!0;e=A})).parse(a,!1);if(!k&&!g&&!h)throw new N(2,2,2008);for(var m=c,n=new Cb(e,0),p=t(d),r=p.next();!r.done;r=p.next()){r=r.value;var u=r.Gd||l,x=r.Mc?
|
|
846
|
+
c+r.Mc:m;m=x+(u||0);var w=0;do{var y=n.N();w+=y;var C=n.N(),D=null;"vttc"==Wb(C)?8<y&&(D=n.bb(y-8)):n.skip(y-8);u&&D&&(y=hv(D,b.periodStart+x/this.g,b.periodStart+m/this.g),f.push(y))}while(r.sampleSize&&w<r.sampleSize)}return f.filter(Mb)};function hv(a,b,c){var d,e,f;(new Ob).box("payl",Vb(function(g){d=wb(g)})).box("iden",Vb(function(g){e=wb(g)})).box("sttg",Vb(function(g){f=wb(g)})).parse(a);return d?iv(d,e,f,b,c):null}
|
|
847
|
+
function iv(a,b,c,d,e){d=new xc(d,e,"");av(a,d,new Map);b&&(d.id=b);if(c)for(a=new Sp(c),b=Vp(a);b;)bv(d,b,[]),Tp(a),b=Vp(a);return d}M("shaka.text.Mp4VttParser",gv);gv.prototype.parseMedia=gv.prototype.parseMedia;gv.prototype.parseInit=gv.prototype.parseInit;Ue['application/mp4; codecs="wvtt"']=function(){return new gv};function jv(){}jv.prototype.parseInit=function(){};jv.prototype.parseMedia=function(a){var b=wb(a).replace(/\r+/g,"");b=b.trim();a=[];if(""==b)return a;b=t(b.split("\n\n"));for(var c=b.next();!c.done;c=b.next()){c=c.value.split("\n");var d=new Sp(c[0]),e=kv(d),f=Up(d,/,/g);d=kv(d);if(null==e||null==f||null==d)throw new N(2,2,2001,"Could not parse cue time range in SubViewer");a.push(new xc(e,d,c.slice(1).join("\n").trim()))}return a};
|
|
848
|
+
function kv(a){a=Up(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)}M("shaka.text.SbvTextParser",jv);jv.prototype.parseMedia=jv.prototype.parseMedia;jv.prototype.parseInit=jv.prototype.parseInit;Ue["text/x-subviewer"]=function(){return new jv};function lv(){this.s=new Yu}lv.prototype.parseInit=function(){};lv.prototype.parseMedia=function(a,b){var c=wb(a);c=mv(c);c=qb(Ab(c));return this.s.parseMedia(c,b)};function mv(a){var b="WEBVTT\n\n";if(""==a)return b;a=a.replace(/\r+/g,"");a=a.trim();a=t(a.split("\n\n"));for(var c=a.next();!c.done;c=a.next())c=c.value.split(/\n/),c[0].match(/\d+/)&&c.shift(),c[0]=c[0].replace(/,/g,"."),b+=c.join("\n")+"\n\n";return b}M("shaka.text.SrtTextParser",lv);lv.srt2webvtt=mv;lv.prototype.parseMedia=lv.prototype.parseMedia;
|
|
849
|
+
lv.prototype.parseInit=lv.prototype.parseInit;Ue["text/srt"]=function(){return new lv};function nv(){}nv.prototype.parseInit=function(){};
|
|
850
|
+
nv.prototype.parseMedia=function(a){var b="",c="";a=wb(a).split(/\r?\n\s*\r?\n/);a=t(a);for(var d=a.next();!d.done;d=a.next()){var e=ov.exec(d.value);e&&(d=e[1],e=e[2],"V4 Styles"==d||"V4+ Styles"==d?b=e:"Events"==d&&(c=e))}a=[];d=null;b=t(b.split(/\r?\n/));for(var f=b.next();!f.done;f=b.next())if(e=f.value,!/^\s*;/.test(e)&&(f=pv.exec(e)))if(e=f[1].trim(),f=f[2].trim(),"Format"==e)d=f.split(qv);else if("Style"==e){e=f.split(qv);f={};for(var g=0;g<d.length&&g<e.length;g++)f[d[g]]=e[g];a.push(f)}d=
|
|
851
|
+
[];b=null;e={};c=t(c.split(/\r?\n/));for(f=c.next();!f.done;e={bd:e.bd},f=c.next())if(f=f.value,!/^\s*;/.test(f)&&(g=pv.exec(f)))if(f=g[1].trim(),g=g[2].trim(),"Format"==f)b=g.split(qv);else if("Dialogue"==f){g=g.split(qv);f={};for(var h=0;h<b.length&&h<g.length;h++)f[b[h]]=g[h];h=rv(f.Start);var k=rv(f.End);g=new xc(h,k,g.slice(b.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,""));e.bd=f.Style;(f=a.find(function(l){return function(m){return m.Name==l.bd}}(e)))&&sv(g,f);d.push(g)}return d};
|
|
852
|
+
function sv(a,b){var c=b.Fontname;c&&(a.fontFamily=c);if(c=b.Fontsize)a.fontSize=c+"px";if(c=b.PrimaryColour)if(c=tv(c))a.color=c;if(c=b.BackColour)if(c=tv(c))a.backgroundColor=c;b.Bold&&(a.fontWeight=700);b.Italic&&(a.fontStyle="italic");b.Underline&&a.textDecoration.push("underline");if(c=b.Spacing)a.letterSpacing=c+"px";if(c=b.Alignment)switch(parseInt(c,10)){case 1:a.displayAlign=Fc;a.textAlign="start";break;case 2:a.displayAlign=Fc;a.textAlign=Bc;break;case 3:a.displayAlign=Fc;a.textAlign="end";
|
|
853
853
|
break;case 5:a.displayAlign="before";a.textAlign="start";break;case 6:a.displayAlign="before";a.textAlign=Bc;break;case 7:a.displayAlign="before";a.textAlign="end";break;case 9:a.displayAlign="center";a.textAlign="start";break;case 10:a.displayAlign="center";a.textAlign=Bc;break;case 11:a.displayAlign="center",a.textAlign="end"}if(c=b.AlphaLevel)a.opacity=parseFloat(c)}
|
|
854
|
-
function
|
|
855
|
-
Ue["text/x-ssa"]=function(){return new
|
|
854
|
+
function tv(a){a=parseInt(a.replace("&H",""),16);return 0<=a?"rgba("+(a&255)+","+(a>>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null}function rv(a){a=uv.exec(a);return 3600*(a[1]?parseInt(a[1].replace(":",""),10):0)+60*parseInt(a[2],10)+parseFloat(a[3])}M("shaka.text.SsaTextParser",nv);nv.prototype.parseMedia=nv.prototype.parseMedia;nv.prototype.parseInit=nv.prototype.parseInit;var ov=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,pv=/^\s*([^:]+):\s*(.*)/,qv=/\s*,\s*/,uv=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;
|
|
855
|
+
Ue["text/x-ssa"]=function(){return new nv};/*
|
|
856
856
|
@license
|
|
857
857
|
EME Encryption Scheme Polyfill
|
|
858
858
|
Copyright 2019 Google LLC
|
|
859
859
|
SPDX-License-Identifier: Apache-2.0
|
|
860
860
|
*/
|
|
861
|
-
function
|
|
862
|
-
function
|
|
861
|
+
function vv(){}var wv;function xv(){wv?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(wv=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=yv):console.debug("EmeEncryptionSchemePolyfill: EME not found")}
|
|
862
|
+
function yv(a,b){var c=this,d;return L(function(e){if(1==e.g)return console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess'),v(e,wv.call(c,a,b),2);d=e.h;if(zv(d))return console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=wv,e["return"](d);console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");navigator.requestMediaKeySystemAccess=Av;return e["return"](Av.call(c,
|
|
863
863
|
a,b))})}
|
|
864
|
-
function
|
|
865
|
-
n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n;return v(r,
|
|
866
|
-
function
|
|
867
|
-
function
|
|
868
|
-
navigator.mediaCapabilities.decodingInfo=
|
|
869
|
-
function
|
|
870
|
-
new
|
|
871
|
-
u);l=p;m=k;return v(n,navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[l]),5);case 5:m.keySystemAccess=n.h;case 3:return n["return"](k)}})}M("McEncryptionSchemePolyfill",
|
|
872
|
-
|
|
873
|
-
function
|
|
874
|
-
function
|
|
864
|
+
function Av(a,b){var c=this,d,e,f,g,h,k,l,m,n,p;return L(function(r){if(1==r.g){console.assert(c==navigator,'bad "this" for requestMediaKeySystemAccess');d=Bv(a);e=[];f=t(b);for(g=f.next();!g.done;g=f.next())h=g.value,k=Cv(h.videoCapabilities,d),l=Cv(h.audioCapabilities,d),h.videoCapabilities&&h.videoCapabilities.length&&!k.length||h.audioCapabilities&&h.audioCapabilities.length&&!l.length||(m=Object.assign({},h),m.videoCapabilities=k,m.audioCapabilities=l,e.push(m));if(!e.length)throw n=Error("Unsupported keySystem or supportedConfigurations."),
|
|
865
|
+
n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n;return v(r,wv.call(c,a,e),2)}p=r.h;return r["return"](new Dv(p,d))})}function Cv(a,b){return a?a.filter(function(c){return!c.encryptionScheme||c.encryptionScheme==b}):a}M("EmeEncryptionSchemePolyfill",vv);vv.install=xv;function Ev(){}var Fv;
|
|
866
|
+
function Gv(){Fv?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(Fv=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=Hv):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}
|
|
867
|
+
function Hv(a){var b=this,c,d;return L(function(e){if(1==e.g)return console.assert(b==navigator.mediaCapabilities,'bad "this" for decodingInfo'),v(e,Fv.call(b,a),2);c=e.h;if(!a.keySystemConfiguration)return e["return"](c);if((d=c.keySystemAccess)&&zv(d))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=Fv,e["return"](c);console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");
|
|
868
|
+
navigator.mediaCapabilities.decodingInfo=Iv;return e["return"](Iv.call(b,a))})}
|
|
869
|
+
function Iv(a){var b=this,c,d,e,f,g,h,k,l,m;return L(function(n){switch(n.g){case 1:return console.assert(b==navigator.mediaCapabilities,'bad "this" for decodingInfo'),c=null,a.keySystemConfiguration&&(d=a.keySystemConfiguration,e=d.keySystem,f=d.audio&&d.audio.encryptionScheme,g=d.video&&d.video.encryptionScheme,c=Bv(e),h={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a},f&&f!=c||g&&g!=c)?n["return"](h):v(n,Fv.call(b,a),2);case 2:k=n.h;if(k.keySystemAccess){k.keySystemAccess=
|
|
870
|
+
new Dv(k.keySystemAccess,c);n.v(3);break}if(!a.keySystemConfiguration){n.v(3);break}var p=a.keySystemConfiguration,r=[],u=[];p.audio&&r.push({robustness:p.audio.robustness||"",contentType:a.audio.contentType});p.video&&u.push({robustness:p.video.robustness||"",contentType:a.video.contentType});p={initDataTypes:p.initDataType?[p.initDataType]:[],distinctiveIdentifier:p.distinctiveIdentifier,persistentState:p.persistentState,sessionTypes:p.sessionTypes};r.length&&(p.audioCapabilities=r);u.length&&(p.videoCapabilities=
|
|
871
|
+
u);l=p;m=k;return v(n,navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[l]),5);case 5:m.keySystemAccess=n.h;case 3:return n["return"](k)}})}M("McEncryptionSchemePolyfill",Ev);Ev.install=Gv;function Dv(a,b){this.h=a;this.g=b;this.keySystem=a.keySystem}
|
|
872
|
+
Dv.prototype.getConfiguration=function(){var a=this.h.getConfiguration();if(a.videoCapabilities)for(var b=t(a.videoCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.g;if(a.audioCapabilities)for(b=t(a.audioCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.g;return a};Dv.prototype.createMediaKeys=function(){return this.h.createMediaKeys()};
|
|
873
|
+
function Bv(a){if(a.startsWith("com.widevine")||a.startsWith("com.microsoft")||a.startsWith("com.adobe")||a.startsWith("org.w3"))return"cenc";if(a.startsWith("com.apple"))return"cbcs-1-9";console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function zv(a){a=a.getConfiguration();var b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&void 0!==a.encryptionScheme?!0:!1}function Jv(){}
|
|
874
|
+
function Ns(){xv();Gv()}M("EncryptionSchemePolyfills",Jv);Jv.install=Ns;"undefined"!==typeof module&&module.exports&&(module.exports=Jv);}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();
|
|
875
875
|
|
|
876
876
|
//# sourceMappingURL=shaka-player.compiled.map
|