@castlabs/prestoplay 6.12.0 → 6.14.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 +54 -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 +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +518 -517
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +63 -52
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +68 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +275 -272
- 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 -24
- package/cjs/cl.tizen.js +69 -69
- 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 +18 -18
- package/cjs/polyfill.min.js +26 -23
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +428 -425
- package/cl.crypto.js +9 -9
- package/cl.dash.js +67 -67
- package/cl.externs.js +63 -52
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +69 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +243 -241
- package/cl.muxdata.js +13 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -17
- 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 +4 -4
- package/typings.d.ts +135 -30
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 _.
|
|
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.P=
|
|
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
|
-
qf=new Uint16Array(1),qf[0]=(
|
|
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
|
-
_.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.qd())return
|
|
70
|
-
_.r.
|
|
71
|
-
_.r.em=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.qd.bind(this),
|
|
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 rL="Full MP4 box must have flags defined",sL="clpp.smooth.SmoothMP4Processor",tL="codecPrivateData",uL=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)},vL=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.bm()}},wL=function(a,b){vL(a,b>>16&255);vL(a,b>>8&255);vL(a,b&255)},xL=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.bm()}},yL=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.bm()}},zL=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.h),a.a+=2}catch(c){_.bm()}},AL=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},BL=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){BL.call(this,a);this.version=b;this.flags=c},CL=function(a,b,c){BL.call(this,a);this.h=b;this.offset=c},DL=function(a,b,c,
|
|
4
|
+
d,e){Z.call(this,a,b,c);this.h=d;this.offset=e},EL=function(a,b,c){BL.call(this,"ftyp");this.j=a;this.hh=b;this.h=c},FL=function(){BL.call(this,_.Oe)},GL=function(){BL.call(this,_.fg)},HL=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]},IL=function(){BL.call(this,"mvex")},JL=function(a){Z.call(this,"trex",0,0);this.h=a},KL=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]},LL=function(a,b){Z.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},ML=function(a){Z.call(this,"hdlr",0,0);this.h=a},NL=function(){Z.call(this,"vmhd",0,1);this.h=new Uint8Array([0,0,0,0,0,0])},OL=function(a){BL.call(this,a);this.A=!0},PL=function(a){OL.call(this,a);this.height=this.width=0;this.depth=24},QL=
|
|
6
|
+
function(a,b,c,d){OL.call(this,a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},RL=function(a,b){PL.call(this,"avc1");this.width=a;this.height=b},SL=function(a,b){RL.call(this,a,b);this.type="encv"},TL=function(a,b,c){QL.call(this,"mp4a",a,b,c)},UL=function(a,b,c){TL.call(this,a,b,c);this.type="enca"},VL=function(a,b){BL.call(this,"avcC");this.Ua=a;this.$b=b;this.version=1;this.h=this.Ua[0][1];this.j=this.Ua[0][2];this.level=this.Ua[0][3]},WL=function(a){Z.call(this,"esds",0,0);this.Ob=
|
|
7
|
+
a},XL=function(a){a=void 0===a?"":a;Z.call(this,"url ",0,1);this.location=a},YL=function(){Z.call(this,"dref",0,0)},ZL=function(){BL.call(this,_.Vf)},$L=function(){Z.call(this,_.Xf,0,0)},aM=function(){Z.call(this,"stts",0,0)},bM=function(){Z.call(this,"stsc",0,0)},cM=function(){Z.call(this,"stco",0,0)},dM=function(){Z.call(this,"stsz",0,0)},eM=function(){Z.call(this,"smhd",0,0)},fM=function(){BL.call(this,"dinf")},gM=function(){BL.call(this,_.Ne)},hM=function(){BL.call(this,_.Je)},iM=function(a,b){Z.call(this,
|
|
8
|
+
"tfdt",a,0);this.h=b},jM=function(){Z.call(this,"mfhd",0,0);this.h=0},kM=function(a,b){Z.call(this,"trun",a,b);this.o=this.l=this.h=0;this.w=[];this.sampleSize=[];this.B=[];this.j=[]},lM=function(a,b){Z.call(this,"tfhd",a,b);this.h=255;this.o=this.w=this.l=this.B=this.j=0},mM=function(){BL.call(this,"traf")},nM=function(){BL.call(this,"moof")},oM=function(){BL.call(this,_.Ie);this.h=new Uint8Array(0)},pM=function(){Z.call(this,"tenc",0,0);this.h=1;this.j=8;this.o="";this.l=[]},qM=function(a,b){Z.call(this,
|
|
9
|
+
"schm",0,0);this.h=a;this.j=b;this.Jb=""},rM=function(a){BL.call(this,"frma");this.h=a},sM=function(){Z.call(this,"saio",0,0);this.offset=[0]},tM=function(a,b,c){Z.call(this,"saiz",0,0);this.h=a;this.l=b;this.j=c},uM=function(a,b){Z.call(this,"senc",a,b);this.j=0;this.l=8;this.h=[]},vM=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},wM=function(a,b,c,d){c=b.Jg[c];b=b.Bm;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]},xM=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.sg?c=["maxWidth","maxHeight","bitrate",tL,"fourCC"]:a.type===_.$c&&(c=["bitrate",tL,"channels","bitsPerSample","samplingRate","fourCC"]);return _.N.ta(a,b,c,["id","segmentIndex"])},yM=function(a,b,c){var d=c.ce.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ua:null,$b:null,width:NaN,height:NaN,Ob:null,Nd:NaN,
|
|
11
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.sg:a.Ua=[_.gj(d[1])];a.$b=[_.gj(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.$c:a.Ob=_.gj(c.ce),a.sampleSize=c.ki||16,a.Nd=c.Nd,a.channelCount=c.hg}return a},zM=function(a,b){return a.filter(function(c){return c.type===b})},AM=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)},HM=function(a,b,c){var d=null;if(BM.test(a)){a=BM.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 CM.test(a)?d=AM(CM,a):DM.test(a)?d=AM(DM,a):EM.test(a)?(a=EM.exec(a),d=Number(a[1])/c.frameRate):FM.test(a)?(a=FM.exec(a),d=Number(a[1])/c.a):GM.test(a)&&(d=AM(GM,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},IM=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))},KM=function(a){this.a=a;this.f=JM(this)},JM=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.am(b)},LM=function(a,b,c){a:{var d=_.u([_.Rd,_.Pd]);for(var e=d.next();!e.done;e=d.next())if((e=c.je(e.value))&&e.keyId){d=e.keyId;break a}_.J(sL,"Could not get default Key ID for DRM init data!");
|
|
14
|
+
d=null}c=new BL("xxxx");a.type===_.sg?c=new SL(a.width,a.height):c=new UL(a.channelCount,a.sampleSize,a.Nd);a=new pM;a.h=1;a.j=8;a.o=d||"00000000000000000000000000000000";a=(new BL("schi")).append([a]);b=(new BL(_.Qf)).append([new rM(b),new qM(_.rd,65536),a]);c.append([b]);return c},MM=function(a,b){var c=b.pe(),d=new HL(a.timescale,a.duration,a.id),e=(new IL).append([new JL(a.id)]),f=new KL(a.id,a.duration,a.timescale,a.width,a.height),g=new LL(a.timescale,a.duration),h=new ML(a.type),l=null,m=new YL;
|
|
15
|
+
m.entries=[new XL];var n=new $L;switch(a.type){case _.sg:var p=new VL(a.Ua,a.$b);c?(l=LM(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new RL(a.width,a.height)).append([p]),n.entries=[l]);l=new NL;break;case _.$c:p=new WL(a.Ob),c?(l=LM(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new TL(a.channelCount,a.sampleSize,a.Nd)).append([p]),n.entries=[l]),l=new eM}n=(new ZL).append([n,new aM,new bM,new dM,new cM]);m=(new fM).append([m]);m=(new gM).append([l,m,n]);g=(new hM).append([g,h,m]);f=(new GL).append([f,
|
|
16
|
+
g]);d=(new FL).append([d,f,e]);e=new EL("dash",0,["iso6","mp41","avc1"]);c&&(c=b.je(_.Pd),f=b.je(_.Rd),c&&d.append([new CL("pssh",c.initData,8)]),f&&d.append([new CL("pssh",f.initData,8)]),c||f||_.J(sL,"Could not get PSSH init data!"));c=new KM([e,d]);return _.Ui(c.write())},OM=function(a,b){var c,d,e,f,g,h;(new _.mm).L("moof",_.nm).Y("mfhd",function(m){var n=new jM;n.h=_.W(m.reader);c=n}).L("traf",_.nm).Y("tfhd",function(m){var n=m.reader.Ga();if(null===m.flags)throw new _.P(_.Q,3,3019,rL);var p=
|
|
17
|
+
new lM(m.version||0,m.flags||0);p.h=_.W(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.jm(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,rL);var p=new kM(m.version||0,m.flags||0);p.h=_.W(m.reader);0<n-
|
|
18
|
+
m.reader.getPosition()&&m.flags&1&&(p.l=_.im(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(_.im(m.reader)));e=p}).Y("sdtp",function(m){var n=_.lm(m.reader,m.reader.Ga());f=new DL("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.lm(m.reader,
|
|
19
|
+
16);if(_.ij(n,NM)){n=_.W(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new uM(m.version,m.flags);n.j=_.W(m.reader);m.flags&1&&(n.l=_.gm(m.reader));for(var p=0;p<n.j;p++){var q={Xg:_.lm(m.reader,8),dd:0,Qf:[]};if(m.flags&2){q.dd=_.hm(m.reader);for(var t=0;t<q.dd;t++){var v={fg:0,gg:0};v.fg=_.hm(m.reader);v.gg=_.W(m.reader);q.Qf.push(v)}}n.h.push(q)}g=n}}).L(_.Ie,function(m){var n=new oM;0<m.reader.Ga()?n.h=_.lm(m.reader,m.reader.Ga()):(_.J(sL,"mdat box is empty!"),n.h=new Uint8Array(0));h=n}).parse(a,
|
|
20
|
+
!1);if(!h)return null;var l=(new mM).append([d,e]);f&&l.append([f]);b.pe()&&g&&l.append([g]);l=(new nM).append([c,l]);return new KM([l,h])},PM=function(a,b,c,d){var e=d.pe(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=OM(b,d);if(null===g)return a.request.contentType===_.bg?a.data:g;d=g.get(_.Ie);if(a.request.contentType===_.bg){e=d.h.buffer;if(c){e=_.R.yd(e);if((e=(new DOMParser).parseFromString(e,_.dg))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new IM(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",_.le],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],HM(p||
|
|
22
|
+
"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.R.Va(e).buffer}else c=e;return c}h=new nM;a=g.get("mfhd");b=new mM;l=g.get("tfhd");m=new iM(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].dd);else g=8;b.append([c,new sM,new tM(g,l,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new KM([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},QM=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},RM=function(a,b,c){a=_.pn(a);c&&a.version!==c&&(a=_.vz(a,c));return{initData:_.tz(a),initDataType:_.rd,keyId:b,periodId:null}},TM=function(){this.w=this.h=this.f=this.D=null;this.M=1;this.T=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.P=SM;this.H=0;this.C=this.I=Infinity;this.o=[];this.K=this.em.bind(this);this.G=new Map},UM=function(a,b){var c,d,e;return _.E(function(f){if(1==f.a)return c=_.rj(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.D.networkingEngine.fetch(c),
|
|
25
|
+
_.x(f,d.O,2);e=f.f;a.l=e.uri;return f["return"](e)})},aN=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.R.yd(b);var f=d.parseFromString(e.trim(),_.dg)}catch(hF){throw hF;}if(f&&f.documentElement.tagName==_.ac)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(hF){}if(!c)throw a.g.error("Unable to parse manifest"),new _.P(_.Q,4,4033,a.l);var h=+VM(a,c,"MajorVersion"),l=+VM(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+VM(a,c,"Duration"),
|
|
26
|
+
p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),t=+c.getAttribute("DVRWindowLength")||Infinity,v=_.an(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?(WM(a,XM),a.A=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):WM(a,SM);a.a={startTime:0,delay:0,duration:n/m,af:t/m,Gd:0};if(v){var z=a.f.playreadyVersion,D=[],G=_.an(v,"ProtectionHeader")[0],
|
|
27
|
+
F=_.fj(_.cn(G)||""),B=_.pn(F).a;D.push(QM(_.Rd,{initData:_.tz(_.hn(B)),initDataType:_.rd,keyId:B,periodId:null},[B]));D.push(QM(_.Pd,RM(F,B,z),[B]));a.o=D}var I=[],O=_.an(c,"StreamIndex");if(!O.length)throw a.g.error("No streams found!"),new _.P(_.Q,4,4034,a.l);for(var M=0;M<O.length;M++){for(var ba,ha=a,qa=O[M],Ta=VM(ha,qa,"Type"),Fa=+qa.getAttribute("Chunks"),Ca=qa.getAttribute("Subtype"),na=qa.getAttribute("Language")||_.hg,Ia=_.Ni(na),tb=qa.getAttribute("Name")||"",Jb=+qa.getAttribute(_.xb),Lc=
|
|
28
|
+
+qa.getAttribute(_.wb),Dm=VM(ha,qa,"Url"),Ms=+qa.getAttribute("TimeScale")||null,Mc=[],Em=_.an(qa,_.Ob),ut=0;ut<Em.length;ut++){var qf=void 0,ic=void 0,vt=void 0,rf=ha,qd=Em[ut],wt=Ta,JQ=+qd.getAttribute("Index"),KQ=+VM(rf,qd,"Bitrate"),kF=NaN,lF=NaN,zn=NaN,xt=NaN,mF=NaN,nF=NaN,oF=NaN,pF=qd.getAttribute("FourCC");switch(wt){case _.sg:kF=+VM(rf,qd,_.wb);lF=+VM(rf,qd,_.xb);break;case _.$c:xt=+qd.getAttribute("Channels")||2,zn=+VM(rf,qd,"SamplingRate"),nF=+VM(rf,qd,"AudioTag"),mF=+VM(rf,qd,"BitsPerSample"),
|
|
29
|
+
oF=+VM(rf,qd,"PacketSize")}var yt=String(qd.getAttribute("CodecPrivateData"));if(wt===_.$c&&!yt){var qF=xt,rF={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},An=rF[zn];if("AACH"===pF){ic=new Uint8Array(4);var sF=rF[2*zn];ic[0]=40|An>>1;ic[1]=An<<7|qF<<3|sF>>1;ic[2]=sF<<7|8;ic[3]=0;qf=new Uint16Array(2);qf[0]=(ic[0]<<8)+ic[1];qf[1]=(ic[2]<<8)+ic[3];vt=qf[0].toString(16)+qf[1].toString(16)}else ic=new Uint8Array(2),ic[0]=16|An>>1,ic[1]=An<<7|qF<<3,
|
|
30
|
+
qf=new Uint16Array(1),qf[0]=(ic[0]<<8)+ic[1],vt=qf[0].toString(16);yt=vt.toUpperCase()}var LQ={id:rf.T++,type:wt,index:JQ,bitrate:KQ,ce:yt,maxHeight:kF,maxWidth:lF,Nd:zn,hg:xt,Um:nF,ki:mF,kn:oF,Wj:pF,segmentIndex:null};Mc.push(LQ)}ba=Mc;for(var Be=[],tF=_.an(qa,"c"),Ij=0;Ij<tF.length;Ij++){var zt=tF[Ij],Od=parseInt(zt.getAttribute("t"),10),Ah=parseInt(zt.getAttribute("d"),10),At=parseInt(zt.getAttribute("r"),10),Jj=0;if(isNaN(Od)&&isNaN(Ah))throw ha.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
31
|
+
new _.P(_.Q,4,4037,ha.l);0===Ij&&isNaN(Od)&&(Jj=Od=0);if(0<Ij){var ng=Be[Be.length-1];Jj=ng.n+1;ng.d||(ng.d=Od-ng.t);Od||(Od=ng.t+ng.d);Ah||(Ah=Od-ng.t)}Be.push({n:Jj,d:Ah,t:Od});if(At){At--;for(var uF=0;uF<At;uF++){var Bn=Be[Be.length-1];Jj=Bn.n+1;Od=Bn.t+Bn.d;Ah=Bn.d;Be.push({n:Jj,d:Ah,t:Od})}}}ha.qd()||Be.length===Fa||ha.g.warn("Number of fragments ("+Fa+") differs from number of chunks ("+Be.length+").");I.push({type:Ta,Ym:Fa,qm:Ca,language:Ia,Fd:na,name:tb,maxWidth:Jb,maxHeight:Lc,Bm:Dm,tracks:ba,
|
|
32
|
+
Jg:Be,timescale:Ms})}var sf={hn:h,hh:l,timescale:m,duration:n,isLive:p,gn:q,af:t,kf:!1,streams:I};if(a.h&&a.w)return YM(a,sf),Promise.resolve();a.G.clear();var Bt=sf.timescale,Ct=sf.duration,NQ=zM(sf.streams,_.$c),OQ=zM(sf.streams,_.sg),PQ=zM(sf.streams,_.bg),vF=[],Cn=ZM(a,Ct,Bt,NQ),Dn=ZM(a,Ct,Bt,OQ),QQ=ZM(a,Ct,Bt,PQ);Cn.length||(Cn=[null]);Dn.length||(Dn=[null]);for(var Et=0;Et<Dn.length;Et++)for(var Ft=0;Ft<Cn.length;Ft++)vF.push($M(a,Dn[Et],Cn[Ft]));var wF={startTime:0,variants:vF,textStreams:QQ,
|
|
33
|
+
thumbStreams:[]};var SQ=sf.streams,Gt=a.a.startTime,xF=a.a.delay,Ht=a.I,yF=Math.min(a.a.duration||Infinity,Ht),It=a.qd(),TQ=a.a.af,UQ=a.a.Gd,zF=a.H,AF=isFinite(a.C)?a.C:0;if(It)yF=Infinity,Gt=Date.now()/1E3-UQ,a.a.startTime=Gt,xF=3*zF;else for(var VQ=isFinite(Ht)?Ht:a.a.duration,BF=_.u(SQ),Jt=BF.next();!Jt.done;Jt=BF.next())for(var CF=_.u(Jt.value.tracks),Kt=CF.next();!Kt.done;Kt=CF.next()){var DF=Kt.value;DF.segmentIndex.offset(-AF);_.$z(DF.segmentIndex,VQ)}a.B=new _.fA(Gt,xF,!It,!0);a.B.f=yF;_.kA(a.B,
|
|
34
|
+
zF);a.B.w=TQ;It||a.B.offset(-AF);a.D.filterAllPeriods([wF]);a.h={presentationTimeline:a.B,periods:[wF],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.D.networkingEngine.hd(a.K),a.J=!0);a.w=sf;return Promise.resolve()},YM=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))){xM(e.Nb,
|
|
35
|
+
g)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var h=bN(a,a.w.timescale,d,g);g=e.Nb.segmentIndex;g.oa(h);(h=a.a.af)&&_.wA(g,_.vA(g)-h).forEach(function(l){l.Sa().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."))},ZM=function(a,b,c,d){for(var e=[],f={Fc:0};f.Fc<d.length;f={Fc:f.Fc},f.Fc++){var g=d[f.Fc].tracks.map(function(h){return function(l){var m=
|
|
36
|
+
d[h.Fc],n=bN(a,c,m,l);n=new _.uA(n);var p=null;m.type!==_.bg&&(p=cN(a,b,c,m,l));l.segmentIndex=n;var q=a.M++,t=Promise.resolve.bind(Promise),v=n.Mc.bind(n),z=n.get.bind(n),D=n.jd.bind(n),G=n.getDuration.bind(n),F=dN[m.type],B="";switch(m.type){case _.sg:B=l.ce;var I=/00000001[0-9]7/.exec(B);B="avc1."+(I&&I[0]?B.substr(B.indexOf(I[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",B);break;case _.$c:B=l.ce,I=2,"AACH"===l.Wj?I=5:B&&(I=(parseInt(B.substr(0,2),16)&248)>>3),B="mp4a.40."+I,a.g.debug("AUDIO CODECS: ",
|
|
37
|
+
B)}I=m.type===_.bg?eN[m.qm]:void 0;return{id:q,originalId:null,mn:null,createSegmentIndex:t,findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:D,getDuration:G,segmentIndex:n,segmentLookupStrategy:_.ez,initSegmentReference:p,mimeType:F,codecs:B,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:I,encrypted:a.mf(),keyId:null,language:m.language,originalLanguage:m.Fd,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},bN=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.C=Math.min(a.C,n)}else n=f[l-1].endTime;var p=n+m,q=wM(a.l,c,l,d);a.H=Math.max(a.H,m);f.push(new _.Li(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.G.set(q,n);e+=m});if(c.type===_.sg||c.type===_.$c)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Gd?a.a.Gd=b.endTime:a.a.Gd=Math.min(a.a.Gd,
|
|
39
|
+
b.endTime);return f},cN=function(a,b,c,d,e){b=yM(b,d.timescale||c,e);c={isLive:a.qd.bind(a),pe:a.mf.bind(a),ck:function(){return 1},je:a.Lg.bind(a)};d=new Uint8Array(0);try{d=MM(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,"+_.ej(d);return new _.Dz(function(){return[f]},0,null,null,!0)},$M=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.hg;return c||b?{id:a.M++,language:e,primary:!1,audio:c,
|
|
40
|
+
video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},VM=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);},fN=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Hb.bind(a),b))},WM=function(a,b){var c=b===SM;if(a.h&&a.h.presentationTimeline){var d=a.h.presentationTimeline;d.j=c;d.l=c}c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.P=b},gN=function(){};
|
|
41
|
+
BL.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};BL.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};BL.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
|
+
BL.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);_.cm(a,AL(this.type));this.size>b&&uL(a,this.size);"uuid"===this.type&&_.cm(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,BL);Z.prototype.a=function(){return 4+BL.prototype.a.call(this)};Z.prototype.write=function(a){BL.prototype.write.call(this,a);vL(a,this.version);wL(a,this.flags)};
|
|
43
|
+
_.w(CL,BL);CL.prototype.a=function(){return this.h.byteLength+BL.prototype.a.call(this)-this.offset};CL.prototype.write=function(a){BL.prototype.write.call(this,a);_.cm(a,this.h,this.offset);a.getPosition()};_.w(DL,Z);DL.prototype.a=function(){return this.h.byteLength+Z.prototype.a.call(this)-this.offset};DL.prototype.write=function(a){Z.prototype.write.call(this,a);_.cm(a,this.h,this.offset);a.getPosition()};_.w(EL,BL);
|
|
44
|
+
EL.prototype.a=function(){var a=this.j.length;a=a+4+this.h.join("").length;return a+BL.prototype.a.call(this)};EL.prototype.write=function(a){BL.prototype.write.call(this,a);_.cm(a,AL(this.j));_.V(a,this.hh);_.cm(a,AL(this.h.join("")));a.getPosition()};_.w(FL,BL);_.w(GL,BL);_.w(HL,Z);HL.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
|
+
HL.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(uL(a,0),uL(a,0),_.V(a,this.timescale),uL(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));_.V(a,65536);xL(a,this.volume);xL(a,0);_.V(a,0);_.V(a,0);for(var b=0;b<this.h.length;b++)vL(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(IL,BL);_.w(JL,Z);JL.prototype.a=function(){return 20+Z.prototype.a.call(this)};
|
|
46
|
+
JL.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(KL,Z);KL.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
|
+
KL.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(uL(a,0),uL(a,0),_.V(a,this.j),_.V(a,0),uL(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);xL(a,0);xL(a,0);xL(a,this.volume);xL(a,0);for(var b=0;b<this.h.length;b++)vL(a,this.h[b]);xL(a,this.width);xL(a,0);xL(a,this.height);xL(a,0);a.getPosition()};_.w(LL,Z);LL.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Z.prototype.a.call(this)};
|
|
48
|
+
LL.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(uL(a,0),uL(a,0),_.V(a,this.timescale),uL(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));xL(a,this.language);xL(a,0);a.getPosition()};_.w(ML,Z);ML.prototype.a=function(){return 33+Z.prototype.a.call(this)};
|
|
49
|
+
ML.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);this.h===_.sg?_.cm(a,AL("vide")):_.cm(a,AL("soun"));_.V(a,0);_.V(a,0);_.V(a,0);this.h===_.sg?_.cm(a,AL("VideoHandler\x00")):_.cm(a,AL("SoundHandler\x00"));a.getPosition()};_.w(NL,Z);NL.prototype.a=function(){return 2+this.h.byteLength+Z.prototype.a.call(this)};NL.prototype.write=function(a){Z.prototype.write.call(this,a);xL(a,0);_.cm(a,this.h);a.getPosition()};_.w(OL,BL);OL.prototype.a=function(){return 8+BL.prototype.a.call(this)};
|
|
50
|
+
OL.prototype.write=function(a){BL.prototype.write.call(this,a);_.V(a,0);xL(a,0);xL(a,1)};_.w(PL,OL);PL.prototype.a=function(){return 70+OL.prototype.a.call(this)};PL.prototype.write=function(a){OL.prototype.write.call(this,a);xL(a,0);xL(a,0);_.V(a,0);_.V(a,0);_.V(a,0);xL(a,this.width);xL(a,this.height);_.V(a,4718592);_.V(a,4718592);_.V(a,0);xL(a,1);vL(a,10);_.cm(a,AL("AVC Coding",31));xL(a,this.depth);zL(a,-1)};_.w(QL,OL);QL.prototype.a=function(){return 20+OL.prototype.a.call(this)};
|
|
51
|
+
QL.prototype.write=function(a){OL.prototype.write.call(this,a);_.V(a,0);_.V(a,0);xL(a,this.channelCount);xL(a,this.sampleSize);zL(a,0);xL(a,0);xL(a,this.sampleRate);xL(a,0)};_.w(RL,PL);RL.prototype.write=function(a){PL.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(SL,RL);_.w(TL,QL);TL.prototype.write=function(a){QL.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(UL,TL);_.w(VL,BL);
|
|
52
|
+
VL.prototype.a=function(){for(var a=7,b=0;b<this.Ua.length;b++)a+=2,a+=this.Ua[b].byteLength;for(b=0;b<this.Ua.length;b++)a+=2,a+=this.$b[b].byteLength;return a+BL.prototype.a.call(this)};
|
|
53
|
+
VL.prototype.write=function(a){BL.prototype.write.call(this,a);vL(a,this.version);vL(a,this.h);vL(a,this.j);vL(a,this.level);vL(a,255);vL(a,224|this.Ua.length);for(var b=0;b<this.Ua.length;b++)xL(a,this.Ua[b].length),_.cm(a,this.Ua[b]);vL(a,this.$b.length);for(b=0;b<this.$b.length;b++)xL(a,this.$b[b].length),_.cm(a,this.$b[b]);a.getPosition()};_.w(WL,Z);WL.prototype.a=function(){return 22+(this.Ob.byteLength+3)+Z.prototype.a.call(this)};
|
|
54
|
+
WL.prototype.write=function(a){Z.prototype.write.call(this,a);vL(a,3);vL(a,23+this.Ob.byteLength);xL(a,1);vL(a,0);vL(a,4);vL(a,15+this.Ob.byteLength);vL(a,64);vL(a,21);wL(a,0);_.V(a,0);_.V(a,0);vL(a,5);vL(a,this.Ob.byteLength);_.cm(a,this.Ob);_.cm(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(XL,Z);XL.prototype.a=function(){return this.location.length+Z.prototype.a.call(this)};XL.prototype.write=function(a){Z.prototype.write.call(this,a);0<this.location.length&&_.cm(a,AL(this.location));a.getPosition()};
|
|
55
|
+
_.w(YL,Z);YL.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)};YL.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(ZL,BL);_.w($L,Z);$L.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
|
+
$L.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(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};aM.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(bM,Z);
|
|
57
|
+
bM.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)};bM.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(cM,Z);cM.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
|
+
cM.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(dM,Z);dM.prototype.a=function(){return 8+Z.prototype.a.call(this)};dM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);_.V(a,0);a.getPosition()};_.w(eM,Z);eM.prototype.a=function(){return 4+Z.prototype.a.call(this)};eM.prototype.write=function(a){Z.prototype.write.call(this,a);zL(a,0);xL(a,0);a.getPosition()};
|
|
59
|
+
_.w(fM,BL);_.w(gM,BL);_.w(hM,BL);_.w(iM,Z);iM.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Z.prototype.a.call(this)};iM.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?uL(a,this.h):_.V(a,this.h);a.getPosition()};_.w(jM,Z);jM.prototype.a=function(){return 4+Z.prototype.a.call(this)};jM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);a.getPosition()};_.w(kM,Z);
|
|
60
|
+
kM.prototype.a=function(){var a=4;this.flags&hN&&(a+=4);this.flags&iN&&(a+=4);for(var b=0;b<this.h;b++)this.flags&jN&&(a+=4),this.flags&kN&&(a+=4),this.flags&lN&&(a+=4),this.flags&mN&&(a+=4);return a+Z.prototype.a.call(this)};
|
|
61
|
+
kM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);this.flags&hN&&(a.getPosition(),yL(a,this.l));this.flags&iN&&_.V(a,this.o);for(var b=0;b<this.h;b++)this.flags&jN&&_.V(a,this.w[b]),this.flags&kN&&_.V(a,this.sampleSize[b]),this.flags&lN&&_.V(a,this.B[b]),this.flags&mN&&(0===this.version?_.V(a,this.j[b]):yL(a,this.j[b]));a.getPosition()};var hN=1,iN=4,jN=256,kN=512,lN=1024,mN=2048;_.w(lM,Z);
|
|
62
|
+
lM.prototype.a=function(){var a=4;this.flags&nN&&(a+=8);this.flags&oN&&(a+=4);this.flags&pN&&(a+=4);this.flags&qN&&(a+=4);this.flags&rN&&(a+=4);return a+Z.prototype.a.call(this)};lM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.h);this.flags&nN&&uL(a,this.j);this.flags&oN&&_.V(a,this.B);this.flags&pN&&_.V(a,this.l);this.flags&qN&&_.V(a,this.w);this.flags&rN&&_.V(a,this.o);a.getPosition()};var nN=1,oN=2,pN=8,qN=16,rN=32;_.w(mM,BL);_.w(nM,BL);_.w(oM,BL);
|
|
63
|
+
oM.prototype.a=function(){return this.h.byteLength+BL.prototype.a.call(this)};oM.prototype.write=function(a){BL.prototype.write.call(this,a);0<this.h.byteLength&&_.cm(a,this.h)};_.w(pM,Z);pM.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
|
+
pM.prototype.write=function(a){Z.prototype.write.call(this,a);vL(a,0);0===this.version?vL(a,0):vL(a,0);vL(a,this.h);vL(a,this.j);_.cm(a,_.gj(this.o));if(1===this.h&&0===this.j){vL(a,0);for(var b=0;b<this.l.length;b++)vL(a,this.l[b])}a.getPosition()};_.w(qM,Z);qM.prototype.a=function(){var a=8;this.flags&1&&(a+=AL(this.Jb).byteLength);return a+Z.prototype.a.call(this)};qM.prototype.write=function(a){Z.prototype.write.call(this,a);_.cm(a,AL(this.h));_.V(a,this.j);this.flags&1&&_.cm(a,AL(this.Jb));a.getPosition()};
|
|
65
|
+
_.w(rM,BL);rM.prototype.a=function(){return AL(this.h).byteLength+BL.prototype.a.call(this)};rM.prototype.write=function(a){BL.prototype.write.call(this,a);_.cm(a,AL(this.h));a.getPosition()};_.w(sM,Z);sM.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
|
+
sM.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]):uL(a,this.offset[b]);a.getPosition()};_.w(tM,Z);tM.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
|
+
tM.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));vL(a,this.h);_.V(a,this.j);if(0===this.h)for(var b=0;b<this.j;b++)vL(a,this.l[b]);a.getPosition()};_.w(uM,Z);uM.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.j;b++)if(a+=this.h[b].Xg.byteLength,this.flags&2){a+=2;for(var c=0;c<this.h[b].dd;c++)a+=2,a+=4}return a+Z.prototype.a.call(this)};
|
|
68
|
+
uM.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.j);this.flags&1&&vL(a,this.l);for(var b=0;b<this.j;b++)if(_.cm(a,this.h[b].Xg),this.flags&2){xL(a,this.h[b].dd);for(var c=0;c<this.h[b].dd;c++)xL(a,this.h[b].Qf[c].fg),_.V(a,this.h[b].Qf[c].gg)}a.getPosition()};var BM=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,CM=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,DM=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,EM=/^(\d*\.?\d*)f$/,FM=/^(\d*\.?\d*)t$/,GM=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;KM.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};KM.prototype.write=function(){this.f=JM(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var NM=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.r=TM.prototype;_.r.configure=function(a){this.f=a};_.r.start=function(a,b){var c=this;this.D=b;var d=_.Og(new Set([a,vM(a)])).concat();return UM(this,d).then(function(e){return aN(c,e.data).then(function(){fN(c,c.A);return c.h})})};_.r.stop=function(){this.D&&this.D.networkingEngine.ze(this.K);this.A=this.w=this.h=this.f=this.D=null;this.j&&(clearTimeout(this.j),this.j=null);this.J=!1;this.I=this.C=Infinity;return Promise.resolve()};
|
|
69
|
+
_.r.update=function(){var a=this;if(this.qd())return UM(this,[this.l]).then(function(b){return aN(a,b.data).then(function(){return a.h})})["catch"](function(b){if(a.D)a.D.onError(b)})};_.r.onExpirationUpdated=function(){};_.r.setCurrentVariant=function(){};_.r.Hb=function(){var a=this;this.g.debug(_.Yy);this.D&&(this.j=null,this.update().then(function(){fN(a,a.A)})["catch"](function(b){a.D&&(a.D.onError(b),1===b.severity&&fN(a,100))}))};_.r.qd=function(){return this.P===XM};
|
|
70
|
+
_.r.mf=function(){return 0<this.o.length};_.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.em=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.qd.bind(this),pe:this.mf.bind(this),ck:function(){return 1},je: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=PM(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 dN={video:_.ug,audio:_.dd,text:_.Xc},SM=_.lc,XM="LIVE",eN={Em:_.md,Nm:_.Zf};_.w(gN,_.Ir);gN.prototype.f=function(){_.Fs.ism=TM;_.Ds[_.Yc]=TM};gN.prototype.a=function(){_.CA("ism");_.DA(_.Yc)};gN.prototype.id=function(){return"smooth"};_.H("clpp.smooth.SmoothComponent",gN);};
|
|
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,28 +1,30 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
b.
|
|
7
|
-
|
|
8
|
-
this.height*(this.
|
|
9
|
-
|
|
10
|
-
f);a.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
b);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_.r.
|
|
2
|
+
var f=function(window){var dx="No thumbnail found for position: ",ex="Position is out of range: ",fx="Thumbnail URL is mandatory",gx="Wrong gridSize format",hx="clpp.thumbnails",ix=function(){this.log=new _.K(hx);this.player=null;this.a=[];this.w=!1},kx=function(a,b){b.reduce(function(c,d){var e=d,f=!1;typeof d===_.Te&&(e=d.step,f=d.preloadWhileBuffering);return c.then(function(){return jx(a,0,e,!!f)})},Promise.resolve())},jx=function(a,b,c,d){if(a.w||b>=a.a.length)return Promise.resolve();var e=b+c;return lx(a,d).then(function(){return a.a[b].load()}).then(function(){return jx(a,
|
|
3
|
+
e,c,d)})},lx=function(a,b){return new Promise(function(c){if(b||a.player.getState()!==_.Mo)c();else a.player.one(_.id,function(){c()})})},mx=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.Bj=h;this.fm=l;this.qk=m;this.rk=n;this.Yb=null},nx=function(){ix.call(this);
|
|
4
|
+
this.f=null;this.o=this.h=1;this.j=0},ox=function(a,b){this.time=a;this.duration=0;this.offset=b;this.length=0;this.Kd=new _.wj},px=function(){this.g=new _.K(hx);this.f=new ArrayBuffer(0);this.a=[];this.h=new _.wj},qx=function(a){var b=a.f.byteLength;a.a.forEach(function(c){c.offset+c.length<b&&c.Kd.resolve()})},sx=function(a,b){return rx(a,b).then(function(c){return new mx(c,b.time,b.duration)})},rx=function(a,b){return b.load().then(function(){var c=_.Ui(a.f,b.offset,b.length);return"data:image/jpeg;base64,"+
|
|
5
|
+
_.dj(c)})},tx=function(){ix.call(this);this.f=null},ux=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},vx=function(){ix.apply(this,arguments)},wx=function(a,b){var c=a.horizontalTiles||b.horizontalTiles||1,d=a.verticalTiles||b.verticalTiles||1,e=c*d;return{Dd:c,Wf:d,Wg:e,durationPerTile:a.durationPerTile||b.durationPerTile||(a.endTime-a.startTime)/e}},xx=function(){this.g=new _.K(hx);this.a=this.m=null},yx=function(a){return a.some(function(b){return 0<
|
|
6
|
+
b.thumbStreams.length})},Dx=function(a){return a?a===zx||a===Ax?new nx:a===Bx?new tx:a===Cx?new px:null:null},Ex=function(a){if(!a)return null;a=new _.Xj(a);return a.path.match(/.*\.vtt$/i)?Bx:a.path.match(/.*\.bif$/i)?Cx:a.path.match(/.*\.(png|jpg|jpeg)$/i)?zx:null},Fx=function(){};ix.prototype.init=function(a,b){var c=this;this.player=a;a.one(_.Gf,function(){c.w=!0});a.isLive()||this.l().then(function(){b&&b.preload&&kx(c,b.preload)})};mx.prototype.raw=function(){return this.la.cloneNode(!1)};
|
|
7
|
+
mx.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(_.Yd);e.style.width=c+_.Df;e.style.height=d+_.Df;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))+_.Df;var f=this.y/this.height;e.style.backgroundPositionX="-"+this.x/this.width*c+_.Df;e.style.backgroundPositionY="-"+f*d+_.Df;return e};
|
|
9
|
+
mx.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.Bj);a.height||(a.height=(a.la.naturalHeight||a.la.height)/a.fm);a.x||(a.x=a.width*a.qk);a.y||(a.y=a.height*a.rk)}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(_.ne,e);b(a)};e=function(g){a.la.removeEventListener("load",f);a.la.removeEventListener(_.ne,e);c(new _.P(1,9,
|
|
10
|
+
2014,"Failed to load thumbnail.",g))};a.la.addEventListener("load",f);a.la.addEventListener(_.ne,e);a.la.src=a.src}}));return this.Yb};_.H("clpp.thumbnails.Thumbnail",mx);mx.prototype.load=mx.prototype.load;mx.prototype.element=mx.prototype.element;mx.prototype.raw=mx.prototype.raw;_.w(nx,ix);
|
|
11
|
+
nx.prototype.init=function(a,b){if(!b||!b.url)throw new _.P(1,9,7100,fx);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,gx);}catch(d){throw this.log.error("Error during parsing gridSize",d),
|
|
12
|
+
new _.P(1,9,7100,gx);}ix.prototype.init.call(this,a,b)};nx.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,ex+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
|
+
nx.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 mx(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()};ox.prototype.load=function(){return this.Kd};
|
|
14
|
+
px.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.P(1,9,7100,fx);var d=b.url,e=_.rj(d);e.type=_.qj;a.getNetworkEngine().fetch(e).O.then(function(f){f=f.data;var g=_.Ui(c.f);f=_.Ui(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=_.Ui(l);n=String.fromCharCode.apply(null,
|
|
15
|
+
Gx);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 ox(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
|
+
qx(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))})};px.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,ex+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,dx+a);return _.x(e,sx(b,c),3);case 3:return d=e.f,_.x(e,d.load(),4);case 4:return e["return"](d)}})};
|
|
17
|
+
px.prototype.Cd=function(){return 0<this.a.length};var Gx=[137,66,73,70,13,10,26,10];_.w(tx,ix);
|
|
18
|
+
tx.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.P(1,9,7100,fx);var d=b.url,e=_.rj(d);e.type=_.qj;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=ux(l[0]);l=ux(l[1])-t;c.a.push(new mx(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))});ix.prototype.init.call(this,a,b)};
|
|
20
|
+
tx.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,ex+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,dx+a);return _.x(d,c.load(),3)}return d["return"](c)})};tx.prototype.l=function(){return this.f};_.w(vx,ix);
|
|
21
|
+
vx.prototype.get=function(a){function b(){return new _.P(1,9,2014,dx+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,ex+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=wx(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.Wg+m])):(q=h.Sa())&&0<q.length&&(v=t=0,z=h.startTime,1<l.Wg&&(t=m%l.Dd,v=Math.floor(m/l.Dd),z+=m*l.durationPerTile),n=new mx(q[0],z,l.durationPerTile,void 0,void 0,void 0,void 0,l.Dd,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();})};vx.prototype.f=function(a,b){return void 0!==a.bandwidth&&void 0!==b.bandwidth?a.bandwidth-b.bandwidth:0};
|
|
24
|
+
vx.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&&!_.N.R(d=b.getSegmentReference(c++));)for(var e=wx(d,b),f=d.Sa()[0],g=new Image,h=d.startTime,l=0;l<e.Wf;++l)for(var m=0;m<e.Dd;++m)this.a.push(new mx(f,h,e.durationPerTile,void 0,void 0,void 0,void 0,e.Dd,e.Wf,m,l,g)),h+=e.durationPerTile;return Promise.resolve()};_.r=xx.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=Ex(c.url||null));(this.a=Dx(d))?(this.g.info("Loading thumbs configuration",c),this.m.one(_.Fe,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(yx(d)){this.a=new vx;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"};_.H("clpp.thumbnails.ThumbnailsPlugin",xx);xx.prototype.get=xx.prototype.get;xx.Id="thumbnails";
|
|
27
|
+
Fx.prototype.create=function(){return new xx};_.nq(new Fx);var zx="SINGLE",Ax="GRID",Bx="WEBVTT",Cx="BIF";};
|
|
26
28
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
27
29
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
28
30
|
else{_=this.clpp._;(f.call(g,this));}
|