@castlabs/prestoplay 6.14.1 → 6.16.0
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 +28 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +114 -112
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +553 -538
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +74 -73
- package/cjs/cl.externs.js +193 -58
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +368 -264
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +89 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +455 -443
- package/cl.crypto.js +9 -9
- package/cl.dash.js +70 -68
- package/cl.externs.js +189 -58
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -71
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +318 -236
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +1 -1
- package/typings.d.ts +393 -57
package/cjs/cl.smooth.js
CHANGED
|
@@ -1,75 +1,76 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b,a.h),a.a+=2}catch(c){_.
|
|
4
|
-
d,e){Z.call(this,a,b,c);this.h=d;this.offset=e},
|
|
5
|
-
this.j=a;this.duration=b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.h=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},
|
|
6
|
-
function(a,b,c,d){
|
|
7
|
-
|
|
8
|
-
"tfdt",a,0);this.
|
|
9
|
-
"schm",0,0);this.h=a;this.j=b;this.
|
|
10
|
-
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.
|
|
11
|
-
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.
|
|
12
|
-
Number(a[1]);var e=Number(a[2]),f=Number(a[3]),g=Number(a[4]);g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}else
|
|
13
|
-
b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0
|
|
14
|
-
d=null}c=new
|
|
15
|
-
m.entries=[new
|
|
16
|
-
g]);d=(new
|
|
17
|
-
new
|
|
18
|
-
m.reader.getPosition()&&m.flags&1&&(p.l=_.
|
|
19
|
-
16);if(_.
|
|
20
|
-
|
|
21
|
-
h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=c;for(var l=["begin",_.
|
|
22
|
-
"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.
|
|
23
|
-
c.start+16,d.seek(e.start),e.write(d),h=d.buffer);return h},
|
|
24
|
-
new _.K("clpp.smooth.SmoothParser");this.J=!1;this.j=this.A=null;this.
|
|
25
|
-
_.
|
|
26
|
-
p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),t=+c.getAttribute("DVRWindowLength")||Infinity,v=_.
|
|
27
|
-
F=_.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
new _.P(_.Q,4,4037,
|
|
32
|
-
|
|
33
|
-
thumbStreams:[]};var
|
|
34
|
-
|
|
35
|
-
g)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var h=
|
|
36
|
-
d[h.
|
|
37
|
-
|
|
38
|
-
roles:[],channelsCount:l.
|
|
39
|
-
b.endTime);return f},
|
|
40
|
-
video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
_.
|
|
71
|
-
_.
|
|
72
|
-
|
|
2
|
+
var f=function(window){var VQ="Full MP4 box must have flags defined",WQ="clpp.smooth.SmoothMP4Processor",XQ="codecPrivateData",YQ=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.U(a,c);_.U(a,d)},ZQ=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Gm()}},$Q=function(a,b){ZQ(a,b>>16&255);ZQ(a,b>>8&255);ZQ(a,b&255)},aR=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.Gm()}},bR=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.Gm()}},cR=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.h),a.a+=2}catch(c){_.Gm()}},dR=function(a,b){if(void 0!==b){for(var c=new Uint8Array(b),d=Math.min(a.length,b),e=0;e<d;++e)c[e]=a.charCodeAt(e);for(;e<b;e++)c[e]=0;return c}c=new Uint8Array(a.length);for(d=0;d<a.length;++d)c[d]=a.charCodeAt(d);return c},eR=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.A=!1;this.entries=[];this.f=[]},Z=function(a,b,c){eR.call(this,a);this.version=b;this.flags=c},fR=function(a,b,c){eR.call(this,a);this.h=b;this.offset=c},gR=function(a,b,c,
|
|
4
|
+
d,e){Z.call(this,a,b,c);this.h=d;this.offset=e},hR=function(a,b,c){eR.call(this,"ftyp");this.j=a;this.bi=b;this.h=c},iR=function(){eR.call(this,_.Ue)},jR=function(){eR.call(this,_.tg)},kR=function(a,b,c){Z.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.j=c+1;this.h=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},lR=function(){eR.call(this,"mvex")},mR=function(a){Z.call(this,"trex",0,0);this.h=a},nR=function(a,b,c,d,e){Z.call(this,"tkhd",1,7);
|
|
5
|
+
this.j=a;this.duration=b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.h=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},oR=function(a,b){Z.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},pR=function(a){Z.call(this,"hdlr",0,0);this.h=a},qR=function(){Z.call(this,"vmhd",0,1);this.h=new Uint8Array([0,0,0,0,0,0])},rR=function(a){eR.call(this,a);this.A=!0},sR=function(a){rR.call(this,a);this.height=this.width=0;this.depth=24},tR=
|
|
6
|
+
function(a,b,c,d){rR.call(this,a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},uR=function(a,b){sR.call(this,"avc1");this.width=a;this.height=b},vR=function(a,b){uR.call(this,a,b);this.type=_.$B},wR=function(a,b,c){tR.call(this,"mp4a",a,b,c)},xR=function(a,b,c){wR.call(this,a,b,c);this.type="enca"},yR=function(a,b){eR.call(this,"avcC");this.gb=a;this.kc=b;this.version=1;this.h=this.gb[0][1];this.j=this.gb[0][2];this.level=this.gb[0][3]},zR=function(a){Z.call(this,"esds",0,0);this.$b=a},
|
|
7
|
+
AR=function(a){a=void 0===a?"":a;Z.call(this,"url ",0,1);this.location=a},BR=function(){Z.call(this,"dref",0,0)},CR=function(){eR.call(this,_.jg)},DR=function(){Z.call(this,_.lg,0,0)},ER=function(){Z.call(this,"stts",0,0)},FR=function(){Z.call(this,"stsc",0,0)},GR=function(){Z.call(this,"stco",0,0)},HR=function(){Z.call(this,"stsz",0,0)},IR=function(){Z.call(this,"smhd",0,0)},JR=function(){eR.call(this,"dinf")},KR=function(){eR.call(this,_.Te)},LR=function(){eR.call(this,_.Oe)},MR=function(a,b){Z.call(this,
|
|
8
|
+
"tfdt",a,0);this.baseMediaDecodeTime=b},NR=function(){Z.call(this,"mfhd",0,0);this.h=0},OR=function(a,b){Z.call(this,"trun",a,b);this.o=this.l=this.h=0;this.w=[];this.sampleSize=[];this.C=[];this.j=[]},PR=function(a,b){Z.call(this,"tfhd",a,b);this.h=255;this.o=this.w=this.l=this.C=this.j=0},QR=function(){eR.call(this,"traf")},RR=function(){eR.call(this,"moof")},SR=function(){eR.call(this,_.Ne);this.h=new Uint8Array(0)},TR=function(){Z.call(this,"tenc",0,0);this.h=1;this.j=8;this.o="";this.l=[]},UR=
|
|
9
|
+
function(a,b){Z.call(this,"schm",0,0);this.h=a;this.j=b;this.Ub=""},VR=function(a){eR.call(this,"frma");this.h=a},WR=function(){Z.call(this,"saio",0,0);this.offset=[0]},YR=function(a,b,c){Z.call(this,"saiz",0,0);this.h=a;this.l=b;this.j=c},ZR=function(a,b){Z.call(this,"senc",a,b);this.j=0;this.l=8;this.h=[]},$R=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},aS=function(a,b,c,d){c=b.Ch[c];b=b.Bn;a=a.replace("Manifest","");b=b.replace("{bitrate}",
|
|
10
|
+
String(d.bitrate)).replace("{Bitrate}",String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.Si([a],[b])[0]},bS=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.r?c=["maxWidth","maxHeight","bitrate",XQ,"fourCC"]:a.type===_.bd&&(c=["bitrate",XQ,"channels","bitsPerSample","samplingRate","fourCC"]);return _.O.oa(a,b,c,["id","segmentIndex"])},cS=function(a,b,c){var d=c.He.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,gb:null,
|
|
11
|
+
kc:null,width:NaN,height:NaN,$b:null,le:NaN,sampleSize:NaN,channelCount:NaN};switch(c.type){case _.r:a.gb=[_.Aj(d[1])];a.kc=[_.Aj(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.bd:a.$b=_.Aj(c.He),a.sampleSize=c.mj||16,a.le=c.le,a.channelCount=c.Ug}return a},dS=function(a,b){return a.filter(function(c){return c.type===b})},eS=function(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)},lS=function(a,b,
|
|
12
|
+
c){var d=null;if(fS.test(a)){a=fS.exec(a);d=Number(a[1]);var e=Number(a[2]),f=Number(a[3]),g=Number(a[4]);g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}else gS.test(a)?d=eS(gS,a):hS.test(a)?d=eS(hS,a):iS.test(a)?(a=iS.exec(a),d=Number(a[1])/c.frameRate):jS.test(a)?(a=jS.exec(a),d=Number(a[1])/c.a):kS.test(a)&&(d=eS(kS,a));d+=b;b=Math.floor(d/3600);c=Math.floor((d-3600*b)/60);a=Math.floor(d-3600*b-60*c);d-=a;10>b&&(b="0"+b);10>c&&(c="0"+c);10>a&&(a="0"+a);0===d?d="000":d=Math.round(1E3*
|
|
13
|
+
d);return b+":"+c+":"+a+"."+d},mS=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=parseInt(a[1],10)/parseInt(a[2],10))},oS=function(a){this.a=a;this.f=nS(this)},nS=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Fm(b)},pS=function(a,b,c){a:{var d=_.w([_.Ud,_.Sd]);for(var e=d.next();!e.done;e=d.next())if((e=c.Le(e.value))&&e.keyId){d=e.keyId;break a}_.Fh(WQ,
|
|
14
|
+
"Could not get default Key ID for DRM init data!");d=null}c=new eR("xxxx");a.type===_.r?c=new vR(a.width,a.height):c=new xR(a.channelCount,a.sampleSize,a.le);a=new TR;a.h=1;a.j=8;a.o=d||"00000000000000000000000000000000";a=(new eR("schi")).append([a]);b=(new eR(_.dg)).append([new VR(b),new UR(_.ud,65536),a]);c.append([b]);return c},qS=function(a,b){var c=b.Pe(),d=new kR(a.timescale,a.duration,a.id),e=(new lR).append([new mR(a.id)]),f=new nR(a.id,a.duration,a.timescale,a.width,a.height),g=new oR(a.timescale,
|
|
15
|
+
a.duration),h=new pR(a.type),l=null,m=new BR;m.entries=[new AR];var n=new DR;switch(a.type){case _.r:var p=new yR(a.gb,a.kc);c?(l=pS(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new uR(a.width,a.height)).append([p]),n.entries=[l]);l=new qR;break;case _.bd:p=new zR(a.$b),c?(l=pS(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new wR(a.channelCount,a.sampleSize,a.le)).append([p]),n.entries=[l]),l=new IR}n=(new CR).append([n,new ER,new FR,new HR,new GR]);m=(new JR).append([m]);m=(new KR).append([l,m,n]);
|
|
16
|
+
g=(new LR).append([g,h,m]);f=(new jR).append([f,g]);d=(new iR).append([d,f,e]);e=new hR("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Le(_.Sd),f=b.Le(_.Ud),c&&d.append([new fR("pssh",c.initData,8)]),f&&d.append([new fR("pssh",f.initData,8)]),c||f||_.Fh(WQ,"Could not get PSSH init data!"));c=new oS([e,d]);return _.nj(c.write())},sS=function(a,b){var c,d,e,f,g,h;(new _.Rm).K("moof",_.Sm).Y("mfhd",function(m){var n=new NR;n.h=_.V(m.reader);c=n}).K("traf",_.Sm).Y("tfhd",function(m){var n=m.reader.La();if(null===
|
|
17
|
+
m.flags)throw new _.P(_.Q,3,3019,VQ);var p=new PR(m.version||0,m.flags||0);p.h=_.V(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.Om(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.C=_.V(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.l=_.V(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.w=_.V(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.o=_.V(m.reader));d=p}).Y("trun",function(m){var n=m.reader.La();if(null===m.flags)throw new _.P(_.Q,3,3019,VQ);var p=new OR(m.version||
|
|
18
|
+
0,m.flags||0);p.h=_.V(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.l=_.Nm(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.o=_.V(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.h;n++)m.flags&256&&p.w.push(_.V(m.reader)),m.flags&512&&p.sampleSize.push(_.V(m.reader)),m.flags&1024&&p.C.push(_.V(m.reader)),m.flags&2048&&(0===m.version?p.j.push(_.V(m.reader)):p.j.push(_.Nm(m.reader)));e=p}).Y("sdtp",function(m){var n=_.Qm(m.reader,m.reader.La());f=new gR("sdtp",m.version||0,m.flags||0,
|
|
19
|
+
n,0)}).K("uuid",function(m){var n=_.Qm(m.reader,16);if(_.Cj(n,rS)){n=_.V(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new ZR(m.version,m.flags);n.j=_.V(m.reader);m.flags&1&&(n.l=_.Lm(m.reader));for(var p=0;p<n.j;p++){var q={Rh:_.Qm(m.reader,8),vd:0,wg:[]};if(m.flags&2){q.vd=_.Mm(m.reader);for(var t=0;t<q.vd;t++){var v={Rg:0,Sg:0};v.Rg=_.Mm(m.reader);v.Sg=_.V(m.reader);q.wg.push(v)}}n.h.push(q)}g=n}}).K(_.Ne,function(m){var n=new SR;0<m.reader.La()?n.h=_.Qm(m.reader,m.reader.La()):(_.Fh(WQ,"mdat box is empty!"),
|
|
20
|
+
n.h=new Uint8Array(0));h=n}).parse(a,!1);if(!h)return null;var l=(new QR).append([d,e]);f&&l.append([f]);b.Pe()&&g&&l.append([g]);l=(new RR).append([c,l]);return new oS([l,h])},tS=function(a,b,c,d){var e=d.Pe(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=sS(b,d);if(null===g)return a.request.contentType===_.R?a.data:g;d=g.get(_.Ne);if(a.request.contentType===_.R){e=d.h.buffer;if(c){e=_.S.Pd(e);if((e=(new DOMParser).parseFromString(e,_.rg))&&"tt"===e.documentElement.tagName.toLowerCase())var h=
|
|
21
|
+
e.documentElement;if(h&&(d=new mS(h.getAttribute("ttp:frameRate"),h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=c;for(var l=["begin",_.qe],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],t=new RegExp("\\w+:"+q),v=0;if(p.hasAttribute(q))p=p.getAttribute(q);else{q=p.attributes;for(var z=q.length;v<z;v++){var B=q[v].name;if(B=B.match(t)){p=
|
|
22
|
+
p.getAttribute(B[0]);break b}}p=null}}f.setAttribute(l[m],lS(p||"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.S.hb(e).buffer}else c=e;return c}h=new RR;a=g.get("mfhd");b=new QR;l=g.get("tfhd");m=new MR(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");l.h=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(e){g=0;l=[];if(c.flags&2)for(l=[],m=0;m<c.j;m++)l.push(10+6*c.h[m].vd);else g=8;b.append([c,new WR,new YR(g,l,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=
|
|
23
|
+
new oS([h,d]);h=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=c.start+16,d.seek(e.start),e.write(d),h=d.buffer);return h},uS=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},vS=function(a,b,c){a=_.Un(a);c&&a.version!==c&&(a=_.jD(a,c));return{initData:_.hD(a),initDataType:_.ud,keyId:b,periodId:null}},xS=function(){this.w=this.h=this.f=
|
|
24
|
+
this.B=null;this.P=1;this.T=0;this.l="";this.C=this.a=null;this.g=new _.K("clpp.smooth.SmoothParser");this.J=!1;this.j=this.A=null;this.M=wS;this.H=0;this.D=this.I=Infinity;this.o=[];this.L=this.dn.bind(this);this.G=new Map},yS=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.Lj(b),c.timeout=a.f.attemptParameters.timeout,c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length),c.baseDelay=a.f.attemptParameters.baseDelay,c.backoffFactor=a.f.attemptParameters.backoffFactor,
|
|
25
|
+
c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.B.networkingEngine.fetch(c),_.y(f,d.N,2);e=f.f;a.l=e.uri;return f["return"](e)})},FS=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.S.Pd(b);var f=d.parseFromString(e.trim(),_.rg)}catch(UJ){throw UJ;}if(f&&f.documentElement.tagName===_.dc)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(UJ){}if(!c)throw a.g.error("Unable to parse manifest"),new _.P(_.Q,4,4033,a.l);var h=+zS(a,c,"MajorVersion"),
|
|
26
|
+
l=+zS(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+zS(a,c,"Duration"),p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),t=+c.getAttribute("DVRWindowLength")||Infinity,v=_.Gn(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+h+"."+l))throw a.g.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.P(_.Q,4,4036,a.l);p?(AS(a,BS),a.A=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):AS(a,wS);a.a={startTime:0,delay:0,
|
|
27
|
+
duration:n/m,If:t/m,ce:0};if(v){var z=a.f.playreadyVersion,B=[],F=_.Gn(v,"ProtectionHeader")[0],G=_.zj(_.In(F)||""),A=_.Un(G).a;B.push(uS(_.Ud,{initData:_.hD(_.Nn(A)),initDataType:_.ud,keyId:A,periodId:null},[A]));B.push(uS(_.Sd,vS(G,A,z),[A]));a.o=B}var H=[],M=_.Gn(c,"StreamIndex");if(!M.length)throw a.g.error("No streams found!"),new _.P(_.Q,4,4034,a.l);for(var N=0;N<M.length;N++){for(var W,pa=a,Ca=M[N],$a=zS(pa,Ca,"Type"),ab=+Ca.getAttribute("Chunks"),Qa=Ca.getAttribute("Subtype"),Da=Ca.getAttribute("Language")||
|
|
28
|
+
_.vg,fb=_.fj(Da),qc=Ca.getAttribute("Name")||"",Kg=+Ca.getAttribute(_.zb),Lg=+Ca.getAttribute(_.yb),Bn=zS(pa,Ca,"Url"),gu=+Ca.getAttribute("TimeScale")||null,ed=[],Cn=_.Gn(Ca,_.Sb),Pu=0;Pu<Cn.length;Pu++){var Qf=void 0,sc=void 0,Qu=void 0,Rf=pa,Gd=Cn[Pu],Ru=$a,nW=+Gd.getAttribute("Index"),oW=+zS(Rf,Gd,"Bitrate"),XJ=NaN,YJ=NaN,yo=NaN,Su=NaN,ZJ=NaN,$J=NaN,aK=NaN,bK=Gd.getAttribute("FourCC");switch(Ru){case _.r:XJ=+zS(Rf,Gd,_.yb);YJ=+zS(Rf,Gd,_.zb);break;case _.bd:Su=+Gd.getAttribute("Channels")||2,
|
|
29
|
+
yo=+zS(Rf,Gd,"SamplingRate"),$J=+zS(Rf,Gd,"AudioTag"),ZJ=+zS(Rf,Gd,"BitsPerSample"),aK=+zS(Rf,Gd,"PacketSize")}var Tu=String(Gd.getAttribute("CodecPrivateData"));if(Ru===_.bd&&!Tu){var cK=Su,dK={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},zo=dK[yo];if("AACH"===bK){sc=new Uint8Array(4);var eK=dK[2*yo];sc[0]=40|zo>>1;sc[1]=zo<<7|cK<<3|eK>>1;sc[2]=eK<<7|8;sc[3]=0;Qf=new Uint16Array(2);Qf[0]=(sc[0]<<8)+sc[1];Qf[1]=(sc[2]<<8)+sc[3];Qu=Qf[0].toString(16)+
|
|
30
|
+
Qf[1].toString(16)}else sc=new Uint8Array(2),sc[0]=16|zo>>1,sc[1]=zo<<7|cK<<3,Qf=new Uint16Array(1),Qf[0]=(sc[0]<<8)+sc[1],Qu=Qf[0].toString(16);Tu=Qu.toUpperCase()}var pW={id:Rf.T++,type:Ru,index:nW,bitrate:oW,He:Tu,maxHeight:XJ,maxWidth:YJ,le:yo,Ug:Su,Rn:$J,mj:ZJ,io:aK,Yk:bK,segmentIndex:null};ed.push(pW)}W=ed;for(var Qe=[],fK=_.Gn(Ca,"c"),pk=0;pk<fK.length;pk++){var Uu=fK[pk],fe=parseInt(Uu.getAttribute("t"),10),ei=parseInt(Uu.getAttribute("d"),10),Vu=parseInt(Uu.getAttribute("r"),10),qk=0;if(isNaN(fe)&&
|
|
31
|
+
isNaN(ei))throw pa.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.P(_.Q,4,4037,pa.l);0===pk&&isNaN(fe)&&(qk=fe=0);if(0<pk){var Og=Qe[Qe.length-1];qk=Og.n+1;Og.d||(Og.d=fe-Og.t);fe||(fe=Og.t+Og.d);ei||(ei=fe-Og.t)}Qe.push({n:qk,d:ei,t:fe});if(Vu){Vu--;for(var gK=0;gK<Vu;gK++){var Ao=Qe[Qe.length-1];qk=Ao.n+1;fe=Ao.t+Ao.d;ei=Ao.d;Qe.push({n:qk,d:ei,t:fe})}}}pa.Hd()||Qe.length===ab||pa.g.warn("Number of fragments ("+ab+") differs from number of chunks ("+
|
|
32
|
+
Qe.length+").");H.push({type:$a,Vn:ab,qn:Qa,language:fb,be:Da,name:qc,maxWidth:Kg,maxHeight:Lg,Bn:Bn,tracks:W,Ch:Qe,timescale:gu})}var Sf={fo:h,bi:l,timescale:m,duration:n,isLive:p,eo:q,If:t,Tf:!1,streams:H};if(a.h&&a.w)return CS(a,Sf),Promise.resolve();a.G.clear();var Wu=Sf.timescale,Bo=Sf.duration,rW=dS(Sf.streams,_.bd),sW=dS(Sf.streams,_.r),tW=dS(Sf.streams,_.R),hK=[],Co=DS(a,Bo,Wu,rW),Do=DS(a,Bo,Wu,sW),uW=DS(a,Bo,Wu,tW);Co.length||(Co=[null]);Do.length||(Do=[null]);for(var Yu=0;Yu<Do.length;Yu++)for(var Zu=
|
|
33
|
+
0;Zu<Co.length;Zu++)hK.push(ES(a,Do[Yu],Co[Zu]));var iK={id:"ID",configurationId:void 0,startTime:0,endTime:Bo,variants:hK,textStreams:uW,thumbStreams:[]};var wW=Sf.streams,$u=a.a.startTime,jK=a.a.delay,av=a.I,kK=Math.min(a.a.duration||Infinity,av),bv=a.Hd(),xW=a.a.If,yW=a.a.ce,lK=a.H,mK=isFinite(a.D)?a.D:0;if(bv)kK=Infinity,$u=Date.now()/1E3-yW,a.a.startTime=$u,jK=3*lK;else for(var zW=isFinite(av)?av:a.a.duration,nK=_.w(wW),cv=nK.next();!cv.done;cv=nK.next())for(var oK=_.w(cv.value.tracks),dv=oK.next();!dv.done;dv=
|
|
34
|
+
oK.next()){var pK=dv.value;pK.segmentIndex.offset(-mK);_.QD(pK.segmentIndex,zW)}a.C=new _.ZD(a.f.timeline||{},$u,jK,!bv,!0);a.C.h=kK;_.gE(a.C,lK);a.C.A=xW;bv||a.C.offset(-mK);a.B.filterAllPeriods([iK]);a.h={presentationTimeline:a.C,periods:[iK],minBufferTime:0};Promise.resolve();a.J||(a.B.networkingEngine.Bd(a.L),a.J=!0);a.w=Sf;return Promise.resolve()},CS=function(a,b){for(var c=0;c<a.w.streams.length;c++)for(var d=b.streams[c],e={},f=_.w(a.w.streams[c].tracks),g=f.next();!g.done;e={Yb:e.Yb},g=f.next())if(e.Yb=
|
|
35
|
+
g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Yb.type&&m.bitrate===l.Yb.bitrate}}(e))){bS(e.Yb,g)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var h=GS(a,a.w.timescale,d,g);g=e.Yb.segmentIndex;g.ra(h);(h=a.a.If)&&_.xE(g,_.wE(g)-h).forEach(function(l){l.Sa().forEach(function(m){a.G["delete"](m)})})}else a.g.warn("Cannot find satisfying update for "+e.Yb.type+" track with bitrate "+(e.Yb.bitrate+". Skipping update."))},
|
|
36
|
+
DS=function(a,b,c,d){for(var e=[],f={Sc:0};f.Sc<d.length;f={Sc:f.Sc},f.Sc++){var g=d[f.Sc].tracks.map(function(h){return function(l){var m=d[h.Sc],n=GS(a,c,m,l);n=new _.vE(n);var p=null;m.type!==_.R&&(p=HS(a,b,c,m,l));l.segmentIndex=n;var q=_.SK++,t=Promise.resolve.bind(Promise),v=n.dd.bind(n),z=n.get.bind(n),B=n.Cd.bind(n),F=n.getDuration.bind(n),G=IS[m.type],A="";switch(m.type){case _.r:A=l.He;var H=/00000001[0-9]7/.exec(A);A="avc1."+(H&&H[0]?A.substr(A.indexOf(H[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",
|
|
37
|
+
A);break;case _.bd:A=l.He,H=2,"AACH"===l.Yk?H=5:A&&(H=(parseInt(A.substr(0,2),16)&248)>>3),A="mp4a.40."+H,a.g.debug("AUDIO CODECS: ",A)}H=m.type===_.R?JS[m.qn]:void 0;return{id:q,originalId:null,ko:null,createSegmentIndex:t,findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:B,getDuration:F,segmentIndex:n,segmentLookupStrategy:_.hC,initSegmentReference:p,mimeType:G,codecs:A,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:H,encrypted:a.Uf(),
|
|
38
|
+
keyId:null,language:m.language,originalLanguage:m.be,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.Ug||null,spatialAudio:!1,closedCaptions:null}}}(f));e=e.concat(g)}return e},GS=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.Ch.forEach(function(h,l){var m=h.d/g;if(0===l){var n=h.t/g;a.D=Math.min(a.D,n)}else n=f[l-1].endTime;var p=n+m,q=aS(a.l,c,l,d);a.H=Math.max(a.H,m);f.push(new _.dj(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.G.set(q,
|
|
39
|
+
n);e+=m});if(c.type===_.r||c.type===_.bd)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.ce?a.a.ce=b.endTime:a.a.ce=Math.min(a.a.ce,b.endTime);return f},HS=function(a,b,c,d,e){b=cS(b,d.timescale||c,e);c={isLive:a.Hd.bind(a),Pe:a.Uf.bind(a),fl:function(){return 1},Le:a.Fh.bind(a)};d=new Uint8Array(0);try{d=qS(b,c)}catch(g){throw a.g.error("Failed to generate initialization segment."),new _.P(_.Q,3,4035,g);}var f="data:text/plain;base64,"+_.yj(d);return new _.uD(function(){return[f]},0,null,null,!0)},ES=
|
|
40
|
+
function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.vg;return c||b?{id:a.P++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},zS=function(a,b,c){if(b=b.getAttribute(c))return b;a.g.error("required attribute not provided: "+c);throw new _.P(_.Q,4,4038,a.l,c);},KS=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.tb.bind(a),b))},AS=function(a,b){var c=b===wS;a.h&&a.h.presentationTimeline&&_.bE(a.h.presentationTimeline,
|
|
41
|
+
c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.M=b},LS=function(){};eR.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.f.push(a[b]),a[b].parent=this;return this};eR.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.f.length;b++){if(this.f[b].type===a)return this.f[b];var c=this.f[b].get(a);if(c)return c}return null};
|
|
42
|
+
eR.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(var c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b};
|
|
43
|
+
eR.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.U(a,1):_.U(a,this.size);_.Hm(a,dR(this.type));this.size>b&&YQ(a,this.size);"uuid"===this.type&&_.Hm(a,null);if(0<this.f.length&&!this.A)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.x(Z,eR);Z.prototype.a=function(){return 4+eR.prototype.a.call(this)};Z.prototype.write=function(a){eR.prototype.write.call(this,a);ZQ(a,this.version);$Q(a,this.flags)};
|
|
44
|
+
_.x(fR,eR);fR.prototype.a=function(){return this.h.byteLength+eR.prototype.a.call(this)-this.offset};fR.prototype.write=function(a){eR.prototype.write.call(this,a);_.Hm(a,this.h,this.offset);a.getPosition()};_.x(gR,Z);gR.prototype.a=function(){return this.h.byteLength+Z.prototype.a.call(this)-this.offset};gR.prototype.write=function(a){Z.prototype.write.call(this,a);_.Hm(a,this.h,this.offset);a.getPosition()};_.x(hR,eR);
|
|
45
|
+
hR.prototype.a=function(){var a=this.j.length;a=a+4+this.h.join("").length;return a+eR.prototype.a.call(this)};hR.prototype.write=function(a){eR.prototype.write.call(this,a);_.Hm(a,dR(this.j));_.U(a,this.bi);_.Hm(a,dR(this.h.join("")));a.getPosition()};_.x(iR,eR);_.x(jR,eR);_.x(kR,Z);kR.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.h.length;return a+=Z.prototype.a.call(this)};
|
|
46
|
+
kR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(YQ(a,0),YQ(a,0),_.U(a,this.timescale),YQ(a,this.duration*this.timescale)):(_.U(a,0),_.U(a,0),_.U(a,this.timescale),_.U(a,this.duration*this.timescale));_.U(a,65536);aR(a,this.volume);aR(a,0);_.U(a,0);_.U(a,0);for(var b=0;b<this.h.length;b++)ZQ(a,this.h[b]);_.U(a,0);_.U(a,0);_.U(a,0);_.U(a,0);_.U(a,0);_.U(a,0);_.U(a,this.j);a.getPosition()};_.x(lR,eR);_.x(mR,Z);mR.prototype.a=function(){return 20+Z.prototype.a.call(this)};
|
|
47
|
+
mR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.h);_.U(a,1);_.U(a,0);_.U(a,0);_.U(a,0);a.getPosition()};_.x(nR,Z);nR.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.h.length;return a+Z.prototype.a.call(this)};
|
|
48
|
+
nR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(YQ(a,0),YQ(a,0),_.U(a,this.j),_.U(a,0),YQ(a,this.duration*this.timescale)):(_.U(a,0),_.U(a,0),_.U(a,this.j),_.U(a,0),_.U(a,this.duration*this.timescale));_.U(a,0);_.U(a,0);aR(a,0);aR(a,0);aR(a,this.volume);aR(a,0);for(var b=0;b<this.h.length;b++)ZQ(a,this.h[b]);aR(a,this.width);aR(a,0);aR(a,this.height);aR(a,0);a.getPosition()};_.x(oR,Z);oR.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Z.prototype.a.call(this)};
|
|
49
|
+
oR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(YQ(a,0),YQ(a,0),_.U(a,this.timescale),YQ(a,this.duration*this.timescale)):(_.U(a,0),_.U(a,0),_.U(a,this.timescale),_.U(a,this.duration*this.timescale));aR(a,this.language);aR(a,0);a.getPosition()};_.x(pR,Z);pR.prototype.a=function(){return 33+Z.prototype.a.call(this)};
|
|
50
|
+
pR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,0);this.h===_.r?_.Hm(a,dR("vide")):_.Hm(a,dR("soun"));_.U(a,0);_.U(a,0);_.U(a,0);this.h===_.r?_.Hm(a,dR("VideoHandler\x00")):_.Hm(a,dR("SoundHandler\x00"));a.getPosition()};_.x(qR,Z);qR.prototype.a=function(){return 2+this.h.byteLength+Z.prototype.a.call(this)};qR.prototype.write=function(a){Z.prototype.write.call(this,a);aR(a,0);_.Hm(a,this.h);a.getPosition()};_.x(rR,eR);rR.prototype.a=function(){return 8+eR.prototype.a.call(this)};
|
|
51
|
+
rR.prototype.write=function(a){eR.prototype.write.call(this,a);_.U(a,0);aR(a,0);aR(a,1)};_.x(sR,rR);sR.prototype.a=function(){return 70+rR.prototype.a.call(this)};sR.prototype.write=function(a){rR.prototype.write.call(this,a);aR(a,0);aR(a,0);_.U(a,0);_.U(a,0);_.U(a,0);aR(a,this.width);aR(a,this.height);_.U(a,4718592);_.U(a,4718592);_.U(a,0);aR(a,1);ZQ(a,10);_.Hm(a,dR("AVC Coding",31));aR(a,this.depth);cR(a,-1)};_.x(tR,rR);tR.prototype.a=function(){return 20+rR.prototype.a.call(this)};
|
|
52
|
+
tR.prototype.write=function(a){rR.prototype.write.call(this,a);_.U(a,0);_.U(a,0);aR(a,this.channelCount);aR(a,this.sampleSize);cR(a,0);aR(a,0);aR(a,this.sampleRate);aR(a,0)};_.x(uR,sR);uR.prototype.write=function(a){sR.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.x(vR,uR);_.x(wR,tR);wR.prototype.write=function(a){tR.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.x(xR,wR);_.x(yR,eR);
|
|
53
|
+
yR.prototype.a=function(){for(var a=7,b=0;b<this.gb.length;b++)a+=2,a+=this.gb[b].byteLength;for(b=0;b<this.gb.length;b++)a+=2,a+=this.kc[b].byteLength;return a+eR.prototype.a.call(this)};
|
|
54
|
+
yR.prototype.write=function(a){eR.prototype.write.call(this,a);ZQ(a,this.version);ZQ(a,this.h);ZQ(a,this.j);ZQ(a,this.level);ZQ(a,255);ZQ(a,224|this.gb.length);for(var b=0;b<this.gb.length;b++)aR(a,this.gb[b].length),_.Hm(a,this.gb[b]);ZQ(a,this.kc.length);for(b=0;b<this.kc.length;b++)aR(a,this.kc[b].length),_.Hm(a,this.kc[b]);a.getPosition()};_.x(zR,Z);zR.prototype.a=function(){return 22+(this.$b.byteLength+3)+Z.prototype.a.call(this)};
|
|
55
|
+
zR.prototype.write=function(a){Z.prototype.write.call(this,a);ZQ(a,3);ZQ(a,23+this.$b.byteLength);aR(a,1);ZQ(a,0);ZQ(a,4);ZQ(a,15+this.$b.byteLength);ZQ(a,64);ZQ(a,21);$Q(a,0);_.U(a,0);_.U(a,0);ZQ(a,5);ZQ(a,this.$b.byteLength);_.Hm(a,this.$b);_.Hm(a,new Uint8Array([6,1,2]));a.getPosition()};_.x(AR,Z);AR.prototype.a=function(){return this.location.length+Z.prototype.a.call(this)};AR.prototype.write=function(a){Z.prototype.write.call(this,a);0<this.location.length&&_.Hm(a,dR(this.location));a.getPosition()};
|
|
56
|
+
_.x(BR,Z);BR.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};BR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.x(CR,eR);_.x(DR,Z);DR.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
|
|
57
|
+
DR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.x(ER,Z);ER.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};ER.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.x(FR,Z);
|
|
58
|
+
FR.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};FR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.x(GR,Z);GR.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
|
|
59
|
+
GR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.x(HR,Z);HR.prototype.a=function(){return 8+Z.prototype.a.call(this)};HR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,0);_.U(a,0);a.getPosition()};_.x(IR,Z);IR.prototype.a=function(){return 4+Z.prototype.a.call(this)};IR.prototype.write=function(a){Z.prototype.write.call(this,a);cR(a,0);aR(a,0);a.getPosition()};
|
|
60
|
+
_.x(JR,eR);_.x(KR,eR);_.x(LR,eR);_.x(MR,Z);MR.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Z.prototype.a.call(this)};MR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?YQ(a,this.baseMediaDecodeTime):_.U(a,this.baseMediaDecodeTime);a.getPosition()};_.x(NR,Z);NR.prototype.a=function(){return 4+Z.prototype.a.call(this)};NR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.h);a.getPosition()};_.x(OR,Z);
|
|
61
|
+
OR.prototype.a=function(){var a=4;this.flags&MS&&(a+=4);this.flags&NS&&(a+=4);for(var b=0;b<this.h;b++)this.flags&OS&&(a+=4),this.flags&PS&&(a+=4),this.flags&QS&&(a+=4),this.flags&RS&&(a+=4);return a+Z.prototype.a.call(this)};
|
|
62
|
+
OR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.h);this.flags&MS&&(a.getPosition(),bR(a,this.l));this.flags&NS&&_.U(a,this.o);for(var b=0;b<this.h;b++)this.flags&OS&&_.U(a,this.w[b]),this.flags&PS&&_.U(a,this.sampleSize[b]),this.flags&QS&&_.U(a,this.C[b]),this.flags&RS&&(0===this.version?_.U(a,this.j[b]):bR(a,this.j[b]));a.getPosition()};var MS=1,NS=4,OS=256,PS=512,QS=1024,RS=2048;_.x(PR,Z);
|
|
63
|
+
PR.prototype.a=function(){var a=4;this.flags&SS&&(a+=8);this.flags&TS&&(a+=4);this.flags&US&&(a+=4);this.flags&VS&&(a+=4);this.flags&WS&&(a+=4);return a+Z.prototype.a.call(this)};PR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.h);this.flags&SS&&YQ(a,this.j);this.flags&TS&&_.U(a,this.C);this.flags&US&&_.U(a,this.l);this.flags&VS&&_.U(a,this.w);this.flags&WS&&_.U(a,this.o);a.getPosition()};var SS=1,TS=2,US=8,VS=16,WS=32;_.x(QR,eR);_.x(RR,eR);_.x(SR,eR);
|
|
64
|
+
SR.prototype.a=function(){return this.h.byteLength+eR.prototype.a.call(this)};SR.prototype.write=function(a){eR.prototype.write.call(this,a);0<this.h.byteLength&&_.Hm(a,this.h)};_.x(TR,Z);TR.prototype.a=function(){var a=20;1===this.h&&0===this.j&&(a=a+1+this.l.length);return a+Z.prototype.a.call(this)};
|
|
65
|
+
TR.prototype.write=function(a){Z.prototype.write.call(this,a);ZQ(a,0);0===this.version?ZQ(a,0):ZQ(a,0);ZQ(a,this.h);ZQ(a,this.j);_.Hm(a,_.Aj(this.o));if(1===this.h&&0===this.j){ZQ(a,0);for(var b=0;b<this.l.length;b++)ZQ(a,this.l[b])}a.getPosition()};_.x(UR,Z);UR.prototype.a=function(){var a=8;this.flags&1&&(a+=dR(this.Ub).byteLength);return a+Z.prototype.a.call(this)};UR.prototype.write=function(a){Z.prototype.write.call(this,a);_.Hm(a,dR(this.h));_.U(a,this.j);this.flags&1&&_.Hm(a,dR(this.Ub));a.getPosition()};
|
|
66
|
+
_.x(VR,eR);VR.prototype.a=function(){return dR(this.h).byteLength+eR.prototype.a.call(this)};VR.prototype.write=function(a){eR.prototype.write.call(this,a);_.Hm(a,dR(this.h));a.getPosition()};_.x(WR,Z);WR.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=4;for(var b=0;1>b;b++)a=0===this.version?a+4:a+8;return a+Z.prototype.a.call(this)};
|
|
67
|
+
WR.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.U(a,0),_.U(a,0));_.U(a,1);for(var b=0;1>b;b++)0===this.version?_.U(a,this.offset[b]):YQ(a,this.offset[b]);a.getPosition()};_.x(YR,Z);YR.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.h&&(a+=this.l.length);return a+Z.prototype.a.call(this)};
|
|
68
|
+
YR.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.U(a,0),_.U(a,0));ZQ(a,this.h);_.U(a,this.j);if(0===this.h)for(var b=0;b<this.j;b++)ZQ(a,this.l[b]);a.getPosition()};_.x(ZR,Z);ZR.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.j;b++)if(a+=this.h[b].Rh.byteLength,this.flags&2){a+=2;for(var c=0;c<this.h[b].vd;c++)a+=2,a+=4}return a+Z.prototype.a.call(this)};
|
|
69
|
+
ZR.prototype.write=function(a){Z.prototype.write.call(this,a);_.U(a,this.j);this.flags&1&&ZQ(a,this.l);for(var b=0;b<this.j;b++)if(_.Hm(a,this.h[b].Rh),this.flags&2){aR(a,this.h[b].vd);for(var c=0;c<this.h[b].vd;c++)aR(a,this.h[b].wg[c].Rg),_.U(a,this.h[b].wg[c].Sg)}a.getPosition()};var fS=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,gS=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,hS=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,iS=/^(\d*\.?\d*)f$/,jS=/^(\d*\.?\d*)t$/,kS=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;oS.prototype.get=function(a){for(var b=0;b<this.a.length;b++){var c=this.a[b].get(a);if(c)return c}return null};oS.prototype.write=function(){this.f=nS(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var rS=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.u=xS.prototype;_.u.configure=function(a){this.f=a};_.u.start=function(a,b){var c=this;this.B=b;var d=_.ch(new Set([a,$R(a)])).concat();return yS(this,d).then(function(e){return FS(c,e.data).then(function(){KS(c,c.A);return c.h})})};_.u.requestStop=function(){};_.u.stop=function(){this.B&&this.B.networkingEngine.cf(this.L);this.A=this.w=this.h=this.f=this.B=null;this.j&&(clearTimeout(this.j),this.j=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
|
|
70
|
+
_.u.update=function(){var a=this;if(this.Hd())return yS(this,[this.l]).then(function(b){return FS(a,b.data).then(function(){return a.h})})["catch"](function(b){if(a.B)a.B.onError(b)})};_.u.setCurrentVariant=function(){};_.u.tb=function(){var a=this;this.g.debug(_.sB);this.B&&(this.j=null,this.update().then(function(){KS(a,a.A)})["catch"](function(b){a.B&&(a.B.onError(b),1===b.severity&&KS(a,100))}))};_.u.Hd=function(){return this.M===BS};_.u.Uf=function(){return 0<this.o.length};
|
|
71
|
+
_.u.Fh=function(a){var b=null;if(this.o.length)for(var c=0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b};
|
|
72
|
+
_.u.dn=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.w.timescale,c={isLive:this.Hd.bind(this),Pe:this.Uf.bind(this),fl:function(){return 1},Le:this.Fh.bind(this)},d=!1,e=new _.P(_.Q,3,4035,null),f=null;try{var g=this.G.get(a.request.uris[a.request.uriIndex])||a.request.startTime||0;g!==a.request.startTime&&this.g.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=tS(a,b,g,c)}catch(h){d=
|
|
73
|
+
!0,e.data=h,3E3===h.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var IS={video:_.Gg,audio:_.gd,text:_.Zc},wS=_.nc,BS="LIVE",JS={Dn:_.qd,Kn:_.ng};_.x(LS,_.Gs);LS.prototype.f=function(){_.Ft.ism=xS;_.Dt[_.$c]=xS};LS.prototype.a=function(){_.ZE("ism");_.$E(_.$c)};LS.prototype.id=function(){return _.eg};_.J("clpp.smooth.SmoothComponent",LS);};
|
|
73
74
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
74
75
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
75
76
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.thumbnails.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
e,c,d)})},
|
|
4
|
-
this.f=null;this.o=this.h=1;this.j=0},
|
|
5
|
-
_.
|
|
6
|
-
b.thumbStreams.length})},
|
|
7
|
-
|
|
8
|
-
this.height*(this.
|
|
9
|
-
|
|
10
|
-
2014,"Failed to load thumbnail.",g))};a.
|
|
11
|
-
|
|
12
|
-
new _.P(1,9,7100,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
d.substr(0,d.lastIndexOf("/"))+"/"+h);t=
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
b();g=f.findSegmentPosition(a-e.startTime);if(null===g||void 0===g)throw c.log.error("Could not find segment index for specified position",a),b();h=f.getSegmentReference(g);if(!h)return
|
|
23
|
-
t,v));return n?_.
|
|
24
|
-
|
|
25
|
-
_.
|
|
26
|
-
_.
|
|
27
|
-
|
|
2
|
+
var f=function(window){var fy="No thumbnail found for position: ",gy="Position is out of range: ",hy="Thumbnail URL is mandatory",iy="Wrong gridSize format",jy="clpp.thumbnails",ky=function(){this.log=new _.K(jy);this.player=null;this.a=[];this.w=!1},my=function(a,b){b.reduce(function(c,d){var e=d,f=!1;typeof d===_.Ye&&(e=d.step,f=d.preloadWhileBuffering);return c.then(function(){return ly(a,0,e,!!f)})},Promise.resolve())},ly=function(a,b,c,d){if(a.w||b>=a.a.length)return Promise.resolve();var e=b+c;return ny(a,d).then(function(){return a.a[b].load()}).then(function(){return ly(a,
|
|
3
|
+
e,c,d)})},ny=function(a,b){return new Promise(function(c){if(b||a.player.getState()!==_.sp)c();else a.player.one(_.md,function(){c()})})},oy=function(a,b,c,d,e,f,g,h,l,m,n,p){d=void 0===d?0:d;e=void 0===e?0:e;f=void 0===f?0:f;g=void 0===g?0:g;h=void 0===h?1:h;l=void 0===l?1:l;m=void 0===m?0:m;n=void 0===n?0:n;p=void 0===p?new Image:p;this.time=b;this.src=a;this.duration=c;this.x=d;this.y=e;this.width=f;this.height=g;this.wa=p;this.Dk=h;this.en=l;this.vl=m;this.wl=n;this.Wf=null},py=function(){ky.call(this);
|
|
4
|
+
this.f=null;this.o=this.h=1;this.j=0},qy=function(a,b){this.time=a;this.duration=0;this.offset=b;this.length=0;this.he=new _.Qj},ry=function(){this.g=new _.K(jy);this.f=new ArrayBuffer(0);this.a=[];this.h=new _.Qj},sy=function(a){var b=a.f.byteLength;a.a.forEach(function(c){c.offset+c.length<b&&c.he.resolve()})},uy=function(a,b){return ty(a,b).then(function(c){return new oy(c,b.time,b.duration)})},ty=function(a,b){return b.load().then(function(){var c=_.nj(a.f,b.offset,b.length);return"data:image/jpeg;base64,"+
|
|
5
|
+
_.xj(c)})},vy=function(){ky.call(this);this.f=null},wy=function(a){a=a.split(/\.|:/).map(parseFloat);var b=0,c,d={3:.001,2:1,1:60,0:3600};for(c=a.length-1;0<=c;c--)b+=a[c]*d[c];return b},xy=function(){ky.apply(this,arguments)},yy=function(a,b){var c=a.horizontalTiles||b.horizontalTiles||1,d=a.verticalTiles||b.verticalTiles||1,e=c*d;return{Wd:c,Fg:d,Qh:e,durationPerTile:a.durationPerTile||b.durationPerTile||(a.endTime-a.startTime)/e}},zy=function(){this.g=new _.K(jy);this.a=this.m=null},Ay=function(a){return a.some(function(b){return 0<
|
|
6
|
+
b.thumbStreams.length})},Fy=function(a){return a?a===By||a===Cy?new py:a===Dy?new vy:a===Ey?new ry:null:null},Gy=function(a){if(!a)return null;a=new _.sk(a);return a.path.match(/.*\.vtt$/i)?Dy:a.path.match(/.*\.bif$/i)?Ey:a.path.match(/.*\.(png|jpg|jpeg)$/i)?By:null},Hy=function(){};ky.prototype.init=function(a,b){var c=this;this.player=a;a.one(_.Nf,function(){c.w=!0});a.isLive()||this.l().then(function(){b&&b.preload&&my(c,b.preload)})};oy.prototype.raw=function(){return this.wa.cloneNode(!1)};
|
|
7
|
+
oy.prototype.element=function(a,b){var c=this.width,d=this.height,e=this.width/this.height;void 0!==a&&void 0===b&&(b=0);null!==a&&void 0!==a&&(c=a);null!==b&&void 0!==b&&(d=b);c||(c=Math.ceil(d*e));d||(d=Math.ceil(c/e));e=document.createElement(_.ae);e.style.width=c+_.Kf;e.style.height=d+_.Kf;e.style.backgroundColor="#000";e.style.backgroundRepeat="no-repeat";e.style.backgroundImage='url("'+this.src+'")';e.style.backgroundSize=Math.ceil(c/this.width*(this.wa.naturalWidth||this.wa.width))+"px "+Math.ceil(d/
|
|
8
|
+
this.height*(this.wa.naturalHeight||this.wa.height))+_.Kf;var f=this.y/this.height;e.style.backgroundPositionX="-"+this.x/this.width*c+_.Kf;e.style.backgroundPositionY="-"+f*d+_.Kf;return e};
|
|
9
|
+
oy.prototype.load=function(){var a=this;this.Wf||(this.Wf=new Promise(function(b,c){function d(){a.width||(a.width=(a.wa.naturalWidth||a.wa.width)/a.Dk);a.height||(a.height=(a.wa.naturalHeight||a.wa.height)/a.en);a.x||(a.x=a.width*a.vl);a.y||(a.y=a.height*a.wl)}if(a.wa.src&&a.wa.complete)d(),b(a);else{var e=null,f=function(){d();a.wa.removeEventListener("load",f);a.wa.removeEventListener(_.se,e);b(a)};e=function(g){a.wa.removeEventListener("load",f);a.wa.removeEventListener(_.se,e);c(new _.P(1,9,
|
|
10
|
+
2014,"Failed to load thumbnail.",g))};a.wa.addEventListener("load",f);a.wa.addEventListener(_.se,e);a.wa.src=a.src}}));return this.Wf};_.J("clpp.thumbnails.Thumbnail",oy);oy.prototype.load=oy.prototype.load;oy.prototype.element=oy.prototype.element;oy.prototype.raw=oy.prototype.raw;_.x(py,ky);
|
|
11
|
+
py.prototype.init=function(a,b){if(!b||!b.url)throw new _.P(1,9,7100,hy);if("GRID"===b.mode&&!b.gridSize)throw new _.P(1,9,7100,"Grid size is mandatory for GRID mode");if(!b.duration)throw new _.P(1,9,7100,"Duration is mandatory");this.f=b;this.j=this.f.duration;if(this.f.gridSize)try{var c=this.f.gridSize.split(/x/).map(function(d){return parseInt(d,10)}).filter(function(d){return 0<d});if(2===c.length)this.h=c[0],this.o=c[1];else throw new _.P(1,9,7100,iy);}catch(d){throw this.log.error("Error during parsing gridSize",d),
|
|
12
|
+
new _.P(1,9,7100,iy);}ky.prototype.init.call(this,a,b)};py.prototype.get=function(a){var b=this,c,d,e,f;return _.I(function(g){if(1==g.a){c=b.player.getDuration();if(0>a||a>c)throw new _.P(1,9,2014,gy+a);d=b.f.duration;e=Math.floor(a/d);f=b.a[e];if(!f)throw new _.P(1,9,2014,"No thumbnail found for position "+a+" at index "+e);return _.y(g,f.load(),2)}return g["return"](f)})};
|
|
13
|
+
py.prototype.l=function(){if(0<this.a.length)return Promise.resolve();var a=this.player.getDuration(),b=this.h*this.o;a=Math.ceil(Math.ceil(a/this.j)/b);for(var c=this.f.templateKey||"$index$",d=0;d<a;d++)for(var e=this.f.url.replace(c,String(d+1)),f=new Image,g=0;g<b;g++)this.a.push(new oy(e,this.j*(d*b+g),this.j,0,0,0,0,this.h,this.o,g%this.h,Math.floor(g/this.h),f));return Promise.resolve()};qy.prototype.load=function(){return this.he};
|
|
14
|
+
ry.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.P(1,9,7100,hy);var d=b.url,e=_.Lj(d);e.type=_.Kj;a.getNetworkEngine().fetch(e).N.then(function(f){f=f.data;var g=_.nj(c.f);f=_.nj(f);for(var h=g.byteLength+f.byteLength,l=new ArrayBuffer(h),m=new DataView(l),n=0,p=0,q=g.byteLength;p<q;p++)m.setUint8(n,g[p]),n+=1;g=0;for(p=f.byteLength;g<p;g++)m.setUint8(n,f[g]),n+=1;c.f=l;c.g.info("Appended "+f.byteLength+" bytes.Total data now "+(h+" bytes."));l=c.f;f=_.nj(l);n=String.fromCharCode.apply(null,
|
|
15
|
+
Iy);g=Array.prototype.slice.call(f,0,8);f=64;h=0;m=!1;if(n===String.fromCharCode.apply(null,g))for(l=new DataView(l,16,20),l=l.getUint32(0,!0),0===l&&(l=1E3);!m;){h+=1;g=l;n=new DataView(c.f,f);m=n.getUint32(0,!0);g=m*g/1E3;n=n.getUint32(4,!0);n=new qy(g,n);if(g=c.a.length)g=c.a[g-1],g.length=n.offset-g.offset,g.duration=n.time-g.time;c.a.push(n);f+=8;(m=4294967295===m)&&c.h.resolve();if(1E5<h)throw Error("There was a problem during reading BIF entries");}else throw Error("The file is not a valid BIF format");
|
|
16
|
+
sy(c)})["catch"](function(f){c.g.error("[BIF] Error while loading thumbnails '\n + 'URL: "+d,f);a.onError(new _.P(1,9,2013,"Error while loading and parsing BIF thumbnails.",f))})};ry.prototype.get=function(a){var b=this,c,d;return _.I(function(e){switch(e.a){case 1:if(0>a)throw new _.P(1,9,2014,gy+a);return _.y(e,b.h,2);case 2:c=b.a.find(function(f){return a>=f.time&&a<f.time+f.duration});if(!c)throw new _.P(1,9,2014,fy+a);return _.y(e,uy(b,c),3);case 3:return d=e.f,_.y(e,d.load(),4);case 4:return e["return"](d)}})};
|
|
17
|
+
ry.prototype.Vd=function(){return 0<this.a.length};var Iy=[137,66,73,70,13,10,26,10];_.x(vy,ky);
|
|
18
|
+
vy.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.P(1,9,7100,hy);var d=b.url,e=_.Lj(d);e.type=_.Kj;this.f=a.getNetworkEngine().fetch(e).N.then(function(f){f=f.data;if(!f)throw Error("No data in the response");f=_.S.ea(f).split(/\n/);for(var g=0;g<f.length;g++){var h=f[g],l=h.split(" --\x3e ");if(2===l.length){h=f[++g];var m=h.indexOf("\x3d"),n=0>m?[]:h.substr(m+1).split(/,/).map(parseFloat);m=n[0];var p=n[1],q=n[2];n=n[3];var t=h.indexOf("#");h=0>t?h:h.substr(0,t);h.match(/^http|^\/\//)||(h=
|
|
19
|
+
d.substr(0,d.lastIndexOf("/"))+"/"+h);t=wy(l[0]);l=wy(l[1])-t;c.a.push(new oy(h,t,l,m,p,q,n,0,0))}}})["catch"](function(f){c.log.error("[VTT] Error while loading thumbnails URL: "+d,f);a.onError(new _.P(1,9,2013,"Error while loading VTT thumbnails.",f))});ky.prototype.init.call(this,a,b)};
|
|
20
|
+
vy.prototype.get=function(a){var b=this,c;return _.I(function(d){if(1==d.a){if(0>a)throw new _.P(1,9,2014,gy+a);return _.y(d,b.f,2)}if(3!=d.a){c=b.a.find(function(e){return a>=e.time&&a<e.time+e.duration});if(!c)throw new _.P(1,9,2014,fy+a);return _.y(d,c.load(),3)}return d["return"](c)})};vy.prototype.l=function(){return this.f};_.x(xy,ky);
|
|
21
|
+
xy.prototype.get=function(a){function b(){return new _.P(1,9,2014,fy+a)}var c=this,d,e,f,g,h,l,m,n,p,q,t,v,z;return _.I(function(B){if(1==B.a){if(0>a)throw c.log.error("Position must be greater than 0 but is "+a),new _.P(1,9,2014,gy+a);d=c.player.getPeriods();for(var F=null,G=_.w(d),A=G.next();!A.done;A=G.next())A=A.value,A.startTime<=a&&(F=A);e=F;if(!e)throw c.log.error("Could not find period for specified position",a),b();f=e.thumbStreams.sort(c.f)[0];if(!f)throw c.log.error("Could not find thumb stream for specified position",a),
|
|
22
|
+
b();g=f.findSegmentPosition(a-e.startTime);if(null===g||void 0===g)throw c.log.error("Could not find segment index for specified position",a),b();h=f.getSegmentReference(g);if(!h)return B.F(2);l=yy(h,f);m=Math.floor((a-h.startTime)/l.durationPerTile);0<c.a.length?(p=f.findSegmentPosition(0),null!==p&&(n=c.a[(g-p)*l.Qh+m])):(q=h.Sa())&&0<q.length&&(v=t=0,z=h.startTime,1<l.Qh&&(t=m%l.Wd,v=Math.floor(m/l.Wd),z+=m*l.durationPerTile),n=new oy(q[0],z,l.durationPerTile,void 0,void 0,void 0,void 0,l.Wd,l.Fg,
|
|
23
|
+
t,v));return n?_.y(B,n.load(),4):B.F(2)}if(2!=B.a)return B["return"](n);c.log.error("segment reference for specified segment index does not exist",g);throw b();})};xy.prototype.f=function(a,b){return void 0!==a.bandwidth&&void 0!==b.bandwidth?a.bandwidth-b.bandwidth:0};
|
|
24
|
+
xy.prototype.l=function(){if(0<this.a.length)return Promise.resolve();var a=this.player.getPeriods();a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value.thumbStreams.sort(this.f)[0])for(var c=b.findSegmentPosition(0),d=void 0;null!==c&&!_.O.S(d=b.getSegmentReference(c++));)for(var e=yy(d,b),f=d.Sa()[0],g=new Image,h=d.startTime,l=0;l<e.Fg;++l)for(var m=0;m<e.Wd;++m)this.a.push(new oy(f,h,e.durationPerTile,void 0,void 0,void 0,void 0,e.Wd,e.Fg,m,l,g)),h+=e.durationPerTile;return Promise.resolve()};_.u=zy.prototype;_.u.onPlayerCreated=function(a){this.m=a};_.u.onPlayerWillDestroy=function(){this.m=null};_.u.onPlayerWillRelease=function(){this.a=null};
|
|
25
|
+
_.u.onContentWillLoad=function(a){var b=this,c=a.getConfiguration().thumbnails;if(c)if(!1===c.enabled)this.g.info("Thumbnails disabled.");else{var d=c.mode||null;d||(d=Gy(c.url||null));(this.a=Fy(d))?(this.g.info("Loading thumbs configuration",c),this.m.one(_.Ke,function(){b.g.info("Initialize thumbnails provider");try{b.a.init(a,c)}catch(e){b.m.onError(e)}})):this.g.warn("Unknown thumbnail mode",d)}else this.a=null};
|
|
26
|
+
_.u.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);if(!this.a&&(c=(c=a.getConfiguration())&&c.thumbnails,!c||void 0===c.enabled||c.enabled)){var d=a.getPeriods();if(Ay(d)){this.a=new xy;try{this.a.init(a,c)}catch(e){this.m.onError(e)}}}};_.u.get=function(a){return this.a?this.a.get(a):Promise.reject(new _.P(1,9,2014,"Thumbnail format is not supported"))};_.u.id=function(){return"thumbnails"};_.J("clpp.thumbnails.ThumbnailsPlugin",zy);zy.prototype.get=zy.prototype.get;zy.Id="thumbnails";
|
|
27
|
+
Hy.prototype.create=function(){return new zy};_.Zq(new Hy);var By="SINGLE",Cy="GRID",Dy="WEBVTT",Ey="BIF";};
|
|
28
28
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
29
29
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
30
30
|
else{_=this.clpp._;(f.call(g,this));}
|