@castlabs/prestoplay 6.18.0 → 6.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +115 -114
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +578 -576
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +77 -75
  10. package/cjs/cl.externs.js +174 -292
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +70 -71
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +312 -311
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +16 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +29 -28
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +13 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +18 -18
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +90 -89
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +475 -474
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +71 -70
  40. package/cl.externs.js +171 -293
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +74 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +276 -274
  47. package/cl.muxdata.js +13 -13
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +11 -11
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +57 -57
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +8 -8
  59. package/cl.vr.js +14 -14
  60. package/cl.vtt.js +12 -12
  61. package/cl.youbora.js +15 -15
  62. package/clpp.styles.css +14 -0
  63. package/package.json +1 -1
  64. package/typings.d.ts +379 -384
package/cjs/cl.tizen.js CHANGED
@@ -1,75 +1,75 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var ON="An unknown error occurred while trying to get volume",PN="Cannot get loading rendition due to platform limitations",QN="PARAM_START_POSITION",RN="SecurityError",SN="The require privilege is: http://tizen.org/privilege/tv.audio",TN="|STARTBITRATE\x3d",UN=function(a,b,c){function d(e){c.call(a,e);a.removeEventListener(b,d)}a.addEventListener(b,d)},VN=function(a,b){this.h=a;this.o=null;this.a=_.Ze;this.l=null;this.j=!1;this.f=new Map;this.C=b;this.g=new _.K("clpp.tizen.DrmEngine")},YN=function(a){var b,
3
- c,d;return _.I(function(e){if(1==e.a){b=a.a===_.Vd||a.a===_.Td;if(!b)throw new _.N(_.O,6,6001,"The key system "+a.a+" is not supported by the player or the platform");c=a.f.get(a.a);if(!c.Vd)throw new _.N(_.O,6,6012,"No license server given for "+a.a);_.D(e,2);return a.a===_.Vd?_.y(e,WN(a),5):_.y(e,XN(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.Vd,distinctiveIdentifierRequired:!1,persistentStateRequired:c.Zf,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],
4
- keyIds:[],periodId:null},_.th(e,0);d=_.E(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.N(_.O,6,6005,{message:JSON.stringify(d)});})},XN=function(a,b){var c,d,e,f;return _.I(function(g){c=ZN;d=$N;e={};e[d.Hi]=!b.Zf;e[d.Ji]=b.Vd;""!==b.customData&&(e[d.Gi]=b.customData);f=JSON.stringify(e);a.g.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(h){throw h;}_.B(g)})},WN=function(a){var b;return _.I(function(c){b=ZN;try{webapis.avplay.setDrm(b.je,
5
- "Initialize",""),webapis.avplay.setDrm(b.je,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.je,"widevine_data_type",a.l.type)}catch(d){throw d;}_.B(c)})},aO=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,G,F;_.I(function(C){if(1==C.a){c=ZN;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.Vd;l=_.Mj([h],_.Jj());l.type=3;l.body=f.buffer;l.method=
6
- _.Mb;_.D(C,2);return _.y(C,a.C.wb.fetch(l).P,4)}if(2!=C.a){m=C.f;if(a.j){n=_.oj(m.data);p=n.byteLength;q="";for(u=0;u<p;u++)q+=String.fromCharCode(n[u]);v=btoa(q);z=b.session_id+QN+(v+QN);a.g.debug("Widevine license params",z);try{webapis.avplay.setDrm(c.je,"widevine_license_data",z)}catch(H){a.g.error("License response rejected by CDM"),A=new _.N(_.O,6,6008,{browserError:JSON.stringify(H)}),a.C.onError(A)}}return _.th(C,0)}G=_.E(C);a.g.error("License request failed.",JSON.stringify(G));F=new _.N(_.O,
7
- 6,6007,{message:_.cb,url:G.data.url,status:G.data.status||NaN,response:G.data.response||"",headers:G.data.headers||{}},G);a.C.onError(F);_.B(C)})},bO=function(a){this.m=a;this.a=this.m.a;this.f=_.np;this.j=_.op;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.K("clpp.tizen.StateManager")},dO=function(a,b){if(a.f!==b)if(a.f===_.yp&&b!==_.np)a.g.debug(_.OB+cO(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;a.f===_.sp?(a.o=(new Date).getTime(),a.m.trigger(new _.L(_.od,{detail:{bufferedTimeMS:-1,
8
- reason:a.h}}))):a.j===_.sp&&a.m.trigger(new _.L(_.nd,{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(_.jg,{detail:d}));a.g.debug("State changed:",cO(a.j),"-\x3e",cO(a.f))}},cO=function(a){return Object.keys(_.wp)[a]},gO=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case eO:c=_.Bp;break;case fO:c=_.Ap;break;default:a.m.isEnded()?c=_.up:a.g.debug("Inconsistent AVPlay playback state:",b)}dO(a,
9
- c)}},hO=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")},iO=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},jO=function(a){var b,c;return _.I(function(d){if(1==d.a)return b=a.m.getConfiguration(),c=null,_.y(d,_.Pt(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
- kO=function(a){var b=document.createElement(_.r),c=new _.xE,d=new _.YC,e=a.m.getTextDisplayer();return new _.zE(b,c,e,d,a.m.getConfiguration())},lO=function(a){var b={configuration:{},Hb:function(){return a.m.getPosition()},W:a.h,wb:a.m.getNetworkEngine(),Qf:a.gk.bind(a),Pf:a.fk.bind(a),onError:a.T.bind(a),Vh:function(){},onEvent:function(){},Zh:a.hk.bind(a),Le:function(){},we:function(){return new _.BF},mf:function(){return!1},yd:null};return new _.vG(a.a,b)},mO=function(a){var b=a.m.getPosition(),
11
- 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},nO=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 _.hk(String(c++),_.T);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=
12
- a[d].kind||_.tC;var f=new _.sk(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},oO=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.yG(a.f,_.P),c=null;if(b){a=nO(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},pO=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===_.ue,a.a&&a.f)){a.setTextVisibility(!0);
13
- var c=mO(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):(_.JG(a.f,c,!0,0),a.m.trigger(new _.L(_.Sl))),a.o=c.language):a.g.error(_.NB,d.id)}},qO=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},rO=function(a,b){a.m.trigger(new _.L(_.Og,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},
14
- sO=function(a){var b=a.na();b&&a.m.trigger(new _.L(_.ld,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},tO=function(a){var b=a.m.getConfiguration(),c=_.mi(b.preferredAudioLanguage||[]),d=a.f[_.jk]||[];if(d.length){var e=null;c.some(function(g){e=_.PC(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.Ba(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},xO=function(a,b){if(b){var c=b.track.type.toUpperCase();uO(a.a,c,Number(b.id)).then(function(){c===vO&&(a.j=b,a.m.trigger(new _.L(_.Rl)));c===wO&&(a.l=b,a.m.trigger(new _.L(_.Sl)))})["catch"](function(){a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},yO=
16
- function(a,b,c){var d=_.gj(b.language||_.yg);c.language=_.ik(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.hd;a=new _.sk(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},zO=function(a,b,c){c.mimeType=_.Mg;a=new _.sk(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},AO=function(a,b,c){b=_.gj(b.track_lang||_.yg);c.mimeType="text/ttml";
17
- c.language=_.ik(b);c.originalLanguage=b;c.kind=_.tC;return new _.sk(String(a),c)},BO=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},EO=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===CO}),f=b.filter(function(n){return n.type===vO}),g=[],h=0;h<f.length;h++){var l=BO(a,f[h].extra_info);if(l){var m=
18
- _.gj(l.language||_.yg);m=_.ik(m);m=c(g,m);m||(m=new _.hk(String(a.o++),_.jk),g.push(m));m.renditions.push(yO(f[h].index,l,m))}else a.g.warn("Skipping audio stream with no extra info")}f=new _.hk(String(a.o++),_.kk);for(h=0;h<e.length;h++)(l=BO(a,e[h].extra_info))?f.renditions.push(zO(e[h].index,l,f)):a.g.warn("Skipping video stream with no extra info");e=[];e=a.h?nO(a.h):DO(a,b);d[_.kk]=[f];d[_.jk]=g;d[_.T]=e;return d},DO=function(a,b){for(var c=b.filter(function(h){return h.type===wO}),d=[],e=0;e<
19
- c.length;e++){var f=BO(a,c[e].extra_info);if(f){var g=new _.hk(String(a.o++),_.T);g.renditions.push(AO(c[e].index,f,g));d.push(g)}else a.g.warn("Skipping text stream with no extra info")}return d},FO=function(a,b){for(var c=a.f[_.kk]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.M.la(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},GO=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},IO=function(a,b){if(b===_.T&&a.h)return oO(a.h);var c=HO(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===b.toUpperCase()})[0];var d=null;b===_.kk&&(d=BO(a,c.extra_info),d=FO(a,{width:d.Width,height:d.Height}));b===_.jk&&(c?(d=GO(a,c,_.jk),a.j=d):d=a.j);b===_.T&&(c?(d=GO(a,c,_.T),a.l=d):d=a.l);return d},JO=function(a){_.Yl.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={}},KO=function(a){return _.I(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;});_.B(b)})},MO=function(a){try{webapis.avplay.setListener({onbufferingstart:a.ak.bind(a),onbufferingprogress:a.$j.bind(a),onbufferingcomplete:a.Zj.bind(a),onstreamcompleted:a.dk.bind(a),oncurrentplaytime:function(b){a.trigger(new _.L(LO,
22
- {currentTime:b}))},onevent:a.ck.bind(a),onsubtitlechange:a.ek.bind(a),ondrmevent:a.bk.bind(a),onerror:a.T.bind(a)})}catch(b){a.g.error(b)}},NO=function(a){var b=!!a.m.getTrackManager().Ja();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",c)}},OO=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.g.debug({estimatedBandwidth:c,Yn:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",TN+d)}catch(e){a.g.debug(e)}},
23
- PO=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+TN+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",c),c;}},SO=function(a){return{position:a.getPosition(),state:a.m.getState(),Cg:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:QO(a),volume:a.getVolume(),un:RO(a),wk:HO(a)}},UO=function(a){var b,c;return _.I(function(d){if(1==d.a)return _.y(d,TO(),2);if(3!=d.a)return b=new Promise(function(e){(new _.Zk(e)).da(5)}),
24
- _.y(d,Promise.race([KO(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"));_.B(d)})},$O=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:a.l=_.Fp(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(VO)),f=c.currentPosition);
25
- _.D(p,2);g=a.l[d].url;h=a.l[d].type;h!==_.Wc||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);e.nextBandwidth?(PO(a,e.nextBandwidth),a.o=!1):(a.o||OO(a,e),a.o=!0);MO(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)},wb:a.m.getNetworkEngine()};a.h=new VN(b.drm,m);return _.y(p,a.h.init(),4);case 4:return a.f||a.trigger(new _.L(WO)),
26
- _.y(p,XO(a),6);case 6:a.f||a.trigger(new _.L(YO));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&&ZO(a,b.muted),b.autoplay&&a.m.play()["catch"](function(q){a.g.debug("Autoplay failed",q)}));_.th(p,0);break;case 2:throw n=_.E(p),a.g.debug("Error while attempting to load source."),n;}})},XO=function(a){return _.I(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
- NO(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)}}))})},aP=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=SO(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(function(){var e=a.a.Cg;a.f=!1;a.a=
28
- null;return e===fO?a.pause():a.play()})}catch(e){return Promise.reject(e)}},RO=function(a){return a.f&&a.a?a.a.un:webapis.avplay.getTotalTrackInfo()},HO=function(a){return a.f&&a.a?a.a.wk:webapis.avplay.getCurrentStreamInfo()},uO=function(a,b,c){b=b.toUpperCase();b===wO&&bP(a,!0);var d=a.j[b];d&&(d.Re.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,zg:0,Re:new _.Zk(function(){return g(h,c,!0)})}),(l=a.j[h])&&3>l.zg?(!a.w&&++l.zg,l.Re.da(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),l&&l.Re.stop(),a.j[h]=null,f())}}g(b,c)})},bP=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)}},ZO=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case RN:a.g.warn("The application does not have the privilege to set mute.",SN);break;default:a.g.warn(ON,c)}}},QO=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case RN:a.g.warn("The application doesn't have the privilege to get the mute state.",SN);break;default:a.g.warn(ON,c)}}return!!b},TO=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");
31
- UN(c,"load",function(d){return a(d)});UN(c,_.te,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},cP=function(){_.Yl.call(this);this.a=new JO(this);this.f=new bO(this);this.configuration=this.B=_.dm();this.w=null;this.g=new _.K("clpp.tizen.Player");this.j=null;this.l=new qO;this.D=new _.dk;this.o=this.h=null;this.A=!1},dP=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())},eP=function(){},fP=function(){};
33
- VN.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.I(function(h){if(1==h.a){b=_.ym[a.h.env]||null;if(!b)throw a.g.debug(_.Aa,_.Sb+a.h.env+_.ba),new _.N(_.O,6,6015,_.Da+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=_.Am(b,a.h.customData);(e=d[_.Td])&&a.f.set(_.Td,{Vd:e.licenseUrl||"",customData:c,Zf:!1});(f=d[_.Vd])&&a.f.set(_.Vd,{Vd:f.licenseUrl||"",customData:c,
34
- Zf:!1});if(0===a.f.size)throw new _.N(_.O,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Td))a.a=_.Td;else if(a.f.get(_.Vd))a.a=_.Vd;else throw new _.N(_.O,6,6001,"Configuration for the target system is missing.");return _.y(h,YN(a),2)}a.j=!0;_.B(h)})};VN.prototype.release=function(){var a=this;return _.I(function(b){a.j=!1;a.o=null;a.a=_.Ze;a.l=null;a.f=new Map;_.B(b)})};VN.prototype.getDrmInfo=function(){return this.o};
35
- var $N={Hi:"DeleteLicenseAfterUse",Ji:"LicenseServer",Kn:"GetChallenge",Ln:"HttpHeader",Nn:"UserAgent",Fn:"Cookie",Gi:"CustomData"};_.t=bO.prototype;_.t.initialize=function(){this.a.on(VO,this.Xg,this);this.a.on(gP,this.Wg,this);this.a.on(hP,this.Vg,this);this.a.on(WO,this.bi,this);this.a.on(YO,this.ai,this);this.a.on(iP,this.Yg,this)};_.t.release=function(){dO(this,_.np);this.l=!1;this.o=-1;this.h=2};_.t.destroy=function(){this.release();this.a.off(VO,this.Xg);this.a.off(gP,this.Wg);this.a.off(hP,this.Vg);this.a.off(WO,this.bi);this.a.off(YO,this.ai);this.a.off(iP,this.Yg);this.m=this.a=null};
36
- _.t.Xg=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;dO(this,_.sp)};_.t.Wg=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",cO(this.f))};_.t.Vg=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()===jP;if(!a&&b){dO(this,_.Ap);return}}if(a=this.f!==_.zp)a=this.a.getState(),a=a===eO||a===fO;a&&gO(this)};
37
- _.t.bi=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===kP?dO(this,_.zp):this.g.error("AVPlay prepares while state is not IDLE")};_.t.ai=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.t.Yg=function(){dO(this,_.up)};_.t.getState=function(){return this.f};_.t=hO.prototype;_.t.initialize=function(a){this.m=a};
38
- _.t.load=function(a){var b=this,c,d,e,f,g,h,l;return _.I(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,jO(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(){}};_.D(m,3);e=b;return _.y(m,b.j.start(a.url,d),5);case 5:e.a=m.f;_.th(m,4);break;case 3:return f=_.E(m),b.g.warn(f),_.D(m,6),g=b,_.y(m,b.j.start(a.url.replace("https://","http://"),d),8);case 8:g.a=m.f;_.th(m,4);break;case 6:h=_.E(m),b.g.error(h),b.a=null;case 4:if(!b.a||!iO(b.a)){m.F(0);break}b.h=kO(b);_.D(m,10);return _.y(m,b.h.open(),12);case 12:b.f=lO(b);l=b.m.getConfiguration();b.f.h=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;b.D=l.preferForcedSubtitles;
40
- _.th(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,_.B(m)}})};_.t.gk=function(a){this.g.debug(_.lC,a);this.w=!0;var b=_.$E(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.fk=function(){this.g.debug("canSwitch_");this.w=!1;this.l&&(_.JG(this.f,this.l,!0,0),this.l=null)};_.t.T=function(){this.g.debug("onError_")};
41
- _.t.hk=function(){this.j&&this.j.update&&this.j.update()};_.t.start=function(){var a=this;return _.I(function(b){if(!a.f)return b["return"]();try{a.f.start()}catch(c){a.g.error("Error while starting streaming engine",c)}_.B(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 _.I(function(b){a.m=null;a.a=null;a.B=null;a.A=null;a.o=null;a.w=!0;a.l=null;_.B(b)})};
42
- _.t.destroy=function(){var a=this;return _.I(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,_.B(b)}})};_.x(qO,_.U);_.t=qO.prototype;_.t.Rh=function(a){var b=a.eventid;a=a.data;switch(b){case lP:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+BO(this,b[0].extra_info).Bit_rate,b=FO(this,{bandwidth:b}))&&(this.w=b,rO(this,b));break;case mP:sO(this);break;default:this.g.debug("Event type: "+b+" data: "+a)}};_.t.Uf=function(a){a.detail.currentState===_.Bp&&this.m.off(_.jg,this.Uf)};
43
- _.t.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.jg,function(c){b.A||(c=c.detail,c.currentState===_.Bp&&(b.g.debug("Current state",c.currentState),b.A=!0,tO(b)))});this.a.on(nP,this.Rh,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(_.jg,this.Uf);this.m.on(_.jg,this.Uf,this);try{var a=RO(this.a);this.f=EO(this,a);var b=this.f[_.jk]||[];b.length&&(this.j=b[0].renditions[0]||null);sO(this)}catch(c){this.g.debug("Could not load track manager")}}};_.t.destroy=function(){this.a.off(nP,this.Rh);this.a=this.m=null};_.t.getVideoTracks=function(){return this.f[_.kk]||[]};_.t.getAudioTracks=function(){return this.f[_.jk]||[]};
45
- _.t.ia=function(){return this.f[_.T]||[]};_.t.na=function(){return IO(this,_.kk)};_.t.Qa=function(){return IO(this,_.jk)};_.t.Ja=function(){return IO(this,_.T)};_.t.fb=function(){return this.w};_.t.ob=function(){this.g.info(PN);return null};_.t.pb=function(){this.g.info(PN);return null};_.t.Ka=function(){var a=this.na();return a?a.track:null};_.t.ma=function(){var a=this.Qa();return a?a.track:null};_.t.wa=function(){var a=this.Ja();return a?a.track:null};
46
- _.t.lb=function(a){var b=this;null===a?(a=this.na(),aP(this.a,a.bandwidth,null).then(function(){sO(b)})):0<a.renditions.length&&this.$a(a.renditions[0])};_.t.Ba=function(a){a?xO(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.t.Ma=function(a){a?(a=a.renditions[0],this.h?pO(this.h,a.track):xO(this,a)):(this.g.debug("Disabling text tracks"),this.l=null,bP(this.a,!1),this.m.trigger(new _.L(_.Sl)))};
47
- _.t.$a=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,rO(this,a),aP(this.a,c.bandwidth,a.bandwidth).then(function(){sO(b)})["catch"](function(d){var e=new _.N(_.O,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.jb=function(a){xO(this,a)};_.t.kb=function(a){this.h?pO(this.h,a.track):xO(this,a)};
48
- _.t.addTextTrack=function(){};_.t.ra=function(){return this.a.o};qO.prototype.isAbrEnabled=qO.prototype.ra;qO.prototype.addTextTrack=qO.prototype.addTextTrack;qO.prototype.setTextRendition=qO.prototype.kb;qO.prototype.setAudioRendition=qO.prototype.jb;qO.prototype.setVideoRendition=qO.prototype.$a;qO.prototype.setTextTrack=qO.prototype.Ma;qO.prototype.setAudioTrack=qO.prototype.Ba;qO.prototype.setVideoTrack=qO.prototype.lb;qO.prototype.getTextTrack=qO.prototype.wa;qO.prototype.getAudioTrack=qO.prototype.ma;
49
- qO.prototype.getVideoTrack=qO.prototype.Ka;qO.prototype.getLoadingTextRendition=qO.prototype.pb;qO.prototype.getLoadingAudioRendition=qO.prototype.ob;qO.prototype.getLoadingVideoRendition=qO.prototype.fb;qO.prototype.getTextRendition=qO.prototype.Ja;qO.prototype.getAudioRendition=qO.prototype.Qa;qO.prototype.getVideoRendition=qO.prototype.na;qO.prototype.getTextTracks=qO.prototype.ia;qO.prototype.getAudioTracks=qO.prototype.getAudioTracks;qO.prototype.getVideoTracks=qO.prototype.getVideoTracks;_.x(JO,_.Yl);_.t=JO.prototype;_.t.ak=function(){this.w=!0;this.f||this.trigger(new _.L(VO))};_.t.$j=function(a){this.w=!0;this.trigger(new _.L(gP,{percent:a}))};_.t.Zj=function(){this.w=!1;this.trigger(new _.L(hP))};_.t.dk=function(){this.trigger(new _.L(iP))};_.t.ck=function(a,b){this.trigger(new _.L(nP,{eventid:a,data:b}))};_.t.ek=function(a,b,c,d,e){this.trigger(new _.L(oP,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
50
- _.t.bk=function(a,b){this.trigger(new _.L(pP,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Vd&&"Challenge"===b.name)aO(c,b);else if("DrmError"===b.name){c.g.debug("DrmError event",b);var d=new _.N(_.O,6,6005,{message:JSON.stringify(b)});c.C.onError(d)}}};_.t.T=function(a){this.trigger(new _.L(qP,{eventType:a}))};
51
- _.t.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(LO,f,b);g=setTimeout(function(){b.off(LO,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===kP)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){NO(b);d(webapis.avplay.play())},function(f){b.trigger(new _.L(qP));e(f)})})).then(function(){return a()});if(c===fO||c===jP)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===eO?
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()===fO?Promise.resolve():Promise.reject()};
53
- _.t.setPlaybackRate=function(a){var b=this.getState();if(b===jP||b===eO||b===fO){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 _.I(function(e){switch(e.a){case 1:return c.g.debug("configure()",b||""),_.D(e,2),_.y(e,UO(c),4);case 4:return _.y(e,$O(c,a,b),5);case 5:_.th(e,0);break;case 2:throw d=_.E(e),new _.N(_.O,7,7003,null,d);}})};_.t.getState=function(){if(this.f&&this.a)return this.a.Cg;try{return webapis.avplay.getState()}catch(a){this.T(JSON.stringify(a))}};
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(_.Gg));webapis.avplay.seekTo(c,function(){b.B=!1;b.m.trigger(new _.L(_.Dg));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.Re.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 RN:this.g.debug("The application does not have the privilege to get the volume.",SN);break;default:this.g.debug(ON,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 RN:this.g.warn("The application does not have the privilege to set the volume.",SN);break;default:this.g.warn("An unknown error occurred while trying to set volume",b)}}};
58
- _.t.isLive=function(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.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 kP="IDLE",jP="READY",eO="PLAYING",fO="PAUSED",CO=_.nc,vO="AUDIO",wO="TEXT",mP="PLAYER_MSG_RESOLUTION_CHANGED",lP="PLAYER_MSG_BITRATE_CHANGE",ZN={PLAYREADY:"PLAYREADY",Hn:"EME_PLAYREADY",On:"VERIMATRIX",je:"WIDEVINE_CDM",In:"EME_WIDEVINE_CDM",Qn:"WIDEVINE_CLASSIC"};_.x(cP,_.Yl);_.t=cP.prototype;_.t.Tg=function(){var a=this;this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.L(_.se));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.g.debug("Could not loop playback")}):this.a.stop()};_.t.Rg=function(a){this.trigger(new _.L(_.ug,{currentTime:a.currentTime/1E3}))};
60
- _.t.Ug=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.kg(d))&&this.o.append([new _.xi(b,c,d)],[])};_.t.Sg=function(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.t.Th=function(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)};
61
- _.t.T=function(a){this.g.debug("Error: TYPE: "+a.eventType);dO(this.f,_.yp);a=new _.N(_.O,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.L(_.te,{detail:a}))};
62
- _.t.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(iP,this.Tg,this);this.a.on(LO,this.Rg,this);this.a.on(oP,this.Ug,this);this.a.on(pP,this.Sg,this);this.a.on(qP,this.T,this);this.a.on(hP,this.Th,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();var c=rP;rP+=1;this.j=_.Yp(_.$e,{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=[_.Zg,_.xe,"position",_.Fe,"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];_.$p(c,f);dP(this)}};_.t.getSurface=function(){return this.w};_.t.getConfiguration=function(){return this.configuration};_.t.getTimeline=function(){return null};_.t.setupPlaylist=function(){return Promise.reject(_.Ib)};_.t.appendLoad=function(){return Promise.reject(_.Ib)};
64
- _.t.seekWith=function(){return Promise.reject(_.Ib)};_.t.destroy=function(){var a=this;return _.I(function(b){switch(b.a){case 1:return _.y(b,a.release(),2);case 2:a.a.off(iP,a.Tg);a.a.off(LO,a.Rg);a.a.off(oP,a.Ug);a.a.off(pP,a.Sg);a.a.off(qP,a.T);a.a.off(hP,a.Th);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,_.B(b)}})};_.t.namespace=function(){return sP};
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()===_.up?this.getDuration():this.a.getPosition()||0};
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
- _.t.getBufferInfo=function(){this.g.warn(_.va);return new _.Xl};_.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 _.I(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,_.B(b)}})};
68
- _.t.load=function(a){var b=this,c,d,e,f,g;return _.I(function(h){switch(h.a){case 1:b.configuration=_.fm(b.B,a);c=_.bp(b.configuration,[_.ze,"native"]);b.o=c.create(b);d=_.Fp(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){h.F(2);break}b.h=new hO;b.h.initialize(b);_.D(h,3);return _.y(h,b.h.load(d),5);case 5:b.h.start();_.th(h,2);break;case 3:f=_.E(h),b.g.error(f);case 2:return _.D(h,6),_.y(h,b.a.load(b.configuration),8);case 8:_.th(h,7);break;case 6:throw g=
69
- _.E(h),b.onError(g),g;case 7:b.l.load(),_.B(h)}})};_.t.play=function(){var a=this;this.trigger(new _.L(_.of));dP(this);return this.a.play().then(function(){gO(a.f)})};_.t.pause=function(){var a=this;return this.a.pause().then(function(){gO(a.f)})};_.t.getState=function(){return this.f.getState()};_.t.getPeriods=function(){return[]};_.t.onError=function(a){var b=new _.L(_.te,{detail:a});a.severity===_.O&&(dO(this.f,_.yp),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()===_.up};_.t.isPaused=function(){return this.a.getState()===fO};_.t.isMuted=function(){return QO(this.a)};_.t.setMuted=function(a){ZO(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 eP).canPlay(a,b)};_.t.getTimelineCues=function(){return[]};_.t.getTextDisplayer=function(){return this.o};_.t.resetAbr=function(){};cP.prototype.getTextDisplayer=cP.prototype.getTextDisplayer;cP.prototype.setNetworkEngine=cP.prototype.setNetworkEngine;cP.prototype.getNetworkEngine=cP.prototype.getNetworkEngine;var sP="clpp.tizen",rP=0;eP.prototype.a=function(){return sP};
72
- eP.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Wc||a===_.Il||a===_.ad)&&b){if(_.Yj(2))return 2;if(_.Yj(3)||_.Yj(4)||_.Yj(5)||_.Yj(6))return _.Ih("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};eP.prototype.f=function(a){return a===_.qa};eP.prototype.create=function(){return new cP};_.x(fP,_.Ts);fP.prototype.f=function(){_.Sh(new eP)};fP.prototype.a=function(){var a=sP;a&&_.Qh[a]&&(delete _.Qh[a],_.Rh.info("Removed Player factory: '"+a+"'"))};fP.prototype.id=function(){return"tizen"};_.J("clpp.tizen.TizenComponent",fP);var VO="onbufferingstart",gP="onbufferingprogress",hP="onbufferingcomplete",iP="onstreamcompleted",LO="oncurrentplaytime",nP="onevent",oP="onsubtitlechange",pP="ondrmevent",qP="onerror",WO="preparingstart",YO="preparingend";};
2
+ var f=function(window){var XN="An unknown error occurred while trying to get volume",YN="Cannot get loading rendition due to platform limitations",ZN="PARAM_START_POSITION",$N="SecurityError",aO="The require privilege is: http://tizen.org/privilege/tv.audio",bO="|STARTBITRATE\x3d",cO=function(a,b,c){function d(e){c.call(a,e);a.removeEventListener(b,d)}a.addEventListener(b,d)},dO=function(a,b){this.h=a;this.o=null;this.a=_.Te;this.l=null;this.j=!1;this.f=new Map;this.D=b;this.g=new _.K("clpp.tizen.DrmEngine")},gO=function(a){var b,
3
+ c,d;return _.I(function(e){if(1==e.a){b=a.a===_.Pd||a.a===_.Nd;if(!b)throw new _.N(_.O,6,6001,"The key system "+a.a+" is not supported by the player or the platform");c=a.f.get(a.a);if(!c.Zd)throw new _.N(_.O,6,6012,"No license server given for "+a.a);_.D(e,2);return a.a===_.Pd?_.y(e,eO(a),5):_.y(e,fO(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.Zd,distinctiveIdentifierRequired:!1,persistentStateRequired:c.eg,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],
4
+ keyIds:[],periodId:null},_.oh(e,0);d=_.F(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.N(_.O,6,6005,{message:JSON.stringify(d)});})},fO=function(a,b){var c,d,e,f;return _.I(function(g){c=hO;d=iO;e={};e[d.Si]=!b.eg;e[d.Ui]=b.Zd;""!==b.customData&&(e[d.Ri]=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)})},eO=function(a){var b;return _.I(function(c){b=hO;try{webapis.avplay.setDrm(b.ne,
5
+ "Initialize",""),webapis.avplay.setDrm(b.ne,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.ne,"widevine_data_type",a.l.type)}catch(d){throw d;}_.A(c)})},jO=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,C,H,E;_.I(function(B){if(1==B.a){c=hO;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.Zd;l=_.Jj([h],_.Gj());l.type=3;l.body=f.buffer;l.method=
6
+ _.Ib;_.D(B,2);return _.y(B,a.D.Jb.fetch(l).U,4)}if(2!=B.a){m=B.f;if(a.j){n=_.lj(m.data);p=n.byteLength;q="";for(t=0;t<p;t++)q+=String.fromCharCode(n[t]);v=btoa(q);z=b.session_id+ZN+(v+ZN);a.g.debug("Widevine license params",z);try{webapis.avplay.setDrm(c.ne,"widevine_license_data",z)}catch(G){a.g.error("License response rejected by CDM"),C=new _.N(_.O,6,6008,{browserError:JSON.stringify(G)}),a.D.onError(C)}}return _.oh(B,0)}H=_.F(B);a.g.error("License request failed.",JSON.stringify(H));E=new _.N(_.O,
7
+ 6,6007,{message:_.$a,url:H.data.url,status:H.data.status||NaN,response:H.data.response||"",headers:H.data.headers||{}},H);a.D.onError(E);_.A(B)})},kO=function(a){this.m=a;this.a=this.m.a;this.f=_.jp;this.j=_.kp;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.K("clpp.tizen.StateManager")},mO=function(a,b){if(a.f!==b)if(a.f===_.up&&b!==_.jp)a.g.debug(_.MB+lO(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;a.f===_.op?(a.o=(new Date).getTime(),a.m.trigger(new _.L(_.ld,{detail:{bufferedTimeMS:-1,
8
+ reason:a.h}}))):a.j===_.op&&a.m.trigger(new _.L(_.kd,{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(_.cg,{detail:d}));a.g.debug("State changed:",lO(a.j),"-\x3e",lO(a.f))}},lO=function(a){return Object.keys(_.sp)[a]},pO=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case nO:c=_.xp;break;case oO:c=_.wp;break;default:a.m.isEnded()?c=_.qp:a.g.debug("Inconsistent AVPlay playback state:",b)}mO(a,
9
+ c)}},qO=function(){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 _.K("clpp.tizen.TextStreamer")},rO=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},sO=function(a){var b,c;return _.I(function(d){if(1==d.a)return b=a.m.getConfiguration(),c=null,_.y(d,_.Qt(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
+ tO=function(a){var b=document.createElement(_.r),c=new _.wE,d=new _.XC,e=a.m.getTextDisplayer();return new _.yE(b,c,e,d,a.m.getConfiguration())},uO=function(a){var b={configuration:{},Pb:function(){return a.m.getPosition()},W:a.h,Jb:a.m.getNetworkEngine(),Uf:a.tk.bind(a),Tf:a.sk.bind(a),onError:a.S.bind(a),di:function(){},onEvent:function(){},ii:a.uk.bind(a),Qe:function(){},ze:function(){return new _.BF},rf:function(){return!1},Gd:null};return new _.wG(a.a,b)},vO=function(a){var b=a.m.getPosition(),
11
+ 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},wO=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 _.dk(String(c++),_.T);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=
12
+ a[d].kind||_.rC;var f=new _.ok(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},xO=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.zG(a.f,_.P),c=null;if(b){a=wO(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},yO=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===_.pe,a.a&&a.f)){a.setTextVisibility(!0);
13
+ var c=vO(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):(_.KG(a.f,c,!0,0),a.m.trigger(new _.L(_.Ol))),a.o=c.language):a.g.error(_.LB,d.id)}},zO=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},AO=function(a,b){a.m.trigger(new _.L(_.Jg,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},
14
+ BO=function(a){var b=a.na();b&&a.m.trigger(new _.L(_.id,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},CO=function(a){var b=a.m.getConfiguration(),c=_.hi(b.preferredAudioLanguage||[]),d=a.f[_.fk]||[];if(d.length){var e=null;c.some(function(g){e=_.OC(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.Da(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},GO=function(a,b){if(b){var c=b.track.type.toUpperCase();DO(a.a,c,Number(b.id)).then(function(){c===EO&&(a.j=b,a.m.trigger(new _.L(_.Nl)));c===FO&&(a.l=b,a.m.trigger(new _.L(_.Ol)))})["catch"](function(){a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},HO=
16
+ function(a,b,c){var d=_.cj(b.language||_.sg);c.language=_.ek(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.dd;a=new _.ok(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},IO=function(a,b,c){c.mimeType=_.Hg;a=new _.ok(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},JO=function(a,b,c){b=_.cj(b.track_lang||_.sg);c.mimeType="text/ttml";
17
+ c.language=_.ek(b);c.originalLanguage=b;c.kind=_.rC;return new _.ok(String(a),c)},KO=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},NO=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===LO}),f=b.filter(function(n){return n.type===EO}),g=[],h=0;h<f.length;h++){var l=KO(a,f[h].extra_info);if(l){var m=
18
+ _.cj(l.language||_.sg);m=_.ek(m);m=c(g,m);m||(m=new _.dk(String(a.o++),_.fk),g.push(m));m.renditions.push(HO(f[h].index,l,m))}else a.g.warn("Skipping audio stream with no extra info")}f=new _.dk(String(a.o++),_.gk);for(h=0;h<e.length;h++)(l=KO(a,e[h].extra_info))?f.renditions.push(IO(e[h].index,l,f)):a.g.warn("Skipping video stream with no extra info");e=[];e=a.h?wO(a.h):MO(a,b);d[_.gk]=[f];d[_.fk]=g;d[_.T]=e;return d},MO=function(a,b){for(var c=b.filter(function(h){return h.type===FO}),d=[],e=0;e<
19
+ c.length;e++){var f=KO(a,c[e].extra_info);if(f){var g=new _.dk(String(a.o++),_.T);g.renditions.push(JO(c[e].index,f,g));d.push(g)}else a.g.warn("Skipping text stream with no extra info")}return d},OO=function(a,b){for(var c=a.f[_.gk]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.M.la(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},PO=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},RO=function(a,b){if(b===_.T&&a.h)return xO(a.h);var c=QO(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===b.toUpperCase()})[0];var d=null;b===_.gk&&(d=KO(a,c.extra_info),d=OO(a,{width:d.Width,height:d.Height}));b===_.fk&&(c?(d=PO(a,c,_.fk),a.j=d):d=a.j);b===_.T&&(c?(d=PO(a,c,_.T),a.l=d):d=a.l);return d},SO=function(a){_.Ul.call(this);this.m=a;this.h=null;this.g=new _.K("clpp.tizen.Middleware");this.C=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={}},TO=function(a){return _.I(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)})},VO=function(a){try{webapis.avplay.setListener({onbufferingstart:a.mk.bind(a),onbufferingprogress:a.lk.bind(a),onbufferingcomplete:a.kk.bind(a),onstreamcompleted:a.qk.bind(a),oncurrentplaytime:function(b){a.trigger(new _.L(UO,
22
+ {currentTime:b}))},onevent:a.pk.bind(a),onsubtitlechange:a.rk.bind(a),ondrmevent:a.nk.bind(a),onerror:a.S.bind(a)})}catch(b){a.g.error(b)}},WO=function(a){var b=!!a.m.getTrackManager().Na();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",c)}},XO=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.g.debug({estimatedBandwidth:c,ho:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",bO+d)}catch(e){a.g.debug(e)}},
23
+ YO=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+bO+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",c),c;}},aP=function(a){return{position:a.getPosition(),state:a.m.getState(),Kg:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:ZO(a),volume:a.getVolume(),Dn:$O(a),Gk:QO(a)}},cP=function(a){var b,c;return _.I(function(d){if(1==d.a)return _.y(d,bP(),2);if(3!=d.a)return b=new Promise(function(e){(new _.Vk(e)).ea(5)}),
24
+ _.y(d,Promise.race([TO(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)})},iP=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:a.l=_.Bp(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(dP)),f=c.currentPosition);
25
+ _.D(p,2);g=a.l[d].url;h=a.l[d].type;h!==_.Tc||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);e.nextBandwidth?(YO(a,e.nextBandwidth),a.o=!1):(a.o||XO(a,e),a.o=!0);VO(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)},Jb:a.m.getNetworkEngine()};a.h=new dO(b.drm,m);return _.y(p,a.h.init(),4);case 4:return a.f||a.trigger(new _.L(eP)),
26
+ _.y(p,fP(a),6);case 6:a.f||a.trigger(new _.L(gP));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&&hP(a,b.muted),b.autoplay&&a.m.play()["catch"](function(q){a.g.debug("Autoplay failed",q)}));_.oh(p,0);break;case 2:throw n=_.F(p),a.g.debug("Error while attempting to load source."),n;}})},fP=function(a){return _.I(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
+ WO(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)}}))})},jP=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=aP(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(function(){var e=a.a.Kg;a.f=!1;a.a=
28
+ null;return e===oO?a.pause():a.play()})}catch(e){return Promise.reject(e)}},$O=function(a){return a.f&&a.a?a.a.Dn:webapis.avplay.getTotalTrackInfo()},QO=function(a){return a.f&&a.a?a.a.Gk:webapis.avplay.getCurrentStreamInfo()},DO=function(a,b,c){b=b.toUpperCase();b===FO&&kP(a,!0);var d=a.j[b];d&&(d.Ve.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,Hg:0,Ve:new _.Vk(function(){return g(h,c,!0)})}),(l=a.j[h])&&3>l.Hg?(!a.w&&++l.Hg,l.Ve.ea(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),l&&l.Ve.stop(),a.j[h]=null,f())}}g(b,c)})},kP=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)}},hP=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case $N:a.g.warn("The application does not have the privilege to set mute.",aO);break;default:a.g.warn(XN,c)}}},ZO=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case $N:a.g.warn("The application doesn't have the privilege to get the mute state.",aO);break;default:a.g.warn(XN,c)}}return!!b},bP=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");
31
+ cO(c,_.Ee,function(d){return a(d)});cO(c,_.ne,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},lP=function(){_.Ul.call(this);this.a=new SO(this);this.f=new kO(this);this.configuration=this.B=_.$l();this.w=null;this.g=new _.K("clpp.tizen.Player");this.j=null;this.l=new zO;this.C=new _.Zj;this.o=this.h=null;this.A=!1},mP=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())},nP=function(){},oP=function(){};
33
+ dO.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.I(function(h){if(1==h.a){b=_.um[a.h.env]||null;if(!b)throw a.g.debug(_.za,_.Nb+a.h.env+_.aa),new _.N(_.O,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=_.wm(b,a.h.customData);(e=d[_.Nd])&&a.f.set(_.Nd,{Zd:e.licenseUrl||"",customData:c,eg:!1});(f=d[_.Pd])&&a.f.set(_.Pd,{Zd:f.licenseUrl||"",customData:c,
34
+ eg:!1});if(0===a.f.size)throw new _.N(_.O,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Nd))a.a=_.Nd;else if(a.f.get(_.Pd))a.a=_.Pd;else throw new _.N(_.O,6,6001,"Configuration for the target system is missing.");return _.y(h,gO(a),2)}a.j=!0;_.A(h)})};dO.prototype.release=function(){var a=this;return _.I(function(b){a.j=!1;a.o=null;a.a=_.Te;a.l=null;a.f=new Map;_.A(b)})};dO.prototype.getDrmInfo=function(){return this.o};
35
+ var iO={Si:"DeleteLicenseAfterUse",Ui:"LicenseServer",Sn:"GetChallenge",Tn:"HttpHeader",Vn:"UserAgent",On:"Cookie",Ri:"CustomData"};_.u=kO.prototype;_.u.initialize=function(){this.a.on(dP,this.fh,this);this.a.on(pP,this.eh,this);this.a.on(qP,this.dh,this);this.a.on(eP,this.ki,this);this.a.on(gP,this.ji,this);this.a.on(rP,this.gh,this)};_.u.release=function(){mO(this,_.jp);this.l=!1;this.o=-1;this.h=2};_.u.destroy=function(){this.release();this.a.off(dP,this.fh);this.a.off(pP,this.eh);this.a.off(qP,this.dh);this.a.off(eP,this.ki);this.a.off(gP,this.ji);this.a.off(rP,this.gh);this.m=this.a=null};
36
+ _.u.fh=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;mO(this,_.op)};_.u.eh=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",lO(this.f))};_.u.dh=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()===sP;if(!a&&b){mO(this,_.wp);return}}if(a=this.f!==_.vp)a=this.a.getState(),a=a===nO||a===oO;a&&pO(this)};
37
+ _.u.ki=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===tP?mO(this,_.vp):this.g.error("AVPlay prepares while state is not IDLE")};_.u.ji=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.u.gh=function(){mO(this,_.qp)};_.u.getState=function(){return this.f};_.u=qO.prototype;_.u.initialize=function(a){this.m=a};
38
+ _.u.load=function(a){var b=this,c,d,e,f,g,h,l;return _.I(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,sO(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(){},onEvent:function(){},onError:function(){}};
39
+ _.D(m,3);e=b;return _.y(m,b.j.start(a.url,d),5);case 5:e.a=m.f;_.oh(m,4);break;case 3:return f=_.F(m),b.g.warn(f),_.D(m,6),g=b,_.y(m,b.j.start(a.url.replace("https://","http://"),d),8);case 8:g.a=m.f;_.oh(m,4);break;case 6:h=_.F(m),b.g.error(h),b.a=null;case 4:if(!b.a||!rO(b.a)){m.F(0);break}b.h=tO(b);_.D(m,10);return _.y(m,b.h.open(),12);case 12:b.f=uO(b);l=b.m.getConfiguration();b.f.h=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;b.C=l.preferForcedSubtitles;_.oh(m,0);break;case 10:_.F(m),
40
+ b.g.debug("Could not setup media source..."),b.h=null,b.f=null,b.j=null,b.a=null,_.A(m)}})};_.u.tk=function(a){this.g.debug(_.jC,a);this.w=!0;var b=_.ZE(a.textStreams,this.o||"",this.A||"",this.C)[0]||null;this.l&&(a.textStreams.includes(this.l)&&(b=this.l),this.l=null);return{variant:null,text:b}};_.u.sk=function(){this.g.debug("canSwitch_");this.w=!1;this.l&&(_.KG(this.f,this.l,!0,0),this.l=null)};_.u.S=function(){this.g.debug("onError_")};_.u.uk=function(){this.j&&this.j.update&&this.j.update()};
41
+ _.u.start=function(){var a=this;return _.I(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)})};_.u.setTextVisibility=function(a){this.g.debug("Set text visibility",a);this.h&&this.h.getTextDisplayer().setTextVisibility(a)};_.u.release=function(){var a=this;return _.I(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
+ _.u.destroy=function(){var a=this;return _.I(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(zO,_.U);_.u=zO.prototype;_.u.ai=function(a){var b=a.eventid;a=a.data;switch(b){case uP:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+KO(this,b[0].extra_info).Bit_rate,b=OO(this,{bandwidth:b}))&&(this.w=b,AO(this,b));break;case vP:BO(this);break;default:this.g.debug("Event type: "+b+" data: "+a)}};_.u.Zf=function(a){a.detail.currentState===_.xp&&this.m.off(_.cg,this.Zf)};
43
+ _.u.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.cg,function(c){b.A||(c=c.detail,c.currentState===_.xp&&(b.g.debug("Current state",c.currentState),b.A=!0,CO(b)))});this.a.on(wP,this.ai,this)};_.u.release=function(){this.f={};this.h=this.w=this.l=this.j=null;this.A=!1;this.o=1};
44
+ _.u.load=function(){if(this.a&&!(0<Object.keys(this.f).length)){this.h=this.m.h;this.m.off(_.cg,this.Zf);this.m.on(_.cg,this.Zf,this);try{var a=$O(this.a);this.f=NO(this,a);var b=this.f[_.fk]||[];b.length&&(this.j=b[0].renditions[0]||null);BO(this)}catch(c){this.g.debug("Could not load track manager")}}};_.u.destroy=function(){this.a.off(wP,this.ai);this.a=this.m=null};_.u.getVideoTracks=function(){return this.f[_.gk]||[]};_.u.getAudioTracks=function(){return this.f[_.fk]||[]};
45
+ _.u.ia=function(){return this.f[_.T]||[]};_.u.na=function(){return RO(this,_.gk)};_.u.Sa=function(){return RO(this,_.fk)};_.u.Na=function(){return RO(this,_.T)};_.u.lb=function(){return this.w};_.u.Ab=function(){this.g.info(YN);return null};_.u.Bb=function(){this.g.info(YN);return null};_.u.Oa=function(){var a=this.na();return a?a.track:null};_.u.ma=function(){var a=this.Sa();return a?a.track:null};_.u.xa=function(){var a=this.Na();return a?a.track:null};
46
+ _.u.wb=function(a){var b=this;null===a?(a=this.na(),jP(this.a,a.bandwidth,null).then(function(){BO(b)})):0<a.renditions.length&&this.cb(a.renditions[0])};_.u.Da=function(a){a?GO(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.u.Qa=function(a){a?(a=a.renditions[0],this.h?yO(this.h,a.track):GO(this,a)):(this.g.debug("Disabling text tracks"),this.l=null,kP(this.a,!1),this.m.trigger(new _.L(_.Ol)))};
47
+ _.u.cb=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,AO(this,a),jP(this.a,c.bandwidth,a.bandwidth).then(function(){BO(b)})["catch"](function(d){var e=new _.N(_.O,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...")};_.u.ub=function(a){GO(this,a)};_.u.vb=function(a){this.h?yO(this.h,a.track):GO(this,a)};
48
+ _.u.addTextTrack=function(){};_.u.qa=function(){return this.a.o};zO.prototype.isAbrEnabled=zO.prototype.qa;zO.prototype.addTextTrack=zO.prototype.addTextTrack;zO.prototype.setTextRendition=zO.prototype.vb;zO.prototype.setAudioRendition=zO.prototype.ub;zO.prototype.setVideoRendition=zO.prototype.cb;zO.prototype.setTextTrack=zO.prototype.Qa;zO.prototype.setAudioTrack=zO.prototype.Da;zO.prototype.setVideoTrack=zO.prototype.wb;zO.prototype.getTextTrack=zO.prototype.xa;zO.prototype.getAudioTrack=zO.prototype.ma;
49
+ zO.prototype.getVideoTrack=zO.prototype.Oa;zO.prototype.getLoadingTextRendition=zO.prototype.Bb;zO.prototype.getLoadingAudioRendition=zO.prototype.Ab;zO.prototype.getLoadingVideoRendition=zO.prototype.lb;zO.prototype.getTextRendition=zO.prototype.Na;zO.prototype.getAudioRendition=zO.prototype.Sa;zO.prototype.getVideoRendition=zO.prototype.na;zO.prototype.getTextTracks=zO.prototype.ia;zO.prototype.getAudioTracks=zO.prototype.getAudioTracks;zO.prototype.getVideoTracks=zO.prototype.getVideoTracks;_.x(SO,_.Ul);_.u=SO.prototype;_.u.mk=function(){this.w=!0;this.f||this.trigger(new _.L(dP))};_.u.lk=function(a){this.w=!0;this.trigger(new _.L(pP,{percent:a}))};_.u.kk=function(){this.w=!1;this.trigger(new _.L(qP))};_.u.qk=function(){this.trigger(new _.L(rP))};_.u.pk=function(a,b){this.trigger(new _.L(wP,{eventid:a,data:b}))};_.u.rk=function(a,b,c,d,e){this.trigger(new _.L(xP,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
50
+ _.u.nk=function(a,b){this.trigger(new _.L(yP,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Pd&&"Challenge"===b.name)jO(c,b);else if("DrmError"===b.name){c.g.debug("DrmError event",b);var d=new _.N(_.O,6,6005,{message:JSON.stringify(b)});c.D.onError(d)}}};_.u.S=function(a){this.trigger(new _.L(zP,{eventType:a}))};
51
+ _.u.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(UO,f,b);g=setTimeout(function(){b.off(UO,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===tP)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){WO(b);d(webapis.avplay.play())},function(f){b.trigger(new _.L(zP));e(f)})})).then(function(){return a()});if(c===oO||c===sP)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===nO?
52
+ Promise.resolve():Promise.reject("Player is in invalid state")};_.u.pause=function(){try{webapis.avplay.pause()}catch(a){Promise.reject(a)}return this.getState()===oO?Promise.resolve():Promise.reject()};
53
+ _.u.setPlaybackRate=function(a){var b=this.getState();if(b===sP||b===nO||b===oO){try{webapis.avplay.setSpeed(a),this.C=a}catch(c){return this.g.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.C)}return!0}this.g.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1};_.u.getPlaybackRate=function(){return this.C};
54
+ _.u.load=function(a,b){var c=this,d;return _.I(function(e){switch(e.a){case 1:return c.g.debug("configure()",b||""),_.D(e,2),_.y(e,cP(c),4);case 4:return _.y(e,iP(c,a,b),5);case 5:_.oh(e,0);break;case 2:throw d=_.F(e),new _.N(_.O,7,7003,null,d);}})};_.u.getState=function(){if(this.f&&this.a)return this.a.Kg;try{return webapis.avplay.getState()}catch(a){this.S(JSON.stringify(a))}};
55
+ _.u.seek=function(a){var b=this,c=1E3*a;return new Promise(function(d,e){b.B=!0;b.m.trigger(new _.L(_.yg));webapis.avplay.seekTo(c,function(){b.B=!1;b.m.trigger(new _.L(_.xg));d()},function(){b.B=!1;e()})})};_.u.getPosition=function(){if(this.f&&this.a)return this.a.position;try{return webapis.avplay.getCurrentTime()/1E3}catch(a){this.S(JSON.stringify(a))}};_.u.getDuration=function(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.S(JSON.stringify(a))}};
56
+ _.u.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.Ve.stop()}a.j={};a.C=1;a.B=!1;a.l=null;a.a=null;return b()}catch(f){return c(f)}})};_.u.getVolume=function(){var a=null;try{a=tizen.tvaudiocontrol.getVolume()}catch(b){switch(b.name){case $N:this.g.debug("The application does not have the privilege to get the volume.",aO);break;default:this.g.debug(XN,b)}}return a};
57
+ _.u.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 $N:this.g.warn("The application does not have the privilege to set the volume.",aO);break;default:this.g.warn("An unknown error occurred while trying to set volume",b)}}};
58
+ _.u.isLive=function(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.S(JSON.stringify(a))}};_.u.stop=function(){try{webapis.avplay.stop()}catch(a){this.g.debug(a)}};_.u.getDrmInfo=function(){this.h&&this.h.getDrmInfo();return null};_.u.setSourceIndex=function(a){this.G=a};_.u.getSourceIndex=function(){return this.G};_.u.getLoadedSource=function(){return this.l&&this.l[this.getSourceIndex()]};
59
+ var tP="IDLE",sP="READY",nO="PLAYING",oO="PAUSED",LO=_.ic,EO="AUDIO",FO="TEXT",vP="PLAYER_MSG_RESOLUTION_CHANGED",uP="PLAYER_MSG_BITRATE_CHANGE",hO={PLAYREADY:"PLAYREADY",Qn:"EME_PLAYREADY",Wn:"VERIMATRIX",ne:"WIDEVINE_CDM",Rn:"EME_WIDEVINE_CDM",Yn:"WIDEVINE_CLASSIC"};_.x(lP,_.Ul);_.u=lP.prototype;_.u.ah=function(){var a=this;this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.L(_.me));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.g.debug("Could not loop playback")}):this.a.stop()};_.u.Zg=function(a){this.trigger(new _.L(_.og,{currentTime:a.currentTime/1E3}))};
60
+ _.u.bh=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.sg(d))&&this.o.append([new _.ti(b,c,d)],[])};_.u.$g=function(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.u.ci=function(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)};
61
+ _.u.S=function(a){this.g.debug("Error: TYPE: "+a.eventType);mO(this.f,_.up);a=new _.N(_.O,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.L(_.ne,{detail:a}))};
62
+ _.u.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(rP,this.ah,this);this.a.on(UO,this.Zg,this);this.a.on(xP,this.bh,this);this.a.on(yP,this.$g,this);this.a.on(zP,this.S,this);this.a.on(qP,this.ci,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();var c=AP;AP+=1;this.j=_.Xp(_.Ue,{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=[_.Ug,_.se,"position",_.ye,"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];_.Zp(c,f);mP(this)}};_.u.getSurface=function(){return this.w};_.u.getConfiguration=function(){return this.configuration};_.u.getTimeline=function(){return null};_.u.setupPlaylist=function(){return Promise.reject(_.Eb)};_.u.appendLoad=function(){return Promise.reject(_.Eb)};
64
+ _.u.seekWith=function(){return Promise.reject(_.Eb)};_.u.setSeekInterceptor=function(){};_.u.destroy=function(){var a=this;return _.I(function(b){switch(b.a){case 1:return _.y(b,a.release(),2);case 2:a.a.off(rP,a.ah);a.a.off(UO,a.Zg);a.a.off(xP,a.bh);a.a.off(yP,a.$g);a.a.off(zP,a.S);a.a.off(qP,a.ci);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)}})};_.u.namespace=function(){return BP};
65
+ _.u.getPlaybackRate=function(){return this.a.getPlaybackRate()};_.u.setDrmCustomDataModifier=function(){};_.u.setCdnErrorCallback=function(){};_.u.detach=function(){};_.u.setPlaybackRate=function(a){this.a.setPlaybackRate(a)};_.u.getPosition=function(){return this.getMediaPosition()};_.u.getMediaPosition=function(){return 0<(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.qp?this.getDuration():this.a.getPosition()||0};
66
+ _.u.seek=function(a){return typeof a===_.k&&0<=a?(this.isLive()||(a=Math.min(a,this.getDuration())),this.a.seek(a)):Promise.reject()};_.u.getPresentationStartTime=function(){return null};_.u.getSeekRange=function(){return{start:0,end:0}};_.u.getVolume=function(){var a=this.a.getVolume();return typeof a===_.k?a/100:null};_.u.setVolume=function(a){this.a.setVolume(a)};_.u.getDuration=function(){return this.getMediaDuration()};_.u.getMediaDuration=function(){return this.a.getDuration()};
67
+ _.u.getBufferInfo=function(){this.g.warn(_.ua);return new _.Tl};_.u.getTrackManager=function(){return this.l};_.u.unload=function(){var a=this;return this.a.release().then(function(){a.l.release()})};_.u.release=function(){var a=this;return _.I(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
+ _.u.load=function(a){var b=this,c,d,e,f,g;return _.I(function(h){switch(h.a){case 1:b.configuration=_.bm(b.B,a);c=_.Yo(b.configuration,[_.ue,"native"]);b.o=c.create(b);d=_.Bp(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){h.F(2);break}b.h=new qO;b.h.initialize(b);_.D(h,3);return _.y(h,b.h.load(d),5);case 5:b.h.start();_.oh(h,2);break;case 3:f=_.F(h),b.g.error(f);case 2:return _.D(h,6),_.y(h,b.a.load(b.configuration),8);case 8:_.oh(h,7);break;case 6:throw g=
69
+ _.F(h),b.onError(g),g;case 7:b.l.load(),_.A(h)}})};_.u.play=function(){var a=this;this.trigger(new _.L(_.hf));mP(this);return this.a.play().then(function(){pO(a.f)})};_.u.pause=function(){var a=this;return this.a.pause().then(function(){pO(a.f)})};_.u.getState=function(){return this.f.getState()};_.u.getPeriods=function(){return[]};_.u.onError=function(a){var b=new _.L(_.ne,{detail:a});a.severity===_.O&&(mO(this.f,_.up),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)};
70
+ _.u.getDrmInfo=function(){return this.a.getDrmInfo()};_.u.isEnded=function(){return this.f.getState()===_.qp};_.u.isPaused=function(){return this.a.getState()===oO};_.u.isMuted=function(){return ZO(this.a)};_.u.setMuted=function(a){hP(this.a,a)};_.u.getNetworkEngine=function(){return this.C};_.u.setNetworkEngine=function(a){this.C=a};_.u.setCmsdManager=function(){};_.u.isLive=function(){return this.a.isLive()};_.u.getStats=function(){return null};_.u.setSourceIndex=function(a){this.a.setSourceIndex(a)};
71
+ _.u.getSourceIndex=function(){return this.a.getSourceIndex()};_.u.getLoadedSource=function(){return this.a.getLoadedSource()};_.u.canPlay=function(a,b){return(new nP).canPlay(a,b)};_.u.getTimelineCues=function(){return[]};_.u.getCueTimeline=function(){return null};_.u.getTextDisplayer=function(){return this.o};_.u.resetAbr=function(){};lP.prototype.getTextDisplayer=lP.prototype.getTextDisplayer;lP.prototype.setNetworkEngine=lP.prototype.setNetworkEngine;lP.prototype.getNetworkEngine=lP.prototype.getNetworkEngine;
72
+ var BP="clpp.tizen",AP=0;nP.prototype.a=function(){return BP};nP.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Tc||a===_.El||a===_.Yc)&&b){if(_.Uj(2))return 2;if(_.Uj(3)||_.Uj(4)||_.Uj(5)||_.Uj(6))return _.Dh("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};nP.prototype.f=function(a){return a===_.pa};nP.prototype.create=function(){return new lP};_.x(oP,_.Us);oP.prototype.f=function(){_.Nh(new nP)};oP.prototype.a=function(){var a=BP;a&&_.Lh[a]&&(delete _.Lh[a],_.Mh.info("Removed Player factory: '"+a+"'"))};oP.prototype.id=function(){return"tizen"};_.J("clpp.tizen.TizenComponent",oP);var dP="onbufferingstart",pP="onbufferingprogress",qP="onbufferingcomplete",rP="onstreamcompleted",UO="oncurrentplaytime",wP="onevent",xP="onsubtitlechange",yP="ondrmevent",zP="onerror",eP="preparingstart",gP="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,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var fx='application/mp4; codecs\x3d"stpp.ttml"',gx='application/mp4; codecs\x3d"stpp.ttml.im1i"',hx='application/mp4; codecs\x3d"stpp.ttml.im1t"',ix="backgroundColor",jx="direction",kx="displayAlign",lx="region",mx="sans-serif",nx="textAlign",ox="textDecoration",px="writingMode",qx=function(a,b,c){this.h=a;this.f=b;this.a=c},rx=function(a,b,c){qx.call(this,a,[],c);this.j=b||""},sx=function(a,b,c){qx.call(this,a,b,c)},tx=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},Bx=function(a,b){var c=null;if(ux.test(a)){c=ux.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 vx.test(a)?c=wx(vx,a):xx.test(a)?c=wx(xx,a):yx.test(a)?(c=yx.exec(a),c=Number(c[1])/b.frameRate):zx.test(a)?(c=zx.exec(a),c=Number(c[1])/b.a):Ax.test(a)&&(c=wx(Ax,a));return c},wx=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)},Cx=function(a){return a.split(":").pop()},Dx=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Fx=function(a,b){for(;Ex.test(a);){var c=Ex.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Gx=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},Hx=function(a,b,c,d,e,f,g){qx.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},Ix=function(a,b,c){a=tx(a,b,nx);if(!a&&c&&(a=tx(c,b,nx),!a&&"rltb"===tx(c,
5
- b,px)))return _.Wf;switch(a){case _.wd:return _.si;case _.Wf:case _.re:return _.Wf;default:return _.Fe}},Jx=function(a,b,c){if(_.S.He(a.w))return document.createTextNode(_.S.kg(a.w||""));if(a.A)return _.Yp("br");for(var d=_.Yp("span"),e=_.w(a.f),f=e.next();!f.done;f=e.next())_.Zp(d,f.value);a=_.w(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(Jx(c.get(e.value),b,c));return d},Kx=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]))},Lx=function(a,b,c){qx.call(this,a,b,c)},Ox=function(a,b,c,d){var e=Mx.exec(a);a=Nx.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},Px=function(a,b){return typeof b===_.k&&0<b?_.yi:Nx.test(a)?0:_.yi},Qx=function(a,b){qx.call(this,"root-container",[],b);this.j=a},Rx=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},Sx=function(a,b){var c=a.getAttribute("extent");
7
- return(c=Nx.exec(c))?Number(c[b]):null},Ux=function(a){a=a.getAttribute("cellResolution");return(a=Tx.exec(a))?Number(a[2]):null},Vx=function(a,b,c){qx.call(this,a,b,c)},Wx=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=[]},Yx=function(a){return Xx.some(function(b){return b in a.attributes})},Zx=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,_.fh(Zx(a,
8
- a.a.get(e).f)).concat([e]));return c},ay=function(){return"inline-"+$x++},by=function(a){this.a=a.firstChild;this.f=new Set},cy=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},dy=function(a){return Cx(a.h.nodeName)},ey=function(){this.a=new Map},gy=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=_.fh(l.l).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.fh(l.f).concat(),
9
- g={},fy.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(lx)&&(c=b.getAttribute(lx));b.hasAttribute(_.og)&&f.push.apply(f,_.fh(b.getAttribute(_.og).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=Cx(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new cy(b,c,d,e,f,g);a.a.set(b,c);return c},hy=function(a){this.a=a;this.f=new DOMParser},iy=function(a){this.f=
10
- a},jy=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")},ky=function(){},ly=function(a){this.a=new hy(a);this.g=new _.K("clpp.ttml.Mp4TtmlParser")},my=function(){this.j=new ky};qx.prototype.getId=function(){return this.h};qx.prototype.getAttribute=function(a){return this.a[a]};_.x(rx,qx);_.x(sx,qx);var ux=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,vx=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,xx=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,yx=/^(\d*(?:\.\d*)?)f$/,zx=/^(\d*(?:\.\d*)?)t$/,Ax=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Mx=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Nx=/^(\d+)px (\d+)px$/,Tx=/^(\d+) (\d+)$/,Ex=/(\d+)px/,ny=/^(\d+px|\d+em|\d*\.?\d+c)$/,Xx=[ix,"color",jx,kx,"fontFamily","fontSize","fontStyle","fontWeight",
11
- "lineHeight","opacity","padding",nx,ox,"textOutline",px,"zIndex"],fy=["begin",_.re];_.x(Hx,sx);
12
- Hx.prototype.build=function(a,b,c,d,e,f,g){var h=Bx(this.a.begin,b);b=Bx(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.Yp(_.be);for(var l=_.w(this.j),m=l.next();!m.done;m=l.next())c.appendChild(Jx(g.get(m.value),e,g));g=new _.xi(h,b,c.innerHTML.trim(),_.wg);g.cssClassList=_.fh(this.f).concat();g.textAlign=Ix(this,e,null);g.writingMode=_.ti;g.line=-1;g.lineInterpretation=_.ui;g.lineAlign=_.vi;g.containerRows=Rx(null,Ux(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
13
- Ix(this,e,f);a:switch(tx(f,e,px)){case "tb":case "tblr":a=_.Jg;break a;case "tbrl":a=_.Kg;break a;default:a=_.ti}g.writingMode=a;a:switch(tx(f,e,kx)){case _.wd:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(tx(f,e,kx)){case _.wd:a=1;break a;default:a=_.ui}g.lineInterpretation=a;a:switch(tx(f,e,kx)){case _.wd:e=_.wd;break a;default:e=_.vi}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(Lx,sx);
15
- Lx.prototype.build=function(a,b){var c=new _.Ai;c.id=this.getId();var d=Rx(a.j.containerWidth,Sx(a,1),720),e=Rx(a.j.containerHeight,Sx(a,2),480);a:switch(tx(this,b,kx)){case "after":var f="flex-start";break a;case _.wd:f=_.wd;break a;default:f="flex-end"}c.displayAlign=f;a:switch(tx(this,b,px)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Pd}c.writingMode=f;f=this.getAttribute("extent")||tx(this,b,"extent");c.width=Ox(f,d,1,100);c.widthUnits=Px(f,d);c.height=
16
- Ox(f,e,2,100);c.heightUnits=Px(f,e);f=this.getAttribute("origin")||tx(this,b,"origin");c.viewportAnchorX=Ox(f,d,1,0);c.viewportAnchorY=Ox(f,e,2,0);c.viewportAnchorUnits=Px(f,d);c.cssClassList=_.fh(this.f).concat();return c};_.x(Qx,qx);_.x(Vx,qx);
17
- Vx.prototype.build=function(a){var b=null;var c=Ux(a);c&&(b=Rx(a.j.containerHeight,Sx(a,2),480)/c);b=Rx(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.h+", ::ttml ."+this.h+" * {";for(var d=_.w(oy.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+":"+Dx(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&&!ny.test(g)&&ny.test(h)&&ny.test(l)?(e=g,f=h):2===d.length&&!ny.test(g)&&ny.test(h)?(e=g,f=h):2===d.length&&ny.test(g)&&ny.test(h)&&(f=g);if(""!==f){f=Dx(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=Gx(this.a.textShadow),d=Dx(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",mx).replace("proportionalSerif",mx).replace("sansSerif",mx).replace("default",mx)+";":"");a:{if(ox 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:"+Dx(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Dx(e),e=Fx(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=Dx(d);d=Fx(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 oy=new Map([[ix,"background-color"],["color","color"],[jx,jx],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);Wx.prototype.Fd=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 $x=0;by.prototype.$c=function(){return!!this.a};by.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!py.has(Cx(a.nodeName))||qy.has(Cx(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&&!py.has(Cx(a.nodeName))));var b=this.a;this.a=a;return b};
22
- var py=new Set(["tt","head","layout",_.Te,_.Be,lx,"styling",_.og,"body",_.be,"p","span","br"]),qy=new Set([_.og,_.Be]);cy.prototype.getId=function(){return this.attributes.id};hy.prototype.parseInit=function(){};
23
- hy.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.M.Oa(this.a.ttml||{}),e=_.oj(a,0,c[0]);e=_.S.ba(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.tg)}catch(n){throw new _.N(_.O,2,2005,"Failed to parse TTML.");}d=new Wx(d);e=new ey;f=new by(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=_.oj(a,b,h);l=_.yj(l);var m="urn:mpeg:14496-30:subs:"+g;d.h.set(m,new rx(m,l,{imageType:"PNG",encoding:"Base64"}));
24
- b+=h}for(;f.$c();)a=f.next(),a=gy(e,a),"tt"===dy(a)&&(d.l=new Qx(d.B,Object.assign({},a.attributes))),"tt"===dy(a)&&(d.w=new Kx(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),dy(a)!==_.Be||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new rx(c,a.h.textContent,a.attributes))),dy(a)===_.Be&&a.attributes.begin&&a.attributes.end?(c="#"+ay(),b=new rx(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
25
- dy(a)===_.og&&(c=a.getId()||ay(),b=new Vx(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),dy(a)!==_.og&&Yx(a)?(c=ay(),b=new Vx(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),dy(a)!==_.be||!a.attributes.extent&&!a.attributes.origin?c=null:(c=ay(),b=new Lx(c,Zx(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),dy(a)!==lx?c=null:(c=a.getId(),b=new Lx(c,Zx(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(dy(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=ay(),b=new Hx(c,"#text"===a.h.nodeName?a.h.textContent:null,"br"===dy(a),a.a,a.j,Zx(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"===dy(a)||a.j?(c=ay(),b=new Hx(c,null,!1,a.a,a.j,Zx(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.Fd();f=[];a=_.w(d.a.values());for(c=a.next();!c.done;c=
27
- a.next())f.push.apply(f,_.fh(c.value.build(d.l)));return{cues:e,styles:f}};iy.prototype.a=function(a){a=(new hy(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=jy(c.startTime)+" --\x3e "+jy(c.endTime),e=[];switch(c.textAlign){case _.Fe:e.push("align:left");break;case _.Wf:e.push("align:right");break;case _.si:e.push("align:middle");break;case _.Fe:e.push("align:start");break;case _.Wf:e.push("align:end")}switch(c.writingMode){case _.Jg:e.push("vertical:lr");break;
28
- case _.Kg:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.S.Wa(b)};ky.prototype.probe=function(a,b){return a===_.$c&&b===_.sg};ky.prototype.create=function(a){return new iy(a)};ly.prototype.parseInit=function(a){var b=!1;(new _.Rm).M(_.We,_.Sm).M(_.vg,_.Sm).M(_.Re,_.Sm).M(_.Ve,_.Sm).M(_.lg,_.Sm).Y(_.ng,_.Tm).M("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.N(_.O,2,2007);};
29
- ly.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Rm).M("moof",_.Sm).M("traf",_.Sm).Y("subs",function(h){for(var l=_.W(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.Mm(h.reader),p=0;p<n;++p){var q=1===h.version?_.W(h.reader):_.Mm(h.reader);g.push(q);h.reader.skip(6)}}}).M(_.Qe,_.Um(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(my,_.Ts);my.prototype.f=function(){_.tu(_.$c,hy);_.tu(_.Yc,ly);_.tu(fx,ly);_.tu(hx,ly);_.tu(gx,ly);_.Kk.push(this.j)};my.prototype.a=function(){_.vu(_.$c);_.vu(_.Yc);_.vu(fx);_.vu(hx);_.vu(gx);_.Mk(this.j)};my.prototype.id=function(){return"subtitles-ttml"};_.J("clpp.ttml.TtmlComponent",my);};
2
+ var f=function(window){var ax='application/mp4; codecs\x3d"stpp.ttml"',bx='application/mp4; codecs\x3d"stpp.ttml.im1i"',cx='application/mp4; codecs\x3d"stpp.ttml.im1t"',dx="backgroundColor",ex="direction",fx="displayAlign",gx="region",hx="sans-serif",ix="textAlign",jx="textDecoration",kx="writingMode",lx=function(a,b,c){this.h=a;this.f=b;this.a=c},mx=function(a,b,c){lx.call(this,a,[],c);this.j=b||""},nx=function(a,b,c){lx.call(this,a,b,c)},ox=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},wx=function(a,b){var c=null;if(px.test(a)){c=px.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 qx.test(a)?c=rx(qx,a):sx.test(a)?c=rx(sx,a):tx.test(a)?(c=tx.exec(a),c=Number(c[1])/b.frameRate):ux.test(a)?(c=ux.exec(a),c=Number(c[1])/b.a):vx.test(a)&&(c=rx(vx,a));return c},rx=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)},xx=function(a){return a.split(":").pop()},yx=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Ax=function(a,b){for(;zx.test(a);){var c=zx.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Bx=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},Cx=function(a,b,c,d,e,f,g){lx.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},Dx=function(a,b,c){a=ox(a,b,ix);if(!a&&c&&(a=ox(c,b,ix),!a&&"rltb"===ox(c,
5
+ b,kx)))return _.Pf;switch(a){case _.td:return _.oi;case _.Pf:case _.le:return _.Pf;default:return _.ye}},Ex=function(a,b,c){if(_.S.Me(a.w))return document.createTextNode(_.S.sg(a.w||""));if(a.A)return _.Xp("br");for(var d=_.Xp("span"),e=_.w(a.f),f=e.next();!f.done;f=e.next())_.Yp(d,f.value);a=_.w(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(Ex(c.get(e.value),b,c));return d},Fx=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]))},Gx=function(a,b,c){lx.call(this,a,b,c)},Jx=function(a,b,c,d){var e=Hx.exec(a);a=Ix.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},Kx=function(a,b){return typeof b===_.k&&0<b?_.ui:Ix.test(a)?0:_.ui},Lx=function(a,b){lx.call(this,"root-container",[],b);this.j=a},Mx=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},Nx=function(a,b){var c=a.getAttribute("extent");
7
+ return(c=Ix.exec(c))?Number(c[b]):null},Px=function(a){a=a.getAttribute("cellResolution");return(a=Ox.exec(a))?Number(a[2]):null},Qx=function(a,b,c){lx.call(this,a,b,c)},Rx=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=[]},Tx=function(a){return Sx.some(function(b){return b in a.attributes})},Ux=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,_.ah(Ux(a,
8
+ a.a.get(e).f)).concat([e]));return c},Wx=function(){return"inline-"+Vx++},Xx=function(a){return a.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})},Yx=function(a){this.a=a.firstChild;this.f=new Set},Zx=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},$x=function(a){return xx(a.h.nodeName)},ay=function(){this.a=new Map},cy=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},h=b.parentNode;
9
+ if(h&&a.a.has(h)){var l=a.a.get(h);e=_.ah(l.l).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.ah(l.f).concat(),g={},by.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(gx)&&(c=b.getAttribute(gx));b.hasAttribute(_.hg)&&f.push.apply(f,_.ah(b.getAttribute(_.hg).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=xx(h);g[m]=b.getAttribute(h)}d=
10
+ g.backgroundImage}c=new Zx(b,c,d,e,f,g);a.a.set(b,c);return c},dy=function(a){this.a=a;this.f=new DOMParser},ey=function(a){this.f=a},fy=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")},gy=function(){},hy=function(a){this.a=new dy(a);this.g=new _.K("clpp.ttml.Mp4TtmlParser")},iy=function(){this.j=new gy};lx.prototype.getId=function(){return this.h};
11
+ lx.prototype.getAttribute=function(a){return this.a[a]};_.x(mx,lx);_.x(nx,lx);var px=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,qx=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,sx=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,tx=/^(\d*(?:\.\d*)?)f$/,ux=/^(\d*(?:\.\d*)?)t$/,vx=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Hx=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Ix=/^(\d+)px (\d+)px$/,Ox=/^(\d+) (\d+)$/,zx=/(\d+)px/,jy=/^(\d+px|\d+em|\d*\.?\d+c)$/,Sx=[dx,"color",ex,fx,"fontFamily","fontSize","fontStyle","fontWeight",
12
+ "lineHeight","opacity","padding",ix,jx,"textOutline",kx,"zIndex"],by=["begin",_.le];_.x(Cx,nx);
13
+ Cx.prototype.build=function(a,b,c,d,e,f,g){var h=wx(this.a.begin,b);b=wx(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.Xp(_.Wd);for(var l=_.w(this.j),m=l.next();!m.done;m=l.next())c.appendChild(Ex(g.get(m.value),e,g));g=new _.ti(h,b,c.innerHTML.trim(),_.qg);g.cssClassList=_.ah(this.f).concat();g.textAlign=Dx(this,e,null);g.writingMode=_.pi;g.line=-1;g.lineInterpretation=_.qi;g.lineAlign=_.ri;g.containerRows=Mx(null,Px(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
14
+ Dx(this,e,f);a:switch(ox(f,e,kx)){case "tb":case "tblr":a=_.Dg;break a;case "tbrl":a=_.Fg;break a;default:a=_.pi}g.writingMode=a;a:switch(ox(f,e,fx)){case _.td:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(ox(f,e,fx)){case _.td:a=1;break a;default:a=_.qi}g.lineInterpretation=a;a:switch(ox(f,e,fx)){case _.td:e=_.td;break a;default:e=_.ri}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(),
15
+ g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.x(Gx,nx);
16
+ Gx.prototype.build=function(a,b){var c=new _.wi;c.id=this.getId();var d=Mx(a.j.containerWidth,Nx(a,1),720),e=Mx(a.j.containerHeight,Nx(a,2),480);a:switch(ox(this,b,fx)){case "after":var f="flex-start";break a;case _.td:f=_.td;break a;default:f="flex-end"}c.displayAlign=f;a:switch(ox(this,b,kx)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Jd}c.writingMode=f;f=this.getAttribute("extent")||ox(this,b,"extent");c.width=Jx(f,d,1,100);c.widthUnits=Kx(f,d);c.height=
17
+ Jx(f,e,2,100);c.heightUnits=Kx(f,e);f=this.getAttribute("origin")||ox(this,b,"origin");c.viewportAnchorX=Jx(f,d,1,0);c.viewportAnchorY=Jx(f,e,2,0);c.viewportAnchorUnits=Kx(f,d);c.cssClassList=_.ah(this.f).concat();return c};_.x(Lx,lx);_.x(Qx,lx);
18
+ Qx.prototype.build=function(a){var b=null;var c=Px(a);c&&(b=Mx(a.j.containerHeight,Nx(a,2),480)/c);b=Mx(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.h+", ::ttml ."+this.h+" * {";for(var d=_.w(ky.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+":"+yx(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:"+
19
+ 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&&!jy.test(g)&&jy.test(h)&&jy.test(l)?(e=g,f=h):2===d.length&&!jy.test(g)&&jy.test(h)?(e=g,f=h):2===d.length&&jy.test(g)&&jy.test(h)&&(f=g);if(""!==f){f=yx(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=Bx(this.a.textShadow),d=yx(d),d="text-shadow:"+
20
+ d+";"):d="";c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif","monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",hx).replace("proportionalSerif",hx).replace("sansSerif",hx).replace("default",hx)+";":"");a:{if(jx 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=
21
+ "text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+yx(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=yx(e),e=Ax(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=yx(d);d=Ax(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.h+" .clpp-text-wrapper {",a.push(c+b+"}"),
22
+ c="::ttml .clpp-text-wrapper__"+this.h+" {",a.push(c+b+"}"));return a};var ky=new Map([[dx,"background-color"],["color","color"],[ex,ex],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Vx=0;Yx.prototype.Rd=function(){return!!this.a};Yx.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!ly.has(xx(a.nodeName))||my.has(xx(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&&!ly.has(xx(a.nodeName))));var b=this.a;this.a=a;return b};
23
+ var ly=new Set(["tt","head","layout",_.Ne,_.ve,gx,"styling",_.hg,"body",_.Wd,"p","span","br"]),my=new Set([_.hg,_.ve]);Zx.prototype.getId=function(){return this.attributes.id};dy.prototype.parseInit=function(){};
24
+ dy.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.M.$a(this.a.ttml||{}),e=_.lj(a,0,c[0]);e=_.S.aa(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.mg)}catch(n){throw new _.N(_.O,2,2005,"Failed to parse TTML.");}d=new Rx(d);e=new ay;f=new Yx(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 mx(m,l,{imageType:"PNG",encoding:"Base64"}));
25
+ b+=h}for(;f.Rd();)a=f.next(),a=cy(e,a),"tt"===$x(a)&&(d.l=new Lx(d.B,Object.assign({},a.attributes))),"tt"===$x(a)&&(d.w=new Fx(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),$x(a)!==_.ve||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new mx(c,a.h.textContent,a.attributes))),$x(a)===_.ve&&a.attributes.begin&&a.attributes.end?(c="#"+Wx(),b=new mx(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
26
+ $x(a)===_.hg&&(c=a.getId()||Wx(),b=new Qx(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),$x(a)!==_.hg&&Tx(a)?(c=Wx(),b=new Qx(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),$x(a)!==_.Wd||!a.attributes.extent&&!a.attributes.origin?c=null:(c=Wx(),b=new Gx(c,Ux(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),$x(a)!==gx?c=null:(c=a.getId(),b=new Gx(c,Ux(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
27
+ c=b),c&&(a.a=c.getId()),c=a.l,-1===["#text","span","br"].indexOf($x(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=Wx(),b=new Cx(c,"#text"===a.h.nodeName?a.h.textContent:null,"br"===$x(a),a.a,a.j,Ux(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"===$x(a)||a.j?(c=Wx(),b=new Cx(c,null,!1,a.a,a.j,Ux(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=Xx(d);f=[];a=_.w(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
28
+ _.ah(c.value.build(d.l)));return{cues:e,styles:f}};ey.prototype.a=function(a){a=(new dy(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=fy(c.startTime)+" --\x3e "+fy(c.endTime),e=[];switch(c.textAlign){case _.ye:e.push("align:left");break;case _.Pf:e.push("align:right");break;case _.oi:e.push("align:middle");break;case _.ye:e.push("align:start");break;case _.Pf:e.push("align:end")}switch(c.writingMode){case _.Dg:e.push("vertical:lr");break;
29
+ case _.Fg:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.S.Ya(b)};gy.prototype.probe=function(a,b){return a===_.Xc&&b===_.lg};gy.prototype.create=function(a){return new ey(a)};hy.prototype.parseInit=function(a){var b=!1;(new _.Nm).M(_.Qe,_.Om).M(_.pg,_.Om).M(_.Le,_.Om).M(_.Pe,_.Om).M(_.eg,_.Om).Y(_.gg,_.Pm).M("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.N(_.O,2,2007);};
30
+ hy.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Nm).M("moof",_.Om).M("traf",_.Om).Y("subs",function(h){for(var l=_.W(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.Im(h.reader),p=0;p<n;++p){var q=1===h.version?_.W(h.reader):_.Im(h.reader);g.push(q);h.reader.skip(6)}}}).M(_.Ke,_.Qm(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(iy,_.Us);iy.prototype.f=function(){_.pu(_.Xc,dy);_.pu(_.Vc,hy);_.pu(ax,hy);_.pu(cx,hy);_.pu(bx,hy);_.Gk.push(this.j)};iy.prototype.a=function(){_.ru(_.Xc);_.ru(_.Vc);_.ru(ax);_.ru(cx);_.ru(bx);_.Ik(this.j)};iy.prototype.id=function(){return"subtitles-ttml"};_.J("clpp.ttml.TtmlComponent",iy);};
30
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
31
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
32
33
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,9 +1,9 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Uw="VerimatrixVCAS",Vw="clpp.verimatrix.Vcas",Ww="clpp.verimatrix.VcasComponent",bx=function(a){_.Em.call(this,Uw);var b={};b[Xw]=Xw;b[Yw]=Yw;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Zw: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?$w:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
- this.D=d;this.B=b;this.w=ax(this,e);this.o=ax(this,f);this.l=ax(this,g);this.j=h;this.H=l;this.G=m;this.g=new _.K(Vw);_.S.empty(this.w)?this.g.warn(_.tc):this.Ua(_.Vd,{licenseUrl:this.w,videoRobustness:[_.$b,void 0],audioRobustness:[_.Zb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.S.empty(this.o)?this.g.warn(_.Nb):this.Ua(_.Td,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
- _.S.empty(this.l)?this.g.warn(_.eb):_.S.empty(this.j)?this.g.warn(_.db):this.Ua(_.Rd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},ax=function(a,b){if(a.D===Zw){var c=Object.assign({},{deviceId:_.zj(_.S.jd(a.A))},a.a&&{authenticator:_.zj(_.S.jd(a.a))});return b+_.vk(c)}return b},cx=function(){this.g=new _.K(Ww)};_.x(bx,_.Em);
5
- bx.prototype.h=function(a,b){if(this.D===dx){var c=this.B[Yw],d={};d[this.B[Xw]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};bx.prototype.I=function(a,b){var c=_.$m(b);switch(this.G){case ex:c=_.vk({r:c,mo:this.H},!0)}return c};bx.prototype.K=function(a,b){this.h(a,b);_.cn(b)};bx.prototype.L=function(a,b){_.dn(b)};_.J(Vw,bx);bx.prototype.constructor=bx.prototype.constructor;bx.NAME=Uw;var Zw="query-string",dx="http-header";
6
- bx.LicenseRequestVuidLocation={QUERY_STRING:Zw,HTTP_HEADER:dx};var Xw="DeviceId",Yw="Authenticator";bx.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Xw,AUTHENTICATOR_HEADER:Yw};var $w="keyid",ex="contentid-siteid";bx.FairPlayAssetIdStrategy={KEYID:$w,CONTENTID_SITEID:ex};_.x(cx,_.Ts);cx.prototype.a=function(){delete _.ym.VerimatrixVCAS};cx.prototype.h=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===Uw){a=a.drm.customData;if(!a)throw new _.N(_.O,7,7100,_.Wd);a=new bx(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.zm(a)}};cx.prototype.id=function(){return"verimatrix-vcas"};_.J(Ww,cx);};
2
+ var f=function(window){var Pw="VerimatrixVCAS",Qw="clpp.verimatrix.Vcas",Rw="clpp.verimatrix.VcasComponent",Xw=function(a){_.Am.call(this,Pw);var b={};b[Sw]=Sw;b[Tw]=Tw;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Uw: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?Vw:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
+ this.C=d;this.B=b;this.w=Ww(this,e);this.o=Ww(this,f);this.l=Ww(this,g);this.j=h;this.H=l;this.G=m;this.g=new _.K(Qw);_.S.empty(this.w)?this.g.warn(_.oc):this.Wa(_.Pd,{licenseUrl:this.w,videoRobustness:[_.Vb,void 0],audioRobustness:[_.Ub,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.S.empty(this.o)?this.g.warn(_.Jb):this.Wa(_.Nd,{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(_.ab):this.Wa(_.Ld,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},Ww=function(a,b){if(a.C===Uw){var c=Object.assign({},{deviceId:_.wj(_.S.nd(a.A))},a.a&&{authenticator:_.wj(_.S.nd(a.a))});return b+_.rk(c)}return b},Yw=function(){this.g=new _.K(Rw)};_.x(Xw,_.Am);
5
+ Xw.prototype.h=function(a,b){if(this.C===Zw){var c=this.B[Tw],d={};d[this.B[Sw]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Xw.prototype.I=function(a,b){var c=_.Wm(b);switch(this.G){case $w:c=_.rk({r:c,vo:this.H},!0)}return c};Xw.prototype.K=function(a,b){this.h(a,b);_.Zm(b)};Xw.prototype.L=function(a,b){_.$m(b)};_.J(Qw,Xw);Xw.prototype.constructor=Xw.prototype.constructor;Xw.NAME=Pw;var Uw="query-string",Zw="http-header";
6
+ Xw.LicenseRequestVuidLocation={QUERY_STRING:Uw,HTTP_HEADER:Zw};var Sw="DeviceId",Tw="Authenticator";Xw.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Sw,AUTHENTICATOR_HEADER:Tw};var Vw="keyid",$w="contentid-siteid";Xw.FairPlayAssetIdStrategy={KEYID:Vw,CONTENTID_SITEID:$w};_.x(Yw,_.Us);Yw.prototype.a=function(){delete _.um.VerimatrixVCAS};Yw.prototype.h=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===Pw){a=a.drm.customData;if(!a)throw new _.N(_.O,7,7100,_.Qd);a=new Xw(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.vm(a)}};Yw.prototype.id=function(){return"verimatrix-vcas"};_.J(Rw,Yw);};
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));}