@castlabs/prestoplay 6.17.0 → 6.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +98 -98
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +372 -369
- package/cjs/cl.crypto.js +8 -8
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +1 -1
- package/cjs/cl.freewheel.js +21 -21
- package/cjs/cl.hls.js +67 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +302 -302
- package/cjs/cl.muxdata.js +14 -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.sessions.js +15 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +64 -64
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +9 -9
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +14 -14
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +83 -83
- package/cl.conviva.js +26 -26
- package/cl.core.js +324 -323
- package/cl.crypto.js +8 -8
- package/cl.dash.js +69 -69
- package/cl.externs.js +1 -1
- package/cl.freewheel.js +15 -15
- package/cl.hls.js +72 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +15 -15
- package/cl.mse.js +267 -268
- package/cl.muxdata.js +11 -11
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +54 -54
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +6 -6
- package/cl.vr.js +14 -14
- package/cl.vtt.js +11 -11
- package/cl.youbora.js +12 -12
- package/package.json +1 -1
- package/typings.d.ts +3 -2
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 _.H(function(e){if(1==e.a){b=a.a===_.
|
|
4
|
-
keyIds:[],periodId:null},_.qh(e,0);d=_.E(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.P(_.Q,6,6005,{message:JSON.stringify(d)});})},
|
|
5
|
-
"Initialize",""),webapis.avplay.setDrm(b.he,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.he,"widevine_data_type",a.l.type)}catch(d){throw d;}_.A(c)})},
|
|
6
|
-
"POST";_.B(D,2);return _.y(D,a.C.vb.fetch(l).P,4)}if(2!=D.a){m=D.f;if(a.j){n=_.lj(m.data);p=n.byteLength;q="";for(u=0;u<p;u++)q+=String.fromCharCode(n[u]);v=btoa(q);z=b.session_id+
|
|
7
|
-
6,6007,{message:_.$a,url:I.data.url,status:I.data.status||NaN,response:I.data.response||"",headers:I.data.headers||{}},I);a.C.onError(F);_.A(D)})},
|
|
8
|
-
reason:a.h}}))):a.j===_.qp&&a.m.trigger(new _.L(_.
|
|
9
|
-
c)}},
|
|
10
|
-
|
|
11
|
-
a.m.getPosition(),c=null;a=_.w(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].roles;e.kind=a[d].kind||_.
|
|
13
|
-
var c=
|
|
14
|
-
|
|
15
|
-
0<f.length&&(c=f[0]));a.g.debug("Setting audio track with preferred language:",e);a.za(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},
|
|
16
|
-
function(a,b,c){var d=_.dj(b.language||_.vg);c.language=_.fk(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.
|
|
17
|
-
c.language=_.fk(b);c.originalLanguage=b;c.kind=_.
|
|
18
|
-
_.dj(l.language||_.vg);m=_.fk(m);m=c(g,m);m||(m=new _.ek(String(a.o++),_.gk),g.push(m));m.renditions.push(
|
|
19
|
-
c.length;e++){var f=
|
|
20
|
-
b){c=a[d].renditions[e];break}return c},
|
|
21
|
-
0;this.o=!0;this.f=!1;this.a=null;this.A=1;this.w=!1;this.j={}},
|
|
22
|
-
{currentTime:b}))},onevent:a.ak.bind(a),onsubtitlechange:a.ck.bind(a),ondrmevent:a.$j.bind(a),onerror:a.T.bind(a)})}catch(b){a.g.error(b)}},
|
|
23
|
-
|
|
24
|
-
_.y(d,Promise.race([
|
|
25
|
-
_.B(p,2);g=a.l[d].url;h=a.l[d].type;h!==_.
|
|
26
|
-
_.y(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,wg:0,
|
|
30
|
-
d)}},
|
|
31
|
-
|
|
32
|
-
a.A),e=Math.floor(b.width*a.A);b=Math.floor(b.height*a.A);a.g.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.g.debug("Could not apply dimension. Player state "+a.a.getState())},
|
|
33
|
-
|
|
34
|
-
Wf:!1});if(0===a.f.size)throw new _.P(_.Q,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.
|
|
35
|
-
var
|
|
36
|
-
_.t.Ug=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;
|
|
37
|
-
_.t.Zh=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===
|
|
38
|
-
_.t.load=function(a){var b=this,c,d,e,f,g,h,l;return _.H(function(m){switch(m.a){case 1:if(!b.m)return b.g.debug("Text streamer is not initialized. Will not load()"),m["return"]();b.B=a;c=b;return _.y(m,
|
|
39
|
-
onError:function(){}};_.B(m,3);e=b;return _.y(m,b.j.start(a.url,d),5);case 5:e.a=m.f;_.qh(m,4);break;case 3:return f=_.E(m),b.g.warn(f),_.B(m,6),g=b,_.y(m,b.j.start(a.url.replace("https://","http://"),d),8);case 8:g.a=m.f;_.qh(m,4);break;case 6:h=_.E(m),b.g.error(h),b.a=null;case 4:if(!b.a
|
|
40
|
-
_.qh(m,0);break;case 10:_.E(m),b.g.debug("Could not setup media source..."),b.h=null,b.f=null,b.j=null,b.a=null,_.A(m)}})};_.t.ek=function(a){this.g.debug(_.
|
|
2
|
+
var f=function(window){var HN="An unknown error occurred while trying to get volume",IN="Cannot get loading rendition due to platform limitations",JN="PARAM_START_POSITION",KN="SecurityError",LN="The require privilege is: http://tizen.org/privilege/tv.audio",MN="|STARTBITRATE\x3d",NN=function(a,b,c){function d(e){c.call(a,e);a.removeEventListener(b,d)}a.addEventListener(b,d)},ON=function(a,b){this.h=a;this.o=null;this.a=_.We;this.l=null;this.j=!1;this.f=new Map;this.C=b;this.g=new _.K("clpp.tizen.DrmEngine")},RN=function(a){var b,
|
|
3
|
+
c,d;return _.H(function(e){if(1==e.a){b=a.a===_.Td||a.a===_.Rd;if(!b)throw new _.P(_.Q,6,6001,"The key system "+a.a+" is not supported by the player or the platform");c=a.f.get(a.a);if(!c.Td)throw new _.P(_.Q,6,6012,"No license server given for "+a.a);_.B(e,2);return a.a===_.Td?_.y(e,PN(a),5):_.y(e,QN(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.Td,distinctiveIdentifierRequired:!1,persistentStateRequired:c.Wf,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],
|
|
4
|
+
keyIds:[],periodId:null},_.qh(e,0);d=_.E(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.P(_.Q,6,6005,{message:JSON.stringify(d)});})},QN=function(a,b){var c,d,e,f;return _.H(function(g){c=SN;d=TN;e={};e[d.Fi]=!b.Wf;e[d.Hi]=b.Td;""!==b.customData&&(e[d.Ei]=b.customData);f=JSON.stringify(e);a.g.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(h){throw h;}_.A(g)})},PN=function(a){var b;return _.H(function(c){b=SN;try{webapis.avplay.setDrm(b.he,
|
|
5
|
+
"Initialize",""),webapis.avplay.setDrm(b.he,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.he,"widevine_data_type",a.l.type)}catch(d){throw d;}_.A(c)})},UN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,C,I,F;_.H(function(D){if(1==D.a){c=SN;d=a.f.get(a.a);a.g.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.Td;l=_.Jj([h],_.Gj());l.type=3;l.body=f.buffer;l.method=
|
|
6
|
+
"POST";_.B(D,2);return _.y(D,a.C.vb.fetch(l).P,4)}if(2!=D.a){m=D.f;if(a.j){n=_.lj(m.data);p=n.byteLength;q="";for(u=0;u<p;u++)q+=String.fromCharCode(n[u]);v=btoa(q);z=b.session_id+JN+(v+JN);a.g.debug("Widevine license params",z);try{webapis.avplay.setDrm(c.he,"widevine_license_data",z)}catch(G){a.g.error("License response rejected by CDM"),C=new _.P(_.Q,6,6008,{browserError:JSON.stringify(G)}),a.C.onError(C)}}return _.qh(D,0)}I=_.E(D);a.g.error("License request failed.",JSON.stringify(I));F=new _.P(_.Q,
|
|
7
|
+
6,6007,{message:_.$a,url:I.data.url,status:I.data.status||NaN,response:I.data.response||"",headers:I.data.headers||{}},I);a.C.onError(F);_.A(D)})},VN=function(a){this.m=a;this.a=this.m.a;this.f=_.lp;this.j=_.mp;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.K("clpp.tizen.StateManager")},XN=function(a,b){if(a.f!==b)if(a.f===_.wp&&b!==_.lp)a.g.debug(_.HB+WN(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;a.f===_.qp?(a.o=(new Date).getTime(),a.m.trigger(new _.L(_.md,{detail:{bufferedTimeMS:-1,
|
|
8
|
+
reason:a.h}}))):a.j===_.qp&&a.m.trigger(new _.L(_.ld,{detail:{bufferedTimeMS:c-a.o,reason:a.h}}));var d={currentState:a.f,previousState:a.j,timeSinceLastStateChangeMS:c-a.w};a.w=c;a.m.trigger(new _.L(_.gg,{detail:d}));a.g.debug("State changed:",WN(a.j),"-\x3e",WN(a.f))}},WN=function(a){return Object.keys(_.up)[a]},$N=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case YN:c=_.zp;break;case ZN:c=_.yp;break;default:a.m.isEnded()?c=_.sp:a.g.debug("Inconsistent AVPlay playback state:",b)}XN(a,
|
|
9
|
+
c)}},aO=function(){this.o=this.A=this.f=this.h=this.B=this.m=this.j=this.a=null;this.D=!1;this.w=!0;this.l=null;this.g=new _.K("clpp.tizen.TextStreamer")},bO=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},cO=function(a){var b,c;return _.H(function(d){if(1==d.a)return b=a.m.getConfiguration(),c=null,_.y(d,_.It(a.B.url,a.m.getNetworkEngine(),b.manifest.attemptParameters,a.B.type||null),2);(c=d.f)&&c.configure(b.manifest);return d["return"](c)})},
|
|
10
|
+
dO=function(a){var b=document.createElement(_.r),c=new _.rE,d=new _.RC(function(){return null}),e=a.m.getTextDisplayer();return new _.tE(b,c,e,d,a.m.getConfiguration())},eO=function(a){var b={configuration:{},Eb:function(){return a.m.getPosition()},W:a.h,vb:a.m.getNetworkEngine(),Nf:a.ek.bind(a),Mf:a.dk.bind(a),onError:a.T.bind(a),Sh:function(){},onEvent:function(){},Wh:a.fk.bind(a),Je:function(){},ve:function(){return new _.vF},jf:function(){return!1},wd:null};return new _.pG(a.a,b)},fO=function(a){var b=
|
|
11
|
+
a.m.getPosition(),c=null;a=_.w(a.a.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c},gO=function(a){a.g.debug("getTextStreams()",a.a);if(a.a){var b=[],c=a.a.periods;a.g.debug("getting text streams");for(var d=0;d<c.length;d++)if(a.g.debug(c[d].startTime,a.m.getPosition()),c[d].startTime<=a.m.getPosition()){b=c[d].textStreams;break}a=b}else a=[];b=[];for(d=c=0;d<a.length;d++){var e=new _.ek(String(c++),_.T);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=
|
|
12
|
+
a[d].roles;e.kind=a[d].kind||_.mC;var f=new _.pk(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},hO=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.sG(a.f,_.R),c=null;if(b){a=gO(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},iO=function(a,b){a.g.debug("Set active track",b);if(b&&(a.o=b.language,a.A=b.roles[0]||"",a.D=b.kind===_.se,a.a&&a.f)){a.setTextVisibility(!0);
|
|
13
|
+
var c=fO(a),d=b.renditions[0];(c=c.textStreams.find(function(e){return String(e.id)===d.id}))?(a.w?(a.g.debug("Switching period defer text selection"),a.l=c):(_.DG(a.f,c,!0,0),a.m.trigger(new _.L(_.Pl))),a.o=c.language):a.g.error(_.GB,d.id)}},jO=function(){this.h=this.a=this.m=null;this.f={};this.g=new _.K("clpp.tizen.TrackManager");this.w=this.l=this.j=null;this.A=!1;this.o=1},kO=function(a,b){a.m.trigger(new _.L(_.Lg,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},
|
|
14
|
+
lO=function(a){var b=a.na();b&&a.m.trigger(new _.L(_.jd,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},mO=function(a){var b=a.m.getConfiguration(),c=_.ji(b.preferredAudioLanguage||[]),d=a.f[_.gk]||[];if(d.length){var e=null;c.some(function(g){e=_.IC(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.g.debug("Setting audio track with preferred language:",e);a.za(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},qO=function(a,b){if(b){var c=b.track.type.toUpperCase();nO(a.a,c,Number(b.id)).then(function(){c===oO&&(a.j=b,a.m.trigger(new _.L(_.Ol)));c===pO&&(a.l=b,a.m.trigger(new _.L(_.Pl)))})["catch"](function(){a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},rO=
|
|
16
|
+
function(a,b,c){var d=_.dj(b.language||_.vg);c.language=_.fk(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.ed;a=new _.pk(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},sO=function(a,b,c){c.mimeType=_.Jg;a=new _.pk(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},tO=function(a,b,c){b=_.dj(b.track_lang||_.vg);c.mimeType="text/ttml";
|
|
17
|
+
c.language=_.fk(b);c.originalLanguage=b;c.kind=_.mC;return new _.pk(String(a),c)},uO=function(a,b){var c=null;try{c=JSON.parse(b)}catch(d){a.g.warn("Couldn't retrieve extra infos from stream."),c=null}return c},xO=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===vO}),f=b.filter(function(n){return n.type===oO}),g=[],h=0;h<f.length;h++){var l=uO(a,f[h].extra_info);if(l){var m=
|
|
18
|
+
_.dj(l.language||_.vg);m=_.fk(m);m=c(g,m);m||(m=new _.ek(String(a.o++),_.gk),g.push(m));m.renditions.push(rO(f[h].index,l,m))}else a.g.warn("Skipping audio stream with no extra info")}f=new _.ek(String(a.o++),_.hk);for(h=0;h<e.length;h++)(l=uO(a,e[h].extra_info))?f.renditions.push(sO(e[h].index,l,f)):a.g.warn("Skipping video stream with no extra info");e=[];e=a.h?gO(a.h):wO(a,b);d[_.hk]=[f];d[_.gk]=g;d[_.T]=e;return d},wO=function(a,b){for(var c=b.filter(function(h){return h.type===pO}),d=[],e=0;e<
|
|
19
|
+
c.length;e++){var f=uO(a,c[e].extra_info);if(f){var g=new _.ek(String(a.o++),_.T);g.renditions.push(tO(c[e].index,f,g));d.push(g)}else a.g.warn("Skipping text stream with no extra info")}return d},yO=function(a,b){for(var c=a.f[_.hk]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.O.la(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},zO=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},BO=function(a,b){if(b===_.T&&a.h)return hO(a.h);var c=AO(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===b.toUpperCase()})[0];var d=null;b===_.hk&&(d=uO(a,c.extra_info),d=yO(a,{width:d.Width,height:d.Height}));b===_.gk&&(c?(d=zO(a,c,_.gk),a.j=d):d=a.j);b===_.T&&(c?(d=zO(a,c,_.T),a.l=d):d=a.l);return d},CO=function(a){_.Vl.call(this);this.m=a;this.h=null;this.g=new _.K("clpp.tizen.Middleware");this.D=1;this.B=!1;this.l=null;this.G=
|
|
21
|
+
0;this.o=!0;this.f=!1;this.a=null;this.A=1;this.w=!1;this.j={}},DO=function(a){return _.H(function(b){tizen.systeminfo.getPropertyValue("DISPLAY",function(c){a.A=c.resolutionWidth/1920;a.g.debug("Display resolution ratio: ",a.A)},function(c){a.g.debug("Could not load DISPLAY property");throw c;});_.A(b)})},FO=function(a){try{webapis.avplay.setListener({onbufferingstart:a.Zj.bind(a),onbufferingprogress:a.Yj.bind(a),onbufferingcomplete:a.Xj.bind(a),onstreamcompleted:a.bk.bind(a),oncurrentplaytime:function(b){a.trigger(new _.L(EO,
|
|
22
|
+
{currentTime:b}))},onevent:a.ak.bind(a),onsubtitlechange:a.ck.bind(a),ondrmevent:a.$j.bind(a),onerror:a.T.bind(a)})}catch(b){a.g.error(b)}},GO=function(a){var b=!!a.m.getTrackManager().Ia();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",c)}},HO=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.g.debug({estimatedBandwidth:c,Sn:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",MN+d)}catch(e){a.g.debug(e)}},
|
|
23
|
+
IO=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+MN+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",c),c;}},LO=function(a){return{position:a.getPosition(),state:a.m.getState(),zg:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:JO(a),volume:a.getVolume(),pn:KO(a),uk:AO(a)}},NO=function(a){var b,c;return _.H(function(d){if(1==d.a)return _.y(d,MO(),2);if(3!=d.a)return b=new Promise(function(e){(new _.Wk(e)).da(5)}),
|
|
24
|
+
_.y(d,Promise.race([DO(a).then(function(){return!0}),b.then(function(){return!1})]),3);c=d.f;if(!c)return a.g.debug("Took to long for the SDK to be ready"),d["return"](Promise.reject("SDK Timeout"));_.A(d)})},TO=function(a,b,c){var d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:a.l=_.Dp(b);d=a.G;e=c||{estimatedBandwidth:0,currentBandwidth:0,nextBandwidth:null,currentPosition:0};a.g.debug("Loading manifest URL: "+a.l[d].url);f=b.startTime||void 0;a.f&&(a.trigger(new _.L(OO)),f=c.currentPosition);
|
|
25
|
+
_.B(p,2);g=a.l[d].url;h=a.l[d].type;h!==_.Uc||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);e.nextBandwidth?(IO(a,e.nextBandwidth),a.o=!1):(a.o||HO(a,e),a.o=!0);FO(a);if(!b.drm||!b.drm.env){a.g.debug("No DRM configuration was provided. Assuming clear content");p.F(4);break}m={onError:function(q){return a.m.onError(q)},vb:a.m.getNetworkEngine()};a.h=new ON(b.drm,m);return _.y(p,a.h.init(),4);case 4:return a.f||a.trigger(new _.L(PO)),
|
|
26
|
+
_.y(p,QO(a),6);case 6:a.f||a.trigger(new _.L(RO));f&&typeof f===_.k&&0<f&&a.seek(f)["catch"](function(q){a.g.debug("Couldn't set start position",q)});a.f||(b.volume&&a.setVolume(b.volume),b.muted&&SO(a,b.muted),b.autoplay&&a.m.play()["catch"](function(q){a.g.debug("Autoplay failed",q)}));_.qh(p,0);break;case 2:throw n=_.E(p),a.g.debug("Error while attempting to load source."),n;}})},QO=function(a){return _.H(function(b){a.g.debug("avplay.prepare()");return b["return"](new Promise(function(c,d){try{webapis.avplay.prepareAsync(function(){a.g.debug("AVPlay is ready!");
|
|
27
|
+
GO(a);c()},function(e){a.g.debug("prepareAsync failed",e);d(e)})}catch(e){a.g.debug("Failed to prepare media player for playback"),d(e)}}))})},UO=function(a,b,c){a.g.debug("switchVideoTrack()");try{var d={estimatedBandwidth:parseInt(webapis.avplay.getStreamingProperty("CURRENT_BANDWITH"),10),currentBandwidth:b,nextBandwidth:c,currentPosition:a.getPosition()};a.a=LO(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(function(){var e=a.a.zg;a.f=!1;a.a=
|
|
28
|
+
null;return e===ZN?a.pause():a.play()})}catch(e){return Promise.reject(e)}},KO=function(a){return a.f&&a.a?a.a.pn:webapis.avplay.getTotalTrackInfo()},AO=function(a){return a.f&&a.a?a.a.uk:webapis.avplay.getCurrentStreamInfo()},nO=function(a,b,c){b=b.toUpperCase();b===pO&&VO(a,!0);var d=a.j[b];d&&(d.Oe.stop(),a.j[b]=null,a.g.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.g.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,wg:0,Oe:new _.Wk(function(){return g(h,c,!0)})}),(l=a.j[h])&&3>l.wg?(!a.w&&++l.wg,l.Oe.da(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),l&&l.Oe.stop(),a.j[h]=null,f())}}g(b,c)})},VO=function(a,b){var c=a.m.getTextDisplayer();c&&c.setTextVisibility(b);c=a.m.h;try{c||webapis.avplay.setSilentSubtitle(!b)}catch(d){a.g.debug("Could not set text track visibility",
|
|
30
|
+
d)}},SO=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case KN:a.g.warn("The application does not have the privilege to set mute.",LN);break;default:a.g.warn(HN,c)}}},JO=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case KN:a.g.warn("The application doesn't have the privilege to get the mute state.",LN);break;default:a.g.warn(HN,c)}}return!!b},MO=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");
|
|
31
|
+
NN(c,"load",function(d){return a(d)});NN(c,_.re,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},WO=function(){_.Vl.call(this);this.a=new CO(this);this.f=new VN(this);this.configuration=this.B=_.am();this.w=null;this.g=new _.K("clpp.tizen.Player");this.j=null;this.l=new jO;this.D=new _.ak;this.o=this.h=null;this.A=!1},XO=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.g.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.g.debug("Could not apply dimension. Player state "+a.a.getState())},YO=function(){},ZO=function(){};
|
|
33
|
+
ON.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.H(function(h){if(1==h.a){b=_.vm[a.h.env]||null;if(!b)throw a.g.debug(_.za,_.Qb+a.h.env+_.ba),new _.P(_.Q,6,6015,_.Aa+a.h.env+"' is missing.");a.l={id:String(Math.floor(1E4*Math.random())),type:"MPEG-DASH"};c=Object.keys(a.h.customData||{}).length?btoa(JSON.stringify(a.h.customData)):"";d=_.xm(b,a.h.customData);(e=d[_.Rd])&&a.f.set(_.Rd,{Td:e.licenseUrl||"",customData:c,Wf:!1});(f=d[_.Td])&&a.f.set(_.Td,{Td:f.licenseUrl||"",customData:c,
|
|
34
|
+
Wf:!1});if(0===a.f.size)throw new _.P(_.Q,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Rd))a.a=_.Rd;else if(a.f.get(_.Td))a.a=_.Td;else throw new _.P(_.Q,6,6001,"Configuration for the target system is missing.");return _.y(h,RN(a),2)}a.j=!0;_.A(h)})};ON.prototype.release=function(){var a=this;return _.H(function(b){a.j=!1;a.o=null;a.a=_.We;a.l=null;a.f=new Map;_.A(b)})};ON.prototype.getDrmInfo=function(){return this.o};
|
|
35
|
+
var TN={Fi:"DeleteLicenseAfterUse",Hi:"LicenseServer",En:"GetChallenge",Fn:"HttpHeader",Hn:"UserAgent",An:"Cookie",Ei:"CustomData"};_.t=VN.prototype;_.t.initialize=function(){this.a.on(OO,this.Ug,this);this.a.on($O,this.Tg,this);this.a.on(aP,this.Sg,this);this.a.on(PO,this.Zh,this);this.a.on(RO,this.Yh,this);this.a.on(bP,this.Vg,this)};_.t.release=function(){XN(this,_.lp);this.l=!1;this.o=-1;this.h=2};_.t.destroy=function(){this.release();this.a.off(OO,this.Ug);this.a.off($O,this.Tg);this.a.off(aP,this.Sg);this.a.off(PO,this.Zh);this.a.off(RO,this.Yh);this.a.off(bP,this.Vg);this.m=this.a=null};
|
|
36
|
+
_.t.Ug=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;XN(this,_.qp)};_.t.Tg=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",WN(this.f))};_.t.Sg=function(){this.g.debug("Buffering complete. Player state: ",this.a.getState());if(!this.l){this.l=!0;var a=this.m.getConfiguration().autoplay,b=this.a.getState()===cP;if(!a&&b){XN(this,_.yp);return}}if(a=this.f!==_.xp)a=this.a.getState(),a=a===YN||a===ZN;a&&$N(this)};
|
|
37
|
+
_.t.Zh=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===dP?XN(this,_.xp):this.g.error("AVPlay prepares while state is not IDLE")};_.t.Yh=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.t.Vg=function(){XN(this,_.sp)};_.t.getState=function(){return this.f};_.t=aO.prototype;_.t.initialize=function(a){this.m=a};
|
|
38
|
+
_.t.load=function(a){var b=this,c,d,e,f,g,h,l;return _.H(function(m){switch(m.a){case 1:if(!b.m)return b.g.debug("Text streamer is not initialized. Will not load()"),m["return"]();b.B=a;c=b;return _.y(m,cO(b),2);case 2:c.j=m.f;if(!b.j)return b.g.debug("Could not find manifest parser for source. Make sure parsers are registered."),m["return"]();d={configurationId:"",networkingEngine:b.m.getNetworkEngine(),filterNewPeriod:function(){},filterAllPeriods:function(){},onTimelineCueAdded:function(){},onEvent:function(){},
|
|
39
|
+
onError:function(){}};_.B(m,3);e=b;return _.y(m,b.j.start(a.url,d),5);case 5:e.a=m.f;_.qh(m,4);break;case 3:return f=_.E(m),b.g.warn(f),_.B(m,6),g=b,_.y(m,b.j.start(a.url.replace("https://","http://"),d),8);case 8:g.a=m.f;_.qh(m,4);break;case 6:h=_.E(m),b.g.error(h),b.a=null;case 4:if(!b.a||!bO(b.a)){m.F(0);break}b.h=dO(b);_.B(m,10);return _.y(m,b.h.open(),12);case 12:b.f=eO(b);l=b.m.getConfiguration();b.f.h=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;b.D=l.preferForcedSubtitles;
|
|
40
|
+
_.qh(m,0);break;case 10:_.E(m),b.g.debug("Could not setup media source..."),b.h=null,b.f=null,b.j=null,b.a=null,_.A(m)}})};_.t.ek=function(a){this.g.debug(_.eC,a);this.w=!0;var b=_.UE(a.textStreams,this.o||"",this.A||"",this.D)[0]||null;this.l&&(a.textStreams.includes(this.l)&&(b=this.l),this.l=null);return{variant:null,text:b}};_.t.dk=function(){this.g.debug("canSwitch_");this.w=!1;this.l&&(_.DG(this.f,this.l,!0,0),this.l=null)};_.t.T=function(){this.g.debug("onError_")};
|
|
41
41
|
_.t.fk=function(){this.j&&this.j.update&&this.j.update()};_.t.start=function(){var a=this;return _.H(function(b){if(!a.f)return b["return"]();try{a.f.start()}catch(c){a.g.error("Error while starting streaming engine",c)}_.A(b)})};_.t.setTextVisibility=function(a){this.g.debug("Set text visibility",a);this.h&&this.h.getTextDisplayer().setTextVisibility(a)};_.t.release=function(){var a=this;return _.H(function(b){a.m=null;a.a=null;a.B=null;a.A=null;a.o=null;a.w=!0;a.l=null;_.A(b)})};
|
|
42
|
-
_.t.destroy=function(){var a=this;return _.H(function(b){switch(b.a){case 1:if(!a.j){b.F(2);break}return _.y(b,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.f){b.F(4);break}return _.y(b,a.f.destroy(),5);case 5:a.f=null,a.w=!0;case 4:if(!a.h){b.F(0);break}return _.y(b,a.h.destroy(),7);case 7:a.h=null,_.A(b)}})};_.x(
|
|
43
|
-
_.t.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.
|
|
44
|
-
_.t.load=function(){if(this.a&&!(0<Object.keys(this.f).length)){this.h=this.m.h;this.m.off(_.
|
|
45
|
-
_.t.ia=function(){return this.f[_.T]||[]};_.t.na=function(){return
|
|
46
|
-
_.t.kb=function(a){var b=this;null===a?(a=this.na(),
|
|
47
|
-
_.t.Za=function(a){var b=this,c=this.na();this.a.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,
|
|
48
|
-
_.t.addTextTrack=function(){};_.t.qa=function(){return this.a.o};
|
|
49
|
-
|
|
50
|
-
_.t.$j=function(a,b){this.trigger(new _.L(
|
|
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 _.H(function(e){switch(e.a){case 1:return c.g.debug("configure()",b||""),_.B(e,2),_.y(e,
|
|
42
|
+
_.t.destroy=function(){var a=this;return _.H(function(b){switch(b.a){case 1:if(!a.j){b.F(2);break}return _.y(b,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.f){b.F(4);break}return _.y(b,a.f.destroy(),5);case 5:a.f=null,a.w=!0;case 4:if(!a.h){b.F(0);break}return _.y(b,a.h.destroy(),7);case 7:a.h=null,_.A(b)}})};_.x(jO,_.V);_.t=jO.prototype;_.t.Oh=function(a){var b=a.eventid;a=a.data;switch(b){case eP:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+uO(this,b[0].extra_info).Bit_rate,b=yO(this,{bandwidth:b}))&&(this.w=b,kO(this,b));break;case fP:lO(this);break;default:this.g.debug("Event type: "+b+" data: "+a)}};_.t.Rf=function(a){a.detail.currentState===_.zp&&this.m.off(_.gg,this.Rf)};
|
|
43
|
+
_.t.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.gg,function(c){b.A||(c=c.detail,c.currentState===_.zp&&(b.g.debug("Current state",c.currentState),b.A=!0,mO(b)))});this.a.on(gP,this.Oh,this)};_.t.release=function(){this.f={};this.h=this.w=this.l=this.j=null;this.A=!1;this.o=1};
|
|
44
|
+
_.t.load=function(){if(this.a&&!(0<Object.keys(this.f).length)){this.h=this.m.h;this.m.off(_.gg,this.Rf);this.m.on(_.gg,this.Rf,this);try{var a=KO(this.a);this.f=xO(this,a);var b=this.f[_.gk]||[];b.length&&(this.j=b[0].renditions[0]||null);lO(this)}catch(c){this.g.debug("Could not load track manager")}}};_.t.destroy=function(){this.a.off(gP,this.Oh);this.a=this.m=null};_.t.getVideoTracks=function(){return this.f[_.hk]||[]};_.t.getAudioTracks=function(){return this.f[_.gk]||[]};
|
|
45
|
+
_.t.ia=function(){return this.f[_.T]||[]};_.t.na=function(){return BO(this,_.hk)};_.t.Pa=function(){return BO(this,_.gk)};_.t.Ia=function(){return BO(this,_.T)};_.t.eb=function(){return this.w};_.t.nb=function(){this.g.info(IN);return null};_.t.ob=function(){this.g.info(IN);return null};_.t.Ja=function(){var a=this.na();return a?a.track:null};_.t.ma=function(){var a=this.Pa();return a?a.track:null};_.t.ua=function(){var a=this.Ia();return a?a.track:null};
|
|
46
|
+
_.t.kb=function(a){var b=this;null===a?(a=this.na(),UO(this.a,a.bandwidth,null).then(function(){lO(b)})):0<a.renditions.length&&this.Za(a.renditions[0])};_.t.za=function(a){a?qO(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.t.La=function(a){a?(a=a.renditions[0],this.h?iO(this.h,a.track):qO(this,a)):(this.g.debug("Disabling text tracks"),this.l=null,VO(this.a,!1),this.m.trigger(new _.L(_.Pl)))};
|
|
47
|
+
_.t.Za=function(a){var b=this,c=this.na();this.a.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,kO(this,a),UO(this.a,c.bandwidth,a.bandwidth).then(function(){lO(b)})["catch"](function(d){var e=new _.P(_.Q,7,7200,{tizenerror:d});b.g.debug("Error while switching video track",d);b.m.onError(e)})):this.g.debug("Trying to switch to already active rendition. Doing nothing...")};_.t.ib=function(a){qO(this,a)};_.t.jb=function(a){this.h?iO(this.h,a.track):qO(this,a)};
|
|
48
|
+
_.t.addTextTrack=function(){};_.t.qa=function(){return this.a.o};jO.prototype.isAbrEnabled=jO.prototype.qa;jO.prototype.addTextTrack=jO.prototype.addTextTrack;jO.prototype.setTextRendition=jO.prototype.jb;jO.prototype.setAudioRendition=jO.prototype.ib;jO.prototype.setVideoRendition=jO.prototype.Za;jO.prototype.setTextTrack=jO.prototype.La;jO.prototype.setAudioTrack=jO.prototype.za;jO.prototype.setVideoTrack=jO.prototype.kb;jO.prototype.getTextTrack=jO.prototype.ua;jO.prototype.getAudioTrack=jO.prototype.ma;
|
|
49
|
+
jO.prototype.getVideoTrack=jO.prototype.Ja;jO.prototype.getLoadingTextRendition=jO.prototype.ob;jO.prototype.getLoadingAudioRendition=jO.prototype.nb;jO.prototype.getLoadingVideoRendition=jO.prototype.eb;jO.prototype.getTextRendition=jO.prototype.Ia;jO.prototype.getAudioRendition=jO.prototype.Pa;jO.prototype.getVideoRendition=jO.prototype.na;jO.prototype.getTextTracks=jO.prototype.ia;jO.prototype.getAudioTracks=jO.prototype.getAudioTracks;jO.prototype.getVideoTracks=jO.prototype.getVideoTracks;_.x(CO,_.Vl);_.t=CO.prototype;_.t.Zj=function(){this.w=!0;this.f||this.trigger(new _.L(OO))};_.t.Yj=function(a){this.w=!0;this.trigger(new _.L($O,{percent:a}))};_.t.Xj=function(){this.w=!1;this.trigger(new _.L(aP))};_.t.bk=function(){this.trigger(new _.L(bP))};_.t.ak=function(a,b){this.trigger(new _.L(gP,{eventid:a,data:b}))};_.t.ck=function(a,b,c,d,e){this.trigger(new _.L(hP,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
|
|
50
|
+
_.t.$j=function(a,b){this.trigger(new _.L(iP,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Td&&"Challenge"===b.name)UN(c,b);else if("DrmError"===b.name){c.g.debug("DrmError event",b);var d=new _.P(_.Q,6,6005,{message:JSON.stringify(b)});c.C.onError(d)}}};_.t.T=function(a){this.trigger(new _.L(jP,{eventType:a}))};
|
|
51
|
+
_.t.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(EO,f,b);g=setTimeout(function(){b.off(EO,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===dP)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){GO(b);d(webapis.avplay.play())},function(f){b.trigger(new _.L(jP));e(f)})})).then(function(){return a()});if(c===ZN||c===cP)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===YN?
|
|
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()===ZN?Promise.resolve():Promise.reject()};
|
|
53
|
+
_.t.setPlaybackRate=function(a){var b=this.getState();if(b===cP||b===YN||b===ZN){try{webapis.avplay.setSpeed(a),this.D=a}catch(c){return this.g.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.D)}return!0}this.g.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 _.H(function(e){switch(e.a){case 1:return c.g.debug("configure()",b||""),_.B(e,2),_.y(e,NO(c),4);case 4:return _.y(e,TO(c,a,b),5);case 5:_.qh(e,0);break;case 2:throw d=_.E(e),new _.P(_.Q,7,7003,null,d);}})};_.t.getState=function(){if(this.f&&this.a)return this.a.zg;try{return webapis.avplay.getState()}catch(a){this.T(JSON.stringify(a))}};
|
|
55
55
|
_.t.seek=function(a){var b=this,c=1E3*a;return new Promise(function(d,e){b.B=!0;b.m.trigger(new _.L(_.Dg));webapis.avplay.seekTo(c,function(){b.B=!1;b.m.trigger(new _.L(_.Cg));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.T(JSON.stringify(a))}};_.t.getDuration=function(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.T(JSON.stringify(a))}};
|
|
56
|
-
_.t.release=function(){var a=this;return new Promise(function(b,c){try{a.h&&(a.h.release(),a.h=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.g.warn("Invalid value passed for setVolume.","The passed value value should be in the range of 0 to 1.");break;case
|
|
56
|
+
_.t.release=function(){var a=this;return new Promise(function(b,c){try{a.h&&(a.h.release(),a.h=null);webapis.avplay.stop();webapis.avplay.close();for(var d in a.j){var e=a.j[d];e&&e.Oe.stop()}a.j={};a.D=1;a.B=!1;a.l=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 KN:this.g.debug("The application does not have the privilege to get the volume.",LN);break;default:this.g.debug(HN,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.g.warn("Invalid value passed for setVolume.","The passed value value should be in the range of 0 to 1.");break;case KN:this.g.warn("The application does not have the privilege to set the volume.",LN);break;default:this.g.warn("An unknown error occurred while trying to set volume",b)}}};
|
|
58
58
|
_.t.isLive=function(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.T(JSON.stringify(a))}};_.t.stop=function(){try{webapis.avplay.stop()}catch(a){this.g.debug(a)}};_.t.getDrmInfo=function(){this.h&&this.h.getDrmInfo();return null};_.t.setSourceIndex=function(a){this.G=a};_.t.getSourceIndex=function(){return this.G};_.t.getLoadedSource=function(){return this.l&&this.l[this.getSourceIndex()]};
|
|
59
|
-
var
|
|
59
|
+
var dP="IDLE",cP="READY",YN="PLAYING",ZN="PAUSED",vO=_.lc,oO="AUDIO",pO="TEXT",fP="PLAYER_MSG_RESOLUTION_CHANGED",eP="PLAYER_MSG_BITRATE_CHANGE",SN={PLAYREADY:"PLAYREADY",Bn:"EME_PLAYREADY",In:"VERIMATRIX",he:"WIDEVINE_CDM",Cn:"EME_WIDEVINE_CDM",Kn:"WIDEVINE_CLASSIC"};_.x(WO,_.Vl);_.t=WO.prototype;_.t.Qg=function(){var a=this;this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.L(_.qe));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.g.debug("Could not loop playback")}):this.a.stop()};_.t.Og=function(a){this.trigger(new _.L(_.rg,{currentTime:a.currentTime/1E3}))};
|
|
60
60
|
_.t.Rg=function(a){var b=this.a.getPosition(),c=b+a.duration/1E3,d=a.text||"";this.g.debug("Got subtitles: ",d,"start:",b,"end:",c,a);(d=_.S.hg(d))&&this.o.append([new _.ui(b,c,d)],[])};_.t.Pg=function(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.t.Qh=function(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)};
|
|
61
|
-
_.t.T=function(a){this.g.debug("Error: TYPE: "+a.eventType);
|
|
62
|
-
_.t.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(
|
|
63
|
-
var e=[_.Wg,_.
|
|
64
|
-
_.t.seekWith=function(){return Promise.reject(_.Hb)};_.t.destroy=function(){var a=this;return _.H(function(b){switch(b.a){case 1:return _.y(b,a.release(),2);case 2:a.a.off(
|
|
61
|
+
_.t.T=function(a){this.g.debug("Error: TYPE: "+a.eventType);XN(this.f,_.wp);a=new _.P(_.Q,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.L(_.re,{detail:a}))};
|
|
62
|
+
_.t.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(bP,this.Qg,this);this.a.on(EO,this.Og,this);this.a.on(hP,this.Rg,this);this.a.on(iP,this.Pg,this);this.a.on(jP,this.T,this);this.a.on(aP,this.Qh,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();var c=kP;kP+=1;this.j=_.Wp(_.Xe,{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=[_.Wg,_.ve,"position",_.Ce,"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=_.w(e);for(e=g.next();!e.done;e=g.next())e=e.value,f[e]=d[e];_.Yp(c,f);XO(this)}};_.t.getSurface=function(){return this.w};_.t.getConfiguration=function(){return this.configuration};_.t.getTimeline=function(){return null};_.t.setupPlaylist=function(){return Promise.reject(_.Hb)};_.t.appendLoad=function(){return Promise.reject(_.Hb)};
|
|
64
|
+
_.t.seekWith=function(){return Promise.reject(_.Hb)};_.t.destroy=function(){var a=this;return _.H(function(b){switch(b.a){case 1:return _.y(b,a.release(),2);case 2:a.a.off(bP,a.Qg);a.a.off(EO,a.Og);a.a.off(hP,a.Rg);a.a.off(iP,a.Pg);a.a.off(jP,a.T);a.a.off(aP,a.Qh);if(!a.h){b.F(3);break}return _.y(b,a.h.destroy(),4);case 4:a.h=null;case 3:a.j&&(a.j.parentElement.removeChild(a.j),a.j=null),a.l.destroy(),a.f.destroy(),a.l=null,a.f=null,_.A(b)}})};_.t.namespace=function(){return lP};
|
|
65
65
|
_.t.getPlaybackRate=function(){return this.a.getPlaybackRate()};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};_.t.setPlaybackRate=function(a){this.a.setPlaybackRate(a)};_.t.getPosition=function(){return this.getMediaPosition()};_.t.getMediaPosition=function(){return 0<(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.sp?this.getDuration():this.a.getPosition()||0};
|
|
66
66
|
_.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};_.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.getMediaDuration()};_.t.getMediaDuration=function(){return this.a.getDuration()};
|
|
67
67
|
_.t.getBufferInfo=function(){this.g.warn(_.ua);return new _.Ul};_.t.getTrackManager=function(){return this.l};_.t.unload=function(){var a=this;return this.a.release().then(function(){a.l.release()})};_.t.release=function(){var a=this;return _.H(function(b){switch(b.a){case 1:if(!a.h){b.F(2);break}return _.y(b,a.h.release(),2);case 2:if(!a.o){b.F(4);break}return _.y(b,a.o.destroy(),5);case 5:a.o=null;case 4:return _.y(b,a.a.release(),6);case 6:a.l.release(),a.f.release(),a.A=!1,_.A(b)}})};
|
|
68
|
-
_.t.load=function(a){var b=this,c,d,e,f,g;return _.H(function(h){switch(h.a){case 1:b.configuration=_.cm(b.B,a);c=_.$o(b.configuration,[_.
|
|
69
|
-
_.E(h),b.onError(g),g;case 7:b.l.load(),_.A(h)}})};_.t.play=function(){var a=this;this.trigger(new _.L(_.
|
|
70
|
-
_.t.getDrmInfo=function(){return this.a.getDrmInfo()};_.t.isEnded=function(){return this.f.getState()===_.sp};_.t.isPaused=function(){return this.a.getState()===
|
|
71
|
-
_.t.getLoadedSource=function(){return this.a.getLoadedSource()};_.t.canPlay=function(a,b){return(new
|
|
72
|
-
|
|
68
|
+
_.t.load=function(a){var b=this,c,d,e,f,g;return _.H(function(h){switch(h.a){case 1:b.configuration=_.cm(b.B,a);c=_.$o(b.configuration,[_.xe,"native"]);b.o=c.create(b);d=_.Dp(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){h.F(2);break}b.h=new aO;b.h.initialize(b);_.B(h,3);return _.y(h,b.h.load(d),5);case 5:b.h.start();_.qh(h,2);break;case 3:f=_.E(h),b.g.error(f);case 2:return _.B(h,6),_.y(h,b.a.load(b.configuration),8);case 8:_.qh(h,7);break;case 6:throw g=
|
|
69
|
+
_.E(h),b.onError(g),g;case 7:b.l.load(),_.A(h)}})};_.t.play=function(){var a=this;this.trigger(new _.L(_.lf));XO(this);return this.a.play().then(function(){$N(a.f)})};_.t.pause=function(){var a=this;return this.a.pause().then(function(){$N(a.f)})};_.t.getState=function(){return this.f.getState()};_.t.getPeriods=function(){return[]};_.t.onError=function(a){var b=new _.L(_.re,{detail:a});a.severity===_.Q&&(XN(this.f,_.wp),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()===_.sp};_.t.isPaused=function(){return this.a.getState()===ZN};_.t.isMuted=function(){return JO(this.a)};_.t.setMuted=function(a){SO(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 YO).canPlay(a,b)};_.t.getTimelineCues=function(){return[]};_.t.getTextDisplayer=function(){return this.o};_.t.resetAbr=function(){};WO.prototype.getTextDisplayer=WO.prototype.getTextDisplayer;WO.prototype.setNetworkEngine=WO.prototype.setNetworkEngine;WO.prototype.getNetworkEngine=WO.prototype.getNetworkEngine;var lP="clpp.tizen",kP=0;YO.prototype.a=function(){return lP};
|
|
72
|
+
YO.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Uc||a===_.Fl||a===_.Zc)&&b){if(_.Vj(2))return 2;if(_.Vj(3)||_.Vj(4)||_.Vj(5)||_.Vj(6))return _.Fh("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};YO.prototype.f=function(a){return a===_.pa};YO.prototype.create=function(){return new WO};_.x(ZO,_.Ms);ZO.prototype.f=function(){_.Ph(new YO)};ZO.prototype.a=function(){var a=lP;a&&_.Nh[a]&&(delete _.Nh[a],_.Oh.info("Removed Player factory: '"+a+"'"))};ZO.prototype.id=function(){return"tizen"};_.J("clpp.tizen.TizenComponent",ZO);var OO="onbufferingstart",$O="onbufferingprogress",aP="onbufferingcomplete",bP="onstreamcompleted",EO="oncurrentplaytime",gP="onevent",hP="onsubtitlechange",iP="ondrmevent",jP="onerror",PO="preparingstart",RO="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,32 +1,32 @@
|
|
|
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
|
-
b,
|
|
6
|
-
this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))},
|
|
7
|
-
return(c=
|
|
8
|
-
a.a.get(e).f)).concat([e]));return c},
|
|
9
|
-
g={},
|
|
10
|
-
a},
|
|
11
|
-
"lineHeight","opacity","padding",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.x(
|
|
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
|
-
d+";"):d="";c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif","monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",
|
|
20
|
-
"text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+
|
|
21
|
-
c="::ttml .clpp-text-wrapper__"+this.h+" {",a.push(c+b+"}"));return a};var
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
b+=h}for(;f.$c();)a=f.next(),a
|
|
25
|
-
|
|
26
|
-
c=b),c&&(a.a=c.getId()),c=a.l,-1===["#text","span","br"].indexOf(
|
|
27
|
-
a.next())f.push.apply(f,_.ch(c.value.build(d.l)));return{cues:e,styles:f}}
|
|
28
|
-
case _.Hg:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.S.Va(b)};
|
|
29
|
-
|
|
2
|
+
var f=function(window){var Zw='application/mp4; codecs\x3d"stpp.ttml"',$w='application/mp4; codecs\x3d"stpp.ttml.im1i"',ax='application/mp4; codecs\x3d"stpp.ttml.im1t"',bx="backgroundColor",cx="direction",dx="displayAlign",ex="region",fx="sans-serif",gx="textAlign",hx="textDecoration",ix="writingMode",jx=function(a,b,c){this.h=a;this.f=b;this.a=c},kx=function(a,b,c){jx.call(this,a,[],c);this.j=b||""},lx=function(a,b,c){jx.call(this,a,b,c)},mx=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},ux=function(a,b){var c=null;if(nx.test(a)){c=nx.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 ox.test(a)?c=px(ox,a):qx.test(a)?c=px(qx,a):rx.test(a)?(c=rx.exec(a),c=Number(c[1])/b.frameRate):sx.test(a)?(c=sx.exec(a),c=Number(c[1])/b.a):tx.test(a)&&(c=px(tx,a));return c},px=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)},vx=function(a){return a.split(":").pop()},wx=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},yx=function(a,b){for(;xx.test(a);){var c=xx.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},zx=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},Ax=function(a,b,c,d,e,f,g){jx.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},Bx=function(a,b,c){a=mx(a,b,gx);if(!a&&c&&(a=mx(c,b,gx),!a&&"rltb"===mx(c,
|
|
5
|
+
b,ix)))return _.Tf;switch(a){case _.ud:return _.pi;case _.Tf:case _.pe:return _.Tf;default:return _.Ce}},Cx=function(a,b,c){if(_.S.Fe(a.w))return document.createTextNode(_.S.hg(a.w||""));if(a.A)return _.Wp("br");for(var d=_.Wp("span"),e=_.w(a.f),f=e.next();!f.done;f=e.next())_.Xp(d,f.value);a=_.w(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(Cx(c.get(e.value),b,c));return d},Dx=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*
|
|
6
|
+
this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))},Ex=function(a,b,c){jx.call(this,a,b,c)},Hx=function(a,b,c,d){var e=Fx.exec(a);a=Gx.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},Ix=function(a,b){return typeof b===_.k&&0<b?_.vi:Gx.test(a)?0:_.vi},Jx=function(a,b){jx.call(this,"root-container",[],b);this.j=a},Kx=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},Lx=function(a,b){var c=a.getAttribute("extent");
|
|
7
|
+
return(c=Gx.exec(c))?Number(c[b]):null},Nx=function(a){a=a.getAttribute("cellResolution");return(a=Mx.exec(a))?Number(a[2]):null},Ox=function(a,b,c){jx.call(this,a,b,c)},Px=function(a){this.B=a;this.w=this.l=null;this.A=0;this.h=new Map;this.a=new Map;this.j=new Map;this.f=new Map;this.o=[]},Rx=function(a){return Qx.some(function(b){return b in a.attributes})},Sx=function(a,b){if(0===b.length)return[];for(var c=[],d=_.w(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.ch(Sx(a,
|
|
8
|
+
a.a.get(e).f)).concat([e]));return c},Ux=function(){return"inline-"+Tx++},Vx=function(a){this.a=a.firstChild;this.f=new Set},Wx=function(a,b,c,d,e,f){this.h=a;this.a=b;this.j=c;this.l=d;this.f=e;this.attributes=f},Xx=function(a){return vx(a.h.nodeName)},Yx=function(){this.a=new Map},$x=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=_.ch(l.l).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.ch(l.f).concat(),
|
|
9
|
+
g={},Zx.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(ex)&&(c=b.getAttribute(ex));b.hasAttribute(_.lg)&&f.push.apply(f,_.ch(b.getAttribute(_.lg).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.w(d);for(h=d.next();!h.done;h=d.next()){h=h.value;var m=vx(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new Wx(b,c,d,e,f,g);a.a.set(b,c);return c},ay=function(a){this.a=a;this.f=new DOMParser},by=function(a){this.f=
|
|
10
|
+
a},cy=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")},dy=function(){},ey=function(a){this.a=new ay(a);this.g=new _.K("clpp.ttml.Mp4TtmlParser")},fy=function(){this.j=new dy};jx.prototype.getId=function(){return this.h};jx.prototype.getAttribute=function(a){return this.a[a]};_.x(kx,jx);_.x(lx,jx);var nx=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,ox=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,qx=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,rx=/^(\d*(?:\.\d*)?)f$/,sx=/^(\d*(?:\.\d*)?)t$/,tx=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Fx=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Gx=/^(\d+)px (\d+)px$/,Mx=/^(\d+) (\d+)$/,xx=/(\d+)px/,gy=/^(\d+px|\d+em|\d*\.?\d+c)$/,Qx=[bx,"color",cx,dx,"fontFamily","fontSize","fontStyle","fontWeight",
|
|
11
|
+
"lineHeight","opacity","padding",gx,hx,"textOutline",ix,"zIndex"],Zx=["begin",_.pe];_.x(Ax,lx);
|
|
12
|
+
Ax.prototype.build=function(a,b,c,d,e,f,g){var h=ux(this.a.begin,b);b=ux(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.Wp(_.$d);for(var l=_.w(this.j),m=l.next();!m.done;m=l.next())c.appendChild(Cx(g.get(m.value),e,g));g=new _.ui(h,b,c.innerHTML.trim(),_.tg);g.cssClassList=_.ch(this.f).concat();g.textAlign=Bx(this,e,null);g.writingMode=_.qi;g.line=-1;g.lineInterpretation=_.ri;g.lineAlign=_.si;g.containerRows=Kx(null,Nx(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
|
|
13
|
+
Bx(this,e,f);a:switch(mx(f,e,ix)){case "tb":case "tblr":a=_.Gg;break a;case "tbrl":a=_.Hg;break a;default:a=_.qi}g.writingMode=a;a:switch(mx(f,e,dx)){case _.ud:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(mx(f,e,dx)){case _.ud:a=1;break a;default:a=_.ri}g.lineInterpretation=a;a:switch(mx(f,e,dx)){case _.ud:e=_.ud;break a;default:e=_.si}g.lineAlign=e}this.l&&(a=d.get(this.l))&&(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};_.x(Ex,lx);
|
|
15
|
+
Ex.prototype.build=function(a,b){var c=new _.xi;c.id=this.getId();var d=Kx(a.j.containerWidth,Lx(a,1),720),e=Kx(a.j.containerHeight,Lx(a,2),480);a:switch(mx(this,b,dx)){case "after":var f="flex-start";break a;case _.ud:f=_.ud;break a;default:f="flex-end"}c.displayAlign=f;a:switch(mx(this,b,ix)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Nd}c.writingMode=f;f=this.getAttribute("extent")||mx(this,b,"extent");c.width=Hx(f,d,1,100);c.widthUnits=Ix(f,d);c.height=
|
|
16
|
+
Hx(f,e,2,100);c.heightUnits=Ix(f,e);f=this.getAttribute("origin")||mx(this,b,"origin");c.viewportAnchorX=Hx(f,d,1,0);c.viewportAnchorY=Hx(f,e,2,0);c.viewportAnchorUnits=Ix(f,d);c.cssClassList=_.ch(this.f).concat();return c};_.x(Jx,jx);_.x(Ox,jx);
|
|
17
|
+
Ox.prototype.build=function(a){var b=null;var c=Nx(a);c&&(b=Kx(a.j.containerHeight,Lx(a,2),480)/c);b=Kx(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.h+", ::ttml ."+this.h+" * {";for(var d=_.w(hy.entries()),e=d.next();!e.done;e=d.next()){var f=_.w(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+wx(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&&!gy.test(g)&&gy.test(h)&&gy.test(l)?(e=g,f=h):2===d.length&&!gy.test(g)&&gy.test(h)?(e=g,f=h):2===d.length&&gy.test(g)&&gy.test(h)&&(f=g);if(""!==f){f=wx(f);d="text-shadow:0 0 "+(f+" "+e+",0 0 ")+(f+" "+e+",0 0 ")+(f+" "+e+";");break a}}d=""}c+=d;"textShadow"in this.a?(d=zx(this.a.textShadow),d=wx(d),d="text-shadow:"+
|
|
19
|
+
d+";"):d="";c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif","monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",fx).replace("proportionalSerif",fx).replace("sansSerif",fx).replace("default",fx)+";":"");a:{if(hx in this.a){d=[];e=_.w(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=
|
|
20
|
+
"text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+wx(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=wx(e),e=yx(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=wx(d);d=yx(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.h+" .clpp-text-wrapper {",a.push(c+b+"}"),
|
|
21
|
+
c="::ttml .clpp-text-wrapper__"+this.h+" {",a.push(c+b+"}"));return a};var hy=new Map([[bx,"background-color"],["color","color"],[cx,cx],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);Px.prototype.Dd=function(){var a=this;return this.o.map(function(b){return b.build(a.l,a.w,a.A,a.h,a.a,a.j,a.f)}).filter(function(b){return null!=b})};var Tx=0;Vx.prototype.$c=function(){return!!this.a};Vx.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!iy.has(vx(a.nodeName))||jy.has(vx(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&&!iy.has(vx(a.nodeName))));var b=this.a;this.a=a;return b};
|
|
22
|
+
var iy=new Set(["tt","head","layout",_.Qe,_.ye,ex,"styling",_.lg,"body",_.$d,"p","span","br"]),jy=new Set([_.lg,_.ye]);Wx.prototype.getId=function(){return this.attributes.id};ay.prototype.parseInit=function(){};
|
|
23
|
+
ay.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.O.Na(this.a.ttml||{}),e=_.lj(a,0,c[0]);e=_.S.ba(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.qg)}catch(n){throw new _.P(_.Q,2,2005,"Failed to parse TTML.");}d=new Px(d);e=new Yx;f=new Vx(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=_.lj(a,b,h);l=_.vj(l);var m="urn:mpeg:14496-30:subs:"+g;d.h.set(m,new kx(m,l,{imageType:"PNG",encoding:"Base64"}));
|
|
24
|
+
b+=h}for(;f.$c();)a=f.next(),a=$x(e,a),"tt"===Xx(a)&&(d.l=new Jx(d.B,Object.assign({},a.attributes))),"tt"===Xx(a)&&(d.w=new Dx(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),Xx(a)!==_.ye||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new kx(c,a.h.textContent,a.attributes))),Xx(a)===_.ye&&a.attributes.begin&&a.attributes.end?(c="#"+Ux(),b=new kx(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
|
|
25
|
+
Xx(a)===_.lg&&(c=a.getId()||Ux(),b=new Ox(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),Xx(a)!==_.lg&&Rx(a)?(c=Ux(),b=new Ox(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),Xx(a)!==_.$d||!a.attributes.extent&&!a.attributes.origin?c=null:(c=Ux(),b=new Ex(c,Sx(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),Xx(a)!==ex?c=null:(c=a.getId(),b=new Ex(c,Sx(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
|
|
26
|
+
c=b),c&&(a.a=c.getId()),c=a.l,-1===["#text","span","br"].indexOf(Xx(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=Ux(),b=new Ax(c,"#text"===a.h.nodeName?a.h.textContent:null,"br"===Xx(a),a.a,a.j,Sx(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.l.push(c.getId()),"p"===Xx(a)||a.j?(c=Ux(),b=new Ax(c,null,!1,a.a,a.j,Sx(d,a.f),a.attributes),d.f.set(c,b),d.o.push(b),c=b):c=null,c&&a.l.push(c.getId());e=d.Dd();f=[];a=_.w(d.a.values());for(c=a.next();!c.done;c=
|
|
27
|
+
a.next())f.push.apply(f,_.ch(c.value.build(d.l)));return{cues:e,styles:f}};by.prototype.a=function(a){a=(new ay(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=cy(c.startTime)+" --\x3e "+cy(c.endTime),e=[];switch(c.textAlign){case _.Ce:e.push("align:left");break;case _.Tf:e.push("align:right");break;case _.pi:e.push("align:middle");break;case _.Ce:e.push("align:start");break;case _.Tf:e.push("align:end")}switch(c.writingMode){case _.Gg:e.push("vertical:lr");break;
|
|
28
|
+
case _.Hg:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.S.Va(b)};dy.prototype.probe=function(a,b){return a===_.Yc&&b===_.pg};dy.prototype.create=function(a){return new by(a)};ey.prototype.parseInit=function(a){var b=!1;(new _.Pm).M(_.Te,_.Qm).M(_.sg,_.Qm).M(_.Oe,_.Qm).M(_.Se,_.Qm).M(_.ig,_.Qm).Y(_.kg,_.Rm).M("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.P(_.Q,2,2007);};
|
|
29
|
+
ey.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Pm).M("moof",_.Qm).M("traf",_.Qm).Y("subs",function(h){for(var l=_.Km(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.Jm(h.reader),p=0;p<n;++p){var q=1===h.version?_.Km(h.reader):_.Jm(h.reader);g.push(q);h.reader.skip(6)}}}).M(_.Ne,_.Sm(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.g.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.x(fy,_.Ms);fy.prototype.f=function(){_.mu(_.Yc,ay);_.mu(_.Wc,ey);_.mu(Zw,ey);_.mu(ax,ey);_.mu($w,ey);_.Hk.push(this.j)};fy.prototype.a=function(){_.ou(_.Yc);_.ou(_.Wc);_.ou(Zw);_.ou(ax);_.ou($w);_.Jk(this.j)};fy.prototype.id=function(){return"subtitles-ttml"};_.J("clpp.ttml.TtmlComponent",fy);};
|
|
30
30
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
31
31
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
32
32
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.verimatrix.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.D=d;this.B=b;this.w=
|
|
4
|
-
_.S.empty(this.l)?this.g.warn(_.db):_.S.empty(this.j)?this.g.warn(_.cb):this.Ta(_.
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var f=function(window){var Nw="VerimatrixVCAS",Ow="clpp.verimatrix.Vcas",Pw="clpp.verimatrix.VcasComponent",Vw=function(a){_.Bm.call(this,Nw);var b={};b[Qw]=Qw;b[Rw]=Rw;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Sw:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,h=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?Tw:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
|
|
3
|
+
this.D=d;this.B=b;this.w=Uw(this,e);this.o=Uw(this,f);this.l=Uw(this,g);this.j=h;this.H=l;this.G=m;this.g=new _.K(Ow);_.S.empty(this.w)?this.g.warn(_.qc):this.Ta(_.Td,{licenseUrl:this.w,videoRobustness:[_.Yb,void 0],audioRobustness:[_.Xb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.S.empty(this.o)?this.g.warn(_.Lb):this.Ta(_.Rd,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
|
|
4
|
+
_.S.empty(this.l)?this.g.warn(_.db):_.S.empty(this.j)?this.g.warn(_.cb):this.Ta(_.Pd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},Uw=function(a,b){if(a.D===Sw){var c=Object.assign({},{deviceId:_.wj(_.S.jd(a.A))},a.a&&{authenticator:_.wj(_.S.jd(a.a))});return b+_.sk(c)}return b},Ww=function(){this.g=new _.K(Pw)};_.x(Vw,_.Bm);
|
|
5
|
+
Vw.prototype.h=function(a,b){if(this.D===Xw){var c=this.B[Rw],d={};d[this.B[Qw]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Vw.prototype.I=function(a,b){var c=_.Ym(b);switch(this.G){case Yw:c=_.sk({r:c,ho:this.H},!0)}return c};Vw.prototype.K=function(a,b){this.h(a,b);_.an(b)};Vw.prototype.L=function(a,b){_.bn(b)};_.J(Ow,Vw);Vw.prototype.constructor=Vw.prototype.constructor;Vw.NAME=Nw;var Sw="query-string",Xw="http-header";
|
|
6
|
+
Vw.LicenseRequestVuidLocation={QUERY_STRING:Sw,HTTP_HEADER:Xw};var Qw="DeviceId",Rw="Authenticator";Vw.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Qw,AUTHENTICATOR_HEADER:Rw};var Tw="keyid",Yw="contentid-siteid";Vw.FairPlayAssetIdStrategy={KEYID:Tw,CONTENTID_SITEID:Yw};_.x(Ww,_.Ms);Ww.prototype.a=function(){delete _.vm.VerimatrixVCAS};Ww.prototype.h=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===Nw){a=a.drm.customData;if(!a)throw new _.P(_.Q,7,7100,_.Ud);a=new Vw(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.wm(a)}};Ww.prototype.id=function(){return"verimatrix-vcas"};_.J(Pw,Ww);};
|
|
7
7
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
8
8
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
9
9
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vimond.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b){a.m.trigger(new _.L(_.Mg,{detail:b}))},
|
|
4
|
-
|
|
2
|
+
var f=function(window){var Dw="Registering listeners",Ew="clpp.vimond.VimondPlugin",Fw=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.D=e;this.a=new _.Uh;this.l=!0;this.f=this.j=this.A=!1;this.B=null;this.h=new _.Wk(this.fh.bind(this));this.g=new _.K("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(Dw),this.a.on(this.m,_.gg,this.kk.bind(this)),this.a.on(this.m,_.rg,this.lk.bind(this)),this.a.on(this.m,_.xc,this.ik.bind(this)),this.a.on(this.m,_.yc,this.jk.bind(this)))},Gw=function(a,
|
|
3
|
+
b){a.m.trigger(new _.L(_.Mg,{detail:b}))},Hw=function(a,b,c){b&&(a.A=!0,a.h.stop());a.m.onError(new _.P(b?_.Q:1,9,9201,c))},Iw=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.K("clpp.vimond.VimondService");this.f=0},Jw=function(a){this.m=a;this.a=new _.Uh;this.g=new _.K("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(Dw),this.a.on(this.m,_.Pf,this.pm.bind(this)),this.a.on(this.m,_.xc,this.gk.bind(this)),this.a.on(this.m,_.yc,this.hk.bind(this)))},
|
|
4
|
+
Kw=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.wf];if(a.h)return[_.pe,_.gf];if(c===_.sp)return[_.pe,null];if(c===_.wp)return[_.re,_.gf];var d=_.gf;if(c===_.qp||c===_.zp||a.f)d=_.wf;return["period",d]},Lw=function(){this.a=!1;this.g=new _.K(Ew);this.j=this.h=this.f=null},Mw=function(){};_.t=Fw.prototype;_.t.lk=function(){this.f||(this.f=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.t.ik=function(){this.g.debug("Ad break started");this.j=!0};
|
|
5
5
|
_.t.jk=function(){this.g.debug("Ad break stopped");this.j=!1};
|
|
6
6
|
_.t.kk=function(a){var b=this,c,d,e,f,g;return _.H(function(h){if(1==h.a){c=a.detail;d=_.up;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.g.debug("Ignore transition"),h["return"]();if(b.l&&e!==d.PLAYING)return h["return"]();if(b.f&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.g.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.F(0);
|
|
7
7
|
b.B=e;return _.y(h,b.fh(),3)}e===d.ENDED&&b.h.stop();_.A(h)})};
|
|
8
8
|
_.t.fh=function(){var a=this,b,c,d,e,f,g;return _.H(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.g.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.h.stop();a.h.da(a.l?10:a.G);a.l=!1;_.B(h,2);l=a.D;l.f++;var m=_.O.oa(l.o);m.client.buildName=_.va;m.client.buildVersion=_.ia;var n=m.client,p=l.a.m.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.m.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
|
|
9
|
-
l.a.m.getLoadedSource().type||"";n=m.client;p=l.a.m.getLoadedSource();p=((new _.qk(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=
|
|
10
|
-
typeof n.liveResumePossible!==_.
|
|
11
|
-
|
|
12
|
-
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.O.R(b.vimond)&&typeof b.vimond===_.
|
|
13
|
-
c=b.failIfUnreachable;typeof c!==_.
|
|
14
|
-
_.t.pg=function(a){this.a&&this.h&&this.h.pg(a)};_.J(
|
|
9
|
+
l.a.m.getLoadedSource().type||"";n=m.client;p=l.a.m.getLoadedSource();p=((new _.qk(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Kw(l.a,l.f);m.client.playerEvent=n[0]||"";m.client.playerState=n[1]||"";m.progress.vod&&(m.progress.vod.position=l.a.getPosition());if(n=m.progress.live){p=l.a;var q=p.m.getPresentationStartTime()||0;p=Math.floor(q+p.m.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;q=l.a;p=q.m.getPosition();q=q.m.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);
|
|
10
|
+
typeof n.liveResumePossible!==_.kd&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.g.debug("Fire an event");n=_.Jj(l.l);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.h;n.body=_.S.jd(JSON.stringify(m));l=l.j.fetch(n).P;return _.y(h,l,4)}if(2!=h.a)return b=h.f,Gw(a,b),_.qh(h,0);d=c=_.E(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),Gw(a,f),Hw(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),
|
|
11
|
+
Gw(a,f),Hw(a,a.I,f)):a.g.error(c.toString());_.A(h)})};_.t.dispose=function(){this.g.debug(_.ic);_.Xh(this.a);this.h.stop()};Iw.prototype.pg=function(a){this.h=a};_.t=Jw.prototype;_.t.getPosition=function(){return Math.floor(this.m.getPosition())};_.t.pm=function(){this.h=!0};_.t.gk=function(){this.f=!0};_.t.hk=function(){this.f=!1};_.t.dispose=function(){this.g.debug(_.ic);_.Xh(this.a)};_.x(Lw,_.zu);_.t=Lw.prototype;_.t.onPlayerCreated=function(){};
|
|
12
|
+
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.O.R(b.vimond)&&typeof b.vimond===_.Xe)?a.namespace()===_.Ed&&(this.a=!1,this.g.info("Vimond does not report when casting.")):this.g.warn("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.w(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.g.warn(d+" key is missing");a.onError(new _.P(1,9,9200));return}this.g.debug(_.wa);
|
|
13
|
+
c=b.failIfUnreachable;typeof c!==_.kd&&(c=!0);d=b.failOnError;typeof d!==_.kd&&(d=!0);this.f=new Jw(a);this.h=new Iw(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Fw(b.playerEventRequest.eventInterval,c,d,a,this.h)}};_.t.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.h=this.f=null)};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"vimond"};
|
|
14
|
+
_.t.pg=function(a){this.a&&this.h&&this.h.pg(a)};_.J(Ew,Lw);Lw.prototype.updateAuthToken=Lw.prototype.pg;Lw.Id="vimond";Mw.prototype.create=function(){return new Lw};_.$q(new Mw);};
|
|
15
15
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
16
16
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
17
17
|
else{_=this.clpp._;(f.call(g,this));}
|