@castlabs/prestoplay 6.7.0 → 6.9.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 +50 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +419 -420
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +26 -26
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +72 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +272 -261
- package/cjs/cl.muxdata.js +15 -11
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +27 -27
- 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/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 +358 -363
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +26 -26
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +61 -57
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +238 -228
- package/cl.muxdata.js +12 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +58 -58
- package/cl.thumbnails.js +17 -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 +1 -1
- package/typings.d.ts +74 -20
package/cjs/cl.thumbnails.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
var e=b+c;return
|
|
4
|
-
c;this.x=d;this.y=e;this.width=f;this.height=g;this.ja=p;this.
|
|
5
|
-
b.time,b.duration)})},
|
|
6
|
-
b.horizontalTiles||1,d=a.verticalTiles||b.verticalTiles||1,e=c*d;return{
|
|
7
|
-
|
|
8
|
-
this.height*(this.ja.naturalHeight||this.ja.height))+_.
|
|
9
|
-
|
|
10
|
-
f);a.ja.addEventListener(_.
|
|
11
|
-
|
|
12
|
-
this.w=e[1];else throw new _.L(_.M,7,7100,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
h=String.fromCharCode.apply(null,
|
|
16
|
-
}).then(function(){
|
|
17
|
-
|
|
18
|
-
h);r=
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Promise.reject();var d=c.getSegmentReference(b);if(d){var e=
|
|
22
|
-
b);return Promise.reject()};
|
|
23
|
-
|
|
24
|
-
_.t.onContentWillLoad=function(a){var b=this,c=a.getConfiguration();if(c.thumbnails){var d=c.thumbnails;d&&(void 0===d.enabled||d.enabled)&&((c=d.mode)||(c=
|
|
25
|
-
_.t.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();
|
|
2
|
+
var f=function(window){var Dt="No thumbnail duration or URL specified",Et="No thumbnail found for position ",Ft="Position is out of range: ",Gt="Thumbnail URL is mandatory",Ht="Wrong gridSize format",It="clpp.thumbnails",Jt=function(){this.log=new _.I(It);this.g=null;this.a=[];this.A=!1},Lt=function(a,b){b.reduce(function(c,d){var e=d,f=!1;typeof d===_.Jd&&(e=d.step,f=d.preloadWhileBuffering);return c.then(function(){return Kt(a,0,e,!!f)})},Promise.resolve())},Kt=function(a,b,c,d){if(a.A||b>=a.a.length)return Promise.resolve();
|
|
3
|
+
var e=b+c;return Mt(a,d).then(function(){return a.a[b].load()}).then(function(){return Kt(a,e,c,d)})},Mt=function(a,b){return new Promise(function(c){if(b||a.g.getState()!==_.Om)c();else a.g.one(_.tc,function(){c()})})},Nt=function(a,b){return b>=a.time&&b<a.time+a.duration},Ot=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=
|
|
4
|
+
c;this.x=d;this.y=e;this.width=f;this.height=g;this.ja=p;this.Ni=h;this.dl=l;this.wj=m;this.xj=n;this.Sb=null},Pt=function(){Jt.call(this);this.f=null;this.w=this.j=1;this.m=0},Qt=function(a,b){this.time=a;this.duration=0;this.offset=b;this.length=0;this.ug=new _.bi},Rt=function(){this.h=new _.I(It);this.f=new ArrayBuffer(0);this.a=[];this.g=new _.bi},St=function(a){var b=a.f.byteLength;a.a.forEach(function(c){c.offset+c.length<b&&c.ug.resolve()})},Ut=function(a,b){return Tt(a,b).then(function(c){return new Ot(c,
|
|
5
|
+
b.time,b.duration)})},Tt=function(a,b){return b.load().then(function(){var c=_.N(a.f,b.offset,b.length);return"data:image/jpeg;base64,"+_.Jh(c)})},Vt=function(){Jt.call(this);this.f=null},Wt=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},Xt=function(){Jt.apply(this,arguments)},Yt=function(a,b){for(var c=null,d=_.u(a),e=d.next();!e.done;e=d.next())e=e.value,e.startTime<=b&&(c=e);return c},Zt=function(a,b){var c=a.horizontalTiles||
|
|
6
|
+
b.horizontalTiles||1,d=a.verticalTiles||b.verticalTiles||1,e=c*d;return{md:c,Bf:d,mg:e,durationPerTile:a.durationPerTile||b.durationPerTile||(a.endTime-a.startTime)/e}},$t=function(){this.h=new _.I(It);this.a=this.l=null},au=function(a){return a.some(function(b){return 0<b.thumbStreams.length})},bu=function(a){if(!a)return null;a=new _.zi(a);return a.path.match(/.*\.vtt$/i)?"WEBVTT":a.path.match(/.*\.bif$/i)?"BIF":a.path.match(/.*\.(png|jpg|jpeg)$/i)?"SINGLE":null},cu=function(){};Jt.prototype.init=function(a,b){var c=this;this.g=a;a.one(_.ee,function(){c.A=!0});a.isLive()||this.o().then(function(){b&&b.preload&&Lt(c,b.preload)})};Ot.prototype.raw=function(){return this.ja.cloneNode(!1)};
|
|
7
|
+
Ot.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(_.Xc);e.style.width=c+_.be;e.style.height=d+_.be;e.style.backgroundColor="#000";e.style.backgroundRepeat="no-repeat";e.style.backgroundImage='url("'+this.src+'")';e.style.backgroundSize=Math.ceil(c/this.width*(this.ja.naturalWidth||this.ja.width))+"px "+Math.ceil(d/
|
|
8
|
+
this.height*(this.ja.naturalHeight||this.ja.height))+_.be;var f=this.y/this.height;e.style.backgroundPositionX="-"+this.x/this.width*c+_.be;e.style.backgroundPositionY="-"+f*d+_.be;return e};
|
|
9
|
+
Ot.prototype.load=function(){var a=this;this.Sb||(this.Sb=new Promise(function(b,c){function d(){a.width||(a.width=(a.ja.naturalWidth||a.ja.width)/a.Ni);a.height||(a.height=(a.ja.naturalHeight||a.ja.height)/a.dl);a.x||(a.x=a.width*a.wj);a.y||(a.y=a.height*a.xj)}if(a.ja.src&&a.ja.complete)d(),b(a);else{var e=null,f=function(){d();a.ja.removeEventListener("load",f);a.ja.removeEventListener(_.hd,e);b(a)};e=function(){a.ja.removeEventListener("load",f);a.ja.removeEventListener(_.hd,e);c()};a.ja.addEventListener("load",
|
|
10
|
+
f);a.ja.addEventListener(_.hd,e);a.ja.src=a.src}}));return this.Sb};_.C("clpp.thumbnails.Thumbnail",Ot);Ot.prototype.load=Ot.prototype.load;Ot.prototype.element=Ot.prototype.element;Ot.prototype.raw=Ot.prototype.raw;_.w(Pt,Jt);
|
|
11
|
+
Pt.prototype.init=function(a,b){if(!b||!b.url)throw new _.L(_.M,7,7100,Gt);if("GRID"===b.mode&&!b.gridSize)throw new _.L(_.M,7,7100,"Grid size is mandatory for GRID mode");if(!b.duration)throw new _.L(_.M,7,7100,"Duration is mandatory");this.f=b;var c=this.f.duration,d=this.f.url;if(!c||!d)throw this.log.error(Dt,c,d),new _.L(_.M,7,7100,Dt);this.m=c;if(this.f.gridSize)try{var e=this.f.gridSize.split(/x/).map(function(f){return parseInt(f,10)}).filter(function(f){return 0<f});if(2===e.length)this.j=e[0],
|
|
12
|
+
this.w=e[1];else throw new _.L(_.M,7,7100,Ht);}catch(f){throw this.log.error("Error during parsing gridSize",f),new _.L(_.M,7,7100,Ht);}Jt.prototype.init.call(this,a,b)};Pt.prototype.get=function(a){var b=this.g.getDuration();if(void 0===this.f.duration)return Promise.reject("Duration configuration not defined");var c=Math.floor(a/this.f.duration);if(0>a||a>b)return Promise.reject(Ft+a);var d=this.a[c];return d?d.load().then(function(){return d}):Promise.reject(Et+a+" at index "+c)};
|
|
13
|
+
Pt.prototype.o=function(){if(0<this.a.length)return Promise.resolve();var a=this.g.getDuration(),b=this.j*this.w;a=Math.ceil(Math.ceil(a/this.m)/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 Ot(e,this.m*(d*b+g),this.m,0,0,0,0,this.j,this.w,g%this.j,Math.floor(g/this.j),f));return Promise.resolve()};Qt.prototype.load=function(){return this.ug};
|
|
14
|
+
Rt.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.L(_.M,7,7100,Gt);var d=b.url,e=_.Xh(d);e.type=_.Wh;a.getNetworkEngine().fetch(e).P.then(function(f){f=f.data;var g=_.N(c.f);f=_.N(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.h.info("Appended "+f.byteLength+" bytes.Total data now "+(h+" bytes."))}).then(function(){var f=c.f,g=_.N(f),
|
|
15
|
+
h=String.fromCharCode.apply(null,du),l=Array.prototype.slice.call(g,0,8);g=64;var m=0;var n=!1;if(h===String.fromCharCode.apply(null,l))for(f=new DataView(f,16,20),f=f.getUint32(0,!0),0===f&&(f=1E3);!n;){m+=1;l=f;h=new DataView(c.f,g);n=h.getUint32(0,!0);l=n*l/1E3;h=h.getUint32(4,!0);h=new Qt(l,h);if(l=c.a.length)l=c.a[l-1],l.length=h.offset-l.offset,l.duration=h.time-l.time;c.a.push(h);g+=8;(n=4294967295===n)&&c.g.resolve();if(1E5<m)throw Error("There was a problem during reading BIF entries");}else throw Error("The file is not a valid BIF format");
|
|
16
|
+
}).then(function(){St(c)})["catch"](function(f){c.h.error("[BIF] Error while loading thumbnails '\n + 'URL: "+d,f);a.onError(new _.L(1,7,2013,"Error while loading and parsing BIF thumbnails.",f))})};Rt.prototype.get=function(a){var b=this;return 0>a?Promise.reject(Ft+a):this.g.then(function(){for(var c=0;c<b.a.length;c++){var d=b.a[c];if(Nt(d,a))return Ut(b,d).then(function(e){return e.load().then(function(){return e})})}return Promise.reject(Et+a)})};var du=[137,66,73,70,13,10,26,10];_.w(Vt,Jt);
|
|
17
|
+
Vt.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.L(_.M,7,7100,Gt);var d=b.url,e=_.Xh(d);e.type=_.Wh;this.f=a.getNetworkEngine().fetch(e).P.then(function(f){if(f=f.data){f=_.uh(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 r=h.indexOf("#");h=0>r?h:h.substr(0,r);h.match(/^http|^\/\//)||(h=d.substr(0,d.lastIndexOf("/"))+"/"+
|
|
18
|
+
h);r=Wt(l[0]);l=Wt(l[1])-r;c.a.push(new Ot(h,r,l,m,p,q,n,0,0))}}}})["catch"](function(f){c.log.error("[VTT] Error while loading thumbnails URL: "+d,f);a.onError(new _.L(1,7,2013,"Error while loading VTT thumbnails.",f))});Jt.prototype.init.call(this,a,b)};
|
|
19
|
+
Vt.prototype.get=function(a){var b=this;return 0>a?Promise.reject(Ft+a):this.f.then(function(){for(var c={},d=0;d<b.a.length;c={Wc:c.Wc},d++)if(c.Wc=b.a[d],Nt(c.Wc,a))return c.Wc.load().then(function(e){return function(){return e.Wc}}(c));return Promise.reject(Et+a)})};Vt.prototype.o=function(){return this.f};_.w(Xt,Jt);
|
|
20
|
+
Xt.prototype.get=function(a){if(0>a)return this.log.error("Position must be greater than 0 but is "+a),Promise.reject();var b=this.g.getPeriods();b=Yt(b,a);if(!b)return this.log.error("Could not find period for specified position",a),Promise.reject();var c=b.thumbStreams.sort(this.f)[0];if(!c)return this.log.error("Could not find thumb stream for specified position",a),Promise.reject();b=c.findSegmentPosition(a-b.startTime);if(null===b||void 0===b)return this.log.error("Could not find segment index for specified position",a),
|
|
21
|
+
Promise.reject();var d=c.getSegmentReference(b);if(d){var e=Zt(d,c);a=Math.floor((a-d.startTime)/e.durationPerTile);var f;if(0<this.a.length)d=c.findSegmentPosition(0),null!==d&&(f=this.a[(b-d)*e.mg+a]);else if((c=d.Ma())&&0<c.length){var g=0,h=0;d=d.startTime;1<e.mg&&(g=a%e.md,h=Math.floor(a/e.md),d+=a*e.durationPerTile);f=new Ot(c[0],d,e.durationPerTile,void 0,void 0,void 0,void 0,e.md,e.Bf,g,h)}if(f)return f.load().then(function(){return f})}this.log.error("segment reference for specified segment index does not exist",
|
|
22
|
+
b);return Promise.reject()};Xt.prototype.f=function(a,b){return void 0!==a.bandwidth&&void 0!==b.bandwidth?a.bandwidth-b.bandwidth:0};
|
|
23
|
+
Xt.prototype.o=function(){if(0<this.a.length)return Promise.resolve();var a=this.g.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&&!_.K.R(d=b.getSegmentReference(c++));)for(var e=Zt(d,b),f=d.Ma()[0],g=new Image,h=d.startTime,l=0;l<e.Bf;++l)for(var m=0;m<e.md;++m)this.a.push(new Ot(f,h,e.durationPerTile,void 0,void 0,void 0,void 0,e.md,e.Bf,m,l,g)),h+=e.durationPerTile;return Promise.resolve()};_.t=$t.prototype;_.t.onPlayerCreated=function(a){this.l=a};_.t.onPlayerWillDestroy=function(){this.l=null};_.t.onPlayerWillRelease=function(){this.a=null};
|
|
24
|
+
_.t.onContentWillLoad=function(a){var b=this,c=a.getConfiguration();if(c.thumbnails){var d=c.thumbnails;d&&(void 0===d.enabled||d.enabled)&&((c=d.mode)||(c=bu(d.url||null)),c&&("SINGLE"===c||"GRID"===c?this.a=new Pt:"WEBVTT"===c?this.a=new Vt:"BIF"===c&&(this.a=new Rt)),this.a&&(this.h.info("Loading thumbs configuration",d),this.l.one(_.vd,function(){b.h.info("Initialize thumbnails provider");b.a.init(a,d)})))}else this.a=null};
|
|
25
|
+
_.t.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();au(d)&&(this.a=new Xt,this.a.init(a,c))}};_.t.get=function(a){return this.a?this.a.get(a):Promise.reject()};_.t.id=function(){return"thumbnails"};_.C("clpp.thumbnails.ThumbnailsPlugin",$t);$t.prototype.get=$t.prototype.get;$t.Id="thumbnails";cu.prototype.create=function(){return new $t};_.qo(new cu);};
|
|
26
26
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
27
27
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
28
28
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.tizen.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
c,d;return _.B(function(e){if(1==e.a){b=a.a===_.
|
|
4
|
-
keyIds:[],periodId:null},_.
|
|
5
|
-
"Initialize",""),webapis.avplay.setDrm(b.
|
|
6
|
-
"POST";_.
|
|
7
|
-
6,6007,{message:_.
|
|
8
|
-
reason:a.g}}))):a.j===_.
|
|
9
|
-
c)}},
|
|
10
|
-
|
|
11
|
-
c=null;a=_.u(a.a.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c},
|
|
12
|
-
a[d].kind||_.
|
|
13
|
-
d=b.renditions[0];(c=c.textStreams.find(function(e){return String(e.id)==d.id}))?(a.w?(a.h.debug("Switching period defer text selection"),a.m=c):(_.
|
|
14
|
-
|
|
15
|
-
0<f.length&&(c=f[0]));a.h.debug("Setting audio track with preferred language:",e);a.
|
|
16
|
-
function(a,b,c){var d=_.
|
|
17
|
-
_.
|
|
18
|
-
m=_.
|
|
19
|
-
c[e].extra_info);if(f){var g=new _.
|
|
20
|
-
b){c=a[d].renditions[e];break}return c},
|
|
21
|
-
this.o=!0;this.f=!1;this.a=null;this.A=1;this.w=!1;this.j={}},
|
|
22
|
-
{currentTime:b}))},onevent:a.
|
|
23
|
-
|
|
24
|
-
_.x(d,Promise.race([
|
|
25
|
-
_.
|
|
26
|
-
_.x(p,
|
|
27
|
-
|
|
28
|
-
null;return e===
|
|
29
|
-
h+" track. Trying again...AVPlay state: "+(a.getState()+", buffering: ")+a.w,n),!1===m&&(a.j[h]={type:h,index:l,
|
|
30
|
-
d)}},
|
|
31
|
-
|
|
32
|
-
a.A),e=Math.floor(b.width*a.A);b=Math.floor(b.height*a.A);a.h.debug("Setting display area to","x:",c,"y:",d,"width:",e,"height:",b);webapis.avplay.setDisplayRect(c,d,e,b);0===c&&0===d&&1920===e&&1080===b&&webapis.avplay.setDisplayMethod("PLAYER_DISPLAY_MODE_LETTER_BOX")}else a.h.debug("Could not apply dimension. Player state "+a.a.getState())},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
_.t.
|
|
37
|
-
_.t.
|
|
38
|
-
_.t.load=function(a){var b=this,c,d,e,f,g,h,l;return _.B(function(m){switch(m.a){case 1:if(!b.l)return b.h.debug("Text streamer is not initialized. Will not load()"),m["return"]();b.B=a;c=b;return _.x(m,
|
|
39
|
-
onError:function(){}};_.
|
|
40
|
-
b.h.debug("Could not setup media source..."),b.g=null,b.f=null,b.j=null,b.a=null,_.
|
|
41
|
-
_.t.start=function(){var a=this;return _.B(function(b){if(!a.f)return b["return"]();try{a.f.start()}catch(c){a.h.error("Error while starting streaming engine",c)}_.
|
|
42
|
-
_.t.destroy=function(){var a=this;return _.B(function(b){switch(b.a){case 1:if(!a.j){b.G(2);break}return _.x(b,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.f){b.G(4);break}return _.x(b,a.f.destroy(),5);case 5:a.f=null,a.w=!0;case 4:if(!a.g){b.G(0);break}return _.x(b,a.g.destroy(),7);case 7:a.g=null,_.
|
|
43
|
-
_.t.initialize=function(a){var b=this;this.l=a;this.a=this.l.a;this.l.on(_.
|
|
44
|
-
_.t.load=function(){if(this.a&&!(0<Object.keys(this.f).length)){this.g=this.l.g;this.l.off(_.
|
|
45
|
-
_.t.ia=function(){return this.f[_.O]||[]};_.t.fa=function(){return
|
|
46
|
-
_.t.
|
|
47
|
-
_.t.
|
|
48
|
-
_.t.addTextTrack=function(){};_.t.ka=function(){return this.a.o};
|
|
49
|
-
|
|
50
|
-
_.t.
|
|
51
|
-
_.t.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(
|
|
52
|
-
Promise.resolve():Promise.reject("Player is in invalid state")};_.t.pause=function(){try{webapis.avplay.pause()}catch(a){Promise.reject(a)}return this.getState()===
|
|
53
|
-
_.t.setPlaybackRate=function(a){var b=this.getState();if(b===
|
|
54
|
-
_.t.load=function(a,b){var c=this,d;return _.B(function(e){switch(e.a){case 1:return c.h.debug("configure()",b||""),_.
|
|
55
|
-
_.t.seek=function(a){var b=this,c=1E3*a;return new Promise(function(d,e){b.B=!0;b.l.trigger(new _.
|
|
56
|
-
_.t.release=function(){var a=this;return new Promise(function(b,c){try{a.g&&(a.g.release(),a.g=null);webapis.avplay.stop();webapis.avplay.close();for(var d in a.j){var e=a.j[d];e&&e.
|
|
57
|
-
_.t.setVolume=function(a){try{tizen.tvaudiocontrol.setVolume(Math.max(0,Math.min(100*a,100)))}catch(b){switch(b.name){case "InvalidValueError":this.h.warn("Invalid value passed for setVolume.","The passed value value should be in the range of 0 to 1.");break;case
|
|
58
|
-
_.t.isLive=function(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.
|
|
59
|
-
var
|
|
60
|
-
_.t.
|
|
61
|
-
_.t.
|
|
62
|
-
_.t.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(
|
|
63
|
-
var e=[_.
|
|
64
|
-
_.t.destroy=function(){var a=this;return _.B(function(b){switch(b.a){case 1:return _.x(b,a.release(),2);case 2:a.a.off(
|
|
65
|
-
_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};_.t.setPlaybackRate=function(a){this.a.setPlaybackRate(a)};_.t.getPosition=function(){return 0<(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.
|
|
66
|
-
_.t.getSeekRange=function(){return{start:0,end:0}};_.t.getVolume=function(){var a=this.a.getVolume();return typeof a===_.k?a/100:null};_.t.setVolume=function(a){this.a.setVolume(a)};_.t.getDuration=function(){return this.a.getDuration()};_.t.getBufferInfo=function(){this.h.warn(_.
|
|
67
|
-
_.t.release=function(){var a=this;return _.B(function(b){switch(b.a){case 1:if(!a.g){b.G(2);break}return _.x(b,a.g.release(),2);case 2:if(!a.o){b.G(4);break}return _.x(b,a.o.destroy(),5);case 5:a.o=null;case 4:return _.x(b,a.a.release(),6);case 6:a.m.release(),a.f.release(),a.A=!1,_.
|
|
68
|
-
_.t.load=function(a){var b=this,c,d,e,f,g;return _.B(function(h){switch(h.a){case 1:_.
|
|
69
|
-
case 6:throw g=_.
|
|
70
|
-
_.t.getDrmInfo=function(){return this.a.getDrmInfo()};_.t.isEnded=function(){return this.f.getState()===_.
|
|
71
|
-
_.t.getLoadedSource=function(){return this.a.getLoadedSource()};_.t.canPlay=function(a,b){return(new
|
|
72
|
-
|
|
2
|
+
var f=function(window){var gG="An unknown error occurred while trying to get volume",hG="Cannot get loading rendition due to platform limitations",iG="PARAM_START_POSITION",jG="SecurityError",kG="The require privilege is: http://tizen.org/privilege/tv.audio",lG="|STARTBITRATE\x3d",mG=function(a,b,c){function d(e){c.call(a,e);a.removeEventListener(b,d)}a.addEventListener(b,d)},nG=function(a,b){this.g=a;this.o=null;this.a=_.Id;this.m=null;this.j=!1;this.f=new Map;this.C=b;this.h=new _.I("clpp.tizen.DrmEngine")},qG=function(a){var b,
|
|
3
|
+
c,d;return _.B(function(e){if(1==e.a){b=a.a===_.Rc||a.a===_.Qc;if(!b)throw new _.L(_.M,6,6001,"The key system "+a.a+" is not supported by the player or the platform");c=a.f.get(a.a);if(!c.qd)throw new _.L(_.M,6,6012,"No license server given for "+a.a);_.zf(e,2);return a.a===_.Rc?_.x(e,oG(a),5):_.x(e,pG(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.qd,distinctiveIdentifierRequired:!1,persistentStateRequired:c.jf,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],
|
|
4
|
+
keyIds:[],periodId:null},_.Af(e,0);d=_.Bf(e);a.h.error("Error while configuring CDM for "+a.a,d);throw new _.L(_.M,6,6005,{message:JSON.stringify(d)});})},pG=function(a,b){var c,d,e,f;return _.B(function(g){c=rG;d=sG;e={};e[d.kh]=!b.jf;e[d.lh]=b.qd;""!==b.customData&&(e[d.jh]=b.customData);f=JSON.stringify(e);a.h.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(h){throw h;}_.y(g)})},oG=function(a){var b;return _.B(function(c){b=rG;try{webapis.avplay.setDrm(b.Dd,
|
|
5
|
+
"Initialize",""),webapis.avplay.setDrm(b.Dd,"widevine_app_session",a.m.id),webapis.avplay.setDrm(b.Dd,"widevine_data_type",a.m.type)}catch(d){throw d;}_.y(c)})},tG=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,v,z,A,E,H;_.B(function(D){if(1==D.a){c=rG;d=a.f.get(a.a);a.h.debug("DRM Challenge data: ",b.challenge);e=atob(b.challenge);f=new Uint8Array(e.length);for(g=0;g<e.length;++g)f[g]=e.charCodeAt(g);h=b.serverurl&&""!==b.serverurl?b.serverurl:d.qd;l=_.Xh([h],_.Uh());l.type=3;l.body=f.buffer;l.method=
|
|
6
|
+
"POST";_.zf(D,2);return _.x(D,a.C.Db.fetch(l).P,4)}if(2!=D.a){m=D.f;if(a.j){n=_.N(m.data);p=n.byteLength;q="";for(r=0;r<p;r++)q+=String.fromCharCode(n[r]);v=btoa(q);z=b.session_id+iG+(v+iG);a.h.debug("Widevine license params",z);try{webapis.avplay.setDrm(c.Dd,"widevine_license_data",z)}catch(F){a.h.error("License response rejected by CDM"),A=new _.L(_.M,6,6008,{browserError:JSON.stringify(F)}),a.C.onError(A)}}return _.Af(D,0)}E=_.Bf(D);a.h.error("License request failed.",JSON.stringify(E));H=new _.L(_.M,
|
|
7
|
+
6,6007,{message:_.Ga,url:E.data.url,status:E.data.status||NaN,response:E.data.response||"",headers:E.data.headers||{}},E);a.C.onError(H);_.y(D)})},uG=function(a){this.l=a;this.a=this.l.a;this.f=_.Em;this.j=_.Km;this.w=(new Date).getTime();this.m=!1;this.o=-1;this.g=2;this.h=new _.I("clpp.tizen.StateManager")},wG=function(a,b){if(a.f!==b)if(a.f===_.Um&&b!==_.Em)a.h.debug(_.bv+vG(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;a.f===_.Om?(a.o=(new Date).getTime(),a.l.trigger(new _.J(_.uc,{detail:{bufferedTimeMS:-1,
|
|
8
|
+
reason:a.g}}))):a.j===_.Om&&a.l.trigger(new _.J(_.tc,{detail:{bufferedTimeMS:c-a.o,reason:a.g}}));var d={currentState:a.f,previousState:a.j,timeSinceLastStateChangeMS:c-a.w};a.w=c;a.l.trigger(new _.J(_.pe,{detail:d}));a.h.debug("State changed:",vG(a.j),"-\x3e",vG(a.f))}},vG=function(a){return Object.keys(_.Sm)[a]},zG=function(a){if(a.m){var b=a.a.getState(),c=a.f;switch(b){case xG:c=_.Xm;break;case yG:c=_.Wm;break;default:a.l.isEnded()?c=_.Qm:a.h.debug("Inconsistent AVPlay playback state:",b)}wG(a,
|
|
9
|
+
c)}},AG=function(){this.o=this.A=this.f=this.g=this.B=this.l=this.j=this.a=null;this.w=!0;this.m=null;this.h=new _.I("clpp.tizen.TextStreamer")},BG=function(a){if(!a)return!1;a=a.periods;for(var b=!1,c=0;c<a.length;c++)b=b||0<a[c].textStreams.length;return b},CG=function(a){var b,c;return _.B(function(d){if(1==d.a)return b=a.l.getConfiguration(),c=null,_.x(d,_.qp(a.B.url,a.l.getNetworkEngine(),b.manifest.attemptParameters,a.B.type||null),2);(c=d.f)&&c.configure(b.manifest);return d["return"](c)})},
|
|
10
|
+
DG=function(a){var b=document.createElement(_.Pe),c=new _.ex,d=new _.nw(function(){return null}),e=a.l.getTextDisplayer();return new _.gx(b,c,e,d,a.l.getConfiguration())},EG=function(a){var b={zb:function(){return a.l.getPosition()},W:a.g,Db:a.l.getNetworkEngine(),af:a.Fi.bind(a),$e:a.Ei.bind(a),onError:a.U.bind(a),Cg:function(){},onEvent:function(){},Hg:a.Gi.bind(a),$d:function(){},Fe:function(){return new _.my},se:function(){return!1},kd:null};return new _.gz(a.a,b)},FG=function(a){var b=a.l.getPosition(),
|
|
11
|
+
c=null;a=_.u(a.a.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c},GG=function(a){a.h.debug("getTextStreams()",a.a);if(a.a){var b=[],c=a.a.periods;a.h.debug("getting text streams");for(var d=0;d<c.length;d++)if(a.h.debug(c[d].startTime,a.l.getPosition()),c[d].startTime<=a.l.getPosition()){b=c[d].textStreams;break}a=b}else a=[];b=[];for(d=c=0;d<a.length;d++){var e=new _.qi(String(c++),_.O);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=
|
|
12
|
+
a[d].kind||_.vv;var f=new _.yi(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},HG=function(a){if(a.g&&!a.g.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.iz(a.f,_.Ae),c=null;if(b){a=GG(a);for(var d=0;d<a.length;d++)if(a[d].renditions[0].id===String(b.id)){c=a[d].renditions[0];break}}return c}return null},IG=function(a,b){a.h.debug("Set active track",b);if(b&&(a.o=b.language,a.A=b.roles[0]||"",a.a&&a.f)){a.setTextVisibility(!0);var c=FG(a),
|
|
13
|
+
d=b.renditions[0];(c=c.textStreams.find(function(e){return String(e.id)==d.id}))?(a.w?(a.h.debug("Switching period defer text selection"),a.m=c):(_.tz(a.f,c,!0,0),a.l.trigger(new _.J(_.Qj))),a.o=c.language):a.h.error(_.av,d.id)}},JG=function(){this.g=this.a=this.l=null;this.f={};this.h=new _.I("clpp.tizen.TrackManager");this.w=this.m=this.j=null;this.A=!1;this.o=1},KG=function(a,b){a.l.trigger(new _.J(_.Te,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},
|
|
14
|
+
LG=function(a){var b=a.fa();b&&a.l.trigger(new _.J(_.rc,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},MG=function(a){var b=a.l.getConfiguration(),c=_.Eg(b.preferredAudioLanguage||[]),d=a.f[_.Q]||[];if(d.length){var e=null;c.some(function(g){e=_.Nv(g,d.map(function(h){return h.language}));return!!e});if(e){var f=d.filter(function(g){return g.language===e});c=f[0];1<f.length&&b.preferredAudioRole&&(f=f.filter(function(g){return 0<=g.roles.indexOf(b.preferredAudioRole)}),
|
|
15
|
+
0<f.length&&(c=f[0]));a.h.debug("Setting audio track with preferred language:",e);a.xa(c)}else a.h.debug("Preferred language(s) not available")}else a.h.debug("Could not set preferred audio language")},QG=function(a,b){if(b){var c=b.track.type.toUpperCase();NG(a.a,c,Number(b.id)).then(function(){c===OG&&(a.j=b,a.l.trigger(new _.J(_.Pj)));c===PG&&(a.m=b,a.l.trigger(new _.J(_.Qj)))})["catch"](function(){a.h.error("Could not select "+c+" track.")})}else a.h.debug("Must provide valid rendition")},RG=
|
|
16
|
+
function(a,b,c){var d=_.eh(b.language||_.Ge);c.language=_.ri(d);c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.oc;a=new _.yi(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},SG=function(a,b,c){c.mimeType=_.Re;a=new _.yi(String(a),c);a.track=c;a.width=b.Width||null;a.height=b.Height||null;a.bandwidth=b.Bit_rate?Number(b.Bit_rate):null;a.codec=b.fourCC||null;return a},TG=function(a,b,c){b=_.eh(b.track_lang||_.Ge);c.mimeType="text/ttml";c.language=
|
|
17
|
+
_.ri(b);c.kind=_.vv;return new _.yi(String(a),c)},UG=function(a,b){var c=null;try{c=JSON.parse(b)}catch(d){a.h.warn("Couldn't retrieve extra infos from stream."),c=null}return c},XG=function(a,b){function c(n,p){for(var q=0;q<n.length;q++)if(n[q].language===p)return n[q];return null}var d={};if(0>=b.length)return d;for(var e=b.filter(function(n){return n.type===VG}),f=b.filter(function(n){return n.type===OG}),g=[],h=0;h<f.length;h++){var l=UG(a,f[h].extra_info);if(l){var m=_.eh(l.language||_.Ge);
|
|
18
|
+
m=_.ri(m);m=c(g,m);m||(m=new _.qi(String(a.o++),_.Q),g.push(m));m.renditions.push(RG(f[h].index,l,m))}else a.h.warn("Skipping audio stream with no extra info")}f=new _.qi(String(a.o++),_.si);for(h=0;h<e.length;h++)(l=UG(a,e[h].extra_info))?f.renditions.push(SG(e[h].index,l,f)):a.h.warn("Skipping video stream with no extra info");e=[];e=a.g?GG(a.g):WG(a,b);d[_.si]=[f];d[_.Q]=g;d[_.O]=e;return d},WG=function(a,b){for(var c=b.filter(function(h){return h.type===PG}),d=[],e=0;e<c.length;e++){var f=UG(a,
|
|
19
|
+
c[e].extra_info);if(f){var g=new _.qi(String(a.o++),_.O);g.renditions.push(TG(c[e].index,f,g));d.push(g)}else a.h.warn("Skipping text stream with no extra info")}return d},YG=function(a,b){for(var c=a.f[_.si]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.K.Aa(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},ZG=function(a,b,c){a=a.f[c]||[];b=String(b.index);c=null;for(var d=0;d<a.length;d++)for(var e=0;e<a[d].renditions.length;e++)if(a[d].renditions[e].id===
|
|
20
|
+
b){c=a[d].renditions[e];break}return c},aH=function(a,b){if(b===_.O&&a.g)return HG(a.g);var c=$G(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===b.toUpperCase()})[0];var d=null;b===_.si&&(d=UG(a,c.extra_info),d=YG(a,{width:d.Width,height:d.Height}));b===_.Q&&(c?(d=ZG(a,c,_.Q),a.j=d):d=a.j);b===_.O&&(c?(d=ZG(a,c,_.O),a.m=d):d=a.m);return d},bH=function(a){_.Wj.call(this);this.l=a;this.g=null;this.h=new _.I("clpp.tizen.Middleware");this.D=1;this.B=!1;this.m=null;this.F=0;
|
|
21
|
+
this.o=!0;this.f=!1;this.a=null;this.A=1;this.w=!1;this.j={}},cH=function(a){return _.B(function(b){tizen.systeminfo.getPropertyValue("DISPLAY",function(c){a.A=c.resolutionWidth/1920;a.h.debug("Display resolution ratio: ",a.A)},function(c){a.h.debug("Could not load DISPLAY property");throw c;});_.y(b)})},eH=function(a){try{webapis.avplay.setListener({onbufferingstart:a.zi.bind(a),onbufferingprogress:a.yi.bind(a),onbufferingcomplete:a.xi.bind(a),onstreamcompleted:a.Ci.bind(a),oncurrentplaytime:function(b){a.trigger(new _.J(dH,
|
|
22
|
+
{currentTime:b}))},onevent:a.Bi.bind(a),onsubtitlechange:a.Di.bind(a),ondrmevent:a.Ai.bind(a),onerror:a.U.bind(a)})}catch(b){a.h.error(b)}},fH=function(a){var b=!!a.l.getTrackManager().La();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.h.debug("Could not set AVPlay subtitle config",c)}},gH=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.h.debug({estimatedBandwidth:c,Rl:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",lG+d)}catch(e){a.h.debug(e)}},
|
|
23
|
+
hH=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+lG+b)}catch(c){throw a.h.debug("Could not set fixed bandwidth",c),c;}},kH=function(a){return{position:a.getPosition(),state:a.l.getState(),If:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:iH(a),volume:a.getVolume(),pl:jH(a),Ui:$G(a)}},mH=function(a){var b,c;return _.B(function(d){if(1==d.a)return _.x(d,lH(),2);if(3!=d.a)return b=new Promise(function(e){(new _.Wi(e)).aa(5)}),
|
|
24
|
+
_.x(d,Promise.race([cH(a).then(function(){return!0}),b.then(function(){return!1})]),3);c=d.f;if(!c)return a.h.debug("Took to long for the SDK to be ready"),d["return"](Promise.reject("SDK Timeout"));_.y(d)})},sH=function(a,b,c){var d,e,f,g,h,l,m,n;return _.B(function(p){switch(p.a){case 1:a.m=_.an(b);d=a.F;e=c||{estimatedBandwidth:0,currentBandwidth:0,nextBandwidth:null,currentPosition:0};a.h.debug("Loading manifest URL: "+a.m[d].url);f=b.startTime||void 0;a.f&&(a.trigger(new _.J(nH)),f=c.currentPosition);
|
|
25
|
+
_.zf(p,2);g=a.m[d].url;h=a.m[d].type;h!==_.cc||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);e.nextBandwidth?(hH(a,e.nextBandwidth),a.o=!1):(a.o||gH(a,e),a.o=!0);eH(a);if(!b.drm||!b.drm.env){a.h.debug("No DRM configuration was provided. Assuming clear content");p.G(4);break}m={onError:function(q){return a.l.onError(q)},Db:a.l.getNetworkEngine()};a.g=new nG(b.drm,m);return _.x(p,a.g.init(),4);case 4:return a.f||a.trigger(new _.J(oH)),
|
|
26
|
+
_.x(p,pH(a),6);case 6:a.f||a.trigger(new _.J(qH));f&&typeof f===_.k&&0<f&&a.seek(f)["catch"](function(q){a.h.debug("Couldn't set start position",q)});a.f||(b.volume&&a.setVolume(b.volume),b.muted&&rH(a,b.muted),b.autoplay&&a.l.play()["catch"](function(q){a.h.debug("Autoplay failed",q)}));_.Af(p,0);break;case 2:throw n=_.Bf(p),a.h.debug("Error while attempting to load source."),n;}})},pH=function(a){return _.B(function(b){a.h.debug("avplay.prepare()");return b["return"](new Promise(function(c,d){try{webapis.avplay.prepareAsync(function(){a.h.debug("AVPlay is ready!");
|
|
27
|
+
fH(a);c()},function(e){a.h.debug("prepareAsync failed",e);d(e)})}catch(e){a.h.debug("Failed to prepare media player for playback"),d(e)}}))})},tH=function(a,b,c){a.h.debug("switchVideoTrack()");try{var d={estimatedBandwidth:parseInt(webapis.avplay.getStreamingProperty("CURRENT_BANDWITH"),10),currentBandwidth:b,nextBandwidth:c,currentPosition:a.getPosition()};a.a=kH(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.l.getConfiguration(),d).then(function(){var e=a.a.If;a.f=!1;a.a=
|
|
28
|
+
null;return e===yG?a.pause():a.play()})}catch(e){return Promise.reject(e)}},jH=function(a){return a.f&&a.a?a.a.pl:webapis.avplay.getTotalTrackInfo()},$G=function(a){return a.f&&a.a?a.a.Ui:webapis.avplay.getCurrentStreamInfo()},NG=function(a,b,c){b=b.toUpperCase();b===PG&&uH(a,!0);var d=a.j[b];d&&(d.ce.stop(),a.j[b]=null,a.h.debug("Cancelled pending track switch for "+b));return new Promise(function(e,f){function g(h,l,m){m=void 0===m?!1:m;try{webapis.avplay.setSelectTrack(h,l),a.j[h]=null,e()}catch(n){a.h.debug("Could not set "+
|
|
29
|
+
h+" track. Trying again...AVPlay state: "+(a.getState()+", buffering: ")+a.w,n),!1===m&&(a.j[h]={type:h,index:l,Gf:0,ce:new _.Wi(function(){return g(h,c,!0)})}),(l=a.j[h])&&3>l.Gf?(!a.w&&++l.Gf,l.ce.aa(a.w?.5:.25)):(a.h.debug("Could not set track after multiple attempts.Giving up..."),l&&l.ce.stop(),a.j[h]=null,f())}}g(b,c)})},uH=function(a,b){var c=a.l.getTextDisplayer();c&&c.setTextVisibility(b);c=a.l.g;try{c||webapis.avplay.setSilentSubtitle(!b)}catch(d){a.h.debug("Could not set text track visibility",
|
|
30
|
+
d)}},rH=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case jG:a.h.warn("The application does not have the privilege to set mute.",kG);break;default:a.h.warn(gG,c)}}},iH=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case jG:a.h.warn("The application doesn't have the privilege to get the mute state.",kG);break;default:a.h.warn(gG,c)}}return!!b},lH=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");
|
|
31
|
+
mG(c,"load",function(d){return a(d)});mG(c,_.hd,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},vH=function(){_.Wj.call(this);this.a=new bH(this);this.f=new uG(this);this.configuration=this.B=_.ck();this.w=null;this.h=new _.I("clpp.tizen.Player");this.j=null;this.m=new JG;this.D=new _.ni;this.o=this.g=null;this.A=!1},wH=function(a){if("NONE"!==a.a.getState()){var b=a.j.getBoundingClientRect();a=a.a;var c=Math.floor(b.left*a.A),d=Math.floor(b.top*
|
|
32
|
+
a.A),e=Math.floor(b.width*a.A);b=Math.floor(b.height*a.A);a.h.debug("Setting display area to","x:",c,"y:",d,"width:",e,"height:",b);webapis.avplay.setDisplayRect(c,d,e,b);0===c&&0===d&&1920===e&&1080===b&&webapis.avplay.setDisplayMethod("PLAYER_DISPLAY_MODE_LETTER_BOX")}else a.h.debug("Could not apply dimension. Player state "+a.a.getState())},xH=function(){},yH=function(){this.a=null};
|
|
33
|
+
nG.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.B(function(h){if(1==h.a){b=_.qk[a.g.env]||null;if(!b)throw a.h.debug(_.ua,_.fb+a.g.env+_.aa),new _.L(_.M,6,6015,_.va+a.g.env+"' is missing.");a.m={id:String(Math.floor(1E4*Math.random())),type:"MPEG-DASH"};c=Object.keys(a.g.customData||{}).length?btoa(JSON.stringify(a.g.customData)):"";d=_.sk(b,a.g.customData);(e=d[_.Qc])&&a.f.set(_.Qc,{qd:e.licenseUrl||"",customData:c,jf:!1});(f=d[_.Rc])&&a.f.set(_.Rc,{qd:f.licenseUrl||"",customData:c,
|
|
34
|
+
jf:!1});if(0===a.f.size)throw new _.L(_.M,6,6E3);if((g=a.g.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Qc))a.a=_.Qc;else if(a.f.get(_.Rc))a.a=_.Rc;else throw new _.L(_.M,6,6001,"Configuration for the target system is missing.");return _.x(h,qG(a),2)}a.j=!0;_.y(h)})};nG.prototype.release=function(){var a=this;return _.B(function(b){a.j=!1;a.o=null;a.a=_.Id;a.m=null;a.f=new Map;_.y(b)})};nG.prototype.getDrmInfo=function(){return this.o};
|
|
35
|
+
var sG={kh:"DeleteLicenseAfterUse",lh:"LicenseServer",Bl:"GetChallenge",Cl:"HttpHeader",Hl:"UserAgent",xl:"Cookie",jh:"CustomData"};_.t=uG.prototype;_.t.initialize=function(){this.a.on(nH,this.Vf,this);this.a.on(zH,this.Uf,this);this.a.on(AH,this.Tf,this);this.a.on(oH,this.Jg,this);this.a.on(qH,this.Ig,this);this.a.on(BH,this.Wf,this)};_.t.release=function(){wG(this,_.Em);this.m=!1;this.o=-1;this.g=2};_.t.destroy=function(){this.release();this.a.off(nH,this.Vf);this.a.off(zH,this.Uf);this.a.off(AH,this.Tf);this.a.off(oH,this.Jg);this.a.off(qH,this.Ig);this.a.off(BH,this.Wf);this.l=this.a=null};
|
|
36
|
+
_.t.Vf=function(){this.h.debug("Buffering start. Player state: ",this.a.getState());this.g=this.a.B?1:2;wG(this,_.Om)};_.t.Uf=function(a){this.h.debug("Buffering progress: "+a.percent+" %. Player state: ",vG(this.f))};_.t.Tf=function(){this.h.debug("Buffering complete. Player state: ",this.a.getState());if(!this.m){this.m=!0;var a=this.l.getConfiguration().autoplay,b=this.a.getState()===CH;if(!a&&b){wG(this,_.Wm);return}}if(a=this.f!==_.Vm)a=this.a.getState(),a=a===xG||a===yG;a&&zG(this)};
|
|
37
|
+
_.t.Jg=function(){this.h.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===DH?wG(this,_.Vm):this.h.error("AVPlay prepares while state is not IDLE")};_.t.Ig=function(){this.h.debug("Preparing ends: AVPlay state:",this.a.getState())};_.t.Wf=function(){wG(this,_.Qm)};_.t.getState=function(){return this.f};_.t=AG.prototype;_.t.initialize=function(a){this.l=a};
|
|
38
|
+
_.t.load=function(a){var b=this,c,d,e,f,g,h,l;return _.B(function(m){switch(m.a){case 1:if(!b.l)return b.h.debug("Text streamer is not initialized. Will not load()"),m["return"]();b.B=a;c=b;return _.x(m,CG(b),2);case 2:c.j=m.f;if(!b.j)return b.h.debug("Could not find manifest parser for source. Make sure parsers are registered."),m["return"]();d={networkingEngine:b.l.getNetworkEngine(),filterNewPeriod:function(){},filterAllPeriods:function(){},onTimelineCueAdded:function(){},onEvent:function(){},
|
|
39
|
+
onError:function(){}};_.zf(m,3);e=b;return _.x(m,b.j.start(a.url,d),5);case 5:e.a=m.f;_.Af(m,4);break;case 3:return f=_.Bf(m),b.h.warn(f),_.zf(m,6),g=b,_.x(m,b.j.start(a.url.replace("https://","http://"),d),8);case 8:g.a=m.f;_.Af(m,4);break;case 6:h=_.Bf(m),b.h.error(h),b.a=null;case 4:if(!b.a||!BG(b.a)){m.G(0);break}b.g=DG(b);_.zf(m,10);return _.x(m,b.g.I,12);case 12:b.f=EG(b);l=b.l.getConfiguration();b.f.j=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;_.Af(m,0);break;case 10:_.Bf(m),
|
|
40
|
+
b.h.debug("Could not setup media source..."),b.g=null,b.f=null,b.j=null,b.a=null,_.y(m)}})};_.t.Fi=function(a){this.h.debug(_.ov,a);this.w=!0;var b=_.Px(a.textStreams,this.o||"",this.A||"")[0]||null;this.m&&(a.textStreams.includes(this.m)&&(b=this.m),this.m=null);return{variant:null,text:b}};_.t.Ei=function(){this.h.debug("canSwitch_");this.w=!1;this.m&&(_.tz(this.f,this.m,!0,0),this.m=null)};_.t.U=function(){this.h.debug("onError_")};_.t.Gi=function(){this.j&&this.j.update&&this.j.update()};
|
|
41
|
+
_.t.start=function(){var a=this;return _.B(function(b){if(!a.f)return b["return"]();try{a.f.start()}catch(c){a.h.error("Error while starting streaming engine",c)}_.y(b)})};_.t.setTextVisibility=function(a){this.h.debug("Set text visibility",a);this.g&&this.g.getTextDisplayer().setTextVisibility(a)};_.t.release=function(){var a=this;return _.B(function(b){a.l=null;a.a=null;a.B=null;a.A=null;a.o=null;a.w=!0;a.m=null;_.y(b)})};
|
|
42
|
+
_.t.destroy=function(){var a=this;return _.B(function(b){switch(b.a){case 1:if(!a.j){b.G(2);break}return _.x(b,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.f){b.G(4);break}return _.x(b,a.f.destroy(),5);case 5:a.f=null,a.w=!0;case 4:if(!a.g){b.G(0);break}return _.x(b,a.g.destroy(),7);case 7:a.g=null,_.y(b)}})};_.w(JG,_.R);_.t=JG.prototype;_.t.zg=function(a){var b=a.eventid;a=a.data;switch(b){case EH:0<Object.keys(this.f).length||(this.h.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+UG(this,b[0].extra_info).Bit_rate,b=YG(this,{bandwidth:b}))&&(this.w=b,KG(this,b));break;case FH:LG(this);break;default:this.h.debug("Event type: "+b+" data: "+a)}};_.t.df=function(a){a.detail.currentState===_.Xm&&this.l.off(_.pe,this.df)};
|
|
43
|
+
_.t.initialize=function(a){var b=this;this.l=a;this.a=this.l.a;this.l.on(_.pe,function(c){b.A||(c=c.detail,c.currentState===_.Xm&&(b.h.debug("Current state",c.currentState),b.A=!0,MG(b)))});this.a.on(GH,this.zg,this)};_.t.release=function(){this.f={};this.g=this.w=this.m=this.j=null;this.A=!1;this.o=1};
|
|
44
|
+
_.t.load=function(){if(this.a&&!(0<Object.keys(this.f).length)){this.g=this.l.g;this.l.off(_.pe,this.df);this.l.on(_.pe,this.df,this);try{var a=jH(this.a);this.f=XG(this,a);var b=this.f[_.Q]||[];b.length&&(this.j=b[0].renditions[0]||null);LG(this)}catch(c){this.h.debug("Could not load track manager")}}};_.t.destroy=function(){this.a.off(GH,this.zg);this.a=this.l=null};_.t.getVideoTracks=function(){return this.f[_.si]||[]};_.t.getAudioTracks=function(){return this.f[_.Q]||[]};
|
|
45
|
+
_.t.ia=function(){return this.f[_.O]||[]};_.t.fa=function(){return aH(this,_.si)};_.t.Ka=function(){return aH(this,_.Q)};_.t.La=function(){return aH(this,_.O)};_.t.Za=function(){return this.w};_.t.ib=function(){this.h.info(hG);return null};_.t.jb=function(){this.h.info(hG);return null};_.t.Na=function(){var a=this.fa();return a?a.track:null};_.t.pa=function(){var a=this.Ka();return a?a.track:null};_.t.qa=function(){var a=this.La();return a?a.track:null};
|
|
46
|
+
_.t.eb=function(a){var b=this;null===a?(a=this.fa(),tH(this.a,a.bandwidth,null).then(function(){LG(b)})):0<a.renditions.length&&this.cb(a.renditions[0])};_.t.xa=function(a){a?QG(this,a.renditions[0]):this.h.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.t.Ga=function(a){a?(a=a.renditions[0],this.g?IG(this.g,a.track):QG(this,a)):(this.h.debug("Disabling text tracks"),this.m=null,uH(this.a,!1),this.l.trigger(new _.J(_.Qj)))};
|
|
47
|
+
_.t.cb=function(a){var b=this,c=this.fa();this.a.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,KG(this,a),tH(this.a,c.bandwidth,a.bandwidth).then(function(){LG(b)})["catch"](function(d){var e=new _.L(_.M,7,7200,{tizenerror:d});b.h.debug("Error while switching video track",d);b.l.onError(e)})):this.h.debug("Trying to switch to already active rendition. Doing nothing...")};_.t.pb=function(a){QG(this,a)};_.t.qb=function(a){this.g?IG(this.g,a.track):QG(this,a)};
|
|
48
|
+
_.t.addTextTrack=function(){};_.t.ka=function(){return this.a.o};JG.prototype.isAbrEnabled=JG.prototype.ka;JG.prototype.addTextTrack=JG.prototype.addTextTrack;JG.prototype.setTextRendition=JG.prototype.qb;JG.prototype.setAudioRendition=JG.prototype.pb;JG.prototype.setVideoRendition=JG.prototype.cb;JG.prototype.setTextTrack=JG.prototype.Ga;JG.prototype.setAudioTrack=JG.prototype.xa;JG.prototype.setVideoTrack=JG.prototype.eb;JG.prototype.getTextTrack=JG.prototype.qa;JG.prototype.getAudioTrack=JG.prototype.pa;
|
|
49
|
+
JG.prototype.getVideoTrack=JG.prototype.Na;JG.prototype.getLoadingTextRendition=JG.prototype.jb;JG.prototype.getLoadingAudioRendition=JG.prototype.ib;JG.prototype.getLoadingVideoRendition=JG.prototype.Za;JG.prototype.getTextRendition=JG.prototype.La;JG.prototype.getAudioRendition=JG.prototype.Ka;JG.prototype.getVideoRendition=JG.prototype.fa;JG.prototype.getTextTracks=JG.prototype.ia;JG.prototype.getAudioTracks=JG.prototype.getAudioTracks;JG.prototype.getVideoTracks=JG.prototype.getVideoTracks;_.w(bH,_.Wj);_.t=bH.prototype;_.t.zi=function(){this.w=!0;this.f||this.trigger(new _.J(nH))};_.t.yi=function(a){this.w=!0;this.trigger(new _.J(zH,{percent:a}))};_.t.xi=function(){this.w=!1;this.trigger(new _.J(AH))};_.t.Ci=function(){this.trigger(new _.J(BH))};_.t.Bi=function(a,b){this.trigger(new _.J(GH,{eventid:a,data:b}))};_.t.Di=function(a,b,c,d,e){this.trigger(new _.J(HH,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
|
|
50
|
+
_.t.Ai=function(a,b){this.trigger(new _.J(IH,{drmType:a,drmData:b}));if(this.g){var c=this.g;if(c.j)if(c.a===_.Rc&&"Challenge"===b.name)tG(c,b);else if("DrmError"===b.name){c.h.debug("DrmError event",b);var d=new _.L(_.M,6,6005,{message:JSON.stringify(b)});c.C.onError(d)}}};_.t.U=function(a){this.trigger(new _.J(JH,{eventType:a}))};
|
|
51
|
+
_.t.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(dH,f,b);g=setTimeout(function(){b.off(dH,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===DH)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){fH(b);d(webapis.avplay.play())},function(f){b.trigger(new _.J(JH));e(f)})})).then(function(){return a()});if(c===yG||c===CH)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===xG?
|
|
52
|
+
Promise.resolve():Promise.reject("Player is in invalid state")};_.t.pause=function(){try{webapis.avplay.pause()}catch(a){Promise.reject(a)}return this.getState()===yG?Promise.resolve():Promise.reject()};
|
|
53
|
+
_.t.setPlaybackRate=function(a){var b=this.getState();if(b===CH||b===xG||b===yG){try{webapis.avplay.setSpeed(a),this.D=a}catch(c){return this.h.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.D)}return!0}this.h.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1};_.t.getPlaybackRate=function(){return this.D};
|
|
54
|
+
_.t.load=function(a,b){var c=this,d;return _.B(function(e){switch(e.a){case 1:return c.h.debug("configure()",b||""),_.zf(e,2),_.x(e,mH(c),4);case 4:return _.x(e,sH(c,a,b),5);case 5:_.Af(e,0);break;case 2:throw d=_.Bf(e),new _.L(_.M,7,7003,null,d);}})};_.t.getState=function(){if(this.f&&this.a)return this.a.If;try{return webapis.avplay.getState()}catch(a){this.U(JSON.stringify(a))}};
|
|
55
|
+
_.t.seek=function(a){var b=this,c=1E3*a;return new Promise(function(d,e){b.B=!0;b.l.trigger(new _.J(_.Le));webapis.avplay.seekTo(c,function(){b.B=!1;b.l.trigger(new _.J(_.Ke));d()},function(){b.B=!1;e()})})};_.t.getPosition=function(){if(this.f&&this.a)return this.a.position;try{return webapis.avplay.getCurrentTime()/1E3}catch(a){this.U(JSON.stringify(a))}};_.t.getDuration=function(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.U(JSON.stringify(a))}};
|
|
56
|
+
_.t.release=function(){var a=this;return new Promise(function(b,c){try{a.g&&(a.g.release(),a.g=null);webapis.avplay.stop();webapis.avplay.close();for(var d in a.j){var e=a.j[d];e&&e.ce.stop()}a.j={};a.D=1;a.B=!1;a.m=null;a.a=null;return b()}catch(f){return c(f)}})};_.t.getVolume=function(){var a=null;try{a=tizen.tvaudiocontrol.getVolume()}catch(b){switch(b.name){case jG:this.h.debug("The application does not have the privilege to get the volume.",kG);break;default:this.h.debug(gG,b)}}return a};
|
|
57
|
+
_.t.setVolume=function(a){try{tizen.tvaudiocontrol.setVolume(Math.max(0,Math.min(100*a,100)))}catch(b){switch(b.name){case "InvalidValueError":this.h.warn("Invalid value passed for setVolume.","The passed value value should be in the range of 0 to 1.");break;case jG:this.h.warn("The application does not have the privilege to set the volume.",kG);break;default:this.h.warn("An unknown error occurred while trying to set volume",b)}}};
|
|
58
|
+
_.t.isLive=function(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.U(JSON.stringify(a))}};_.t.stop=function(){try{webapis.avplay.stop()}catch(a){this.h.debug(a)}};_.t.getDrmInfo=function(){this.g&&this.g.getDrmInfo();return null};_.t.setSourceIndex=function(a){this.F=a};_.t.getSourceIndex=function(){return this.F};_.t.getLoadedSource=function(){return this.m&&this.m[this.getSourceIndex()]};
|
|
59
|
+
var DH="IDLE",CH="READY",xG="PLAYING",yG="PAUSED",VG=_.Bb,OG="AUDIO",PG="TEXT",FH="PLAYER_MSG_RESOLUTION_CHANGED",EH="PLAYER_MSG_BITRATE_CHANGE",rG={PLAYREADY:"PLAYREADY",yl:"EME_PLAYREADY",Il:"VERIMATRIX",Dd:"WIDEVINE_CDM",zl:"EME_WIDEVINE_CDM",Kl:"WIDEVINE_CLASSIC"};_.w(vH,_.Wj);_.t=vH.prototype;_.t.Rf=function(){var a=this;this.h.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.J(_.gd));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.h.debug("Could not loop playback")}):this.a.stop()};_.t.Pf=function(a){this.trigger(new _.J(_.De,{currentTime:a.currentTime/1E3}))};
|
|
60
|
+
_.t.Sf=function(a){var b=this.a.getPosition(),c=b+a.duration/1E3,d=a.text||"";this.h.debug("Got subtitles: ",d,"start:",b,"end:",c,a);(d=_.Hh(d))&&this.o.append([new _.yg(b,c,d)],[])};_.t.Qf=function(a){this.h.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.t.Bg=function(){this.A||(this.h.debug("Initial buffering completed..."),this.A=!0)};
|
|
61
|
+
_.t.U=function(a){this.h.debug("Error: TYPE: "+a.eventType);wG(this.f,_.Um);a=new _.L(_.M,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.J(_.hd,{detail:a}))};
|
|
62
|
+
_.t.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(BH,this.Rf,this);this.a.on(dH,this.Pf,this);this.a.on(HH,this.Sf,this);this.a.on(IH,this.Qf,this);this.a.on(JH,this.U,this);this.a.on(AH,this.Bg,this);this.f.initialize();this.m.initialize(this);this.h.debug("Initializing player surface");this.w.hideMediaElement();var c=KH;KH+=1;this.j=_.tn(_.Jd,{id:"__clpp_tizen_player_"+c,type:"application/avplayer"});this.w.addElementToContainer(this.j,!0);var d=this.w.getMedia();if(d){c=this.j;
|
|
63
|
+
var e=[_.df,_.kd,"position",_.pd,"top"],f={};d=null!==d.parentElement?window.getComputedStyle(d,null):d.style;if(!e||0===e.length){e||(e=[]);for(var g in d)e.push(g)}g=_.u(e);for(e=g.next();!e.done;e=g.next())e=e.value,f[e]=d[e];_.vn(c,f);wH(this)}};_.t.getSurface=function(){return this.w};_.t.getConfiguration=function(){return this.configuration};
|
|
64
|
+
_.t.destroy=function(){var a=this;return _.B(function(b){switch(b.a){case 1:return _.x(b,a.release(),2);case 2:a.a.off(BH,a.Rf);a.a.off(dH,a.Pf);a.a.off(HH,a.Sf);a.a.off(IH,a.Qf);a.a.off(JH,a.U);a.a.off(AH,a.Bg);if(!a.g){b.G(3);break}return _.x(b,a.g.destroy(),4);case 4:a.g=null;case 3:a.j&&(a.j.parentElement.removeChild(a.j),a.j=null),a.m.destroy(),a.f.destroy(),a.m=null,a.f=null,_.y(b)}})};_.t.namespace=function(){return LH};_.t.getPlaybackRate=function(){return this.a.getPlaybackRate()};
|
|
65
|
+
_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};_.t.setPlaybackRate=function(a){this.a.setPlaybackRate(a)};_.t.getPosition=function(){return 0<(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.Qm?this.getDuration():this.a.getPosition()||0};_.t.seek=function(a){return typeof a===_.k&&0<=a?(this.isLive()||(a=Math.min(a,this.getDuration())),this.a.seek(a)):Promise.reject()};_.t.getPresentationStartTime=function(){return null};
|
|
66
|
+
_.t.getSeekRange=function(){return{start:0,end:0}};_.t.getVolume=function(){var a=this.a.getVolume();return typeof a===_.k?a/100:null};_.t.setVolume=function(a){this.a.setVolume(a)};_.t.getDuration=function(){return this.a.getDuration()};_.t.getBufferInfo=function(){this.h.warn(_.na);return new _.Vj};_.t.getTrackManager=function(){return this.m};_.t.unload=function(){var a=this;return this.a.release().then(function(){a.m.release()})};
|
|
67
|
+
_.t.release=function(){var a=this;return _.B(function(b){switch(b.a){case 1:if(!a.g){b.G(2);break}return _.x(b,a.g.release(),2);case 2:if(!a.o){b.G(4);break}return _.x(b,a.o.destroy(),5);case 5:a.o=null;case 4:return _.x(b,a.a.release(),6);case 6:a.m.release(),a.f.release(),a.A=!1,_.y(b)}})};
|
|
68
|
+
_.t.load=function(a){var b=this,c,d,e,f,g;return _.B(function(h){switch(h.a){case 1:_.fk(a)&&(b.configuration=_.ek(b.B,a));c=_.sm(b.configuration,["html","native"]);b.o=c.create(b);d=_.an(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){h.G(2);break}b.g=new AG;b.g.initialize(b);_.zf(h,3);return _.x(h,b.g.load(d),5);case 5:b.g.start();_.Af(h,2);break;case 3:f=_.Bf(h),b.h.error(f);case 2:return _.zf(h,6),_.x(h,b.a.load(b.configuration),8);case 8:_.Af(h,7);break;
|
|
69
|
+
case 6:throw g=_.Bf(h),b.onError(g),g;case 7:b.m.load(),_.y(h)}})};_.t.play=function(){var a=this;this.trigger(new _.J(_.Xd));wH(this);return this.a.play().then(function(){zG(a.f)})};_.t.pause=function(){var a=this;return this.a.pause().then(function(){zG(a.f)})};_.t.getState=function(){return this.f.getState()};_.t.getPeriods=function(){return[]};_.t.onError=function(a){var b=new _.J(_.hd,{detail:a});a.severity===_.M&&(wG(this.f,_.Um),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)};
|
|
70
|
+
_.t.getDrmInfo=function(){return this.a.getDrmInfo()};_.t.isEnded=function(){return this.f.getState()===_.Qm};_.t.isPaused=function(){return this.a.getState()===yG};_.t.isMuted=function(){return iH(this.a)};_.t.setMuted=function(a){rH(this.a,a)};_.t.getNetworkEngine=function(){return this.D};_.t.setNetworkEngine=function(a){this.D=a};_.t.isLive=function(){return this.a.isLive()};_.t.getStats=function(){return null};_.t.setSourceIndex=function(a){this.a.setSourceIndex(a)};_.t.getSourceIndex=function(){return this.a.getSourceIndex()};
|
|
71
|
+
_.t.getLoadedSource=function(){return this.a.getLoadedSource()};_.t.canPlay=function(a,b){return(new xH).canPlay(a,b)};_.t.getTimelineCues=function(){return[]};_.t.getTextDisplayer=function(){return this.o};_.t.resetAbr=function(){};vH.prototype.getTextDisplayer=vH.prototype.getTextDisplayer;vH.prototype.setNetworkEngine=vH.prototype.setNetworkEngine;vH.prototype.getNetworkEngine=vH.prototype.getNetworkEngine;var LH="clpp.tizen",KH=0;xH.prototype.a=function(){return LH};
|
|
72
|
+
xH.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.cc||a===_.Gj||a===_.hc)&&b){if(_.ii(2))return 2;if(_.ii(3)||_.ii(4)||_.ii(5)||_.ii(6))return _.G("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};xH.prototype.create=function(){return new vH};_.w(yH,_.wo);yH.prototype.Oa=function(){this.a=new xH;_.Yf(this.a)};yH.prototype.Ha=function(){if(this.a){var a=this.a.a();a&&_.Wf[a]&&(delete _.Wf[a],_.Xf.info("Removed Player factory: '"+a+"'"));this.a=null}};yH.prototype.id=function(){return"tizen"};_.C("clpp.tizen.TizenComponent",yH);var nH="onbufferingstart",zH="onbufferingprogress",AH="onbufferingcomplete",BH="onstreamcompleted",dH="oncurrentplaytime",GH="onevent",HH="onsubtitlechange",IH="ondrmevent",JH="onerror",oH="preparingstart",qH="preparingend";};
|
|
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.ttml.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
e.a)return e.getAttribute(c)}return null},
|
|
4
|
-
0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)}
|
|
5
|
-
|
|
6
|
-
b,c){
|
|
7
|
-
Number(a[2]):null},
|
|
8
|
-
a.w,a.A,a.g,a.a,a.j,a.f)}).filter(function(b){return null!=b})},
|
|
9
|
-
g={},
|
|
10
|
-
a},
|
|
11
|
-
"color",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.w(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
e+";";break a}}d=""}c+=d;a:{if("textOutline"in this.a){d=this.a.textOutline.split(" ");e="black";f=".4em";var g=d[0]&&d[0].trim(),h=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!
|
|
19
|
-
"monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
b+=h}for(;f.a;)a=f.next(),a=
|
|
24
|
-
_.
|
|
25
|
-
(a.a=c.getId()),c=a.m,-1===["#text","span","br"].indexOf(
|
|
26
|
-
_.
|
|
27
|
-
case _.
|
|
28
|
-
|
|
2
|
+
var f=function(window){var cs='application/mp4; codecs\x3d"stpp.ttml"',ds='application/mp4; codecs\x3d"stpp.ttml.im1i"',es='application/mp4; codecs\x3d"stpp.ttml.im1t"',fs="backgroundColor",gs="direction",hs="displayAlign",is="region",js="sans-serif",ks="textAlign",ts="textDecoration",Bs="writingMode",Cs=function(a,b,c){this.g=a;this.f=b;this.a=c},Ds=function(a,b,c){Cs.call(this,a,[],c);this.j=b||""},Es=function(a,b,c){Cs.call(this,a,b,c)},Fs=function(a,b,c){a=a.f;for(var d=a.length-1;0<=d;d--){var e=b.get(a[d]);if(c in
|
|
3
|
+
e.a)return e.getAttribute(c)}return null},Ns=function(a,b){var c=null;if(Gs.test(a)){c=Gs.exec(a);var d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]);g+=(Number(c[5])||0)/b.f;f+=g/b.frameRate;c=f+60*e+3600*d}else Hs.test(a)?c=Is(Hs,a):Js.test(a)?c=Is(Js,a):Ks.test(a)?(c=Ks.exec(a),c=Number(c[1])/b.frameRate):Ls.test(a)?(c=Ls.exec(a),c=Number(c[1])/b.a):Ms.test(a)&&(c=Is(Ms,a));return c},Is=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||
|
|
4
|
+
0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},Os=function(a){return a.split(":").pop()},Ps=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Rs=function(a,b){for(;Qs.test(a);){var c=Qs.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Ss=function(a,b,c,d,e,f,g){Cs.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.m=e;this.j=[]},Ts=function(a,b,c){a=Fs(a,b,ks);if(!a&&c&&(a=Fs(c,b,ks),!a&&"rltb"===Fs(c,b,Bs)))return _.ie;switch(a){case _.Bc:return _.tg;case _.ie:case _.ed:return _.ie;default:return _.pd}},
|
|
5
|
+
Us=function(a,b,c){if(_.Dh(a.w))return document.createTextNode(_.Hh(a.w||""));if(a.A)return _.tn("br");for(var d=_.tn("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.un(d,f.value);a=_.u(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(Us(c.get(e.value),b,c));return d},Vs=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))},Ws=function(a,
|
|
6
|
+
b,c){Cs.call(this,a,b,c)},Zs=function(a,b,c,d){var e=Xs.exec(a);a=Ys.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},$s=function(a,b){return typeof b===_.k&&0<b?_.zg:Ys.test(a)?0:_.zg},at=function(a,b){Cs.call(this,"root-container",[],b);this.j=a},bt=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},ct=function(a,b){var c=a.getAttribute("extent");return(c=Ys.exec(c))?Number(c[b]):null},et=function(a){a=a.getAttribute("cellResolution");return(a=dt.exec(a))?
|
|
7
|
+
Number(a[2]):null},ft=function(a,b,c){Cs.call(this,a,b,c)},gt=function(a){this.B=a;this.w=this.m=null;this.A=0;this.g=new Map;this.a=new Map;this.j=new Map;this.f=new Map;this.o=[]},it=function(a){return ht.some(function(b){return b in a.attributes})},jt=function(a,b){if(0===b.length)return[];for(var c=[],d=_.u(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.mf(jt(a,a.a.get(e).f)).concat([e]));return c},lt=function(){return"inline-"+kt++},mt=function(a){return a.o.map(function(b){return b.build(a.m,
|
|
8
|
+
a.w,a.A,a.g,a.a,a.j,a.f)}).filter(function(b){return null!=b})},nt=function(a){this.a=a.firstChild;this.f=new Set},ot=function(a,b,c,d,e,f){this.g=a;this.a=b;this.j=c;this.m=d;this.f=e;this.attributes=f},pt=function(a){return Os(a.g.nodeName)},qt=function(){this.a=new Map},st=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},h=b.parentNode;if(h&&a.a.has(h)){var l=a.a.get(h);e=_.mf(l.m).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.mf(l.f).concat(),
|
|
9
|
+
g={},rt.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(is)&&(c=b.getAttribute(is));b.hasAttribute(_.ve)&&f.push.apply(f,_.mf(b.getAttribute(_.ve).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.u(d);for(h=d.next();!h.done;h=d.next()){h=h.value;var m=Os(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new ot(b,c,d,e,f,g);a.a.set(b,c);return c},tt=function(a){this.a=a;this.f=new DOMParser},ut=function(a){this.f=
|
|
10
|
+
a},vt=function(a){return String(Math.floor(a/3600)).padStart(2,"0")+":"+String(Math.floor(a/60%60)).padStart(2,"0")+":"+String(Math.floor(a%60)).padStart(2,"0")+"."+String(Math.floor(1E3*a%1E3)).padStart(3,"0")},wt=function(){},xt=function(a){this.a=new tt(a);this.h=new _.I("clpp.ttml.Mp4TtmlParser")},yt=function(){this.a=new wt};Cs.prototype.getId=function(){return this.g};Cs.prototype.getAttribute=function(a){return this.a[a]};_.w(Ds,Cs);_.w(Es,Cs);var Gs=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Hs=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Js=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Ks=/^(\d*(?:\.\d*)?)f$/,Ls=/^(\d*(?:\.\d*)?)t$/,Ms=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Xs=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Ys=/^(\d+)px (\d+)px$/,dt=/^(\d+) (\d+)$/,Qs=/(\d+)px/,zt=/^(\d+px|\d+em|\d*\.?\d+c)$/,ht=["fontStyle","fontSize","fontFamily","fontWeight","lineHeight",
|
|
11
|
+
"color",fs,"opacity","padding","zIndex",ks,hs,Bs,gs,ts,"textOutline"],rt=["begin",_.ed];_.w(Ss,Es);
|
|
12
|
+
Ss.prototype.build=function(a,b,c,d,e,f,g){var h=Ns(this.a.begin,b);b=Ns(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.tn(_.Xc);for(var l=_.u(this.j),m=l.next();!m.done;m=l.next())c.appendChild(Us(g.get(m.value),e,g));g=new _.yg(h,b,c.innerHTML.trim(),_.Fe);g.cssClassList=_.mf(this.f).concat();g.textAlign=Ts(this,e,null);g.writingMode=_.ug;g.line=-1;g.lineInterpretation=_.vg;g.lineAlign=_.wg;g.containerRows=bt(null,et(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
|
|
13
|
+
Ts(this,e,f);a:switch(Fs(f,e,Bs)){case "tb":case "tblr":a=_.Ne;break a;case "tbrl":a=_.Oe;break a;default:a=_.ug}g.writingMode=a;a:switch(Fs(f,e,hs)){case _.Bc:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Fs(f,e,hs)){case _.Bc:a=1;break a;default:a=_.vg}g.lineInterpretation=a;a:switch(Fs(f,e,hs)){case _.Bc:e=_.Bc;break a;default:e=_.wg}g.lineAlign=e}this.m&&(a=d.get(this.m))&&(d=a.getAttribute("encoding"),e=a.getAttribute("imageType")||a.getAttribute("imagetype"),a=a.j.trim(),
|
|
14
|
+
g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.w(Ws,Es);
|
|
15
|
+
Ws.prototype.build=function(a,b){var c=new _.Bg;c.id=this.getId();var d=bt(a.j.containerWidth,ct(a,1),720),e=bt(a.j.containerHeight,ct(a,2),480);a:switch(Fs(this,b,hs)){case "after":var f="flex-start";break a;case _.Bc:f=_.Bc;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Fs(this,b,Bs)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Nc}c.writingMode=f;f=this.getAttribute("extent")||Fs(this,b,"extent");c.width=Zs(f,d,1,100);c.widthUnits=$s(f,d);c.height=
|
|
16
|
+
Zs(f,e,2,100);c.heightUnits=$s(f,e);f=this.getAttribute("origin")||Fs(this,b,"origin");c.viewportAnchorX=Zs(f,d,1,0);c.viewportAnchorY=Zs(f,e,2,0);c.viewportAnchorUnits=$s(f,d);c.cssClassList=_.mf(this.f).concat();return c};_.w(at,Cs);_.w(ft,Cs);
|
|
17
|
+
ft.prototype.build=function(a){var b=null;var c=et(a);c&&(b=bt(a.j.containerHeight,ct(a,2),480)/c);b=bt(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.u(At.entries()),e=d.next();!e.done;e=d.next()){var f=_.u(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+Ps(this.a[e])+";")}a:{if("unicodeBidi"in this.a){d=this.a.unicodeBidi;e="";switch(d){case "normal":case "embed":e=d;break;case "bidiOverride":e="bidi-override"}if(0<e.length){d="unicode-bidi:"+
|
|
18
|
+
e+";";break a}}d=""}c+=d;a:{if("textOutline"in this.a){d=this.a.textOutline.split(" ");e="black";f=".4em";var g=d[0]&&d[0].trim(),h=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!zt.test(g)&&zt.test(h)&&zt.test(l)?(e=g,f=h):2===d.length&&!zt.test(g)&&zt.test(h)?(e=g,f=h):2===d.length&&zt.test(g)&&zt.test(h)&&(f=g);if(""!==f){f=Ps(f);d="text-shadow:0 0 "+(f+" "+e+",0 0 ")+(f+" "+e+",0 0 ")+(f+" "+e+";");break a}}d=""}c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif",
|
|
19
|
+
"monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",js).replace("proportionalSerif",js).replace("sansSerif",js).replace("default",js)+";":"");a:{if(ts in this.a){d=[];e=_.u(this.a.textDecoration.split(" "));for(f=e.next();!f.done;f=e.next())switch(f=f.value,f){case "underline":case "overline":d.push(f);break;case "lineThrough":d.push("line-through")}if(0<d.length){d="text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+
|
|
20
|
+
Ps(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Ps(e),e=Rs(e,b),d=d+"line-height:"+e+";"):d="";a.push(c+d+"}");a:{if("fontSize"in this.a&&(c=this.a.fontSize.split(" "),d=null,1===c.length&&(d=c[0]),2===c.length&&(d=c[1]),d)){d=d.trim();d=Ps(d);d=Rs(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.g+" .clpp-text-wrapper {",a.push(c+b+"}"),c="::ttml .clpp-text-wrapper__"+this.g+" {",a.push(c+b+"}"));return a};
|
|
21
|
+
var At=new Map([["color","color"],[fs,"background-color"],[gs,gs],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var kt=0;nt.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Bt.has(Os(a.nodeName))||Ct.has(Os(a.nodeName))||!a.firstChild||this.f.has(a.firstChild)?a.nextSibling?a=a.nextSibling:a=a.parentNode:a=a.firstChild;while(a&&(this.f.has(a)||a.nodeType!==Node.TEXT_NODE&&!Bt.has(Os(a.nodeName))));var b=this.a;this.a=a;return b};var Bt=new Set(["tt","head","layout",_.Ad,_.md,is,"styling",_.ve,"body",_.Xc,"p","span","br"]),Ct=new Set([_.ve,_.md]);ot.prototype.getId=function(){return this.attributes.id};tt.prototype.parseInit=function(){};
|
|
22
|
+
tt.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.K.Ra(this.a.ttml||{}),e=_.N(a,0,c[0]);e=_.uh(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.Ce)}catch(n){throw new _.L(_.M,2,2005,"Failed to parse TTML.");}d=new gt(d);e=new qt;f=new nt(f);b=b.periodStart;typeof b===_.k&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var h=c[g],l=_.N(a,b,h);l=_.Jh(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new Ds(m,l,{imageType:"PNG",encoding:"Base64"}));
|
|
23
|
+
b+=h}for(;f.a;)a=f.next(),a=st(e,a),"tt"===pt(a)&&(d.m=new at(d.B,Object.assign({},a.attributes))),"tt"===pt(a)&&(d.w=new Vs(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),pt(a)!==_.md||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.g.set(c,new Ds(c,a.g.textContent,a.attributes))),pt(a)===_.md&&a.attributes.begin&&a.attributes.end?(c="#"+lt(),b=new Ds(c,a.g.textContent,a.attributes),d.g.set(c,b),c=b):c=null,c&&(a.j=c.getId()),pt(a)===
|
|
24
|
+
_.ve&&(c=a.getId()||lt(),b=new ft(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),pt(a)!==_.ve&&it(a)?(c=lt(),b=new ft(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),pt(a)!==_.Xc||!a.attributes.extent&&!a.attributes.origin?c=null:(c=lt(),b=new Ws(c,jt(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),pt(a)!==is?c=null:(c=a.getId(),b=new Ws(c,jt(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&
|
|
25
|
+
(a.a=c.getId()),c=a.m,-1===["#text","span","br"].indexOf(pt(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=lt(),b=new Ss(c,"#text"===a.g.nodeName?a.g.textContent:null,"br"===pt(a),a.a,a.j,jt(d,a.f),a.attributes),d.f.set(c,b),(g=d.f.get(g))&&g.j.push(c),c=b):c=null),c&&a.m.push(c.getId()),"p"===pt(a)||a.j?(c=lt(),b=new Ss(c,null,!1,a.a,a.j,jt(d,a.f),a.attributes),d.f.set(c,b),d.o.push(b),c=b):c=null,c&&a.m.push(c.getId());e=mt(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
|
|
26
|
+
_.mf(c.value.build(d.m)));return{cues:e,styles:f}};ut.prototype.a=function(a){a=(new tt(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.u(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=vt(c.startTime)+" --\x3e "+vt(c.endTime),e=[];switch(c.textAlign){case _.pd:e.push("align:left");break;case _.ie:e.push("align:right");break;case _.tg:e.push("align:middle");break;case _.pd:e.push("align:start");break;case _.ie:e.push("align:end")}switch(c.writingMode){case _.Ne:e.push("vertical:lr");break;
|
|
27
|
+
case _.Oe:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.yh(b)};wt.prototype.probe=function(a,b){return a===_.gc&&b===_.Be};wt.prototype.create=function(a){return new ut(a)};xt.prototype.parseInit=function(a){var b=!1;(new _.Kk).L(_.Dd,_.Lk).L(_.Ee,_.Lk).L(_.yd,_.Lk).L(_.Cd,_.Lk).L(_.re,_.Lk).Y(_.ue,_.Mk).L("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.L(_.M,2,2007);};
|
|
28
|
+
xt.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Kk).L("moof",_.Lk).L("traf",_.Lk).Y("subs",function(h){for(var l=_.T(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.Fk(h.reader),p=0;p<n;++p){var q=1===h.version?_.T(h.reader):_.Fk(h.reader);g.push(q);h.reader.skip(6)}}}).L(_.xd,_.Nk(function(h){d=!0;h=c.a.parseMedia(h,b,g);e=e.concat(h.cues);f=f.concat(h.styles)})).parse(a);d||this.h.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.w(yt,_.wo);yt.prototype.Oa=function(){_.Op[_.gc]=tt;_.Op[_.ec]=xt;_.Op[cs]=xt;_.Op[es]=xt;_.Op[ds]=xt;_.Qi.push(this.a)};yt.prototype.Ha=function(){_.Pp(_.gc);_.Pp(_.ec);_.Pp(cs);_.Pp(es);_.Pp(ds);_.Si(this.a)};yt.prototype.id=function(){return _.ye};_.C("clpp.ttml.TtmlComponent",yt);};
|
|
29
29
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
30
30
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
31
31
|
else{_=this.clpp._;(f.call(g,this));}
|