@castlabs/prestoplay 6.25.2-beta.7 → 6.25.2
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 +4 -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 +105 -105
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +329 -329
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +88 -88
- package/cjs/cl.externs.js +31 -31
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +291 -289
- package/cjs/cl.muxdata.js +9 -9
- package/cjs/cl.persistent.js +10 -10
- package/cjs/cl.playlist.js +4 -4
- package/cjs/cl.sessions.js +8 -8
- package/cjs/cl.simid.js +4 -4
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +11 -11
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +3 -3
- package/cjs/cl.verimatrix.js +2 -2
- package/cjs/cl.vimond.js +8 -8
- package/cjs/cl.vr.js +7 -7
- package/cjs/cl.vtt.js +2 -2
- package/cjs/cl.yospace.js +2 -2
- package/cjs/cl.youbora.js +17 -17
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +84 -84
- package/cl.conviva.js +26 -26
- package/cl.core.js +178 -178
- package/cl.crypto.js +8 -8
- package/cl.dash.js +82 -82
- package/cl.externs.js +31 -31
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +80 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -18
- package/cl.mediatailor.js +3 -3
- package/cl.mse.js +243 -243
- package/cl.muxdata.js +6 -6
- package/cl.persistent.js +2 -2
- package/cl.playlist.js +4 -4
- package/cl.sessions.js +2 -2
- package/cl.simid.js +1 -1
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +9 -9
- package/cl.tizen.js +54 -54
- package/cl.ttml.js +2 -2
- package/cl.verimatrix.js +1 -1
- package/cl.vimond.js +3 -3
- package/cl.vr.js +2 -2
- package/cl.vtt.js +2 -2
- package/cl.yospace.js +2 -2
- package/cl.youbora.js +12 -12
- package/package.json +1 -1
- package/typings.d.ts +9 -0
package/cl.tizen.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";import './cl.mse.js';let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
const b=a.f.get(a.a);if(!b.
|
|
3
|
-
a.g.debug("DRM Challenge data: ",b.challenge);const d=atob(b.challenge);var e=new Uint8Array(d.length);for(let h=0;h<d.length;++h)e[h]=d.charCodeAt(h);c=_.mj([b.serverurl&&""!==b.serverurl?b.serverurl:c.
|
|
4
|
-
try{webapis.avplay.setDrm(
|
|
5
|
-
"Initialize",""),webapis.avplay.setDrm(
|
|
6
|
-
a.j=a.f;a.f=b;a.f===_.Po?(a.o=(new Date).getTime(),a.m.trigger(new _.F(_.Nc,{detail:{bufferedTimeMS:-1,reason:a.h}}))):a.j===_.Po&&a.m.trigger(new _.F(_.Mc,{detail:{bufferedTimeMS:c-a.o,reason:a.h}}));b={currentState:a.f,previousState:a.j,timeSinceLastStateChangeMS:c-a.w};a.w=c;a.m.trigger(new _.F(_.Kf,{detail:b}));a.g.debug("State changed:",
|
|
7
|
-
_.Vo;break;default:a.m.isEnded()?c=_.Lo:a.g.debug("Inconsistent AVPlay playback state:",b)}
|
|
8
|
-
return new _.
|
|
9
|
-
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=[];c=0;for(d=0;d<a.length;d++){const e=new _.Ij(String(c++),_.L);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=a[d].kind||_.YB;const f=new _.Qj(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},
|
|
10
|
-
if(a.f){const b=_.
|
|
11
|
-
a.o=b.language):a.g.error("No stream with id",d.id)}},
|
|
12
|
-
[];for(let d=0;d<a.length;d++)for(let e=0;e<a[d].renditions.length;e++)_.eh(a[d].renditions[e],b,Object.keys(b))&&c.push(a[d].renditions[e]);return c[0]||null},
|
|
13
|
-
a.g.debug("Setting audio track with preferred language:",e);a.xa(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},
|
|
14
|
-
(k=new _.Ij(String(a.h++),_.M),g.push(k));k.renditions.push(
|
|
15
|
-
var d=null;b===_.N&&(d=
|
|
16
|
-
_.dg);c.language=_.Cj(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.Fc;a=new _.Qj(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},
|
|
17
|
-
b;c.kind=_.YB;return new _.Qj(String(a),c)},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`AVPlay state: ${a.getState()}, `+`buffering: ${a.w}`,m),!1===l&&(a.j[h]={type:h,index:k,
|
|
21
|
-
a.A)},b=>{a.g.debug("Could not load DISPLAY property");throw b;})})},
|
|
22
|
-
c)}},
|
|
23
|
-
|
|
24
|
-
const b=new Promise(c=>{(new _.rk(c)).ka(5)});if(!(yield Promise.race([
|
|
25
|
-
b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case
|
|
26
|
-
new URL(g);h.searchParams.append("cl-ext",".mpd");g=h.toString()}webapis.avplay.open(g);e.nextBandwidth?(
|
|
27
|
-
h)});a.f||(b.volume&&a.setVolume(b.volume),b.muted
|
|
28
|
-
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())},
|
|
29
|
-
a.l={id:String(Math.floor(1E4*Math.random())),type:"MPEG-DASH"};var c=Object.keys(a.h.customData||{}).length?btoa(JSON.stringify(a.h.customData)):"";b=_.Sl(b,a.h.customData);const d=b[_.rd];d&&a.f.set(_.rd,{
|
|
30
|
-
yield
|
|
31
|
-
this.H);this.a.off(
|
|
32
|
-
|
|
33
|
-
yield b.j.start(a.url.replace("https://","http://"),c)}catch(e){b.g.error(e),b.a=null}}if(b.a&&
|
|
34
|
-
a);this.w=!0;let b=_.
|
|
35
|
-
a);this.h&&this.h.getTextDisplayer().setTextVisibility(a)}release(){const a=this;return _.x(function*(){a.m=null;a.a=null;a.B=null;a.A=null;a.o=null;a.w=!0;a.l=null})}destroy(){const a=this;return _.x(function*(){a.j&&(yield a.j.stop(),a.j=null);a.f&&(yield a.f.destroy(),a.f=null,a.w=!0);a.h&&(yield a.h.destroy(),a.h=null)})}};var
|
|
36
|
-
b+" data: "+a)}}A(a){a.detail.currentState===_.Wo&&this.m.off(_.Kf,this.A)}initialize(a){this.m=a;this.a=this.m.a;this.m.on(_.Kf,b=>{this.B||(b=b.detail,b.currentState===_.Wo&&(this.g.debug("Current state",b.currentState),this.B=!0,
|
|
37
|
-
const b=this.f[_.M]||[];b.length&&(this.l=b[0].renditions[0]||null);
|
|
38
|
-
this.Ma();return a?a.track:null}wa(){const a=this.Qa();return a?a.track:null}
|
|
39
|
-
this.na();this.a.o||a.width!==b.width||a.height!==b.height||a.bandwidth!==b.bandwidth?(this.w=a,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
attriCount:d,attributes:e}))}K(a,b){this.trigger(new _.F(
|
|
43
|
-
d)=>{webapis.avplay.prepareAsync(()=>{
|
|
44
|
-
this.F=a}catch(c){return this.g.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.F)}return!0}this.g.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1}getPlaybackRate(){return this.F}load(a,b){const c=this;return _.x(function*(){c.g.debug("configure()",b||"");try{yield
|
|
1
|
+
import {clpp} from "./cl.core.js";import './cl.mse.js';let g={};const _ = clpp._;var f=function(window){'use strict';var WM="An unknown error occurred while trying to get volume",XM="Cannot get loading rendition due to platform limitations",YM="SecurityError",ZM="The require privilege is: http://tizen.org/privilege/tv.audio",$M="|STARTBITRATE\x3d",aN=function(a,b,c){const d=e=>{c.call(a,e);a.removeEventListener(b,d)};a.addEventListener(b,d)},dN=function(a){return _.x(function*(){if(a.a!==_.td&&a.a!==_.rd)throw new _.I(_.G,6,6001,`The key system ${a.a} is not supported by `+"the player or the platform");
|
|
2
|
+
const b=a.f.get(a.a);if(!b.ud)throw new _.I(_.G,6,6012,`No license server given for ${a.a}`);try{a.a===_.td?yield bN(a):yield cN(a,b),a.o={keySystem:a.a,licenseServerUri:b.ud,distinctiveIdentifierRequired:!1,persistentStateRequired:b.Ue,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null}}catch(c){throw a.g.error(`Error while configuring CDM for ${a.a}`,c),new _.I(_.G,6,6005,{message:JSON.stringify(c)});}})},fN=function(a,b){_.x(function*(){var c=a.f.get(a.a);
|
|
3
|
+
a.g.debug("DRM Challenge data: ",b.challenge);const d=atob(b.challenge);var e=new Uint8Array(d.length);for(let h=0;h<d.length;++h)e[h]=d.charCodeAt(h);c=_.mj([b.serverurl&&""!==b.serverurl?b.serverurl:c.ud],_.ij());c.type=3;c.body=e.buffer;c.method=_.cb;try{var f=yield a.D.vb.fetch(c).T;if(a.j){var g=_.K(f.data);const h=g.byteLength;e="";for(f=0;f<h;f++)e+=String.fromCharCode(g[f]);const k=`${b.session_id}PARAM_START_POSITION`+`${btoa(e)}PARAM_START_POSITION`;a.g.debug("Widevine license params",k);
|
|
4
|
+
try{webapis.avplay.setDrm(eN,"widevine_license_data",k)}catch(l){a.g.error("License response rejected by CDM");const m=new _.I(_.G,6,6008,{browserError:JSON.stringify(l)});a.D.onError(m)}}}catch(h){a.g.error("License request failed.",JSON.stringify(h)),g=new _.I(_.G,6,6007,{message:"Error while fetching license!",url:h.data.url,status:h.data.status||NaN,response:h.data.response||"",headers:h.data.headers||{}},h),a.D.onError(g)}})},bN=function(a){return _.x(function*(){try{webapis.avplay.setDrm(eN,
|
|
5
|
+
"Initialize",""),webapis.avplay.setDrm(eN,"widevine_app_session",a.l.id),webapis.avplay.setDrm(eN,"widevine_data_type",a.l.type)}catch(b){throw b;}})},cN=function(a,b){return _.x(function*(){var c={};c[gN]=!b.Ue;c[hN]=b.ud;""!==b.customData&&(c[iN]=b.customData);c=JSON.stringify(c);a.g.debug("PlayReady properties: ",c);try{webapis.avplay.setDrm(jN,"SetProperties",c)}catch(d){throw d;}})},lN=function(a,b){if(a.f!==b)if(a.f===_.Mo&&b!==_.To)a.g.debug(_.yB+`${kN(b)}`);else{var c=(new Date).getTime();
|
|
6
|
+
a.j=a.f;a.f=b;a.f===_.Po?(a.o=(new Date).getTime(),a.m.trigger(new _.F(_.Nc,{detail:{bufferedTimeMS:-1,reason:a.h}}))):a.j===_.Po&&a.m.trigger(new _.F(_.Mc,{detail:{bufferedTimeMS:c-a.o,reason:a.h}}));b={currentState:a.f,previousState:a.j,timeSinceLastStateChangeMS:c-a.w};a.w=c;a.m.trigger(new _.F(_.Kf,{detail:b}));a.g.debug("State changed:",kN(a.j),"-\x3e",kN(a.f))}},kN=function(a){return Object.keys(_.So)[a]},oN=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case mN:c=_.Wo;break;case nN:c=
|
|
7
|
+
_.Vo;break;default:a.m.isEnded()?c=_.Lo:a.g.debug("Inconsistent AVPlay playback state:",b)}lN(a,c)}},pN=function(a){return _.x(function*(){const b=a.m.getConfiguration();let c;(c=yield _.Xs(a.B.url,a.m.getNetworkEngine(),b.manifest.attemptParameters,a.B.type||null))&&c.configure(b.manifest);return c})},qN=function(a){if(!a)return!1;a=a.periods;let b=!1;for(let c=0;c<a.length;c++)b=b||0<a[c].textStreams.length;return b},rN=function(a){const b=document.createElement(_.w),c=new _.zI,d=new _.GH,e=a.m.getTextDisplayer();
|
|
8
|
+
return new _.AI(b,c,e,d,a.m.getConfiguration())},sN=function(a){const b={configuration:{},Ib:()=>a.m.getPosition(),aa:a.h,vb:a.m.getNetworkEngine(),Kc:null,Pe:a.G.bind(a),Oe:a.F.bind(a),onError:a.H.bind(a),og:()=>{},onEvent:()=>{},sg:a.I.bind(a),ge:()=>{},gd:()=>new _.xJ,ve:()=>!1,ed:null};return new _.VI(a.a,b)},tN=function(a){const b=a.m.getPosition();let c=null;for(const d of a.a.periods)d.startTime<=b&&(c=d);return c},uN=function(a){a.g.debug("getTextStreams()",a.a);if(a.a){var b=[],c=a.a.periods;
|
|
9
|
+
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=[];c=0;for(d=0;d<a.length;d++){const e=new _.Ij(String(c++),_.L);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=a[d].kind||_.YB;const f=new _.Qj(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},vN=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;
|
|
10
|
+
if(a.f){const b=_.vG(a.f,_.H);let c=null;if(b){a=uN(a);for(let 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},wN=function(a,b){a.g.debug("Set active track",b);if(b&&(a.o=b.language,a.A=b.roles[0]||"",a.C=b.kind===_.Ud,a.a&&a.f)){a.setTextVisibility(!0);const c=tN(a),d=b.renditions[0];(b=c.textStreams.find(e=>String(e.id)===d.id))?(a.w?(a.g.debug("Switching period defer text selection"),a.l=b):(_.IG(a.f,b,!0,0),a.m.trigger(new _.F(_.Uf))),
|
|
11
|
+
a.o=b.language):a.g.error("No stream with id",d.id)}},xN=function(a){const b=a.na();b&&a.m.trigger(new _.F(_.Kc,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},yN=function(a,b){a.m.trigger(new _.F(_.rg,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},zN=function(a,b){let c=null;try{c=JSON.parse(b)}catch(d){a.g.warn("Couldn't retrieve extra infos from stream."),c=null}return c},AN=function(a,b){a=a.f[_.N]||[];const c=
|
|
12
|
+
[];for(let d=0;d<a.length;d++)for(let e=0;e<a[d].renditions.length;e++)_.eh(a[d].renditions[e],b,Object.keys(b))&&c.push(a[d].renditions[e]);return c[0]||null},BN=function(a){const b=a.m.getConfiguration();var c=_.$h(b.preferredAudioLanguage||[]);const d=a.f[_.M]||[];if(d.length){var e=null;c.some(g=>{e=_.tC(g,d.map(h=>h.language));return!!e});if(e){var f=d.filter(g=>g.language===e);c=f[0];1<f.length&&b.preferredAudioRole&&(f=f.filter(g=>0<=g.roles.indexOf(b.preferredAudioRole)),0<f.length&&(c=f[0]));
|
|
13
|
+
a.g.debug("Setting audio track with preferred language:",e);a.xa(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},HN=function(a,b){var c=(l,m)=>{for(let n=0;n<l.length;n++)if(l[n].language===m)return l[n];return null};const d={};if(0>=b.length)return d;var e=b.filter(l=>l.type===CN),f=b.filter(l=>l.type===DN);const g=[];for(var h=0;h<f.length;h++){const l=zN(a,f[h].extra_info);if(l){var k=_.Bi(l.language||_.dg);k=_.Cj(k);k=c(g,k);k||
|
|
14
|
+
(k=new _.Ij(String(a.h++),_.M),g.push(k));k.renditions.push(EN(f[h].index,l,k))}else a.g.warn("Skipping audio stream with no extra info")}c=new _.Ij(String(a.h++),_.N);for(f=0;f<e.length;f++)(h=zN(a,e[f].extra_info))?c.renditions.push(FN(e[f].index,h,c)):a.g.warn("Skipping video stream with no extra info");e=[];e=a.j?uN(a.j):GN(a,b);d[_.N]=[c];d[_.M]=g;d[_.L]=e;return d},KN=function(a,b){if(b===_.L&&a.j)return vN(a.j);var c=IN(a.a)||[];if(0===c.length)return null;c=c.filter(e=>e.type===b.toUpperCase())[0];
|
|
15
|
+
var d=null;b===_.N&&(d=zN(a,c.extra_info),d=AN(a,{width:d.Width,height:d.Height}));b===_.M&&(c?(d=JN(a,c,_.M),a.l=d):d=a.l);b===_.L&&(c?(d=JN(a,c,_.L),a.o=d):d=a.o);return d},NN=function(a,b){if(b){const c=b.track.type.toUpperCase();LN(a.a,c,Number(b.id)).then(()=>{c===DN&&(a.l=b,a.m.trigger(new _.F(_.Ic)));c===MN&&(a.o=b,a.m.trigger(new _.F(_.Uf)))}).catch(()=>{a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},EN=function(a,b,c){const d=_.Bi(b.language||
|
|
16
|
+
_.dg);c.language=_.Cj(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.Fc;a=new _.Qj(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},FN=function(a,b,c){c.mimeType=_.pg;a=new _.Qj(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},ON=function(a,b,c){b=_.Bi(b.track_lang||_.dg);c.mimeType="text/ttml";c.language=_.Cj(b);c.originalLanguage=
|
|
17
|
+
b;c.kind=_.YB;return new _.Qj(String(a),c)},GN=function(a,b){b=b.filter(d=>d.type===MN);const c=[];for(let d=0;d<b.length;d++){const e=zN(a,b[d].extra_info);if(!e){a.g.warn("Skipping text stream with no extra info");continue}const f=new _.Ij(String(a.h++),_.L);f.renditions.push(ON(b[d].index,e,f));c.push(f)}return c},JN=function(a,b,c){a=a.f[c]||[];b=String(b.index);c=null;for(let d=0;d<a.length;d++)for(let e=0;e<a[d].renditions.length;e++)if(a[d].renditions[e].id===b){c=a[d].renditions[e];break}return c},
|
|
18
|
+
PN=function(a){return a.f&&a.a?a.a.Ii:webapis.avplay.getTotalTrackInfo()},RN=function(a,b,c){a.g.debug("switchVideoTrack()");try{const d={estimatedBandwidth:parseInt(webapis.avplay.getStreamingProperty("CURRENT_BANDWITH"),10),currentBandwidth:b,nextBandwidth:c,currentPosition:a.getPosition()};a.a=QN(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(()=>{const e=a.a.Hf;a.f=!1;a.a=null;return e===nN?a.pause():a.play()})}catch(d){return Promise.reject(d)}},
|
|
19
|
+
SN=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",d)}},LN=function(a,b,c){b=b.toUpperCase();b===MN&&SN(a,!0);const d=a.j[b];d&&(d.pe.stop(),a.j[b]=null,a.g.debug(`Cancelled pending track switch for ${b}`));return new Promise((e,f)=>{const g=(h,k,l)=>{l=void 0===l?!1:l;try{webapis.avplay.setSelectTrack(h,k),a.j[h]=null,e()}catch(m){a.g.debug(`Could not set ${h} track. Trying again...`+
|
|
20
|
+
`AVPlay state: ${a.getState()}, `+`buffering: ${a.w}`,m),!1===l&&(a.j[h]={type:h,index:k,Df:0,pe:new _.rk(()=>g(h,c,!0))}),(k=a.j[h])&&3>k.Df?(!a.w&&++k.Df,k.pe.ka(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),k&&k.pe.stop(),a.j[h]=null,f())}};g(b,c)})},IN=function(a){return a.f&&a.a?a.a.kh:webapis.avplay.getCurrentStreamInfo()},TN=function(a){return _.x(function*(){tizen.systeminfo.getPropertyValue("DISPLAY",b=>{a.A=b.resolutionWidth/1920;a.g.debug("Display resolution ratio: ",
|
|
21
|
+
a.A)},b=>{a.g.debug("Could not load DISPLAY property");throw b;})})},VN=function(a){try{webapis.avplay.setListener({onbufferingstart:a.J.bind(a),onbufferingprogress:a.I.bind(a),onbufferingcomplete:a.H.bind(a),onstreamcompleted:a.M.bind(a),oncurrentplaytime:b=>{a.trigger(new _.F(UN,{currentTime:b}))},onevent:a.L.bind(a),onsubtitlechange:a.P.bind(a),ondrmevent:a.K.bind(a),onerror:a.B.bind(a)})}catch(b){a.g.error(b)}},WN=function(a){const b=!!a.m.getTrackManager().Qa();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",
|
|
22
|
+
c)}},XN=function(a,b){try{const c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.g.debug({estimatedBandwidth:c,Yi:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",$M+d)}catch(c){a.g.debug(c)}},YN=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+$M+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",c),c;}},ZN=function(a){let b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case YM:a.g.warn("The application doesn't have the privilege to get the mute state.",
|
|
23
|
+
ZM);break;default:a.g.warn(WM,c)}}return!!b},QN=function(a){return{position:a.getPosition(),state:a.m.getState(),Hf:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:ZN(a),volume:a.getVolume(),Ii:PN(a),kh:IN(a)}},$N=function(){return new Promise((a,b)=>{if(window.webapis)a();else{const c=document.createElement("script");aN(c,_.ke,d=>a(d));aN(c,_.q,d=>b(d));c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},aO=function(a){return _.x(function*(){yield $N();
|
|
24
|
+
const b=new Promise(c=>{(new _.rk(c)).ka(5)});if(!(yield Promise.race([TN(a).then(()=>!0),b.then(()=>!1)])))return a.g.debug("Took to long for the SDK to be ready"),Promise.reject("SDK Timeout")})},bO=function(a){return _.x(function*(){a.g.debug("avplay.prepare()");return new Promise((b,c)=>{try{webapis.avplay.prepareAsync(()=>{a.g.debug("AVPlay is ready!");WN(a);b()},d=>{a.g.debug("prepareAsync failed",d);c(d)})}catch(d){a.g.debug("Failed to prepare media player for playback"),c(d)}})})},cO=function(a,
|
|
25
|
+
b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case YM:a.g.warn("The application does not have the privilege to set mute.",ZM);break;default:a.g.warn(WM,c)}}},hO=function(a,b,c){return _.x(function*(){a.l=_.Zo(b);const d=a.G,e=c||{estimatedBandwidth:0,currentBandwidth:0,nextBandwidth:null,currentPosition:0};a.g.debug(`Loading manifest URL: ${a.l[d].url}`);let f=b.startTime||void 0;a.f&&(a.trigger(new _.F(dO)),f=c.currentPosition);try{let g=a.l[d].url;if(a.l[d].type===_.tc&&!g.includes(".mpd")){const h=
|
|
26
|
+
new URL(g);h.searchParams.append("cl-ext",".mpd");g=h.toString()}webapis.avplay.open(g);e.nextBandwidth?(YN(a,e.nextBandwidth),a.o=!1):(a.o||XN(a,e),a.o=!0);VN(a);if(b.drm&&b.drm.env){const h={onError:k=>a.m.onError(k),vb:a.m.getNetworkEngine()};a.h=new eO(b.drm,h);yield a.h.init()}else a.g.debug("No DRM configuration was provided. Assuming clear content");a.f||a.trigger(new _.F(fO));yield bO(a);a.f||a.trigger(new _.F(gO));f&&typeof f===_.t&&0<f&&a.seek(f).catch(h=>{a.g.debug("Couldn't set start position",
|
|
27
|
+
h)});a.f||(b.volume&&a.setVolume(b.volume),b.muted&&cO(a,b.muted),b.autoplay&&a.m.play().catch(h=>{a.g.debug("Autoplay failed",h)}))}catch(g){throw a.g.debug("Error while attempting to load source."),g;}})},iO=function(a){if("NONE"!==a.a.getState()){var b=a.j.getBoundingClientRect();{a=a.a;const c=Math.floor(b.left*a.A),d=Math.floor(b.top*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,
|
|
28
|
+
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())},eO=class{constructor(a,b){this.h=a;this.o=null;this.a=_.Be;this.l=null;this.j=!1;this.f=new Map;this.D=b;this.g=new _.S("clpp.tizen.DrmEngine")}init(){const a=this;return _.x(function*(){var b=_.Ql[a.h.env]||null;if(!b)throw a.g.debug(_.va,_.gb+a.h.env+_.aa),new _.I(_.G,6,6015,`DRM environment '${a.h.env}' is missing.`);
|
|
29
|
+
a.l={id:String(Math.floor(1E4*Math.random())),type:"MPEG-DASH"};var c=Object.keys(a.h.customData||{}).length?btoa(JSON.stringify(a.h.customData)):"";b=_.Sl(b,a.h.customData);const d=b[_.rd];d&&a.f.set(_.rd,{ud:d.licenseUrl||"",customData:c,Ue:!1});(b=b[_.td])&&a.f.set(_.td,{ud:b.licenseUrl||"",customData:c,Ue:!1});if(0===a.f.size)throw new _.I(_.G,6,6E3);if((c=a.h.preferredDrmSystem)&&a.f.get(c))a.a=c;else if(a.f.get(_.rd))a.a=_.rd;else if(a.f.get(_.td))a.a=_.td;else throw new _.I(_.G,6,6001,"Configuration for the target system is missing.");
|
|
30
|
+
yield dN(a);a.j=!0})}release(){const a=this;return _.x(function*(){a.j=!1;a.o=null;a.a=_.Be;a.l=null;a.f=new Map})}getDrmInfo(){return this.o}},gN="DeleteLicenseAfterUse",hN="LicenseServer",iN="CustomData";var oO=class{constructor(a){this.m=a;this.a=this.m.a;this.f=_.To;this.j=_.hv;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.S("clpp.tizen.StateManager")}initialize(){this.a.on(dO,this.C,this);this.a.on(jO,this.B,this);this.a.on(kO,this.A,this);this.a.on(fO,this.H,this);this.a.on(gO,this.G,this);this.a.on(lO,this.F,this)}release(){lN(this,_.To);this.l=!1;this.o=-1;this.h=2}destroy(){this.release();this.a.off(dO,this.C);this.a.off(jO,this.B);this.a.off(kO,this.A);this.a.off(fO,
|
|
31
|
+
this.H);this.a.off(gO,this.G);this.a.off(lO,this.F);this.m=this.a=null}C(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.C?1:2;lN(this,_.Po)}B(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",kN(this.f))}A(){this.g.debug("Buffering complete. Player state: ",this.a.getState());if(!this.l){this.l=!0;var a=this.m.getConfiguration().autoplay;const b=this.a.getState()===mO;if(!a&&b){lN(this,_.Vo);return}}if(a=this.f!==_.Uo)a=this.a.getState(),a=a===
|
|
32
|
+
mN||a===nN;a&&oN(this)}H(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===nO?lN(this,_.Uo):this.g.error("AVPlay prepares while state is not IDLE")}G(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())}F(){lN(this,_.Lo)}getState(){return this.f}};var pO=class{constructor(){this.o=this.A=this.f=this.h=this.B=this.m=this.j=this.a=null;this.C=!1;this.w=!0;this.l=null;this.g=new _.S("clpp.tizen.TextStreamer")}initialize(a){this.m=a}load(a){const b=this;return _.x(function*(){if(b.m)if(b.B=a,b.j=yield pN(b),b.j){var c={configurationId:"",networkingEngine:b.m.getNetworkEngine(),onContentSteeringInfoFound:()=>null,filterNewPeriod:()=>{},filterAllPeriods:()=>{},onEvent:()=>{},onError:()=>{}};try{b.a=yield b.j.start(a.url,c)}catch(d){b.g.warn(d);try{b.a=
|
|
33
|
+
yield b.j.start(a.url.replace("https://","http://"),c)}catch(e){b.g.error(e),b.a=null}}if(b.a&&qN(b.a)){b.h=rN(b);try{yield b.h.open();b.f=sN(b);const d=b.m.getConfiguration();b.f.h=d.streaming;b.o=d.preferredTextLanguage;b.A=d.preferredTextRole;b.C=d.preferForcedSubtitles}catch(d){b.g.debug("Could not setup media source..."),b.h=null,b.f=null,b.j=null,b.a=null}}}else b.g.debug("Could not find manifest parser for source. Make sure parsers are registered.");else b.g.debug("Text streamer is not initialized. Will not load()")})}G(a){this.g.debug(_.RB,
|
|
34
|
+
a);this.w=!0;let b=_.NF(a.textStreams,this.o||"",this.A||"",this.C)[0]||null;this.l&&(a.textStreams.includes(this.l)&&(b=this.l),this.l=null);return{video:null,audio:null,text:b,Za:null}}F(){this.g.debug("canSwitch_");this.w=!1;this.l&&(_.IG(this.f,this.l,!0,0),this.l=null)}H(){this.g.debug("onError_")}I(){this.j&&this.j.update&&this.j.update()}start(){const a=this;return _.x(function*(){if(a.f)try{a.f.start()}catch(b){a.g.error("Error while starting streaming engine",b)}})}setTextVisibility(a){this.g.debug("Set text visibility",
|
|
35
|
+
a);this.h&&this.h.getTextDisplayer().setTextVisibility(a)}release(){const a=this;return _.x(function*(){a.m=null;a.a=null;a.B=null;a.A=null;a.o=null;a.w=!0;a.l=null})}destroy(){const a=this;return _.x(function*(){a.j&&(yield a.j.stop(),a.j=null);a.f&&(yield a.f.destroy(),a.f=null,a.w=!0);a.h&&(yield a.h.destroy(),a.h=null)})}};var tO=class extends _.T{constructor(){super();this.j=this.a=this.m=null;this.f={};this.g=new _.S("clpp.tizen.TrackManager");this.w=this.o=this.l=null;this.B=!1;this.h=1}C(a){var b=a.eventid;a=a.data;switch(b){case qO:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+zN(this,b[0].extra_info).Bit_rate,b=AN(this,{bandwidth:b}))&&(this.w=b,yN(this,b));break;case rO:xN(this);break;default:this.g.debug("Event type: "+
|
|
36
|
+
b+" data: "+a)}}A(a){a.detail.currentState===_.Wo&&this.m.off(_.Kf,this.A)}initialize(a){this.m=a;this.a=this.m.a;this.m.on(_.Kf,b=>{this.B||(b=b.detail,b.currentState===_.Wo&&(this.g.debug("Current state",b.currentState),this.B=!0,BN(this)))});this.a.on(sO,this.C,this)}release(){this.f={};this.j=this.w=this.o=this.l=null;this.B=!1;this.h=1}load(){if(this.a&&!(0<Object.keys(this.f).length)){this.j=this.m.h;this.m.off(_.Kf,this.A);this.m.on(_.Kf,this.A,this);try{const a=PN(this.a);this.f=HN(this,a);
|
|
37
|
+
const b=this.f[_.M]||[];b.length&&(this.l=b[0].renditions[0]||null);xN(this)}catch(a){this.g.debug("Could not load track manager")}}}destroy(){this.a.off(sO,this.C);this.a=this.m=null}getVideoTracks(){return this.f[_.N]||[]}getAudioTracks(){return this.f[_.M]||[]}ma(){return this.f[_.L]||[]}na(){return KN(this,_.N)}Ma(){return KN(this,_.M)}Qa(){return KN(this,_.L)}rb(){return this.w}Fb(){this.g.info(XM);return null}Gb(){this.g.info(XM);return null}Ea(){const a=this.na();return a?a.track:null}qa(){const a=
|
|
38
|
+
this.Ma();return a?a.track:null}wa(){const a=this.Qa();return a?a.track:null}Ab(a){null===a?(a=this.na(),RN(this.a,a.bandwidth,null).then(()=>{xN(this)})):0<a.renditions.length&&this.jb(a.renditions[0])}xa(a){a?NN(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")}Sa(a){a?(a=a.renditions[0],this.j?wN(this.j,a.track):NN(this,a)):(this.g.debug("Disabling text tracks"),this.o=null,SN(this.a,!1),this.m.trigger(new _.F(_.Uf)))}jb(a){const b=
|
|
39
|
+
this.na();this.a.o||a.width!==b.width||a.height!==b.height||a.bandwidth!==b.bandwidth?(this.w=a,yN(this,a),RN(this.a,b.bandwidth,a.bandwidth).then(()=>{xN(this)}).catch(c=>{const d=new _.I(_.G,7,7200,{tizenerror:c});this.g.debug("Error while switching video track",c);this.m.onError(d)})):this.g.debug("Trying to switch to already active rendition. Doing nothing...")}yb(a){NN(this,a)}zb(a){this.j?wN(this.j,a.track):NN(this,a)}addTextTrack(){}ta(){return this.a.o}};tO.prototype.isAbrEnabled=tO.prototype.ta;
|
|
40
|
+
tO.prototype.addTextTrack=tO.prototype.addTextTrack;tO.prototype.setTextRendition=tO.prototype.zb;tO.prototype.setAudioRendition=tO.prototype.yb;tO.prototype.setVideoRendition=tO.prototype.jb;tO.prototype.setTextTrack=tO.prototype.Sa;tO.prototype.setAudioTrack=tO.prototype.xa;tO.prototype.setVideoTrack=tO.prototype.Ab;tO.prototype.getTextTrack=tO.prototype.wa;tO.prototype.getAudioTrack=tO.prototype.qa;tO.prototype.getVideoTrack=tO.prototype.Ea;tO.prototype.getLoadingTextRendition=tO.prototype.Gb;
|
|
41
|
+
tO.prototype.getLoadingAudioRendition=tO.prototype.Fb;tO.prototype.getLoadingVideoRendition=tO.prototype.rb;tO.prototype.getTextRendition=tO.prototype.Qa;tO.prototype.getAudioRendition=tO.prototype.Ma;tO.prototype.getVideoRendition=tO.prototype.na;tO.prototype.getTextTracks=tO.prototype.ma;tO.prototype.getAudioTracks=tO.prototype.getAudioTracks;tO.prototype.getVideoTracks=tO.prototype.getVideoTracks;var xO=class extends _.su{constructor(a){super();this.m=a;this.h=null;this.g=new _.S("clpp.tizen.Middleware");this.F=1;this.C=!1;this.l=null;this.G=0;this.o=!0;this.f=!1;this.a=null;this.A=1;this.w=!1;this.j={}}J(){this.w=!0;this.f||this.trigger(new _.F(dO))}I(a){this.w=!0;this.trigger(new _.F(jO,{percent:a}))}H(){this.w=!1;this.trigger(new _.F(kO))}M(){this.trigger(new _.F(lO))}L(a,b){this.trigger(new _.F(sO,{eventid:a,data:b}))}P(a,b,c,d,e){this.trigger(new _.F(uO,{duration:a,text:b,subtitleType:c,
|
|
42
|
+
attriCount:d,attributes:e}))}K(a,b){this.trigger(new _.F(vO,{drmType:a,drmData:b}));this.h&&(a=this.h,a.j&&(a.a===_.td&&"Challenge"===b.name?fN(a,b):"DrmError"===b.name&&(a.g.debug("DrmError event",b),b=new _.I(_.G,6,6005,{message:JSON.stringify(b)}),a.D.onError(b))))}B(a){this.trigger(new _.F(wO,{eventType:a}))}play(){const a=this.getState(),b=()=>new Promise((c,d)=>{let e=null;const f=()=>{c();clearTimeout(e)};this.one(UN,f,this);e=setTimeout(()=>{this.off(UN,f);d("Timeout")},3E4)});if(a===nO)return(new Promise((c,
|
|
43
|
+
d)=>{webapis.avplay.prepareAsync(()=>{WN(this);c(webapis.avplay.play())},e=>{this.trigger(new _.F(wO));d(e)})})).then(()=>b());if(a===nN||a===mO)try{return webapis.avplay.play(),b()}catch(c){return Promise.reject(c)}return a===mN?Promise.resolve():Promise.reject("Player is in invalid state")}pause(){try{webapis.avplay.pause()}catch(a){Promise.reject(a)}return this.getState()===nN?Promise.resolve():Promise.reject()}setPlaybackRate(a){const b=this.getState();if(b===mO||b===mN||b===nN){try{webapis.avplay.setSpeed(a),
|
|
44
|
+
this.F=a}catch(c){return this.g.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.F)}return!0}this.g.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1}getPlaybackRate(){return this.F}load(a,b){const c=this;return _.x(function*(){c.g.debug("configure()",b||"");try{yield aO(c),yield hO(c,a,b)}catch(d){throw new _.I(_.G,7,7003,null,d);}})}getState(){if(this.f&&this.a)return this.a.Hf;try{return webapis.avplay.getState()}catch(a){this.B(JSON.stringify(a))}}seek(a){const b=
|
|
45
45
|
1E3*a;return new Promise((c,d)=>{this.C=!0;this.m.trigger(new _.F(_.jg));webapis.avplay.seekTo(b,()=>{this.C=!1;this.m.trigger(new _.F(_.ig));c()},()=>{this.C=!1;d()})})}getPosition(){if(this.f&&this.a)return this.a.position;try{return webapis.avplay.getCurrentTime()/1E3}catch(a){this.B(JSON.stringify(a))}}getDuration(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.B(JSON.stringify(a))}}release(){return new Promise((a,b)=>{try{this.h&&(this.h.release(),
|
|
46
|
-
this.h=null);webapis.avplay.stop();webapis.avplay.close();for(const c in this.j){const d=this.j[c];d&&d.
|
|
47
|
-
"The passed value value should be in the range of 0 to 1.");break;case
|
|
48
|
-
a}getSourceIndex(){return this.G}getLoadedSource(){return this.l&&this.l[this.getSourceIndex()]}},
|
|
49
|
-
{currentTime:a.currentTime/1E3}))}J(a){const b=this.a.getPosition(),c=b+a.duration/1E3;let d=a.text||"";this.g.debug("Got subtitles: ",d,"start:",b,"end:",c,a);(d=_.gj(d))&&this.o.append([new _.Vt(b,c,d)],[])}G(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)}K(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)}H(a){this.g.debug(`Error: TYPE: ${a.eventType}`);
|
|
50
|
-
b){this.configuration=this.B=b;this.w=a;this.a.on(
|
|
51
|
-
_.ee,"top"];const e={};c=null!==c.parentElement?window.getComputedStyle(c,null):c.style;if(!b||0===b.length)for(d in b||(b=[]),c)b.push(d);for(const f of b)e[f]=c[f];var d=e}_.qp(a,d);
|
|
52
|
-
this;return _.x(function*(){yield a.release();a.a.off(
|
|
46
|
+
this.h=null);webapis.avplay.stop();webapis.avplay.close();for(const c in this.j){const d=this.j[c];d&&d.pe.stop()}this.j={};this.F=1;this.C=!1;this.a=this.l=null;return a()}catch(c){return b(c)}})}getVolume(){let a=null;try{a=tizen.tvaudiocontrol.getVolume()}catch(b){switch(b.name){case YM:this.g.debug("The application does not have the privilege to get the volume.",ZM);break;default:this.g.debug(WM,b)}}return a}setVolume(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.",
|
|
47
|
+
"The passed value value should be in the range of 0 to 1.");break;case YM:this.g.warn("The application does not have the privilege to set the volume.",ZM);break;default:this.g.warn("An unknown error occurred while trying to set volume",b)}}}isLive(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.B(JSON.stringify(a))}}stop(){try{webapis.avplay.stop()}catch(a){this.g.debug(a)}}getDrmInfo(){this.h&&this.h.getDrmInfo();return null}setSourceIndex(a){this.G=
|
|
48
|
+
a}getSourceIndex(){return this.G}getLoadedSource(){return this.l&&this.l[this.getSourceIndex()]}},nO="IDLE",mO="READY",mN="PLAYING",nN="PAUSED",CN=_.Bb,DN=_.rB,MN="TEXT",rO="PLAYER_MSG_RESOLUTION_CHANGED",qO="PLAYER_MSG_BITRATE_CHANGE",jN="PLAYREADY",eN="WIDEVINE_CDM";var BO=class extends _.su{constructor(){super();this.a=new xO(this);this.f=new oO(this);this.configuration=this.B=_.rl();this.w=null;this.g=new _.S("clpp.tizen.Player");this.j=null;this.l=new tO;this.C=new _.zr;this.o=this.h=null;this.A=!1}I(){this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.F(_.Sd));this.configuration.loop?this.seek(this.configuration.startTime||0).catch(()=>{this.g.debug("Could not loop playback")}):this.a.stop()}F(a){this.trigger(new _.F(_.Zf,
|
|
49
|
+
{currentTime:a.currentTime/1E3}))}J(a){const b=this.a.getPosition(),c=b+a.duration/1E3;let d=a.text||"";this.g.debug("Got subtitles: ",d,"start:",b,"end:",c,a);(d=_.gj(d))&&this.o.append([new _.Vt(b,c,d)],[])}G(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)}K(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)}H(a){this.g.debug(`Error: TYPE: ${a.eventType}`);lN(this.f,_.Mo);a=new _.I(_.G,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.F(_.q,{detail:a}))}init(a,
|
|
50
|
+
b){this.configuration=this.B=b;this.w=a;this.a.on(lO,this.I,this);this.a.on(UN,this.F,this);this.a.on(uO,this.J,this);this.a.on(vO,this.G,this);this.a.on(wO,this.H,this);this.a.on(kO,this.K,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();a=yO;yO+=1;a="__clpp_tizen_player_"+a;this.j=_.op(_.Ce,{id:a,type:"application/avplayer"});this.w.addElementToContainer(this.j,!0);var c=this.w.getMedia();if(c){a=this.j;{b=[_.Fg,_.Zd,"position",
|
|
51
|
+
_.ee,"top"];const e={};c=null!==c.parentElement?window.getComputedStyle(c,null):c.style;if(!b||0===b.length)for(d in b||(b=[]),c)b.push(d);for(const f of b)e[f]=c[f];var d=e}_.qp(a,d);iO(this)}}getSurface(){return this.w}getConfiguration(){return this.configuration}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Za)}appendLoad(){return Promise.reject(_.Za)}seekWith(){return Promise.reject(_.Za)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){const a=
|
|
52
|
+
this;return _.x(function*(){yield a.release();a.a.off(lO,a.I);a.a.off(UN,a.F);a.a.off(uO,a.J);a.a.off(vO,a.G);a.a.off(wO,a.H);a.a.off(kO,a.K);a.h&&(yield a.h.destroy(),a.h=null);a.j&&(a.j.parentElement.removeChild(a.j),a.j=null);a.l.destroy();a.f.destroy();a.l=null;a.f=null})}namespace(){return zO}getPlaybackRate(){return this.a.getPlaybackRate()}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}setPlaybackRate(a){this.a.setPlaybackRate(a)}getPosition(){return this.getMediaPosition()}getMediaPosition(){return 0<
|
|
53
53
|
(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.Lo?this.getDuration():this.a.getPosition()||0}seek(a){return typeof a===_.t&&0<=a?(this.isLive()||(a=Math.min(a,this.getDuration())),this.a.seek(a)):Promise.reject()}getPresentationStartTime(){return null}getSeekRange(){return{start:0,end:0}}getVolume(){const a=this.a.getVolume();return typeof a===_.t?a/100:null}setVolume(a){this.a.setVolume(a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.a.getDuration()}getBufferInfo(){this.g.warn(_.pa);
|
|
54
54
|
return new _.ru}getTrackManager(){return this.l}unload(){return this.a.release().then(()=>{this.l.release()})}release(){const a=this;return _.x(function*(){a.h&&(yield a.h.release());a.o&&(yield a.o.destroy(),a.o=null);yield a.a.release();a.l.release();a.f.release();a.A=!1})}load(a){const b=this;return _.x(function*(){b.configuration=_.tl(b.B,a);var c=_.Do(b.configuration,[_.ae,"native"]);b.o=c.create(b);c=_.Zo(b.configuration)[0];if(b.configuration.tizen&&b.configuration.tizen.sideStreamText){b.h=
|
|
55
|
-
new
|
|
56
|
-
_.Lo}isPaused(){return this.a.getState()===
|
|
57
|
-
|
|
55
|
+
new pO;b.h.initialize(b);try{yield b.h.load(c),b.h.start()}catch(d){b.g.error(d)}}try{yield b.a.load(b.configuration)}catch(d){throw b.onError(d),d;}b.l.load()})}play(){this.trigger(new _.F(_.Re));iO(this);return this.a.play().then(()=>{oN(this.f)})}pause(){return this.a.pause().then(()=>{oN(this.f)})}getState(){return this.f.getState()}getPeriods(){return[]}onError(a){const b=new _.F(_.q,{detail:a});a.severity===_.G&&(lN(this.f,_.Mo),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)}getDrmInfo(){return this.a.getDrmInfo()}isEnded(){return this.f.getState()===
|
|
56
|
+
_.Lo}isPaused(){return this.a.getState()===nN}isMuted(){return ZN(this.a)}setMuted(a){cO(this.a,a)}getNetworkEngine(){return this.C}setNetworkEngine(a){this.C=a}setCmsdManager(){}isLive(){return this.a.isLive()}getStats(){return null}setSourceIndex(a){this.a.setSourceIndex(a)}getSourceIndex(){return this.a.getSourceIndex()}getLoadedSource(){return this.a.getLoadedSource()}canPlay(a,b){return(new AO).canPlay(a,b)}getTimelineCues(){return[]}getCueTimeline(){return null}getTextDisplayer(){return this.o}resetAbr(){}},
|
|
57
|
+
zO="clpp.tizen",yO=0,AO=class{a(){return zO}canPlay(a){a=a.type;const b=!!window.webapis;if((a===_.tc||a===_.kl||a===_.yc)&&b){if(_.vk(2))return 2;if(_.vk(3)||_.vk(4)||_.vk(5)||_.vk(6))return _.C("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0}f(a){return a===_.ma}create(){return new BO}};_.z("clpp.tizen.TizenComponent",class extends _.Av{f(){_.uh(new AO)}a(){var a=zO;a&&_.sh[a]&&(delete _.sh[a],_.th.info("Removed Player factory: '"+a+"'"))}id(){return"tizen"}});var dO="onbufferingstart",jO="onbufferingprogress",kO="onbufferingcomplete",lO="onstreamcompleted",UN="oncurrentplaytime",sO="onevent",uO="onsubtitlechange",vO="ondrmevent",wO="onerror",fO="preparingstart",gO="preparingend";};f.call(g, window);
|
package/cl.ttml.js
CHANGED
|
@@ -12,9 +12,9 @@ d,1,100);c.widthUnits=cy(e,d);c.height=by(e,a,2,100);c.heightUnits=cy(e,a);b=thi
|
|
|
12
12
|
this.a){d=this.a.textOutline.split(" ");e="black";let g=".4em";const h=d[0]&&d[0].trim(),k=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!vy.test(h)&&vy.test(k)&&vy.test(l)?(e=h,g=k):2===d.length&&!vy.test(h)&&vy.test(k)?(e=h,g=k):2===d.length&&vy.test(h)&&vy.test(k)&&(g=h);if(""!==g){g=Ux(g);d="text-shadow:"+`0 0 ${g} ${e},`+`0 0 ${g} ${e},`+`0 0 ${g} ${e};`;break a}}d=""}c+=d;"textShadow"in this.a?(d=Xx(this.a.textShadow),d=Ux(d),d=`text-shadow:${d};`):d="";c=c+d+("fontFamily"in this.a?`font-family:${this.a.fontFamily.replace("monospaceSansSerif",
|
|
13
13
|
"monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif","sans-serif").replace("proportionalSerif","sans-serif").replace("sansSerif","sans-serif").replace("default","sans-serif")};`:"");a:{if(Ix in this.a){d=this.a.textDecoration.split(" ");e=[];for(f of d)switch(f){case "underline":case "overline":e.push(f);break;case "lineThrough":e.push("line-through")}if(0<e.length){var f=`text-decoration:${e.join(" ")};`;break a}}f=""}"padding"in this.a?(d="border: solid transparent;border-width:"+
|
|
14
14
|
Ux(this.a.padding),d+=";"):d="";f=c=c+f+d;"lineHeight"in this.a?(c="",d=this.a.lineHeight,d=Ux(d),d=Wx(d,b),c+="line-height:",c+=d,c+=";"):c="";a.push(f+c+"}");a:{if("fontSize"in this.a&&(f=this.a.fontSize.split(" "),c=null,1===f.length&&(c=f[0]),2===f.length&&(c=f[1]),c)){c=c.trim();c=Ux(c);c=Wx(c,b);b=`font-size:${c};`;break a}b=null}b&&(f=`::ttml .${this.h} .clpp-text-wrapper {`,f+=b,f+="}",a.push(f),f=`::ttml .clpp-text-wrapper__${this.h} {`,f+=b,f+="}",a.push(f));return a}},Ay=new Map([[Dx,"background-color"],
|
|
15
|
-
["color","color"],[Ex,Ex],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Cy=class{constructor(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=[]}},hy=0;var Fy=class{constructor(a){this.a=a.firstChild;this.f=new Set}
|
|
15
|
+
["color","color"],[Ex,Ex],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Cy=class{constructor(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=[]}},hy=0;var Fy=class{constructor(a){this.a=a.firstChild;this.f=new Set}nd(){return!!this.a}next(){if(!this.a)return null;let a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Dy.has(Tx(a.nodeName))||Ey.has(Tx(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&&!Dy.has(Tx(a.nodeName))));const b=this.a;this.a=a;return b}},Dy=new Set(["tt","head","layout",_.se,_.be,Gx,"styling",_.Pf,"body",
|
|
16
16
|
_.Cd,"p","span","br"]),Ey=new Set([_.Pf,_.be]);var py=class{constructor(a,b,c,d,e,f){this.h=a;this.a=b;this.j=c;this.l=d;this.f=e;this.attributes=f}getId(){return this.attributes.id}};var Gy=class{constructor(){this.a=new Map}};var Hy=class{constructor(a){this.a=a;this.f=new DOMParser}parseInit(){}parseMedia(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.Xg(this.a.ttml||{}),e=_.K(a,0,c[0]);e=_.Ui(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.Tf)}catch(m){throw new _.I(_.G,2,2005,"Failed to parse TTML.");}d=new Cy(d);e=new Gy;f=new Fy(f);b=b.periodStart;typeof b===_.t&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var h=c[g],k=_.K(a,b,h);k=_.Hl(k);const m=`urn:mpeg:14496-30:subs:${g}`;d.h.set(m,
|
|
17
|
-
new ty(m,k,{imageType:"PNG",encoding:"Base64"}));b+=h}for(;f.
|
|
17
|
+
new ty(m,k,{imageType:"PNG",encoding:"Base64"}));b+=h}for(;f.nd();)a=f.next(),a=qy(e,a),c=d,b=a,"tt"===ny(b)&&(c.l=new zy(c.B,Object.assign({},b.attributes))),c=d,b=a,"tt"===ny(b)&&(c.w=new xy(b.attributes.frameRate,b.attributes.subFrameRate,b.attributes.frameRateMultiplier,b.attributes.tickRate)),c=d,b=a,ny(b)!==_.be||b.attributes.begin||b.attributes.end||(g=`#${b.getId()}`,c.h.set(g,new ty(g,b.h.textContent,b.attributes))),c=d,g=a,ny(g)===_.be&&g.attributes.begin&&g.attributes.end?(b=`#${iy()}`,
|
|
18
18
|
g=new ty(b,g.h.textContent,g.attributes),c.h.set(b,g),c=g):c=null,c&&(a.j=c.getId()),c=d,b=a,ny(b)===_.Pf&&(g=b.getId()||iy(),h=new By(g,b.f,Object.assign({},b.attributes)),c.a.set(g,h),b.a&&c.j.get(b.a).f.push(g)),c=d,g=a,ny(g)!==_.Pf&&ky(g)?(b=iy(),g=new By(b,[],Object.assign({},g.attributes)),c.a.set(b,g),c=g):c=null,c&&a.f.push(c.getId()),c=d,g=a,ny(g)!==_.Cd||!g.attributes.extent&&!g.attributes.origin?c=null:(b=iy(),g=new yy(b,ly(c,g.f),Object.assign({},g.attributes)),c.j.set(b,g),c=g),c&&(a.a=
|
|
19
19
|
c.getId()),c=d,g=a,ny(g)!==Gx?c=null:(b=g.getId(),g=new yy(b,ly(c,g.f),Object.assign({},g.attributes)),c.j.set(b,g),c=g),c&&(a.a=c.getId()),c=d,g=a,b=g.l,-1===[_.da,"span","br"].indexOf(ny(g))||0===b.length?c=null:(h=b[b.length-1],c.f.has(h)?(b=iy(),g=new wy(b,g.h.nodeName===_.da?g.h.textContent:null,"br"===ny(g),g.a,g.j,ly(c,g.f),g.attributes),c.f.set(b,g),(c=c.f.get(h))&&c.j.push(b),c=g):c=null),c&&a.l.push(c.getId()),c=d,g=a,"p"===ny(g)||g.j?(b=iy(),g=new wy(b,null,!1,g.a,g.j,ly(c,g.f),g.attributes),
|
|
20
20
|
c.f.set(b,g),c.o.push(g),c=g):c=null,c&&a.l.push(c.getId());e=my(d);f=[];for(l of d.a.values())f.push(...l.build(d.l));var l=f;return{cues:e,styles:l}}};var Iy=class{constructor(a){this.f=a}a(a){var b=new Hy(this.f);({cues:a}=b.parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}));b="WEBVTT\n\n";for(const d of a){a=b;b=ry(d.startTime)+" --\x3e "+ry(d.endTime);{var c=d;const e=[];switch(c.textAlign){case _.ee:e.push("align:left");break;case _.wf:e.push("align:right");break;case _.Qt:e.push("align:middle");break;case _.Jf:e.push("align:start");break;case _.Rd:e.push("align:end")}switch(c.writingMode){case _.mg:e.push("vertical:lr");break;case _.ng:e.push("vertical:rl")}c=
|
package/cl.verimatrix.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var px="VerimatrixVCAS",qx="clpp.verimatrix.Vcas",rx="clpp.verimatrix.VcasComponent",tx=function(a,b){return a.C===sx?(a=Object.assign({},{deviceId:_.Il(_.$i(a.A))},a.a&&{authenticator:_.Il(_.$i(a.a))}),b+_.Lj(a)):b},zx=class extends _.yu{constructor(a){super(px);const b={};b[ux]=ux;b[vx]=vx;const {deviceId:c,authenticator:d,licenseRequestVuidLocation:e=sx,httpHeaderNames:f=b,widevineLicenseUrl:g,playReadyLicenseUrl:h,fairPlayLicenseUrl:k,fairPlayCertificateUrl:l,fairPlaySiteId:m,fairPlayAssetIdStrategy:n=
|
|
2
2
|
wx}=a;this.A=c;this.a=d;this.C=e;this.B=f;this.w=tx(this,g);this.o=tx(this,h);this.l=tx(this,k);this.j=l;this.G=m;this.F=n;this.g=new _.S(qx);_.dj(this.w)?this.g.warn(_.Fb):this.$a(_.td,{licenseUrl:this.w,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.dj(this.o)?this.g.warn(_.db):this.$a(_.rd,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],
|
|
3
|
-
modifiers:{licenseRequest:this.h.bind(this)}});_.dj(this.l)?this.g.warn(_.Da):_.dj(this.j)?this.g.warn(_.Ca):this.$a(_.pd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.J.bind(this),licenseResponse:this.K.bind(this),extractContentId:this.H.bind(this)}})}h(a,b){if(this.C===xx){a=this.B[vx];const c={};c[this.B[ux]]=this.A;this.a&&(c[a]=this.a);Object.keys(c).forEach(d=>{b.headers[d]=c[d]})}}H(a,b){a=_.nm(b);switch(this.F){case yx:a=_.Lj({r:a,
|
|
3
|
+
modifiers:{licenseRequest:this.h.bind(this)}});_.dj(this.l)?this.g.warn(_.Da):_.dj(this.j)?this.g.warn(_.Ca):this.$a(_.pd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.J.bind(this),licenseResponse:this.K.bind(this),extractContentId:this.H.bind(this)}})}h(a,b){if(this.C===xx){a=this.B[vx];const c={};c[this.B[ux]]=this.A;this.a&&(c[a]=this.a);Object.keys(c).forEach(d=>{b.headers[d]=c[d]})}}H(a,b){a=_.nm(b);switch(this.F){case yx:a=_.Lj({r:a,jj:this.G},!0)}return a}J(a,b){this.h(a,
|
|
4
4
|
b);_.sm(b)}K(a,b){_.tm(b)}};_.z(qx,zx);zx.prototype.constructor=zx.prototype.constructor;zx.NAME=px;var sx="query-string",xx="http-header";zx.LicenseRequestVuidLocation={QUERY_STRING:sx,HTTP_HEADER:xx};var ux="DeviceId",vx="Authenticator";zx.LicenseRequestHttpHeader={DEVICE_ID_HEADER:ux,AUTHENTICATOR_HEADER:vx};var wx="keyid",yx="contentid-siteid";zx.FairPlayAssetIdStrategy={KEYID:wx,CONTENTID_SITEID:yx};_.z(rx,class extends _.Av{constructor(){super();this.g=new _.S(rx)}a(){delete _.Ql.VerimatrixVCAS}h(a){a=a.getConfiguration();if(a.drm&&a.drm.env===px){({customData:a}=a.drm);if(!a)throw new _.I(_.G,7,7100,_.ud);a=new zx(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.Rl(a)}}id(){return"verimatrix-vcas"}});};f.call(g, window);
|
package/cl.vimond.js
CHANGED
|
@@ -3,6 +3,6 @@ e;this.a=new _.Nt;this.j=!0;this.Z=this.h=this.A=!1;this.B=null;this.f=new _.rk(
|
|
|
3
3
|
this.h=!1}H(a){const b=this;return _.x(function*(){const c=a.detail,d=c.currentState;b.g.debug(`State changed, prev: ${c.previousState} curr: ${d}`);b.A||b.h||(d!==b.B||b.Z?b.j&&d!==_.Wo||(b.Z&&[_.Vo,_.Po].includes(d)?b.g.debug("Seeking"):(b.Z&&d===_.Wo&&(b.g.debug("Seeked"),b.Z=!1),[_.Wo,_.Vo,_.Mo,_.Lo].includes(d)&&(b.B=d,yield b.w(),d===_.Lo&&b.f.stop()))):b.g.debug("Ignore transition"))})}w(){const a=this;return _.x(function*(){var b=Math.floor(Date.now()/1E3);0<a.l&&a.g.debug(`Last event was ${b-
|
|
4
4
|
a.l} seconds ago`);a.l=b;a.f.stop();a.f.ka(a.j?10:a.J);a.j=!1;try{var c=yield a.C.fireEvent();ix(a,c)}catch(d){b=d.code,c=d.data,[1002,1003].includes(b)?(a.g.debug("Unreachable service"),ix(a,c),jx(a,a.K,c)):1001===b?(a.g.debug("Generic service error"),ix(a,c),jx(a,a.L,c)):a.g.error(d.toString())}})}};var mx=class{constructor(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.S("clpp.vimond.VimondService");this.f=0}fireEvent(){this.f++;const a=_.Wg(this.o);a.client.buildName=_.qa;a.client.buildVersion=_.ea;var b=a.client;var c=(c=this.a.m.getDrmInfo())?c.keySystem:"";b.drm=c;a.client.pageUrl=document.location.href;a.client.streamUrl=this.a.m.getLoadedSource().url;a.client.userAgent=navigator.userAgent;a.client.videoFormat=this.a.m.getLoadedSource().type||"";b=a.client;c=this.a.m.getLoadedSource();
|
|
5
5
|
c=((new _.mm(c.url)).scheme||"").replace(":","");b.videoProtocol=c;b=kx(this.a,this.f);a.client.playerEvent=b[0]||"";a.client.playerState=b[1]||"";a.progress.vod&&(a.progress.vod.position=this.a.getPosition());if(b=a.progress.live){c=this.a;var d=c.m.getPresentationStartTime()||0;c=Math.floor(d+c.m.getPosition());c=(new Date(1E3*c)).toISOString();b.position=c;d=this.a;c=d.m.getPosition();d=d.m.getSeekRange().end;c=30>Math.abs(d-c);b.onLiveEdge=c;typeof b.liveResumePossible!==_.Lc&&(b.liveResumePossible=
|
|
6
|
-
!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.mj(this.l);b.method=_.cb;b.contentType="application/json";b.headers.Authorization=`Bearer ${this.h}`;b.body=_.$i(JSON.stringify(a));return this.j.fetch(b).T}
|
|
7
|
-
a.onError(new _.I(1,9,9200));return}this.g.debug(_.ra);c=b.failIfUnreachable;typeof c!==_.Lc&&(c=!0);var d=b.failOnError;typeof d!==_.Lc&&(d=!0);this.f=new nx(a);this.h=new mx(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new lx(b.playerEventRequest.eventInterval,c,d,a,this.h)}}onPlayerWillRelease(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.wb);_.Dh(a.a)}this.j&&(a=this.j,a.g.debug(_.wb),_.Dh(a.a),a.f.stop());this.j=this.h=this.f=null}}onPlayerWillDestroy(){}id(){return"vimond"}
|
|
8
|
-
this.h&&this.h.
|
|
6
|
+
!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.mj(this.l);b.method=_.cb;b.contentType="application/json";b.headers.Authorization=`Bearer ${this.h}`;b.body=_.$i(JSON.stringify(a));return this.j.fetch(b).T}qf(a){this.h=a}};var nx=class{constructor(a){this.m=a;this.a=new _.Nt;this.g=new _.S("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(gx),this.a.on(this.m,_.sf,this.o.bind(this)),this.a.on(this.m,_.Rb,this.j.bind(this)),this.a.on(this.m,_.Sb,this.l.bind(this)))}getPosition(){return Math.floor(this.m.getPosition())}o(){this.h=!0}j(){this.f=!0}l(){this.f=!1}};var ox=class extends _.Pv{constructor(){super();this.a=!1;this.g=new _.S(hx);this.j=this.h=this.f=null}onPlayerCreated(){}onContentWillLoad(a){var b=a.getConfiguration();(this.a=!_.B(b.vimond)&&typeof b.vimond===_.Ce)?a.namespace()===_.dd&&(this.a=!1,this.g.info("Vimond does not report when casting.")):this.g.debug("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c of["authToken","playerEventRequest"])if(!b[c]){this.g.warn(`${c} key is missing`);
|
|
7
|
+
a.onError(new _.I(1,9,9200));return}this.g.debug(_.ra);c=b.failIfUnreachable;typeof c!==_.Lc&&(c=!0);var d=b.failOnError;typeof d!==_.Lc&&(d=!0);this.f=new nx(a);this.h=new mx(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new lx(b.playerEventRequest.eventInterval,c,d,a,this.h)}}onPlayerWillRelease(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.wb);_.Dh(a.a)}this.j&&(a=this.j,a.g.debug(_.wb),_.Dh(a.a),a.f.stop());this.j=this.h=this.f=null}}onPlayerWillDestroy(){}id(){return"vimond"}qf(a){this.a&&
|
|
8
|
+
this.h&&this.h.qf(a)}};_.z(hx,ox);ox.prototype.updateAuthToken=ox.prototype.qf;ox.Id="vimond";_.Ir(new class{create(){return new ox}});};f.call(g, window);
|
package/cl.vr.js
CHANGED
|
@@ -11,5 +11,5 @@ this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&
|
|
|
11
11
|
var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new dx(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.C;c.a.useProgram(c.f);{c=Vw(this.I,this.K,this.G).a;let d;d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=
|
|
12
12
|
c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d}b.uniformMatrix4fv(this.C.h,!1,this.I.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.X;a.a.bindBuffer(a.a.ARRAY_BUFFER,a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,
|
|
13
13
|
0,a.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.C.a.useProgram(null)}}}}fa(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Ow)a.type===Ow?a.touches[0]&&(this.h.x=a.touches[0].clientX,this.h.y=a.touches[0].clientY):(this.h.x=a.clientX,this.h.y=a.clientY),this.g.debug("Mouse Start coordinates:",this.h,a),this.a.addEventListener("mousemove",this.A,!1),this.a.addEventListener(Nw,this.A,!1),this.a.addEventListener("mouseup",this.B,!1),this.a.addEventListener("touchend",
|
|
14
|
-
this.B,!1)}ia(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===Nw&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;const d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.V;const {
|
|
15
|
-
_.z("clpp.vr.VrPlugin",fx);fx.prototype.setCameraFieldOfView=fx.prototype.
|
|
14
|
+
this.B,!1)}ia(a){a.preventDefault();var b=a.clientX;let c=a.clientY;a.type===Nw&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;const d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.V;const {bh:e,dh:f}={bh:a*b*(this.L?-1:1),dh:d*b*(this.M?-1:1)};this.j+=e;this.l+=f;$w(this)}za(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Zw(this)}Yh(a,b){this.l=b;this.j=a;$w(this)}yh(){return{x:this.j,y:this.l}}vi(a){this.H=a;this.F()}};
|
|
15
|
+
_.z("clpp.vr.VrPlugin",fx);fx.prototype.setCameraFieldOfView=fx.prototype.vi;fx.prototype.getCameraCoordinates=fx.prototype.yh;fx.prototype.moveCamera=fx.prototype.Yh;fx.Id="vr";_.Ir(new class{create(){return new fx}});};f.call(g, window);
|
package/cl.vtt.js
CHANGED
|
@@ -7,6 +7,6 @@ b," The region will be ignored."),null)},Hw=function(a,b,c){let d,e,f;(new _.om)
|
|
|
7
7
|
8589934592;a=b.periodStart+e/9E4-a}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(a=b.segmentStart);b=[];for(var f of c)if(/^region/.test(f.toLowerCase())){e=new _.Fi(f.replace(/\n/g," "));d=new _.$t;Aw(e);Bw(e);for(var g=Aw(e);g;){a:{var h;var k=d;var l=g;if(h=/^id:(.*)$/.exec(l))k.id=h[1];else if(h=/^width:(\d{1,2}|100)%$/.exec(l))k.width=Number(h[1]);else if(h=/^lines:(\d+)$/.exec(l))k.height=Number(h[1]),k.heightUnits=2;else if(h=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.regionAnchorX=
|
|
8
8
|
Number(h[1]),k.regionAnchorY=Number(h[2]);else if(h=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(l))k.viewportAnchorX=Number(h[1]),k.viewportAnchorY=Number(h[2]);else if(/^scroll:up$/.exec(l))k.scroll="up";else{k=!1;break a}k=!0}k||_.C("VTT parser encountered an invalid VTTRegion setting: ",g,uw);Bw(e);g=Aw(e)}e=d;b.push(e)}f=[];for(var m of c)if(/^style/.test(m.toLowerCase())){e=m.replace(/^style/i,"").replace(/\n/g," ");d=/[^{}]+{[^{}]*}/g;do(g=d.exec(e))&&f.push(g[0]);while(g)}m=[];for(const n of c)if(n.includes("--\x3e")){a:{l=
|
|
9
9
|
n.split("\n");h=a;c=b;if(1===l.length&&!l[0]||/^NOTE($|[ \t])/.test(l[0])||"STYLE"===l[0]){c=null;break a}e=null;l[0].includes("--\x3e")||(e=l[0],l.splice(0,1));d=new _.Fi(l[0]);g=Dw(d);const r=_.Ei(d,/[ \t]+--\x3e[ \t]+/g);k=Dw(d);if(null==g||null==r||null==k)throw new _.I(_.G,2,2001);g+=h;k+=h;l=l.slice(1).join("\n").trim();g=new _.Vt(g,k,l,_.xg);e&&(g.id=e);Bw(d);for(k=Aw(d);k;)Fw(g,k,c)||_.C(vw,k,uw),Bw(d),k=Aw(d);null!=e&&(g.id=e);c=g}c&&m.push(c)}return{cues:m,styles:f}}};var Lw=class extends Kw{parseMedia(a,b){return super.parseMedia((new Iw).a(a),b)}};var Mw=class{constructor(){this.a=null;this.g=new _.S("clpp.vtt.mp4")}parseInit(a){let b=!1;(new _.om).N(_.ye,_.hm).N(_.ag,_.hm).N(_.qe,_.hm).ea("mdhd",c=>{0===c.version?(c.reader.skip(4),c.reader.skip(4),this.a=_.P(c.reader),c.reader.skip(4)):(c.reader.skip(8),c.reader.skip(8),this.a=_.P(c.reader),c.reader.skip(8));c.reader.skip(4)}).N(_.xe,_.hm).N(_.Mf,_.hm).ea(_.Of,_.im).N("wvtt",()=>{b=!0}).parse(a);if(!this.a)throw new _.I(_.G,2,2008);if(!b)throw new _.I(_.G,2,2008);}parseMedia(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),
|
|
10
|
-
new _.I(_.G,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.om).N("moof",_.hm).N("traf",_.hm).ea("tfdt",r=>{g=!0;c=0===r.version?_.P(r.reader):_.cm(r.reader)}).ea("tfhd",r=>{var u=r.flags;r=r.reader;r.skip(4);u&1&&r.skip(8);u&2&&r.skip(4);l=u&8?_.P(r):null}).ea("trun",r=>{h=!0;{var u=r.version,v=r.flags;r=r.reader;const y=_.P(r);v&1&&r.skip(4);v&4&&r.skip(4);const A=[];for(let D=0;D<y;D++){const E={duration:null,sampleSize:null,
|
|
11
|
-
_.P(r));v&1024&&r.skip(4);v&2048&&(E.
|
|
10
|
+
new _.I(_.G,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new _.om).N("moof",_.hm).N("traf",_.hm).ea("tfdt",r=>{g=!0;c=0===r.version?_.P(r.reader):_.cm(r.reader)}).ea("tfhd",r=>{var u=r.flags;r=r.reader;r.skip(4);u&1&&r.skip(8);u&2&&r.skip(4);l=u&8?_.P(r):null}).ea("trun",r=>{h=!0;{var u=r.version,v=r.flags;r=r.reader;const y=_.P(r);v&1&&r.skip(4);v&4&&r.skip(4);const A=[];for(let D=0;D<y;D++){const E={duration:null,sampleSize:null,lf:null};v&256&&(E.duration=_.P(r));v&512&&(E.sampleSize=
|
|
11
|
+
_.P(r));v&1024&&r.skip(4);v&2048&&(E.lf=0===u?_.P(r):_.bm(r));A.push(E)}d=A}}).N(_.pe,_.jm(r=>{k=!0;e=r})).parse(a);if(!k&&!g&&!h)throw new _.I(_.G,2,2008);a=c;var m=new DataView(e.buffer,e.byteOffset,e.byteLength);m=new _.ln(m,!1);for(const r of d){const u=r.duration||l,v=r.lf?c+r.lf:a;a=v+(u||0);let y=0;do{const A=_.P(m);y+=A;var n=_.P(m);n=_.gm(n);let D=null;"vttc"===n?8<A&&(D=_.em(m,A-8)):("vtte"!==n&&this.g.error("Unknown box "+n+"! Skipping!"),m.skip(A-8));u?D&&f.push(Hw(D,b.periodStart+v/this.a,
|
|
12
12
|
b.periodStart+a/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&y<r.sampleSize)}return{cues:f.filter(_.ii),styles:[]}}};_.z("clpp.vtt.VttComponent",class extends _.Av{constructor(){super();this.j=new Jw}f(){_.yt(_.Sf,Kw);_.yt(yw,Kw);_.yt(zw,Kw);_.yt(_.wc,Mw);_.yt(xw,Lw);_.yt(ww,Lw);_.ck.push(this.j)}a(){_.At(_.Sf);_.At(yw);_.At(zw);_.At(_.wc);_.At(xw);_.At(ww);_.ek(this.j)}id(){return"subtitles-vtt"}});};f.call(g, window);
|
package/cl.yospace.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var qw="clpp.yospace.YospacePlugin",tw=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.S(qw)}
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var qw="clpp.yospace.YospacePlugin",tw=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.S(qw)}bg(){return this.a}onContentWillLoad(a,b){const c=this;return _.x(function*(){var d=a.getConfiguration().yospace;if(d.enabled){if(typeof window.YospaceAdManagement!==_.Ce)throw new _.I(_.G,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");a:{d=d.streamType||rw;var e=b.url;c.g.info("Creating Yospace session for stream type",d);switch(d){case rw:d=YospaceAdManagement.SessionVOD.create(e);
|
|
2
2
|
break a;case sw:d=YospaceAdManagement.SessionLive.create(e);break a;default:d=YospaceAdManagement.SessionDVRLive.create(e)}}d=yield d;e=d.getSessionState();if(e!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",e,"URL",b.url),new _.I(_.G,9,7003,"Yospace session failed to initialize.");a.trigger(new _.F(_.Kg,{detail:d}));b.url=d.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=d}})}onPlayerWillRelease(a){if(this.a){this.g.info("Shutting down Yospace session.");
|
|
3
|
-
const b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.F(_.Jg,{detail:b}))}}id(){return"yospace"}};_.z(qw,tw);tw.prototype.getSession=tw.prototype.
|
|
3
|
+
const b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.F(_.Jg,{detail:b}))}}id(){return"yospace"}};_.z(qw,tw);tw.prototype.getSession=tw.prototype.bg;tw.Id="yospace";_.Ir(new class{create(){return new tw}});var rw=_.Cb,sw="LIVE";_.z("clpp.yospace.StreamType",{VOD:rw,LIVE:sw,DVR:"DVR"});};f.call(g, window);
|
package/cl.youbora.js
CHANGED
|
@@ -3,26 +3,26 @@ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(windo
|
|
|
3
3
|
!1)},fw=function(a,b){if(b.namespace()===_.dd)return a.g.info("Youbora does not report when casting."),!1;const c=b.getConfiguration().youbora;if(!_.bh(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn(Rv),b.onError(new _.I(1,9,9101)),!1;if(_.B(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.I(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found "+
|
|
4
4
|
`version ${youbora.VERSION}. Some or all features of YouboraPlugin `+"may not work correctly."),b.onError(new _.I(1,9,9102)));return!0},gw=a=>(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:b=>({code:`${b.code}`,message:b.message,severity:b.severity}),hw=(a,b,c,d)=>{b=gw(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.q;b.severity===_.G?(d.fireFatalError(b.code,b.message,b.metadata),c.debug(`Reporting "fatal ${a}" to Youbora`,
|
|
5
5
|
b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(`Reporting "${a}" to Youbora`,b.code,b));return b};var iw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.a=new _.Nt;this.g=new _.S("clpp.npaw.YouboraAdapter");this.h=this.o=!1;this.registerListeners()}getPlayhead(){return this.getIsLive()?-1:this.m.getPosition()}getDuration(){return this.m.getDuration()}getRendition(){let c,d,e;var f=this.m.getTrackManager();f&&(f=f.na())&&(c=f.width,d=f.height,e=f.bandwidth);c&&d&&e||(f=this.j(),c=c||f.width,d=d||f.height,e=e||f.streamBandwidth);return youbora.Util.buildRenditionString(c,
|
|
6
|
-
d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ea())?c.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"6.25.2-
|
|
6
|
+
d,e)}getIsLive(){return this.m.isLive()}getResource(){const c=this.m.getLoadedSource();return c&&c.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.m.getPlaybackRate()}getFramesPerSecond(){var c=this.m.getTrackManager();return c&&(c=c.Ea())?c.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"6.25.2-castlabsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&this.a&&(this.g.debug("registering listeners"),
|
|
7
7
|
youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Kf,this.I.bind(this)),this.a.on(this.m,_.q,this.F.bind(this)),this.a.on(this.m,_.jg,this.H.bind(this)),this.a.on(this.m,_.ig,this.G.bind(this)),this.a.on(this.m,_.oc,this.B.bind(this)),this.a.on(this.m,_.Qc,this.C.bind(this)))}unregisterListeners(){this.g.debug(_.wb);_.Dh(this.a)}dispose(){super.dispose()}j(){return this.m.getStats()||_.Io()}w(){return!!this.m.getConfiguration().autoplay}I(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case _.Uo:this.w()&&
|
|
8
8
|
this.f();break;case _.Wo:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Vo:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.To:this.fireBufferEnd();this.fireStop();break;case _.Lo:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Po:this.fireBufferBegin();break;default:this.g.debug(Qv,c)}}f(){this.plugin.isInitiated||(this.h=!1,this.fireInit())}A(){var c=this.m.getDrmInfo();c&&(c=cw(c.keySystem))&&
|
|
9
|
-
this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=hw(c,this.m,this.g,this))&&c.severity===_.G&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Cf),this.f(),this.fireSeekBegin())}G(){this.l(_.Bf);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.
|
|
9
|
+
this.plugin.setOptions({"content.drm":c});this.fireJoin()}F(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=hw(c,this.m,this.g,this))&&c.severity===_.G&&(this.h=!0)}H(){this.m.isEnded()||(this.l(_.Cf),this.f(),this.fireSeekBegin())}G(){this.l(_.Bf);this.fireSeekEnd()}B(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.Jb()}C(c){this.g.debug("Casting",c);this.fireCasted()}l(c,...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var jw=a=>{class b extends youbora.Adapter{constructor(c){super(c);this.m=c;this.j=this.a=null;this.f=new _.Nt;this.g=new _.S("clpp.npaw.YouboraAdsAdapter");this.registerListeners();this.l=!1}getDuration(){return this.a&&this.a.getDuration()}getRendition(){let c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.fb(),this.a.eb(),this.a.Oa()));return c}getBitrate(){return this.a&&this.a.Oa()}getPlayhead(){const c=this.m.getAdsManager();return c&&c.getPosition()}getResource(){return this.a&&this.a.getMediaUrl()}getTitle(){return this.a&&
|
|
10
10
|
this.a.getTitle()}getProvider(){return this.a&&this.a.getAdvertiserName()}getCreativeId(){return this.a&&this.a.getCreativeId()}getPosition(){const c=youbora.Constants.AdPosition;let d=null;if(this.a)switch(this.a.Pa()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d}getIsSkippable(){return this.a&&-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const c=this.m.getAdsManager();return c&&0<c.getVolume()}getExpectedBreaks(){return this.j&&
|
|
11
|
-
this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.gb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.j&&this.j.getCuePoints().map(c=>-1===c?this.m.getDuration():c)}getIsFullscreen(){return this.m.getSurface().isFullscreen()}getIsVisible(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(aw,c);return c}getPlayerName(){return _.qa}getVersion(){return"6.25.2-
|
|
12
|
-
this.f&&(this.f.on(this.m,_.oc,this.M.bind(this)),this.f.on(this.m,_.
|
|
11
|
+
this.j.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.gb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.j&&this.j.getCuePoints().map(c=>-1===c?this.m.getDuration():c)}getIsFullscreen(){return this.m.getSurface().isFullscreen()}getIsVisible(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(aw,c);return c}getPlayerName(){return _.qa}getVersion(){return"6.25.2-castlabsadsadapter-js"}getPlayerVersion(){return _.ea}registerListeners(){this.m&&
|
|
12
|
+
this.f&&(this.f.on(this.m,_.oc,this.M.bind(this)),this.f.on(this.m,_.jc,this.L.bind(this)),this.f.on(this.m,_.cc,this.I.bind(this)),this.f.on(this.m,_.ec,this.J.bind(this)),this.f.on(this.m,_.Vb,this.G.bind(this)),this.f.on(this.m,_.Wb,this.o.bind(this,1)),this.f.on(this.m,_.bc,this.o.bind(this,2)),this.f.on(this.m,_.mc,this.o.bind(this,3)),this.f.on(this.m,_.Ub,this.F.bind(this)),this.f.on(this.m,_.fc,this.K.bind(this)),this.f.on(this.m,_.q,this.H.bind(this)),this.f.on(this.m,_.Rb,this.A.bind(this)),
|
|
13
13
|
this.f.on(this.m,_.Sb,this.B.bind(this)),this.f.on(this.m,_.Tb,this.C.bind(this)),this.f.on(this.m,_.dc,this.w.bind(this)))}unregisterListeners(){_.Dh(this.f)}dispose(){super.dispose()}M(c){this.g.debug(Wv,c);this.j=c.adsTimeline}L(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()}G(){this.h("ad ended");this.fireStop()}I(){this.h("ad pause");this.w();this.firePause()}J(){this.h("ad resume");this.w();this.fireResume()}C(){this.l=!0;this.h(Uv);this.fireBufferBegin()}w(){this.l&&
|
|
14
14
|
(this.h(Tv),this.l=!1,this.fireBufferEnd())}o(c){this.h("ad quartile",c);this.fireQuartile(c)}F(){this.h("ad clicked");const c=this.a&&this.a.qb();this.g.debug(Vv,c);this.fireClick(c)}K(){this.h("ad skipped");this.fireSkip()}A(c){this.a=c.ad;this.h(Sv,this.a);this.fireBreakStart()}B(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){const c=this.plugin.getAdapter();c&&c.fireStop()}}H(c){(c=c.detail)&&10003===c.code&&hw(c,this.m,this.g,this)}h(c,
|
|
15
15
|
...d){this.g.debug(`Reporting "${c}" event to Youbora`,...d)}}return new b(a)};var lw=()=>{class a extends NpawPluginAdapters.video.Shaka{constructor(){super();this.f=this.h=!1;this.a=null}getPlayhead(){return this.getIsLive()?-1:this.player.getPosition()}getDuration(){return this.player.getDuration()}getRendition(){let b=null,c=null,d=null;var e=this.player.getTrackManager();e&&(e=e.na())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)}getIsLive(){return this.player.isLive()}getResource(){const b=
|
|
16
|
-
this.player.getLoadedSource();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.getPlaybackRate()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.Ea())?b.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"castlabs-adapter-6.25.2-
|
|
16
|
+
this.player.getLoadedSource();return b&&b.url}getBitrate(){return this.j().streamBandwidth}getThroughput(){return this.j().estimatedBandwidth}getPlayrate(){return this.player.getPlaybackRate()}getFramesPerSecond(){var b=this.player.getTrackManager();return b&&(b=b.Ea())?b.frameRate:null}getPlayerName(){return _.qa}getVersion(){return"castlabs-adapter-6.25.2-js"}getPlayerVersion(){return _.ea}registerListeners(){const b=this.w();this.player&&b&&(b.on(this.player,_.Kf,this.I.bind(this)),b.on(this.player,
|
|
17
17
|
_.q,this.F.bind(this)),b.on(this.player,_.Cf,this.H.bind(this)),b.on(this.player,_.Bf,this.G.bind(this)),b.on(this.player,_.oc,this.B.bind(this)),b.on(this.player,_.Qc,this.C.bind(this)))}unregisterListeners(){kw.debug(_.wb);_.Dh(this.w())}dispose(){this.unregisterListeners();this.f=this.h=!1;this.a=null}j(){return this.player.getStats()||_.Io()}o(){return!!this.player.getConfiguration().autoplay}I(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.Uo:this.o()&&this.fireStart();
|
|
18
18
|
break;case _.Wo:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.Vo:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.To:this.fireBufferEnd();this.fireStop();break;case _.Lo:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Po:this.fireBufferBegin();break;default:kw.debug(Qv,b)}}A(){this.fireJoin()}F(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=hw(b,this.player,kw,this))&&
|
|
19
|
-
b.severity===_.G&&(this.f=!0)}H(){this.player.isEnded()||(this.l(_.Cf),this.fireSeekBegin())}w(){this.a||(this.a=new _.Nt);return this.a}G(){this.l(_.Bf);this.fireSeekEnd()}B(b){kw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.
|
|
19
|
+
b.severity===_.G&&(this.f=!0)}H(){this.player.isEnded()||(this.l(_.Cf),this.fireSeekBegin())}w(){this.a||(this.a=new _.Nt);return this.a}G(){this.l(_.Bf);this.fireSeekEnd()}B(b){kw.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Jb()}C(b){kw.debug("Casting",b);this.fireCasted()}l(b,...c){kw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},kw=new _.S("clpp.npaw.NpawAdapter");var nw=()=>{class a extends NpawPluginAdapters.ads.Ima{constructor(){super();this.j=this.h=this.l=this.a=null;this.o=!1}getDuration(){return this.a?this.a.getDuration():null}getRendition(){let b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.fb(),this.a.eb(),this.a.Oa()));return b}getBitrate(){let b=null;this.a&&(b=this.a.Oa());return b}getPlayhead(){let b=null;const c=this.player.getAdsManager();c&&(b=c.getPosition());return b}getResource(){let b=null;this.a&&(b=this.a.getMediaUrl());
|
|
20
20
|
return b}getTitle(){let b=null;this.a&&(b=this.a.getTitle());return b}getProvider(){let b=null;this.a&&(b=this.a.getAdvertiserName());return b}getCreativeId(){let b=null;this.a&&(b=this.a.getCreativeId());return b}dispose(){this.unregisterListeners();this.j=this.h=this.a=null}getPosition(){const b=this.getNpawReference().Constants.AdPosition;let c=null;if(this.a)switch(this.a.Pa()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}mw.debug("Ad position",c);return c}getIsSkippable(){return this.a&&
|
|
21
21
|
-1!==this.a.getSkipTimeOffset()}getAudioEnabled(){const b=this.player.getAdsManager();return b&&0<b.getVolume()}getExpectedBreaks(){return this.h&&this.h.getCuePoints().length}getGivenBreaks(){return this.getExpectedBreaks()}getExpectedAds(){return this.a&&this.a.gb()}getGivenAds(){return this.getExpectedAds()}getBreaksTime(){return this.h&&this.h.getCuePoints().map(b=>-1===b?this.player.getDuration():b)}getIsFullscreen(){return this.player.getSurface().isFullscreen()}getIsVisible(){var b=this.player.getSurface().getContainer();
|
|
22
|
-
b=this.getNpawUtils().calculateAdViewability(b);mw.debug(aw,b);return b}getPlayerName(){return _.qa}getVersion(){return"castlabs-ads-adapter-6.25.2-
|
|
23
|
-
_.Wb,this.w.bind(this,1)),b.on(this.player,_.bc,this.w.bind(this,2)),b.on(this.player,_.mc,this.w.bind(this,3)),b.on(this.player,_.Ub,this.H.bind(this)),b.on(this.player,_.
|
|
22
|
+
b=this.getNpawUtils().calculateAdViewability(b);mw.debug(aw,b);return b}getPlayerName(){return _.qa}getVersion(){return"castlabs-ads-adapter-6.25.2-js"}getPlayerVersion(){return _.ea}B(){this.j||(this.j=new _.Nt);return this.j}registerListeners(){const b=this.B();this.player&&b&&(b.on(this.player,_.oc,this.R.bind(this)),b.on(this.player,_.jc,this.P.bind(this)),b.on(this.player,_.cc,this.K.bind(this)),b.on(this.player,_.ec,this.L.bind(this)),b.on(this.player,_.Vb,this.I.bind(this)),b.on(this.player,
|
|
23
|
+
_.Wb,this.w.bind(this,1)),b.on(this.player,_.bc,this.w.bind(this,2)),b.on(this.player,_.mc,this.w.bind(this,3)),b.on(this.player,_.Ub,this.H.bind(this)),b.on(this.player,_.fc,this.M.bind(this)),b.on(this.player,_.q,this.J.bind(this)),b.on(this.player,_.Rb,this.C.bind(this)),b.on(this.player,_.Sb,this.F.bind(this)),b.on(this.player,_.Tb,this.G.bind(this)),b.on(this.player,_.dc,this.S.bind(this)))}unregisterListeners(){_.Dh(this.B())}R(b){mw.debug(Wv,b);this.h=b.adsTimeline}P(b){this.a=b.ad;this.f("ad start",
|
|
24
24
|
this.a);this.fireStart();this.fireJoin()}I(){this.f("ad ended");this.fireStop({adPlayhead:this.l})}K(){this.f("ad pause");this.A();this.firePause()}L(){this.f("ad resume");this.A();this.fireResume()}G(){this.o=!0;this.f(Uv);this.fireBufferBegin()}S(){this.l=this.getPlayhead();this.A()}A(){this.o&&(this.f(Tv),this.o=!1,this.fireBufferEnd())}w(b){this.f("ad quartile",b);this.fireQuartile(b)}H(){this.f("ad clicked");const b=this.a&&this.a.qb();mw.debug(Vv,b);this.fireClick(b)}M(){this.f("ad skipped");
|
|
25
|
-
this.fireSkip()}C(b){this.a=b.ad;this.f(Sv,this.a);this.fireBreakStart()}F(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&hw(b,this.player,mw,this)}f(b,...c){mw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},mw=new _.S("clpp.npaw.NpawAdsAdapter");var ow=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.S(Xv);this.m=null}
|
|
26
|
-
var c=a.youbora;void 0===c[Zv]&&(c[Zv]=b.isLive);void 0===c[$v]&&(c[$v]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.
|
|
27
|
-
ow.prototype.getAdapter=ow.prototype.getAdapter;ow.prototype.getNpawPlugin=ow.prototype.
|
|
28
|
-
a.youbora;void 0===c[Zv]&&(c[Zv]=b.isLive);void 0===c[$v]&&(c[$v]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.
|
|
25
|
+
this.fireSkip()}C(b){this.a=b.ad;this.f(Sv,this.a);this.fireBreakStart()}F(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})}J(b){(b=b.detail)&&10003===b.code&&hw(b,this.player,mw,this)}f(b,...c){mw.debug(`Reporting "${b}" event to NPAW`,...c)}}return a},mw=new _.S("clpp.npaw.NpawAdsAdapter");var ow=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.S(Xv);this.m=null}ff(a){dw(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,lw()),this.a.registerAdsAdapterFromClass(this.m,nw())}Ch(){return this.a}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;ew(this,a)&&(a=a.getConfiguration().youbora,this.ff(new NpawPlugin(a.accountCode)))}onContentWillLoad(a,b){if(ew(this,a)){a=a.getConfiguration();
|
|
26
|
+
var c=a.youbora;void 0===c[Zv]&&(c[Zv]=b.isLive);void 0===c[$v]&&(c[$v]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.ff(new NpawPlugin(c.accountCode));this.a.setAnalyticsOptions(c)}}onContentLoaded(a){const b={};(a=a.getDrmInfo())&&(a=cw(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Ee,b);this.a.setAnalyticsOptions(b)}onPlayerWillRelease(){}onPlayerWillDestroy(){dw(this);this.a.destroy()}id(){return bw}};_.z(Xv,ow);ow.prototype.getAdsAdapter=ow.prototype.getAdsAdapter;
|
|
27
|
+
ow.prototype.getAdapter=ow.prototype.getAdapter;ow.prototype.getNpawPlugin=ow.prototype.Ch;ow.prototype.setNpawPlugin=ow.prototype.ff;ow.Id=bw;new _.S(Xv);var pw=class extends _.Pv{constructor(){super();this.a=null;this.g=new _.S(Yv);this.m=null}gf(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(iw(this.m)),this.a.setAdsAdapter(jw(this.m))}getAdapter(){return this.a&&this.a.getAdapter()}getAdsAdapter(){return this.a&&this.a.getAdsAdapter()}onPlayerCreated(a){this.m=a;fw(this,a)&&(a=a.getConfiguration().youbora,this.gf(new youbora.Plugin(a)))}onContentWillLoad(a,b){if(fw(this,a)){a=a.getConfiguration();var c=
|
|
28
|
+
a.youbora;void 0===c[Zv]&&(c[Zv]=b.isLive);void 0===c[$v]&&(c[$v]=b.name);void 0===c.viewerId&&(c.viewerId=a.viewerId);this.a||this.gf(new youbora.Plugin(c));this.a.setOptions(c)}}onPlayerWillRelease(){}onPlayerWillDestroy(){}id(){return bw}};_.z(Yv,pw);pw.prototype.getAdsAdapter=pw.prototype.getAdsAdapter;pw.prototype.getAdapter=pw.prototype.getAdapter;pw.prototype.setYouboraPlugin=pw.prototype.gf;pw.Id=bw;_.Ir(new class{create(a){return a.youbora&&a.youbora.v7?new ow:new pw}});};f.call(g, window);
|
package/package.json
CHANGED
package/typings.d.ts
CHANGED
|
@@ -5041,6 +5041,15 @@ export namespace clpp {
|
|
|
5041
5041
|
* A user prompt was shown and the user denied access.
|
|
5042
5042
|
* The key system is not available from unsecure contexts. (ie.
|
|
5043
5043
|
* requires HTTPS) See https://goo.gl/EEhZqT.
|
|
5044
|
+
* In case of Widevine this issue may be resolved by setting the flags
|
|
5045
|
+
* distinctiveIdentifierRequired and/or
|
|
5046
|
+
* persistentStateRequired to either true of false depending
|
|
5047
|
+
* on the platform, see {@link /#/docs/drm#cdm-configuration|DRM docs}
|
|
5048
|
+
* for more details.
|
|
5049
|
+
* Try {@link /#/cdm|CDM probe page} to check which CDMs and CDM
|
|
5050
|
+
* configurations are supported by your browser.
|
|
5051
|
+
* Note that the use of distinctive identifiers may present
|
|
5052
|
+
* {@link https:\\/\\/www.w3.org/TR/encrypted-media/#identifier-requirements|privacy concerns}.
|
|
5044
5053
|
*
|
|
5045
5054
|
*/
|
|
5046
5055
|
REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE = 6001,
|