@castlabs/prestoplay 6.13.0 → 6.14.1
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 +42 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -6
- package/cjs/cl.cast.js +111 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +528 -518
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +60 -58
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +265 -274
- package/cjs/cl.muxdata.js +15 -14
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +70 -70
- 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 +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +441 -431
- package/cl.crypto.js +8 -8
- package/cl.dash.js +68 -68
- package/cl.externs.js +60 -58
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +236 -239
- package/cl.muxdata.js +13 -12
- 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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/clpp.styles.css +2 -0
- package/package.json +4 -4
- package/typings.d.ts +93 -50
package/cjs/cl.smooth.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
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
|
-
a},
|
|
8
|
-
"tfdt",a,0);this.h=b},
|
|
9
|
-
"schm",0,0);this.h=a;this.j=b;this.Jb=""},
|
|
10
|
-
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.Bi([a],[b])[0]},
|
|
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==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))},
|
|
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
|
-
!1);if(!h)return null;var l=(new
|
|
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=_.R.
|
|
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
|
-
_.x(f,d.O,2);e=f.f;a.l=e.uri;return f["return"](e)})},
|
|
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
|
-
B)}
|
|
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
|
-
_.w(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_.w(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
_.w(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
_.w(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
_.r.update=function(){var a=this;if(this.
|
|
70
|
-
_.r.
|
|
71
|
-
_.r.
|
|
72
|
-
!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
|
|
2
|
+
var f=function(window){var OL="Full MP4 box must have flags defined",PL="clpp.smooth.SmoothMP4Processor",QL="codecPrivateData",RL=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.V(a,c);_.V(a,d)},SL=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.nm()}},TL=function(a,b){SL(a,b>>16&255);SL(a,b>>8&255);SL(a,b&255)},UL=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.nm()}},VL=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.nm()}},WL=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.h),a.a+=2}catch(c){_.nm()}},XL=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},YL=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){YL.call(this,a);this.version=b;this.flags=c},ZL=function(a,b,c){YL.call(this,a);this.h=b;this.offset=c},$L=function(a,b,c,
|
|
4
|
+
d,e){Z.call(this,a,b,c);this.h=d;this.offset=e},aM=function(a,b,c){YL.call(this,"ftyp");this.j=a;this.ih=b;this.h=c},bM=function(){YL.call(this,_.Re)},cM=function(){YL.call(this,_.gg)},dM=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]},eM=function(){YL.call(this,"mvex")},fM=function(a){Z.call(this,"trex",0,0);this.h=a},gM=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]},hM=function(a,b){Z.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},iM=function(a){Z.call(this,"hdlr",0,0);this.h=a},jM=function(){Z.call(this,"vmhd",0,1);this.h=new Uint8Array([0,0,0,0,0,0])},kM=function(a){YL.call(this,a);this.A=!0},lM=function(a){kM.call(this,a);this.height=this.width=0;this.depth=24},mM=
|
|
6
|
+
function(a,b,c,d){kM.call(this,a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},nM=function(a,b){lM.call(this,"avc1");this.width=a;this.height=b},oM=function(a,b){nM.call(this,a,b);this.type="encv"},pM=function(a,b,c){mM.call(this,"mp4a",a,b,c)},qM=function(a,b,c){pM.call(this,a,b,c);this.type="enca"},rM=function(a,b){YL.call(this,"avcC");this.Ta=a;this.$b=b;this.version=1;this.h=this.Ta[0][1];this.j=this.Ta[0][2];this.level=this.Ta[0][3]},sM=function(a){Z.call(this,"esds",0,0);this.Ob=
|
|
7
|
+
a},tM=function(a){a=void 0===a?"":a;Z.call(this,"url ",0,1);this.location=a},uM=function(){Z.call(this,"dref",0,0)},vM=function(){YL.call(this,_.Xf)},wM=function(){Z.call(this,_.Zf,0,0)},xM=function(){Z.call(this,"stts",0,0)},yM=function(){Z.call(this,"stsc",0,0)},zM=function(){Z.call(this,"stco",0,0)},AM=function(){Z.call(this,"stsz",0,0)},BM=function(){Z.call(this,"smhd",0,0)},CM=function(){YL.call(this,"dinf")},DM=function(){YL.call(this,_.Qe)},EM=function(){YL.call(this,_.Me)},FM=function(a,b){Z.call(this,
|
|
8
|
+
"tfdt",a,0);this.h=b},GM=function(){Z.call(this,"mfhd",0,0);this.h=0},HM=function(a,b){Z.call(this,"trun",a,b);this.o=this.l=this.h=0;this.w=[];this.sampleSize=[];this.B=[];this.j=[]},IM=function(a,b){Z.call(this,"tfhd",a,b);this.h=255;this.o=this.w=this.l=this.B=this.j=0},JM=function(){YL.call(this,"traf")},KM=function(){YL.call(this,"moof")},LM=function(){YL.call(this,_.Le);this.h=new Uint8Array(0)},MM=function(){Z.call(this,"tenc",0,0);this.h=1;this.j=8;this.o="";this.l=[]},NM=function(a,b){Z.call(this,
|
|
9
|
+
"schm",0,0);this.h=a;this.j=b;this.Jb=""},OM=function(a){YL.call(this,"frma");this.h=a},PM=function(){Z.call(this,"saio",0,0);this.offset=[0]},QM=function(a,b,c){Z.call(this,"saiz",0,0);this.h=a;this.l=b;this.j=c},RM=function(a,b){Z.call(this,"senc",a,b);this.j=0;this.l=8;this.h=[]},SM=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},TM=function(a,b,c,d){c=b.Jg[c];b=b.Cm;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",
|
|
10
|
+
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.Bi([a],[b])[0]},UM=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.tg?c=["maxWidth","maxHeight","bitrate",QL,"fourCC"]:a.type===_.$c&&(c=["bitrate",QL,"channels","bitsPerSample","samplingRate","fourCC"]);return _.O.ta(a,b,c,["id","segmentIndex"])},VM=function(a,b,c){var d=c.de.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ta:null,$b:null,width:NaN,height:NaN,Ob:null,Od:NaN,
|
|
11
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.tg:a.Ta=[_.jj(d[1])];a.$b=[_.jj(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.$c:a.Ob=_.jj(c.de),a.sampleSize=c.mi||16,a.Od=c.Od,a.channelCount=c.hg}return a},WM=function(a,b){return a.filter(function(c){return c.type===b})},XM=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)},dN=function(a,b,c){var d=null;if(YM.test(a)){a=YM.exec(a);d=
|
|
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 ZM.test(a)?d=XM(ZM,a):$M.test(a)?d=XM($M,a):aN.test(a)?(a=aN.exec(a),d=Number(a[1])/c.frameRate):bN.test(a)?(a=bN.exec(a),d=Number(a[1])/c.a):cN.test(a)&&(d=XM(cN,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*d);return b+":"+c+":"+a+"."+d},eN=function(a,
|
|
13
|
+
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))},gN=function(a){this.a=a;this.f=fN(this)},fN=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.mm(b)},hN=function(a,b,c){a:{var d=_.u([_.Sd,_.Qd]);for(var e=d.next();!e.done;e=d.next())if((e=c.ke(e.value))&&e.keyId){d=e.keyId;break a}_.J(PL,"Could not get default Key ID for DRM init data!");
|
|
14
|
+
d=null}c=new YL("xxxx");a.type===_.tg?c=new oM(a.width,a.height):c=new qM(a.channelCount,a.sampleSize,a.Od);a=new MM;a.h=1;a.j=8;a.o=d||"00000000000000000000000000000000";a=(new YL("schi")).append([a]);b=(new YL(_.Sf)).append([new OM(b),new NM(_.rd,65536),a]);c.append([b]);return c},iN=function(a,b){var c=b.pe(),d=new dM(a.timescale,a.duration,a.id),e=(new eM).append([new fM(a.id)]),f=new gM(a.id,a.duration,a.timescale,a.width,a.height),g=new hM(a.timescale,a.duration),h=new iM(a.type),l=null,m=new uM;
|
|
15
|
+
m.entries=[new tM];var n=new wM;switch(a.type){case _.tg:var p=new rM(a.Ta,a.$b);c?(l=hN(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new nM(a.width,a.height)).append([p]),n.entries=[l]);l=new jM;break;case _.$c:p=new sM(a.Ob),c?(l=hN(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new pM(a.channelCount,a.sampleSize,a.Od)).append([p]),n.entries=[l]),l=new BM}n=(new vM).append([n,new xM,new yM,new AM,new zM]);m=(new CM).append([m]);m=(new DM).append([l,m,n]);g=(new EM).append([g,h,m]);f=(new cM).append([f,
|
|
16
|
+
g]);d=(new bM).append([d,f,e]);e=new aM("dash",0,["iso6","mp41","avc1"]);c&&(c=b.ke(_.Qd),f=b.ke(_.Sd),c&&d.append([new ZL("pssh",c.initData,8)]),f&&d.append([new ZL("pssh",f.initData,8)]),c||f||_.J(PL,"Could not get PSSH init data!"));c=new gN([e,d]);return _.Xi(c.write())},kN=function(a,b){var c,d,e,f,g,h;(new _.ym).M("moof",_.zm).Y("mfhd",function(m){var n=new GM;n.h=_.W(m.reader);c=n}).M("traf",_.zm).Y("tfhd",function(m){var n=m.reader.Ga();if(null===m.flags)throw new _.P(_.Q,3,3019,OL);var p=
|
|
17
|
+
new IM(m.version||0,m.flags||0);p.h=_.W(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.vm(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.B=_.W(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.l=_.W(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.w=_.W(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.o=_.W(m.reader));d=p}).Y("trun",function(m){var n=m.reader.Ga();if(null===m.flags)throw new _.P(_.Q,3,3019,OL);var p=new HM(m.version||0,m.flags||0);p.h=_.W(m.reader);0<n-
|
|
18
|
+
m.reader.getPosition()&&m.flags&1&&(p.l=_.um(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.o=_.W(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.h;n++)m.flags&256&&p.w.push(_.W(m.reader)),m.flags&512&&p.sampleSize.push(_.W(m.reader)),m.flags&1024&&p.B.push(_.W(m.reader)),m.flags&2048&&(0===m.version?p.j.push(_.W(m.reader)):p.j.push(_.um(m.reader)));e=p}).Y("sdtp",function(m){var n=_.xm(m.reader,m.reader.Ga());f=new $L("sdtp",m.version||0,m.flags||0,n,0)}).M("uuid",function(m){var n=_.xm(m.reader,
|
|
19
|
+
16);if(_.lj(n,jN)){n=_.W(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new RM(m.version,m.flags);n.j=_.W(m.reader);m.flags&1&&(n.l=_.sm(m.reader));for(var p=0;p<n.j;p++){var q={Yg:_.xm(m.reader,8),bd:0,Qf:[]};if(m.flags&2){q.bd=_.tm(m.reader);for(var t=0;t<q.bd;t++){var v={fg:0,gg:0};v.fg=_.tm(m.reader);v.gg=_.W(m.reader);q.Qf.push(v)}}n.h.push(q)}g=n}}).M(_.Le,function(m){var n=new LM;0<m.reader.Ga()?n.h=_.xm(m.reader,m.reader.Ga()):(_.J(PL,"mdat box is empty!"),n.h=new Uint8Array(0));h=n}).parse(a,
|
|
20
|
+
!1);if(!h)return null;var l=(new JM).append([d,e]);f&&l.append([f]);b.pe()&&g&&l.append([g]);l=(new KM).append([c,l]);return new gN([l,h])},lN=function(a,b,c,d){var e=d.pe(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=kN(b,d);if(null===g)return a.request.contentType===_.Di?a.data:g;d=g.get(_.Le);if(a.request.contentType===_.Di){e=d.h.buffer;if(c){e=_.R.zd(e);if((e=(new DOMParser).parseFromString(e,_.eg))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new eN(h.getAttribute("ttp:frameRate"),
|
|
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",_.ne],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 D=q[v].name;if(D=D.match(t)){p=p.getAttribute(D[0]);break b}}p=null}}f.setAttribute(l[m],dN(p||
|
|
22
|
+
"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.R.Ua(e).buffer}else c=e;return c}h=new KM;a=g.get("mfhd");b=new JM;l=g.get("tfhd");m=new FM(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].bd);else g=8;b.append([c,new PM,new QM(g,l,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new gN([h,d]);h=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=
|
|
23
|
+
c.start+16,d.seek(e.start),e.write(d),h=d.buffer);return h},mN=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},nN=function(a,b,c){a=_.Bn(a);c&&a.version!==c&&(a=_.Tz(a,c));return{initData:_.Rz(a),initDataType:_.rd,keyId:b,periodId:null}},pN=function(){this.w=this.h=this.f=this.C=null;this.P=1;this.U=0;this.l="";this.B=this.a=null;this.g=
|
|
24
|
+
new _.K("clpp.smooth.SmoothParser");this.J=!1;this.j=this.A=null;this.L=oN;this.H=0;this.D=this.I=Infinity;this.o=[];this.K=this.fm.bind(this);this.G=new Map},qN=function(a,b){var c,d,e;return _.E(function(f){if(1==f.a)return c=_.uj(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,c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.C.networkingEngine.fetch(c),
|
|
25
|
+
_.x(f,d.O,2);e=f.f;a.l=e.uri;return f["return"](e)})},xN=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.R.zd(b);var f=d.parseFromString(e.trim(),_.eg)}catch(wF){throw wF;}if(f&&f.documentElement.tagName==_.ac)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(wF){}if(!c)throw a.g.error("Unable to parse manifest"),new _.P(_.Q,4,4033,a.l);var h=+rN(a,c,"MajorVersion"),l=+rN(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+rN(a,c,"Duration"),
|
|
26
|
+
p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),t=+c.getAttribute("DVRWindowLength")||Infinity,v=_.nn(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?(sN(a,tN),a.A=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):sN(a,oN);a.a={startTime:0,delay:0,duration:n/m,$e:t/m,Hd:0};if(v){var z=a.f.playreadyVersion,D=[],G=_.nn(v,"ProtectionHeader")[0],
|
|
27
|
+
F=_.ij(_.pn(G)||""),B=_.Bn(F).a;D.push(mN(_.Sd,{initData:_.Rz(_.un(B)),initDataType:_.rd,keyId:B,periodId:null},[B]));D.push(mN(_.Qd,nN(F,B,z),[B]));a.o=D}var H=[],N=_.nn(c,"StreamIndex");if(!N.length)throw a.g.error("No streams found!"),new _.P(_.Q,4,4034,a.l);for(var M=0;M<N.length;M++){for(var S,ba=a,qa=N[M],Ta=rN(ba,qa,"Type"),Ga=+qa.getAttribute("Chunks"),Ca=qa.getAttribute("Subtype"),oa=qa.getAttribute("Language")||_.ig,Ia=_.Qi(oa),tb=qa.getAttribute("Name")||"",Ib=+qa.getAttribute(_.wb),Oc=
|
|
28
|
+
+qa.getAttribute(_.vb),Gm=rN(ba,qa,"Url"),Ts=+qa.getAttribute("TimeScale")||null,Pc=[],Hm=_.nn(qa,_.Ob),Bt=0;Bt<Hm.length;Bt++){var of=void 0,hc=void 0,Ct=void 0,pf=ba,sd=Hm[Bt],Dt=Ta,fR=+sd.getAttribute("Index"),gR=+rN(pf,sd,"Bitrate"),zF=NaN,AF=NaN,Cn=NaN,Et=NaN,BF=NaN,CF=NaN,DF=NaN,EF=sd.getAttribute("FourCC");switch(Dt){case _.tg:zF=+rN(pf,sd,_.vb);AF=+rN(pf,sd,_.wb);break;case _.$c:Et=+sd.getAttribute("Channels")||2,Cn=+rN(pf,sd,"SamplingRate"),CF=+rN(pf,sd,"AudioTag"),BF=+rN(pf,sd,"BitsPerSample"),
|
|
29
|
+
DF=+rN(pf,sd,"PacketSize")}var Ft=String(sd.getAttribute("CodecPrivateData"));if(Dt===_.$c&&!Ft){var FF=Et,GF={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},Dn=GF[Cn];if("AACH"===EF){hc=new Uint8Array(4);var HF=GF[2*Cn];hc[0]=40|Dn>>1;hc[1]=Dn<<7|FF<<3|HF>>1;hc[2]=HF<<7|8;hc[3]=0;of=new Uint16Array(2);of[0]=(hc[0]<<8)+hc[1];of[1]=(hc[2]<<8)+hc[3];Ct=of[0].toString(16)+of[1].toString(16)}else hc=new Uint8Array(2),hc[0]=16|Dn>>1,hc[1]=Dn<<7|FF<<3,
|
|
30
|
+
of=new Uint16Array(1),of[0]=(hc[0]<<8)+hc[1],Ct=of[0].toString(16);Ft=Ct.toUpperCase()}var hR={id:pf.U++,type:Dt,index:fR,bitrate:gR,de:Ft,maxHeight:zF,maxWidth:AF,Od:Cn,hg:Et,Vm:CF,mi:BF,ln:DF,Yj:EF,segmentIndex:null};Pc.push(hR)}S=Pc;for(var Ae=[],IF=_.nn(qa,"c"),Lj=0;Lj<IF.length;Lj++){var Gt=IF[Lj],Nd=parseInt(Gt.getAttribute("t"),10),Bh=parseInt(Gt.getAttribute("d"),10),Ht=parseInt(Gt.getAttribute("r"),10),Mj=0;if(isNaN(Nd)&&isNaN(Bh))throw ba.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
31
|
+
new _.P(_.Q,4,4037,ba.l);0===Lj&&isNaN(Nd)&&(Mj=Nd=0);if(0<Lj){var kg=Ae[Ae.length-1];Mj=kg.n+1;kg.d||(kg.d=Nd-kg.t);Nd||(Nd=kg.t+kg.d);Bh||(Bh=Nd-kg.t)}Ae.push({n:Mj,d:Bh,t:Nd});if(Ht){Ht--;for(var JF=0;JF<Ht;JF++){var En=Ae[Ae.length-1];Mj=En.n+1;Nd=En.t+En.d;Bh=En.d;Ae.push({n:Mj,d:Bh,t:Nd})}}}ba.rd()||Ae.length===Ga||ba.g.warn("Number of fragments ("+Ga+") differs from number of chunks ("+Ae.length+").");H.push({type:Ta,Zm:Ga,rm:Ca,language:Ia,Gd:oa,name:tb,maxWidth:Ib,maxHeight:Oc,Cm:Gm,tracks:S,
|
|
32
|
+
Jg:Ae,timescale:Ts})}var qf={jn:h,ih:l,timescale:m,duration:n,isLive:p,hn:q,$e:t,jf:!1,streams:H};if(a.h&&a.w)return uN(a,qf),Promise.resolve();a.G.clear();var It=qf.timescale,Fn=qf.duration,jR=WM(qf.streams,_.$c),kR=WM(qf.streams,_.tg),lR=WM(qf.streams,_.Di),KF=[],Gn=vN(a,Fn,It,jR),Hn=vN(a,Fn,It,kR),mR=vN(a,Fn,It,lR);Gn.length||(Gn=[null]);Hn.length||(Hn=[null]);for(var Kt=0;Kt<Hn.length;Kt++)for(var Lt=0;Lt<Gn.length;Lt++)KF.push(wN(a,Hn[Kt],Gn[Lt]));var LF={startTime:0,endTime:Fn,variants:KF,textStreams:mR,
|
|
33
|
+
thumbStreams:[]};var oR=qf.streams,Mt=a.a.startTime,MF=a.a.delay,Nt=a.I,NF=Math.min(a.a.duration||Infinity,Nt),Ot=a.rd(),pR=a.a.$e,qR=a.a.Hd,OF=a.H,PF=isFinite(a.D)?a.D:0;if(Ot)NF=Infinity,Mt=Date.now()/1E3-qR,a.a.startTime=Mt,MF=3*OF;else for(var rR=isFinite(Nt)?Nt:a.a.duration,QF=_.u(oR),Pt=QF.next();!Pt.done;Pt=QF.next())for(var RF=_.u(Pt.value.tracks),Qt=RF.next();!Qt.done;Qt=RF.next()){var SF=Qt.value;SF.segmentIndex.offset(-PF);_.sA(SF.segmentIndex,rR)}a.B=new _.AA(a.f.timeline||{},Mt,MF,!Ot,
|
|
34
|
+
!0);a.B.h=NF;_.GA(a.B,OF);a.B.w=pR;Ot||a.B.offset(-PF);a.C.filterAllPeriods([LF]);a.h={presentationTimeline:a.B,periods:[LF],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.jd(a.K),a.J=!0);a.w=qf;return Promise.resolve()},uN=function(a,b){for(var c=0;c<a.w.streams.length;c++)for(var d=b.streams[c],e={},f=_.u(a.w.streams[c].tracks),g=f.next();!g.done;e={Nb:e.Nb},g=f.next())if(e.Nb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Nb.type&&m.bitrate===l.Nb.bitrate}}(e))){UM(e.Nb,
|
|
35
|
+
g)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var h=yN(a,a.w.timescale,d,g);g=e.Nb.segmentIndex;g.oa(h);(h=a.a.$e)&&_.TA(g,_.SA(g)-h).forEach(function(l){l.Ra().forEach(function(m){a.G["delete"](m)})})}else a.g.warn("Cannot find satisfying update for "+e.Nb.type+" track with bitrate "+(e.Nb.bitrate+". Skipping update."))},vN=function(a,b,c,d){for(var e=[],f={Cc:0};f.Cc<d.length;f={Cc:f.Cc},f.Cc++){var g=d[f.Cc].tracks.map(function(h){return function(l){var m=
|
|
36
|
+
d[h.Cc],n=yN(a,c,m,l);n=new _.RA(n);var p=null;m.type!==_.Di&&(p=zN(a,b,c,m,l));l.segmentIndex=n;var q=_.uF++,t=Promise.resolve.bind(Promise),v=n.Kc.bind(n),z=n.get.bind(n),D=n.kd.bind(n),G=n.getDuration.bind(n),F=AN[m.type],B="";switch(m.type){case _.tg:B=l.de;var H=/00000001[0-9]7/.exec(B);B="avc1."+(H&&H[0]?B.substr(B.indexOf(H[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",B);break;case _.$c:B=l.de,H=2,"AACH"===l.Yj?H=5:B&&(H=(parseInt(B.substr(0,2),16)&248)>>3),B="mp4a.40."+H,a.g.debug("AUDIO CODECS: ",
|
|
37
|
+
B)}H=m.type===_.Di?BN[m.rm]:void 0;return{id:q,originalId:null,nn:null,createSegmentIndex:t,findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:D,getDuration:G,segmentIndex:n,segmentLookupStrategy:_.Cz,initSegmentReference:p,mimeType:F,codecs:B,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:H,encrypted:a.lf(),keyId:null,language:m.language,originalLanguage:m.Gd,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,
|
|
38
|
+
roles:[],channelsCount:l.hg||null,spatialAudio:!1,closedCaptions:null}}}(f));e=e.concat(g)}return e},yN=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.Jg.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=TM(a.l,c,l,d);a.H=Math.max(a.H,m);f.push(new _.Oi(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.G.set(q,n);e+=m});if(c.type===_.tg||c.type===_.$c)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Hd?a.a.Hd=b.endTime:a.a.Hd=Math.min(a.a.Hd,
|
|
39
|
+
b.endTime);return f},zN=function(a,b,c,d,e){b=VM(b,d.timescale||c,e);c={isLive:a.rd.bind(a),pe:a.lf.bind(a),ek:function(){return 1},ke:a.Lg.bind(a)};d=new Uint8Array(0);try{d=iN(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,"+_.hj(d);return new _.aA(function(){return[f]},0,null,null,!0)},wN=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.ig;return c||b?{id:a.P++,language:e,primary:!1,audio:c,
|
|
40
|
+
video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},rN=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);},CN=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Hb.bind(a),b))},sN=function(a,b){var c=b===oN;a.h&&a.h.presentationTimeline&&_.BA(a.h.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.L=b},DN=function(){};
|
|
41
|
+
YL.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};YL.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};YL.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};
|
|
42
|
+
YL.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.V(a,1):_.V(a,this.size);_.om(a,XL(this.type));this.size>b&&RL(a,this.size);"uuid"===this.type&&_.om(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()};_.w(Z,YL);Z.prototype.a=function(){return 4+YL.prototype.a.call(this)};Z.prototype.write=function(a){YL.prototype.write.call(this,a);SL(a,this.version);TL(a,this.flags)};
|
|
43
|
+
_.w(ZL,YL);ZL.prototype.a=function(){return this.h.byteLength+YL.prototype.a.call(this)-this.offset};ZL.prototype.write=function(a){YL.prototype.write.call(this,a);_.om(a,this.h,this.offset);a.getPosition()};_.w($L,Z);$L.prototype.a=function(){return this.h.byteLength+Z.prototype.a.call(this)-this.offset};$L.prototype.write=function(a){Z.prototype.write.call(this,a);_.om(a,this.h,this.offset);a.getPosition()};_.w(aM,YL);
|
|
44
|
+
aM.prototype.a=function(){var a=this.j.length;a=a+4+this.h.join("").length;return a+YL.prototype.a.call(this)};aM.prototype.write=function(a){YL.prototype.write.call(this,a);_.om(a,XL(this.j));_.V(a,this.ih);_.om(a,XL(this.h.join("")));a.getPosition()};_.w(bM,YL);_.w(cM,YL);_.w(dM,Z);dM.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)};
|
|
45
|
+
dM.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(RL(a,0),RL(a,0),_.V(a,this.timescale),RL(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));_.V(a,65536);UL(a,this.volume);UL(a,0);_.V(a,0);_.V(a,0);for(var b=0;b<this.h.length;b++)SL(a,this.h[b]);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,this.j);a.getPosition()};_.w(eM,YL);_.w(fM,Z);fM.prototype.a=function(){return 20+Z.prototype.a.call(this)};
|
|
46
|
+
fM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);_.V(a,1);_.V(a,0);_.V(a,0);_.V(a,0);a.getPosition()};_.w(gM,Z);gM.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)};
|
|
47
|
+
gM.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(RL(a,0),RL(a,0),_.V(a,this.j),_.V(a,0),RL(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.j),_.V(a,0),_.V(a,this.duration*this.timescale));_.V(a,0);_.V(a,0);UL(a,0);UL(a,0);UL(a,this.volume);UL(a,0);for(var b=0;b<this.h.length;b++)SL(a,this.h[b]);UL(a,this.width);UL(a,0);UL(a,this.height);UL(a,0);a.getPosition()};_.w(hM,Z);hM.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Z.prototype.a.call(this)};
|
|
48
|
+
hM.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(RL(a,0),RL(a,0),_.V(a,this.timescale),RL(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));UL(a,this.language);UL(a,0);a.getPosition()};_.w(iM,Z);iM.prototype.a=function(){return 33+Z.prototype.a.call(this)};
|
|
49
|
+
iM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);this.h===_.tg?_.om(a,XL("vide")):_.om(a,XL("soun"));_.V(a,0);_.V(a,0);_.V(a,0);this.h===_.tg?_.om(a,XL("VideoHandler\x00")):_.om(a,XL("SoundHandler\x00"));a.getPosition()};_.w(jM,Z);jM.prototype.a=function(){return 2+this.h.byteLength+Z.prototype.a.call(this)};jM.prototype.write=function(a){Z.prototype.write.call(this,a);UL(a,0);_.om(a,this.h);a.getPosition()};_.w(kM,YL);kM.prototype.a=function(){return 8+YL.prototype.a.call(this)};
|
|
50
|
+
kM.prototype.write=function(a){YL.prototype.write.call(this,a);_.V(a,0);UL(a,0);UL(a,1)};_.w(lM,kM);lM.prototype.a=function(){return 70+kM.prototype.a.call(this)};lM.prototype.write=function(a){kM.prototype.write.call(this,a);UL(a,0);UL(a,0);_.V(a,0);_.V(a,0);_.V(a,0);UL(a,this.width);UL(a,this.height);_.V(a,4718592);_.V(a,4718592);_.V(a,0);UL(a,1);SL(a,10);_.om(a,XL("AVC Coding",31));UL(a,this.depth);WL(a,-1)};_.w(mM,kM);mM.prototype.a=function(){return 20+kM.prototype.a.call(this)};
|
|
51
|
+
mM.prototype.write=function(a){kM.prototype.write.call(this,a);_.V(a,0);_.V(a,0);UL(a,this.channelCount);UL(a,this.sampleSize);WL(a,0);UL(a,0);UL(a,this.sampleRate);UL(a,0)};_.w(nM,lM);nM.prototype.write=function(a){lM.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(oM,nM);_.w(pM,mM);pM.prototype.write=function(a){mM.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(qM,pM);_.w(rM,YL);
|
|
52
|
+
rM.prototype.a=function(){for(var a=7,b=0;b<this.Ta.length;b++)a+=2,a+=this.Ta[b].byteLength;for(b=0;b<this.Ta.length;b++)a+=2,a+=this.$b[b].byteLength;return a+YL.prototype.a.call(this)};
|
|
53
|
+
rM.prototype.write=function(a){YL.prototype.write.call(this,a);SL(a,this.version);SL(a,this.h);SL(a,this.j);SL(a,this.level);SL(a,255);SL(a,224|this.Ta.length);for(var b=0;b<this.Ta.length;b++)UL(a,this.Ta[b].length),_.om(a,this.Ta[b]);SL(a,this.$b.length);for(b=0;b<this.$b.length;b++)UL(a,this.$b[b].length),_.om(a,this.$b[b]);a.getPosition()};_.w(sM,Z);sM.prototype.a=function(){return 22+(this.Ob.byteLength+3)+Z.prototype.a.call(this)};
|
|
54
|
+
sM.prototype.write=function(a){Z.prototype.write.call(this,a);SL(a,3);SL(a,23+this.Ob.byteLength);UL(a,1);SL(a,0);SL(a,4);SL(a,15+this.Ob.byteLength);SL(a,64);SL(a,21);TL(a,0);_.V(a,0);_.V(a,0);SL(a,5);SL(a,this.Ob.byteLength);_.om(a,this.Ob);_.om(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(tM,Z);tM.prototype.a=function(){return this.location.length+Z.prototype.a.call(this)};tM.prototype.write=function(a){Z.prototype.write.call(this,a);0<this.location.length&&_.om(a,XL(this.location));a.getPosition()};
|
|
55
|
+
_.w(uM,Z);uM.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)};uM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(vM,YL);_.w(wM,Z);wM.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)};
|
|
56
|
+
wM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(xM,Z);xM.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)};xM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(yM,Z);
|
|
57
|
+
yM.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)};yM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(zM,Z);zM.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)};
|
|
58
|
+
zM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(AM,Z);AM.prototype.a=function(){return 8+Z.prototype.a.call(this)};AM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);_.V(a,0);a.getPosition()};_.w(BM,Z);BM.prototype.a=function(){return 4+Z.prototype.a.call(this)};BM.prototype.write=function(a){Z.prototype.write.call(this,a);WL(a,0);UL(a,0);a.getPosition()};
|
|
59
|
+
_.w(CM,YL);_.w(DM,YL);_.w(EM,YL);_.w(FM,Z);FM.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Z.prototype.a.call(this)};FM.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?RL(a,this.h):_.V(a,this.h);a.getPosition()};_.w(GM,Z);GM.prototype.a=function(){return 4+Z.prototype.a.call(this)};GM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);a.getPosition()};_.w(HM,Z);
|
|
60
|
+
HM.prototype.a=function(){var a=4;this.flags&EN&&(a+=4);this.flags&FN&&(a+=4);for(var b=0;b<this.h;b++)this.flags&GN&&(a+=4),this.flags&HN&&(a+=4),this.flags&IN&&(a+=4),this.flags&JN&&(a+=4);return a+Z.prototype.a.call(this)};
|
|
61
|
+
HM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);this.flags&EN&&(a.getPosition(),VL(a,this.l));this.flags&FN&&_.V(a,this.o);for(var b=0;b<this.h;b++)this.flags&GN&&_.V(a,this.w[b]),this.flags&HN&&_.V(a,this.sampleSize[b]),this.flags&IN&&_.V(a,this.B[b]),this.flags&JN&&(0===this.version?_.V(a,this.j[b]):VL(a,this.j[b]));a.getPosition()};var EN=1,FN=4,GN=256,HN=512,IN=1024,JN=2048;_.w(IM,Z);
|
|
62
|
+
IM.prototype.a=function(){var a=4;this.flags&KN&&(a+=8);this.flags&LN&&(a+=4);this.flags&MN&&(a+=4);this.flags&NN&&(a+=4);this.flags&ON&&(a+=4);return a+Z.prototype.a.call(this)};IM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);this.flags&KN&&RL(a,this.j);this.flags&LN&&_.V(a,this.B);this.flags&MN&&_.V(a,this.l);this.flags&NN&&_.V(a,this.w);this.flags&ON&&_.V(a,this.o);a.getPosition()};var KN=1,LN=2,MN=8,NN=16,ON=32;_.w(JM,YL);_.w(KM,YL);_.w(LM,YL);
|
|
63
|
+
LM.prototype.a=function(){return this.h.byteLength+YL.prototype.a.call(this)};LM.prototype.write=function(a){YL.prototype.write.call(this,a);0<this.h.byteLength&&_.om(a,this.h)};_.w(MM,Z);MM.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)};
|
|
64
|
+
MM.prototype.write=function(a){Z.prototype.write.call(this,a);SL(a,0);0===this.version?SL(a,0):SL(a,0);SL(a,this.h);SL(a,this.j);_.om(a,_.jj(this.o));if(1===this.h&&0===this.j){SL(a,0);for(var b=0;b<this.l.length;b++)SL(a,this.l[b])}a.getPosition()};_.w(NM,Z);NM.prototype.a=function(){var a=8;this.flags&1&&(a+=XL(this.Jb).byteLength);return a+Z.prototype.a.call(this)};NM.prototype.write=function(a){Z.prototype.write.call(this,a);_.om(a,XL(this.h));_.V(a,this.j);this.flags&1&&_.om(a,XL(this.Jb));a.getPosition()};
|
|
65
|
+
_.w(OM,YL);OM.prototype.a=function(){return XL(this.h).byteLength+YL.prototype.a.call(this)};OM.prototype.write=function(a){YL.prototype.write.call(this,a);_.om(a,XL(this.h));a.getPosition()};_.w(PM,Z);PM.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)};
|
|
66
|
+
PM.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));_.V(a,1);for(var b=0;1>b;b++)0===this.version?_.V(a,this.offset[b]):RL(a,this.offset[b]);a.getPosition()};_.w(QM,Z);QM.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)};
|
|
67
|
+
QM.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));SL(a,this.h);_.V(a,this.j);if(0===this.h)for(var b=0;b<this.j;b++)SL(a,this.l[b]);a.getPosition()};_.w(RM,Z);RM.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.j;b++)if(a+=this.h[b].Yg.byteLength,this.flags&2){a+=2;for(var c=0;c<this.h[b].bd;c++)a+=2,a+=4}return a+Z.prototype.a.call(this)};
|
|
68
|
+
RM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.j);this.flags&1&&SL(a,this.l);for(var b=0;b<this.j;b++)if(_.om(a,this.h[b].Yg),this.flags&2){UL(a,this.h[b].bd);for(var c=0;c<this.h[b].bd;c++)UL(a,this.h[b].Qf[c].fg),_.V(a,this.h[b].Qf[c].gg)}a.getPosition()};var YM=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,ZM=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,$M=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,aN=/^(\d*\.?\d*)f$/,bN=/^(\d*\.?\d*)t$/,cN=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;gN.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};gN.prototype.write=function(){this.f=fN(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var jN=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.r=pN.prototype;_.r.configure=function(a){this.f=a};_.r.start=function(a,b){var c=this;this.C=b;var d=_.Pg(new Set([a,SM(a)])).concat();return qN(this,d).then(function(e){return xN(c,e.data).then(function(){CN(c,c.A);return c.h})})};_.r.stop=function(){this.C&&this.C.networkingEngine.ye(this.K);this.A=this.w=this.h=this.f=this.C=null;this.j&&(clearTimeout(this.j),this.j=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
|
|
69
|
+
_.r.update=function(){var a=this;if(this.rd())return qN(this,[this.l]).then(function(b){return xN(a,b.data).then(function(){return a.h})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.r.setCurrentVariant=function(){};_.r.Hb=function(){var a=this;this.g.debug(_.vz);this.C&&(this.j=null,this.update().then(function(){CN(a,a.A)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&CN(a,100))}))};_.r.rd=function(){return this.L===tN};_.r.lf=function(){return 0<this.o.length};
|
|
70
|
+
_.r.Lg=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};
|
|
71
|
+
_.r.fm=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.rd.bind(this),pe:this.lf.bind(this),ek:function(){return 1},ke:this.Lg.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=lN(a,b,g,c)}catch(h){d=
|
|
72
|
+
!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 AN={video:_.vg,audio:_.dd,text:_.Xc},oN=_.lc,tN="LIVE",BN={Fm:_.nd,Om:_.ag};_.w(DN,_.fs);DN.prototype.f=function(){_.dt.ism=pN;_.bt[_.Yc]=pN};DN.prototype.a=function(){_.ZA("ism");_.$A(_.Yc)};DN.prototype.id=function(){return"smooth"};_.I("clpp.smooth.SmoothComponent",DN);};
|
|
73
73
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
74
74
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
75
75
|
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 D.F(2);l=
|
|
23
|
-
t,v));return n?_.x(D,n.load(),4):D.F(2)}if(2!=D.a)return D["return"](n);c.log.error("segment reference for specified segment index does not exist",g);throw b();})};
|
|
24
|
-
|
|
25
|
-
_.r.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=
|
|
26
|
-
_.r.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(
|
|
27
|
-
|
|
2
|
+
var f=function(window){var Bx="No thumbnail found for position: ",Cx="Position is out of range: ",Dx="Thumbnail URL is mandatory",Ex="Wrong gridSize format",Fx="clpp.thumbnails",Gx=function(){this.log=new _.K(Fx);this.player=null;this.a=[];this.w=!1},Ix=function(a,b){b.reduce(function(c,d){var e=d,f=!1;typeof d===_.Ve&&(e=d.step,f=d.preloadWhileBuffering);return c.then(function(){return Hx(a,0,e,!!f)})},Promise.resolve())},Hx=function(a,b,c,d){if(a.w||b>=a.a.length)return Promise.resolve();var e=b+c;return Jx(a,d).then(function(){return a.a[b].load()}).then(function(){return Hx(a,
|
|
3
|
+
e,c,d)})},Jx=function(a,b){return new Promise(function(c){if(b||a.player.getState()!==_.$o)c();else a.player.one(_.jd,function(){c()})})},Kx=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.la=p;this.Dj=h;this.gm=l;this.rk=m;this.sk=n;this.Yb=null},Lx=function(){Gx.call(this);
|
|
4
|
+
this.f=null;this.o=this.h=1;this.j=0},Mx=function(a,b){this.time=a;this.duration=0;this.offset=b;this.length=0;this.Ld=new _.zj},Nx=function(){this.g=new _.K(Fx);this.f=new ArrayBuffer(0);this.a=[];this.h=new _.zj},Ox=function(a){var b=a.f.byteLength;a.a.forEach(function(c){c.offset+c.length<b&&c.Ld.resolve()})},Qx=function(a,b){return Px(a,b).then(function(c){return new Kx(c,b.time,b.duration)})},Px=function(a,b){return b.load().then(function(){var c=_.Xi(a.f,b.offset,b.length);return"data:image/jpeg;base64,"+
|
|
5
|
+
_.gj(c)})},Rx=function(){Gx.call(this);this.f=null},Sx=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},Tx=function(){Gx.apply(this,arguments)},Ux=function(a,b){var c=a.horizontalTiles||b.horizontalTiles||1,d=a.verticalTiles||b.verticalTiles||1,e=c*d;return{Ed:c,Wf:d,Xg:e,durationPerTile:a.durationPerTile||b.durationPerTile||(a.endTime-a.startTime)/e}},Vx=function(){this.g=new _.K(Fx);this.a=this.m=null},Wx=function(a){return a.some(function(b){return 0<
|
|
6
|
+
b.thumbStreams.length})},ay=function(a){return a?a===Xx||a===Yx?new Lx:a===Zx?new Rx:a===$x?new Nx:null:null},by=function(a){if(!a)return null;a=new _.bk(a);return a.path.match(/.*\.vtt$/i)?Zx:a.path.match(/.*\.bif$/i)?$x:a.path.match(/.*\.(png|jpg|jpeg)$/i)?Xx:null},cy=function(){};Gx.prototype.init=function(a,b){var c=this;this.player=a;a.one(_.If,function(){c.w=!0});a.isLive()||this.l().then(function(){b&&b.preload&&Ix(c,b.preload)})};Kx.prototype.raw=function(){return this.la.cloneNode(!1)};
|
|
7
|
+
Kx.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(_.Zd);e.style.width=c+_.Ff;e.style.height=d+_.Ff;e.style.backgroundColor="#000";e.style.backgroundRepeat="no-repeat";e.style.backgroundImage='url("'+this.src+'")';e.style.backgroundSize=Math.ceil(c/this.width*(this.la.naturalWidth||this.la.width))+"px "+Math.ceil(d/
|
|
8
|
+
this.height*(this.la.naturalHeight||this.la.height))+_.Ff;var f=this.y/this.height;e.style.backgroundPositionX="-"+this.x/this.width*c+_.Ff;e.style.backgroundPositionY="-"+f*d+_.Ff;return e};
|
|
9
|
+
Kx.prototype.load=function(){var a=this;this.Yb||(this.Yb=new Promise(function(b,c){function d(){a.width||(a.width=(a.la.naturalWidth||a.la.width)/a.Dj);a.height||(a.height=(a.la.naturalHeight||a.la.height)/a.gm);a.x||(a.x=a.width*a.rk);a.y||(a.y=a.height*a.sk)}if(a.la.src&&a.la.complete)d(),b(a);else{var e=null,f=function(){d();a.la.removeEventListener("load",f);a.la.removeEventListener(_.pe,e);b(a)};e=function(g){a.la.removeEventListener("load",f);a.la.removeEventListener(_.pe,e);c(new _.P(1,9,
|
|
10
|
+
2014,"Failed to load thumbnail.",g))};a.la.addEventListener("load",f);a.la.addEventListener(_.pe,e);a.la.src=a.src}}));return this.Yb};_.I("clpp.thumbnails.Thumbnail",Kx);Kx.prototype.load=Kx.prototype.load;Kx.prototype.element=Kx.prototype.element;Kx.prototype.raw=Kx.prototype.raw;_.w(Lx,Gx);
|
|
11
|
+
Lx.prototype.init=function(a,b){if(!b||!b.url)throw new _.P(1,9,7100,Dx);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,Ex);}catch(d){throw this.log.error("Error during parsing gridSize",d),
|
|
12
|
+
new _.P(1,9,7100,Ex);}Gx.prototype.init.call(this,a,b)};Lx.prototype.get=function(a){var b=this,c,d,e,f;return _.E(function(g){if(1==g.a){c=b.player.getDuration();if(0>a||a>c)throw new _.P(1,9,2014,Cx+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 _.x(g,f.load(),2)}return g["return"](f)})};
|
|
13
|
+
Lx.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 Kx(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()};Mx.prototype.load=function(){return this.Ld};
|
|
14
|
+
Nx.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.P(1,9,7100,Dx);var d=b.url,e=_.uj(d);e.type=_.tj;a.getNetworkEngine().fetch(e).O.then(function(f){f=f.data;var g=_.Xi(c.f);f=_.Xi(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=_.Xi(l);n=String.fromCharCode.apply(null,
|
|
15
|
+
dy);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 Mx(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
|
+
Ox(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))})};Nx.prototype.get=function(a){var b=this,c,d;return _.E(function(e){switch(e.a){case 1:if(0>a)throw new _.P(1,9,2014,Cx+a);return _.x(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,Bx+a);return _.x(e,Qx(b,c),3);case 3:return d=e.f,_.x(e,d.load(),4);case 4:return e["return"](d)}})};
|
|
17
|
+
Nx.prototype.Dd=function(){return 0<this.a.length};var dy=[137,66,73,70,13,10,26,10];_.w(Rx,Gx);
|
|
18
|
+
Rx.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.P(1,9,7100,Dx);var d=b.url,e=_.uj(d);e.type=_.tj;this.f=a.getNetworkEngine().fetch(e).O.then(function(f){f=f.data;if(!f)throw Error("No data in the response");f=_.R.Z(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=Sx(l[0]);l=Sx(l[1])-t;c.a.push(new Kx(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))});Gx.prototype.init.call(this,a,b)};
|
|
20
|
+
Rx.prototype.get=function(a){var b=this,c;return _.E(function(d){if(1==d.a){if(0>a)throw new _.P(1,9,2014,Cx+a);return _.x(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,Bx+a);return _.x(d,c.load(),3)}return d["return"](c)})};Rx.prototype.l=function(){return this.f};_.w(Tx,Gx);
|
|
21
|
+
Tx.prototype.get=function(a){function b(){return new _.P(1,9,2014,Bx+a)}var c=this,d,e,f,g,h,l,m,n,p,q,t,v,z;return _.E(function(D){if(1==D.a){if(0>a)throw c.log.error("Position must be greater than 0 but is "+a),new _.P(1,9,2014,Cx+a);d=c.player.getPeriods();for(var G=null,F=_.u(d),B=F.next();!B.done;B=F.next())B=B.value,B.startTime<=a&&(G=B);e=G;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 D.F(2);l=Ux(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.Xg+m])):(q=h.Ra())&&0<q.length&&(v=t=0,z=h.startTime,1<l.Xg&&(t=m%l.Ed,v=Math.floor(m/l.Ed),z+=m*l.durationPerTile),n=new Kx(q[0],z,l.durationPerTile,void 0,void 0,void 0,void 0,l.Ed,l.Wf,
|
|
23
|
+
t,v));return n?_.x(D,n.load(),4):D.F(2)}if(2!=D.a)return D["return"](n);c.log.error("segment reference for specified segment index does not exist",g);throw b();})};Tx.prototype.f=function(a,b){return void 0!==a.bandwidth&&void 0!==b.bandwidth?a.bandwidth-b.bandwidth:0};
|
|
24
|
+
Tx.prototype.l=function(){if(0<this.a.length)return Promise.resolve();var a=this.player.getPeriods();a=_.u(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.R(d=b.getSegmentReference(c++));)for(var e=Ux(d,b),f=d.Ra()[0],g=new Image,h=d.startTime,l=0;l<e.Wf;++l)for(var m=0;m<e.Ed;++m)this.a.push(new Kx(f,h,e.durationPerTile,void 0,void 0,void 0,void 0,e.Ed,e.Wf,m,l,g)),h+=e.durationPerTile;return Promise.resolve()};_.r=Vx.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onPlayerWillDestroy=function(){this.m=null};_.r.onPlayerWillRelease=function(){this.a=null};
|
|
25
|
+
_.r.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=by(c.url||null));(this.a=ay(d))?(this.g.info("Loading thumbs configuration",c),this.m.one(_.Ie,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
|
+
_.r.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(Wx(d)){this.a=new Tx;try{this.a.init(a,c)}catch(e){this.m.onError(e)}}}};_.r.get=function(a){return this.a?this.a.get(a):Promise.reject(new _.P(1,9,2014,"Thumbnail format is not supported"))};_.r.id=function(){return"thumbnails"};_.I("clpp.thumbnails.ThumbnailsPlugin",Vx);Vx.prototype.get=Vx.prototype.get;Vx.Id="thumbnails";
|
|
27
|
+
cy.prototype.create=function(){return new Vx};_.Dq(new cy);var Xx="SINGLE",Yx="GRID",Zx="WEBVTT",$x="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));}
|