@castlabs/prestoplay 6.25.2 → 6.27.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 (69) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +5 -5
  3. package/cjs/cl.adobe.js +3 -3
  4. package/cjs/cl.airplay.js +3 -3
  5. package/cjs/cl.broadpeak.js +7 -7
  6. package/cjs/cl.cast.js +115 -114
  7. package/cjs/cl.conviva.js +32 -32
  8. package/cjs/cl.core.js +620 -620
  9. package/cjs/cl.crypto.js +9 -9
  10. package/cjs/cl.dash.js +89 -88
  11. package/cjs/cl.externs.js +89 -51
  12. package/cjs/cl.freewheel.js +25 -25
  13. package/cjs/cl.hls.js +79 -77
  14. package/cjs/cl.hlssmpte.js +6 -6
  15. package/cjs/cl.htmlcue.js +30 -30
  16. package/cjs/cl.ima.js +24 -24
  17. package/cjs/cl.mediatailor.js +3 -3
  18. package/cjs/cl.mse.js +351 -336
  19. package/cjs/cl.muxdata.js +15 -15
  20. package/cjs/cl.onboard.js +3 -3
  21. package/cjs/cl.persistent.js +15 -15
  22. package/cjs/cl.playlist.js +6 -6
  23. package/cjs/cl.sessions.js +16 -16
  24. package/cjs/cl.simid.js +17 -17
  25. package/cjs/cl.smooth.js +72 -72
  26. package/cjs/cl.thumbnails.js +26 -26
  27. package/cjs/cl.tizen.js +73 -72
  28. package/cjs/cl.ttml.js +29 -29
  29. package/cjs/cl.verimatrix.js +5 -5
  30. package/cjs/cl.vimond.js +12 -12
  31. package/cjs/cl.vr.js +19 -19
  32. package/cjs/cl.vtt.js +14 -14
  33. package/cjs/cl.yospace.js +4 -4
  34. package/cjs/cl.youbora.js +39 -37
  35. package/cjs/polyfill.min.js +15 -3
  36. package/cl.adobe.js +3 -3
  37. package/cl.airplay.js +3 -3
  38. package/cl.broadpeak.js +5 -5
  39. package/cl.cast.js +92 -90
  40. package/cl.conviva.js +27 -27
  41. package/cl.core.js +496 -500
  42. package/cl.crypto.js +9 -9
  43. package/cl.dash.js +82 -82
  44. package/cl.externs.js +89 -51
  45. package/cl.freewheel.js +19 -19
  46. package/cl.hls.js +80 -80
  47. package/cl.hlssmpte.js +5 -5
  48. package/cl.htmlcue.js +26 -26
  49. package/cl.ima.js +17 -17
  50. package/cl.mediatailor.js +3 -3
  51. package/cl.mse.js +305 -294
  52. package/cl.muxdata.js +13 -13
  53. package/cl.onboard.js +4 -4
  54. package/cl.persistent.js +11 -11
  55. package/cl.playlist.js +5 -5
  56. package/cl.sessions.js +10 -10
  57. package/cl.simid.js +14 -14
  58. package/cl.smooth.js +60 -60
  59. package/cl.thumbnails.js +19 -19
  60. package/cl.tizen.js +57 -57
  61. package/cl.ttml.js +22 -22
  62. package/cl.verimatrix.js +4 -4
  63. package/cl.vimond.js +8 -8
  64. package/cl.vr.js +15 -15
  65. package/cl.vtt.js +12 -12
  66. package/cl.yospace.js +3 -3
  67. package/cl.youbora.js +29 -28
  68. package/package.json +3 -3
  69. package/typings.d.ts +124 -3
package/cjs/cl.tizen.js CHANGED
@@ -1,76 +1,77 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var IN="An unknown error occurred while trying to get volume",JN="Cannot get loading rendition due to platform limitations",KN="PARAM_START_POSITION",LN="SecurityError",MN="The require privilege is: http://tizen.org/privilege/tv.audio",NN="|STARTBITRATE\x3d",ON=function(a,b,c){function d(e){c.call(a,e);a.removeEventListener(b,d)}a.addEventListener(b,d)},PN=function(a,b){this.h=a;this.o=null;this.a=_.Qe;this.l=null;this.j=!1;this.f=new Map;this.F=b;this.g=new _.J("clpp.tizen.DrmEngine")},SN=function(a){var b,
3
- c,d;return _.H(function(e){if(1==e.a){b=a.a===_.Gd||a.a===_.Ed;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.ue)throw new _.N(_.O,6,6012,"No license server given for "+a.a);_.C(e,2);return a.a===_.Gd?_.x(e,QN(a),5):_.x(e,RN(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.ue,distinctiveIdentifierRequired:!1,persistentStateRequired:c.Cg,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],
4
- keyIds:[],periodId:null},_.uh(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)});})},RN=function(a,b){var c,d,e,f;return _.H(function(g){c=TN;d=UN;e={};e[d.uj]=!b.Cg;e[d.yj]=b.ue;""!==b.customData&&(e[d.tj]=b.customData);f=JSON.stringify(e);a.g.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(h){throw h;}_.y(g)})},QN=function(a){var b;return _.H(function(c){b=TN;try{webapis.avplay.setDrm(b.Pe,
5
- "Initialize",""),webapis.avplay.setDrm(b.Pe,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.Pe,"widevine_data_type",a.l.type)}catch(d){throw d;}_.y(c)})},VN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,D,G;_.H(function(B){if(1==B.a){c=TN;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.ue;l=_.ck([h],_.Yj());l.type=3;l.body=f.buffer;l.method=
6
- _.sb;_.C(B,2);return _.x(B,a.F.Db.fetch(l).S,4)}if(2!=B.a){m=B.f;if(a.j){n=_.Oj(m.data);p=n.byteLength;q="";for(t=0;t<p;t++)q+=String.fromCharCode(n[t]);v=btoa(q);z=b.session_id+KN+(v+KN);a.g.debug("Widevine license params",z);try{webapis.avplay.setDrm(c.Pe,"widevine_license_data",z)}catch(F){a.g.error("License response rejected by CDM"),A=new _.N(_.O,6,6008,{browserError:JSON.stringify(F)}),a.F.onError(A)}}return _.uh(B,0)}D=_.E(B);a.g.error("License request failed.",JSON.stringify(D));G=new _.N(_.O,
7
- 6,6007,{message:"Error while fetching license!",url:D.data.url,status:D.data.status||NaN,response:D.data.response||"",headers:D.data.headers||{}},D);a.F.onError(G);_.y(B)})},WN=function(a){this.m=a;this.a=this.m.a;this.f=_.tq;this.j=_.uq;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.J("clpp.tizen.StateManager")},YN=function(a,b){if(a.f!==b)if(a.f===_.Eq&&b!==_.tq)a.g.debug(_.UC+XN(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;a.f===_.yq?(a.o=(new Date).getTime(),a.m.trigger(new _.K(_.ad,
8
- {detail:{bufferedTimeMS:-1,reason:a.h}}))):a.j===_.yq&&a.m.trigger(new _.K(_.$c,{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 _.K(_.bg,{detail:d}));a.g.debug("State changed:",XN(a.j),"-\x3e",XN(a.f))}},XN=function(a){return Object.keys(_.Cq)[a]},aO=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case ZN:c=_.Hq;break;case $N:c=_.Gq;break;default:a.m.isEnded()?c=_.Aq:a.g.debug("Inconsistent AVPlay playback state:",
9
- b)}YN(a,c)}},bO=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 _.J("clpp.tizen.TextStreamer")},cO=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},dO=function(a){var b,c;return _.H(function(d){if(1==d.a)return b=a.m.getConfiguration(),c=null,_.x(d,_.av(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
- eO=function(a){var b=document.createElement(_.Jg),c=new _.AG,d=new _.cE,e=a.m.getTextDisplayer();return new _.CG(b,c,e,d,a.m.getConfiguration())},fO=function(a){var b={configuration:{},Pb:function(){return a.m.getPosition()},X:a.h,Db:a.m.getNetworkEngine(),od:null,ug:a.gl.bind(a),tg:a.fl.bind(a),onError:a.hl.bind(a),Ii:function(){},onEvent:function(){},Ni:a.il.bind(a),uf:function(){},fe:function(){return new _.pH},Wf:function(){return!1},$d:null};return new _.WH(a.a,b)},gO=function(a){var b=a.m.getPosition(),
11
- c=null;a=_.u(a.a.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c},hO=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++),_.S);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=
12
- a[d].kind||_.rD;var f=new _.Lk(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},iO=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.ZH(a.f,_.pj),c=null;if(b){a=hO(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},jO=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===_.ke,a.a&&a.f)){a.setTextVisibility(!0);
13
- var c=gO(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):(_.kI(a.f,c,!0,0),a.m.trigger(new _.K(_.mg))),a.o=c.language):a.g.error("No stream with id",d.id)}},kO=function(){this.j=this.a=this.m=null;this.f={};this.g=new _.J("clpp.tizen.TrackManager");this.w=this.o=this.l=null;this.A=!1;this.h=1},lO=function(a,b){a.m.trigger(new _.K(_.Ng,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,
14
- abrSelection:a.a.o}}))},mO=function(a){var b=a.ma();b&&a.m.trigger(new _.K(_.Yc,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},nO=function(a){var b=a.m.getConfiguration(),c=_.Gi(b.preferredAudioLanguage||[]),d=a.f[_.T]||[];if(d.length){var e=null;c.some(function(g){e=_.OD(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.Ia(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},rO=function(a,b){if(b){var c=b.track.type.toUpperCase();oO(a.a,c,Number(b.id)).then(function(){c===pO&&(a.l=b,a.m.trigger(new _.K(_.Wc)));c===qO&&(a.o=b,a.m.trigger(new _.K(_.mg)))})["catch"](function(){a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},sO=
16
- function(a,b,c){var d=_.Cj(b.language||_.wg);c.language=_.Ek(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.Tc;a=new _.Lk(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},tO=function(a,b,c){c.mimeType=_.Lg;a=new _.Lk(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},uO=function(a,b,c){b=_.Cj(b.track_lang||_.wg);c.mimeType="text/ttml";
17
- c.language=_.Ek(b);c.originalLanguage=b;c.kind=_.rD;return new _.Lk(String(a),c)},vO=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},yO=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===wO}),f=b.filter(function(n){return n.type===pO}),g=[],h=0;h<f.length;h++){var l=vO(a,f[h].extra_info);if(l){var m=
18
- _.Cj(l.language||_.wg);m=_.Ek(m);m=c(g,m);m||(m=new _.Dk(String(a.h++),_.T),g.push(m));m.renditions.push(sO(f[h].index,l,m))}else a.g.warn("Skipping audio stream with no extra info")}f=new _.Dk(String(a.h++),_.Fk);for(h=0;h<e.length;h++)(l=vO(a,e[h].extra_info))?f.renditions.push(tO(e[h].index,l,f)):a.g.warn("Skipping video stream with no extra info");e=[];e=a.j?hO(a.j):xO(a,b);d[_.Fk]=[f];d[_.T]=g;d[_.S]=e;return d},xO=function(a,b){for(var c=b.filter(function(h){return h.type===qO}),d=[],e=0;e<
19
- c.length;e++){var f=vO(a,c[e].extra_info);if(f){var g=new _.Dk(String(a.h++),_.S);g.renditions.push(uO(c[e].index,f,g));d.push(g)}else a.g.warn("Skipping text stream with no extra info")}return d},zO=function(a,b){for(var c=a.f[_.Fk]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.L.pa(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},AO=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},CO=function(a,b){if(b===_.S&&a.j)return iO(a.j);var c=BO(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===b.toUpperCase()})[0];var d=null;b===_.Fk&&(d=vO(a,c.extra_info),d=zO(a,{width:d.Width,height:d.Height}));b===_.T&&(c?(d=AO(a,c,_.T),a.l=d):d=a.l);b===_.S&&(c?(d=AO(a,c,_.S),a.o=d):d=a.o);return d},DO=function(a){_.mm.call(this);this.m=a;this.h=null;this.g=new _.J("clpp.tizen.Middleware");this.C=1;this.B=!1;this.l=null;this.G=0;
21
- this.o=!0;this.f=!1;this.a=null;this.A=1;this.w=!1;this.j={}},EO=function(a){return _.H(function(b){tizen.systeminfo.getPropertyValue("DISPLAY",function(c){a.A=c.resolutionWidth/1920;a.g.debug("Display resolution ratio: ",a.A)},function(c){a.g.debug("Could not load DISPLAY property");throw c;});_.y(b)})},GO=function(a){try{webapis.avplay.setListener({onbufferingstart:a.Zk.bind(a),onbufferingprogress:a.Yk.bind(a),onbufferingcomplete:a.Xk.bind(a),onstreamcompleted:a.cl.bind(a),oncurrentplaytime:function(b){a.trigger(new _.K(FO,
22
- {currentTime:b}))},onevent:a.al.bind(a),onsubtitlechange:a.el.bind(a),ondrmevent:a.$k.bind(a),onerror:a.Wd.bind(a)})}catch(b){a.g.error(b)}},HO=function(a){var b=!!a.m.getTrackManager().Wa();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",c)}},IO=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.g.debug({estimatedBandwidth:c,jp:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",NN+d)}catch(e){a.g.debug(e)}},
23
- JO=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+NN+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",c),c;}},MO=function(a){return{position:a.getPosition(),state:a.m.getState(),ph:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:KO(a),volume:a.getVolume(),Eo:LO(a),ul:BO(a)}},OO=function(a){var b,c;return _.H(function(d){if(1==d.a)return _.x(d,NO(),2);if(3!=d.a)return b=new Promise(function(e){(new _.Xh(e)).ga(5)}),
24
- _.x(d,Promise.race([EO(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"));_.y(d)})},UO=function(a,b,c){var d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:a.l=_.Lq(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 _.K(PO)),f=c.currentPosition);
25
- _.C(p,2);g=a.l[d].url;h=a.l[d].type;h!==_.Ic||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);e.nextBandwidth?(JO(a,e.nextBandwidth),a.o=!1):(a.o||IO(a,e),a.o=!0);GO(a);if(!b.drm||!b.drm.env){a.g.debug("No DRM configuration was provided. Assuming clear content");p.D(4);break}m={onError:function(q){return a.m.onError(q)},Db:a.m.getNetworkEngine()};a.h=new PN(b.drm,m);return _.x(p,a.h.init(),4);case 4:return a.f||a.trigger(new _.K(QO)),
26
- _.x(p,RO(a),6);case 6:a.f||a.trigger(new _.K(SO));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&&TO(a,b.muted),b.autoplay&&a.m.play()["catch"](function(q){a.g.debug("Autoplay failed",q)}));_.uh(p,0);break;case 2:throw n=_.E(p),a.g.debug("Error while attempting to load source."),n;}})},RO=function(a){return _.H(function(b){a.g.debug("avplay.prepare()");return b["return"](new Promise(function(c,d){try{webapis.avplay.prepareAsync(function(){a.g.debug("AVPlay is ready!");
27
- HO(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)}}))})},VO=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=MO(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(function(){var e=a.a.ph;a.f=!1;a.a=
28
- null;return e===$N?a.pause():a.play()})}catch(e){return Promise.reject(e)}},LO=function(a){return a.f&&a.a?a.a.Eo:webapis.avplay.getTotalTrackInfo()},BO=function(a){return a.f&&a.a?a.a.ul:webapis.avplay.getCurrentStreamInfo()},oO=function(a,b,c){b=b.toUpperCase();b===qO&&WO(a,!0);var d=a.j[b];d&&(d.Ff.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,lh:0,Ff:new _.Xh(function(){return g(h,c,!0)})}),(l=a.j[h])&&3>l.lh?(!a.w&&++l.lh,l.Ff.ga(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),l&&l.Ff.stop(),a.j[h]=null,f())}}g(b,c)})},WO=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)}},TO=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case LN:a.g.warn("The application does not have the privilege to set mute.",MN);break;default:a.g.warn(IN,c)}}},KO=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case LN:a.g.warn("The application doesn't have the privilege to get the mute state.",MN);break;default:a.g.warn(IN,c)}}return!!b},NO=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");
31
- ON(c,_.Be,function(d){return a(d)});ON(c,_.ie,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},XO=function(){_.mm.call(this);this.a=new DO(this);this.f=new WN(this);this.configuration=this.B=_.tm();this.w=null;this.g=new _.J("clpp.tizen.Player");this.j=null;this.l=new kO;this.C=new _.vk;this.o=this.h=null;this.A=!1},YO=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())},ZO=function(){},$O=function(){};
33
- PN.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.H(function(h){if(1==h.a){b=_.Vm[a.h.env]||null;if(!b)throw a.g.debug(_.Ea,_.xb+a.h.env+_.aa),new _.N(_.O,6,6015,_.Fa+a.h.env+"' is missing.");a.l={id:String(Math.floor(1E4*Math.random())),type:"MPEG-DASH"};c=Object.keys(a.h.customData||{}).length?btoa(JSON.stringify(a.h.customData)):"";d=_.Xm(b,a.h.customData);(e=d[_.Ed])&&a.f.set(_.Ed,{ue:e.licenseUrl||"",customData:c,Cg:!1});(f=d[_.Gd])&&a.f.set(_.Gd,{ue:f.licenseUrl||"",customData:c,
34
- Cg:!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(_.Ed))a.a=_.Ed;else if(a.f.get(_.Gd))a.a=_.Gd;else throw new _.N(_.O,6,6001,"Configuration for the target system is missing.");return _.x(h,SN(a),2)}a.j=!0;_.y(h)})};PN.prototype.release=function(){var a=this;return _.H(function(b){a.j=!1;a.o=null;a.a=_.Qe;a.l=null;a.f=new Map;_.y(b)})};PN.prototype.getDrmInfo=function(){return this.o};
35
- var UN={uj:"DeleteLicenseAfterUse",yj:"LicenseServer",Uo:"GetChallenge",Vo:"HttpHeader",Xo:"UserAgent",Ro:"Cookie",tj:"CustomData"};_.r=WN.prototype;_.r.initialize=function(){this.a.on(PO,this.Gh,this);this.a.on(aP,this.Fh,this);this.a.on(bP,this.Eh,this);this.a.on(QO,this.Pi,this);this.a.on(SO,this.Oi,this);this.a.on(cP,this.Hh,this)};_.r.release=function(){YN(this,_.tq);this.l=!1;this.o=-1;this.h=2};_.r.destroy=function(){this.release();this.a.off(PO,this.Gh);this.a.off(aP,this.Fh);this.a.off(bP,this.Eh);this.a.off(QO,this.Pi);this.a.off(SO,this.Oi);this.a.off(cP,this.Hh);this.m=this.a=null};
36
- _.r.Gh=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;YN(this,_.yq)};_.r.Fh=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",XN(this.f))};_.r.Eh=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()===dP;if(!a&&b){YN(this,_.Gq);return}}if(a=this.f!==_.Fq)a=this.a.getState(),a=a===ZN||a===$N;a&&aO(this)};
37
- _.r.Pi=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===eP?YN(this,_.Fq):this.g.error("AVPlay prepares while state is not IDLE")};_.r.Oi=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.r.Hh=function(){YN(this,_.Aq)};_.r.getState=function(){return this.f};_.r=bO.prototype;_.r.initialize=function(a){this.m=a};
38
- _.r.load=function(a){var b=this,c,d,e,f,g,h,l;return _.H(function(m){switch(m.a){case 1:if(!b.m)return b.g.debug("Text streamer is not initialized. Will not load()"),m["return"]();b.B=a;c=b;return _.x(m,dO(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(),onContentSteeringInfoFound:function(){return null},filterNewPeriod:function(){},filterAllPeriods:function(){},
39
- onEvent:function(){},onError:function(){}};_.C(m,3);e=b;return _.x(m,b.j.start(a.url,d),5);case 5:e.a=m.f;_.uh(m,4);break;case 3:return f=_.E(m),b.g.warn(f),_.C(m,6),g=b,_.x(m,b.j.start(a.url.replace("https://","http://"),d),8);case 8:g.a=m.f;_.uh(m,4);break;case 6:h=_.E(m),b.g.error(h),b.a=null;case 4:if(!b.a||!cO(b.a)){m.D(0);break}b.h=eO(b);_.C(m,10);return _.x(m,b.h.open(),12);case 12:b.f=fO(b);l=b.m.getConfiguration();b.f.h=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;b.C=
40
- l.preferForcedSubtitles;_.uh(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,_.y(m)}})};_.r.gl=function(a){this.g.debug(_.lD,a);this.w=!0;var b=_.oH(a.textStreams,this.o||"",this.A||"",this.C)[0]||null;this.l&&(a.textStreams.includes(this.l)&&(b=this.l),this.l=null);return{video:null,audio:null,text:b,eb:null}};_.r.fl=function(){this.g.debug("canSwitch_");this.w=!1;this.l&&(_.kI(this.f,this.l,!0,0),this.l=null)};_.r.hl=function(){this.g.debug("onError_")};
41
- _.r.il=function(){this.j&&this.j.update&&this.j.update()};_.r.start=function(){var a=this;return _.H(function(b){if(!a.f)return b["return"]();try{a.f.start()}catch(c){a.g.error("Error while starting streaming engine",c)}_.y(b)})};_.r.setTextVisibility=function(a){this.g.debug("Set text visibility",a);this.h&&this.h.getTextDisplayer().setTextVisibility(a)};_.r.release=function(){var a=this;return _.H(function(b){a.m=null;a.a=null;a.B=null;a.A=null;a.o=null;a.w=!0;a.l=null;_.y(b)})};
42
- _.r.destroy=function(){var a=this;return _.H(function(b){switch(b.a){case 1:if(!a.j){b.D(2);break}return _.x(b,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.f){b.D(4);break}return _.x(b,a.f.destroy(),5);case 5:a.f=null,a.w=!0;case 4:if(!a.h){b.D(0);break}return _.x(b,a.h.destroy(),7);case 7:a.h=null,_.y(b)}})};_.w(kO,_.gl);_.r=kO.prototype;_.r.Gi=function(a){var b=a.eventid;a=a.data;switch(b){case fP:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+vO(this,b[0].extra_info).Bit_rate,b=zO(this,{bandwidth:b}))&&(this.w=b,lO(this,b));break;case gP:mO(this);break;default:this.g.debug("Event type: "+b+" data: "+a)}};_.r.yg=function(a){a.detail.currentState===_.Hq&&this.m.off(_.bg,this.yg)};
43
- _.r.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.bg,function(c){b.A||(c=c.detail,c.currentState===_.Hq&&(b.g.debug("Current state",c.currentState),b.A=!0,nO(b)))});this.a.on(hP,this.Gi,this)};_.r.release=function(){this.f={};this.j=this.w=this.o=this.l=null;this.A=!1;this.h=1};
44
- _.r.load=function(){if(this.a&&!(0<Object.keys(this.f).length)){this.j=this.m.h;this.m.off(_.bg,this.yg);this.m.on(_.bg,this.yg,this);try{var a=LO(this.a);this.f=yO(this,a);var b=this.f[_.T]||[];b.length&&(this.l=b[0].renditions[0]||null);mO(this)}catch(c){this.g.debug("Could not load track manager")}}};_.r.destroy=function(){this.a.off(hP,this.Gi);this.a=this.m=null};_.r.getVideoTracks=function(){return this.f[_.Fk]||[]};_.r.getAudioTracks=function(){return this.f[_.T]||[]};
45
- _.r.la=function(){return this.f[_.S]||[]};_.r.ma=function(){return CO(this,_.Fk)};_.r.Sa=function(){return CO(this,_.T)};_.r.Wa=function(){return CO(this,_.S)};_.r.Ab=function(){return this.w};_.r.Mb=function(){this.g.info(JN);return null};_.r.Nb=function(){this.g.info(JN);return null};_.r.La=function(){var a=this.ma();return a?a.track:null};_.r.qa=function(){var a=this.Sa();return a?a.track:null};_.r.Ba=function(){var a=this.Wa();return a?a.track:null};
46
- _.r.Ib=function(a){var b=this;null===a?(a=this.ma(),VO(this.a,a.bandwidth,null).then(function(){mO(b)})):0<a.renditions.length&&this.sb(a.renditions[0])};_.r.Ia=function(a){a?rO(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.r.Xa=function(a){a?(a=a.renditions[0],this.j?jO(this.j,a.track):rO(this,a)):(this.g.debug("Disabling text tracks"),this.o=null,WO(this.a,!1),this.m.trigger(new _.K(_.mg)))};
47
- _.r.sb=function(a){var b=this,c=this.ma();this.a.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,lO(this,a),VO(this.a,c.bandwidth,a.bandwidth).then(function(){mO(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...")};_.r.Gb=function(a){rO(this,a)};_.r.Hb=function(a){this.j?jO(this.j,a.track):rO(this,a)};
48
- _.r.addTextTrack=function(){};_.r.va=function(){return this.a.o};kO.prototype.isAbrEnabled=kO.prototype.va;kO.prototype.addTextTrack=kO.prototype.addTextTrack;kO.prototype.setTextRendition=kO.prototype.Hb;kO.prototype.setAudioRendition=kO.prototype.Gb;kO.prototype.setVideoRendition=kO.prototype.sb;kO.prototype.setTextTrack=kO.prototype.Xa;kO.prototype.setAudioTrack=kO.prototype.Ia;kO.prototype.setVideoTrack=kO.prototype.Ib;kO.prototype.getTextTrack=kO.prototype.Ba;kO.prototype.getAudioTrack=kO.prototype.qa;
49
- kO.prototype.getVideoTrack=kO.prototype.La;kO.prototype.getLoadingTextRendition=kO.prototype.Nb;kO.prototype.getLoadingAudioRendition=kO.prototype.Mb;kO.prototype.getLoadingVideoRendition=kO.prototype.Ab;kO.prototype.getTextRendition=kO.prototype.Wa;kO.prototype.getAudioRendition=kO.prototype.Sa;kO.prototype.getVideoRendition=kO.prototype.ma;kO.prototype.getTextTracks=kO.prototype.la;kO.prototype.getAudioTracks=kO.prototype.getAudioTracks;kO.prototype.getVideoTracks=kO.prototype.getVideoTracks;_.w(DO,_.mm);_.r=DO.prototype;_.r.Zk=function(){this.w=!0;this.f||this.trigger(new _.K(PO))};_.r.Yk=function(a){this.w=!0;this.trigger(new _.K(aP,{percent:a}))};_.r.Xk=function(){this.w=!1;this.trigger(new _.K(bP))};_.r.cl=function(){this.trigger(new _.K(cP))};_.r.al=function(a,b){this.trigger(new _.K(hP,{eventid:a,data:b}))};_.r.el=function(a,b,c,d,e){this.trigger(new _.K(iP,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
50
- _.r.$k=function(a,b){this.trigger(new _.K(jP,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Gd&&"Challenge"===b.name)VN(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.F.onError(d)}}};_.r.Wd=function(a){this.trigger(new _.K(kP,{eventType:a}))};
51
- _.r.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(FO,f,b);g=setTimeout(function(){b.off(FO,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===eP)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){HO(b);d(webapis.avplay.play())},function(f){b.trigger(new _.K(kP));e(f)})})).then(function(){return a()});if(c===$N||c===dP)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===ZN?
52
- Promise.resolve():Promise.reject("Player is in invalid state")};_.r.pause=function(){try{webapis.avplay.pause()}catch(a){Promise.reject(a)}return this.getState()===$N?Promise.resolve():Promise.reject()};
53
- _.r.setPlaybackRate=function(a){var b=this.getState();if(b===dP||b===ZN||b===$N){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};_.r.getPlaybackRate=function(){return this.C};
54
- _.r.load=function(a,b){var c=this,d;return _.H(function(e){switch(e.a){case 1:return c.g.debug("configure()",b||""),_.C(e,2),_.x(e,OO(c),4);case 4:return _.x(e,UO(c,a,b),5);case 5:_.uh(e,0);break;case 2:throw d=_.E(e),new _.N(_.O,7,7003,null,d);}})};_.r.getState=function(){if(this.f&&this.a)return this.a.ph;try{return webapis.avplay.getState()}catch(a){this.Wd(JSON.stringify(a))}};
55
- _.r.seek=function(a){var b=this,c=1E3*a;return new Promise(function(d,e){b.B=!0;b.m.trigger(new _.K(_.Cg));webapis.avplay.seekTo(c,function(){b.B=!1;b.m.trigger(new _.K(_.Bg));d()},function(){b.B=!1;e()})})};_.r.getPosition=function(){if(this.f&&this.a)return this.a.position;try{return webapis.avplay.getCurrentTime()/1E3}catch(a){this.Wd(JSON.stringify(a))}};_.r.getDuration=function(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.Wd(JSON.stringify(a))}};
56
- _.r.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.Ff.stop()}a.j={};a.C=1;a.B=!1;a.l=null;a.a=null;return b()}catch(f){return c(f)}})};_.r.getVolume=function(){var a=null;try{a=tizen.tvaudiocontrol.getVolume()}catch(b){switch(b.name){case LN:this.g.debug("The application does not have the privilege to get the volume.",MN);break;default:this.g.debug(IN,b)}}return a};
57
- _.r.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 LN:this.g.warn("The application does not have the privilege to set the volume.",MN);break;default:this.g.warn("An unknown error occurred while trying to set volume",b)}}};
58
- _.r.isLive=function(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.Wd(JSON.stringify(a))}};_.r.stop=function(){try{webapis.avplay.stop()}catch(a){this.g.debug(a)}};_.r.getDrmInfo=function(){this.h&&this.h.getDrmInfo();return null};_.r.setSourceIndex=function(a){this.G=a};_.r.getSourceIndex=function(){return this.G};_.r.getLoadedSource=function(){return this.l&&this.l[this.getSourceIndex()]};
59
- var eP="IDLE",dP="READY",ZN="PLAYING",$N="PAUSED",wO=_.Vb,pO=_.ja,qO="TEXT",gP="PLAYER_MSG_RESOLUTION_CHANGED",fP="PLAYER_MSG_BITRATE_CHANGE",TN={PLAYREADY:"PLAYREADY",So:"EME_PLAYREADY",Yo:"VERIMATRIX",Pe:"WIDEVINE_CDM",To:"EME_WIDEVINE_CDM",$o:"WIDEVINE_CLASSIC"};_.w(XO,_.mm);_.r=XO.prototype;_.r.Ch=function(){var a=this;this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.K(_.he));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.g.debug("Could not loop playback")}):this.a.stop()};_.r.zh=function(a){this.trigger(new _.K(_.rg,{currentTime:a.currentTime/1E3}))};
60
- _.r.Dh=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=_.Q.Pg(d))&&this.o.append([new _.Si(b,c,d)],[])};_.r.Ah=function(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.r.Hi=function(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)};
61
- _.r.Bh=function(a){this.g.debug("Error: TYPE: "+a.eventType);YN(this.f,_.Eq);a=new _.N(_.O,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.K(_.ie,{detail:a}))};
62
- _.r.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(cP,this.Ch,this);this.a.on(FO,this.zh,this);this.a.on(iP,this.Dh,this);this.a.on(jP,this.Ah,this);this.a.on(kP,this.Bh,this);this.a.on(bP,this.Hi,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();var c=lP;lP+=1;this.j=_.er(_.Re,{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=[_.Yg,_.pe,"position",_.ve,"top"],f={};d=null!==d.parentElement?window.getComputedStyle(d,null):d.style;if(!e||0===e.length){e||(e=[]);for(var g in d)e.push(g)}g=_.u(e);for(e=g.next();!e.done;e=g.next())e=e.value,f[e]=d[e];_.gr(c,f);YO(this)}};_.r.getSurface=function(){return this.w};_.r.getConfiguration=function(){return this.configuration};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.ob)};_.r.appendLoad=function(){return Promise.reject(_.ob)};
64
- _.r.seekWith=function(){return Promise.reject(_.ob)};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};
65
- _.r.destroy=function(){var a=this;return _.H(function(b){switch(b.a){case 1:return _.x(b,a.release(),2);case 2:a.a.off(cP,a.Ch);a.a.off(FO,a.zh);a.a.off(iP,a.Dh);a.a.off(jP,a.Ah);a.a.off(kP,a.Bh);a.a.off(bP,a.Hi);if(!a.h){b.D(3);break}return _.x(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,_.y(b)}})};_.r.namespace=function(){return mP};_.r.getPlaybackRate=function(){return this.a.getPlaybackRate()};
66
- _.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.setPlaybackRate=function(a){this.a.setPlaybackRate(a)};_.r.getPosition=function(){return this.getMediaPosition()};_.r.getMediaPosition=function(){return 0<(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.Aq?this.getDuration():this.a.getPosition()||0};_.r.seek=function(a){return typeof a===_.k&&0<=a?(this.isLive()||(a=Math.min(a,this.getDuration())),this.a.seek(a)):Promise.reject()};
67
- _.r.getPresentationStartTime=function(){return null};_.r.getSeekRange=function(){return{start:0,end:0}};_.r.getVolume=function(){var a=this.a.getVolume();return typeof a===_.k?a/100:null};_.r.setVolume=function(a){this.a.setVolume(a)};_.r.getDuration=function(){return this.getMediaDuration()};_.r.getMediaDuration=function(){return this.a.getDuration()};_.r.getBufferInfo=function(){this.g.warn(_.wa);return new _.lm};_.r.getTrackManager=function(){return this.l};_.r.unload=function(){var a=this;return this.a.release().then(function(){a.l.release()})};
68
- _.r.release=function(){var a=this;return _.H(function(b){switch(b.a){case 1:if(!a.h){b.D(2);break}return _.x(b,a.h.release(),2);case 2:if(!a.o){b.D(4);break}return _.x(b,a.o.destroy(),5);case 5:a.o=null;case 4:return _.x(b,a.a.release(),6);case 6:a.l.release(),a.f.release(),a.A=!1,_.y(b)}})};
69
- _.r.load=function(a){var b=this,c,d,e,f,g;return _.H(function(h){switch(h.a){case 1:b.configuration=_.vm(b.B,a);c=_.kq(b.configuration,[_.re,"native"]);b.o=c.create(b);d=_.Lq(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){h.D(2);break}b.h=new bO;b.h.initialize(b);_.C(h,3);return _.x(h,b.h.load(d),5);case 5:b.h.start();_.uh(h,2);break;case 3:f=_.E(h),b.g.error(f);case 2:return _.C(h,6),_.x(h,b.a.load(b.configuration),8);case 8:_.uh(h,7);break;case 6:throw g=
70
- _.E(h),b.onError(g),g;case 7:b.l.load(),_.y(h)}})};_.r.play=function(){var a=this;this.trigger(new _.K(_.ff));YO(this);return this.a.play().then(function(){aO(a.f)})};_.r.pause=function(){var a=this;return this.a.pause().then(function(){aO(a.f)})};_.r.getState=function(){return this.f.getState()};_.r.getPeriods=function(){return[]};_.r.onError=function(a){var b=new _.K(_.ie,{detail:a});a.severity===_.O&&(YN(this.f,_.Eq),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)};
71
- _.r.getDrmInfo=function(){return this.a.getDrmInfo()};_.r.isEnded=function(){return this.f.getState()===_.Aq};_.r.isPaused=function(){return this.a.getState()===$N};_.r.isMuted=function(){return KO(this.a)};_.r.setMuted=function(a){TO(this.a,a)};_.r.getNetworkEngine=function(){return this.C};_.r.setNetworkEngine=function(a){this.C=a};_.r.setCmsdManager=function(){};_.r.isLive=function(){return this.a.isLive()};_.r.getStats=function(){return null};_.r.setSourceIndex=function(a){this.a.setSourceIndex(a)};
72
- _.r.getSourceIndex=function(){return this.a.getSourceIndex()};_.r.getLoadedSource=function(){return this.a.getLoadedSource()};_.r.canPlay=function(a,b){return(new ZO).canPlay(a,b)};_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.getTextDisplayer=function(){return this.o};_.r.resetAbr=function(){};var mP="clpp.tizen",lP=0;ZO.prototype.a=function(){return mP};
73
- ZO.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Ic||a===_.Zl||a===_.Nc)&&b){if(_.qk(2))return 2;if(_.qk(3)||_.qk(4)||_.qk(5)||_.qk(6))return _.Jh("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};ZO.prototype.f=function(a){return a===_.ra};ZO.prototype.create=function(){return new XO};_.w($O,_.Bu);$O.prototype.f=function(){_.Th(new ZO)};$O.prototype.a=function(){var a=mP;a&&_.Rh[a]&&(delete _.Rh[a],_.Sh.info("Removed Player factory: '"+a+"'"))};$O.prototype.id=function(){return"tizen"};_.I("clpp.tizen.TizenComponent",$O);var PO="onbufferingstart",aP="onbufferingprogress",bP="onbufferingcomplete",cP="onstreamcompleted",FO="oncurrentplaytime",hP="onevent",iP="onsubtitlechange",jP="ondrmevent",kP="onerror",QO="preparingstart",SO="preparingend";};
2
+ var f=function(window){var RN="An unknown error occurred while trying to get volume",SN="Cannot get loading rendition due to platform limitations",TN="PARAM_START_POSITION",UN="SecurityError",VN="The require privilege is: http://tizen.org/privilege/tv.audio",WN="|STARTBITRATE\x3d",XN=function(a,b,c){function d(e){c.call(a,e);a.removeEventListener(b,d)}a.addEventListener(b,d)},YN=function(a,b){this.h=a;this.o=null;this.a=_.Qe;this.l=null;this.j=!1;this.f=new Map;this.D=b;this.g=new _.K("clpp.tizen.DrmEngine")},aO=function(a){var b,
3
+ c,d;return _.I(function(e){if(1==e.a){b=a.a===_.Fd||a.a===_.Dd;if(!b)throw new _.O(_.Q,6,6001,"The key system "+a.a+" is not supported by the player or the platform");c=a.f.get(a.a);if(!c.qe)throw new _.O(_.Q,6,6012,"No license server given for "+a.a);_.F(e,2);return a.a===_.Fd?_.x(e,ZN(a),5):_.x(e,$N(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.qe,distinctiveIdentifierRequired:!1,persistentStateRequired:c.vg,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],
4
+ keyIds:[],periodId:null},_.G(e,0);d=_.H(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.O(_.Q,6,6005,{message:JSON.stringify(d)});})},$N=function(a,b){var c,d,e,f;return _.I(function(g){c=bO;d=cO;e={};e[d.sj]=!b.vg;e[d.uj]=b.qe;""!==b.customData&&(e[d.qj]=b.customData);f=JSON.stringify(e);a.g.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(h){throw h;}_.z(g)})},ZN=function(a){var b;return _.I(function(c){b=bO;try{webapis.avplay.setDrm(b.Oe,
5
+ "Initialize",""),webapis.avplay.setDrm(b.Oe,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.Oe,"widevine_data_type",a.l.type)}catch(d){throw d;}_.z(c)})},dO=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,A,B,C;_.I(function(E){if(1==E.a){c=bO;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.qe;l=_.Yj([h],_.Uj());l.type=3;l.body=f.buffer;l.method=
6
+ _.rb;_.F(E,2);return _.x(E,a.D.Bb.fetch(l).T,4)}if(2!=E.a){m=E.f;if(a.j){n=_.gj(m.data);p=n.byteLength;q="";for(t=0;t<p;t++)q+=String.fromCharCode(n[t]);u=btoa(q);y=b.session_id+TN+(u+TN);a.g.debug("Widevine license params",y);try{webapis.avplay.setDrm(c.Oe,"widevine_license_data",y)}catch(D){a.g.error("License response rejected by CDM"),A=new _.O(_.Q,6,6008,{browserError:JSON.stringify(D)}),a.D.onError(A)}}return _.G(E,0)}B=_.H(E);a.g.error("License request failed.",JSON.stringify(B));C=new _.O(_.Q,
7
+ 6,6007,{message:"Error while fetching license!",url:B.data.url,status:B.data.status||NaN,response:B.data.response||"",headers:B.data.headers||{}},B);a.D.onError(C);_.z(E)})},eO=function(a){this.m=a;this.a=this.m.a;this.f=_.Lq;this.j=_.Mq;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.K("clpp.tizen.StateManager")},gO=function(a,b){if(a.f!==b)if(a.f===_.Wq&&b!==_.Lq)a.g.debug(_.MC+fO(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;a.f===_.Qq?(a.o=(new Date).getTime(),a.m.trigger(new _.M(_.$c,
8
+ {detail:{bufferedTimeMS:-1,reason:a.h}}))):a.j===_.Qq&&a.m.trigger(new _.M(_.Zc,{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 _.M(_.bg,{detail:d}));a.g.debug("State changed:",fO(a.j),"-\x3e",fO(a.f))}},fO=function(a){return Object.keys(_.Uq)[a]},jO=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case hO:c=_.Zq;break;case iO:c=_.Yq;break;default:a.m.isEnded()?c=_.Sq:a.g.debug("Inconsistent AVPlay playback state:",
9
+ b)}gO(a,c)}},kO=function(){this.o=this.A=this.f=this.h=this.B=this.m=this.j=this.a=null;this.F=!1;this.w=!0;this.l=null;this.g=new _.K("clpp.tizen.TextStreamer")},lO=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},mO=function(a){var b,c;return _.I(function(d){if(1==d.a)return b=a.m.getConfiguration(),c=null,_.x(d,_.ov(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
+ nO=function(a){var b=document.createElement(_.Jg),c=new _.tG,d=new _.ZD,e=a.m.getTextDisplayer();return new _.vG(b,c,e,d,a.m.getConfiguration())},oO=function(a){var b={configuration:{},zb:function(){return a.m.getPosition()},X:a.h,Bb:a.m.getNetworkEngine(),jd:null,ng:a.$k.bind(a),Ci:a.Zk.bind(a),onError:a.al.bind(a),Di:function(){},onEvent:function(){},Ii:a.cl.bind(a),qf:function(){},$d:function(){return new _.iH},Sf:function(){return!1},Ud:null};return new _.PH(a.a,b)},pO=function(a){var b=a.m.getPosition(),
11
+ c=null;a=_.v(a.a.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c},qO=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 _.Jl(String(c++),_.Ll);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;
12
+ e.kind=a[d].kind||_.jD;var f=new _.Sl(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},rO=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.SH(a.f,_.yj),c=null;if(b){a=qO(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},sO=function(a,b){var c,d,e,f;_.I(function(g){if(1==g.a){c=_.CK;a.g.debug("Set active track",b);if(!b)return g.C(0);a.o=b.language;
13
+ a.A=b.roles[0]||"";a.F=b.kind===c.Yg;if(!a.a||!a.f)return g.C(0);a.setTextVisibility(!0);d=pO(a);e=b.renditions[0];f=d.textStreams.find(function(h){return String(h.id)===e.id});return f?a.w?(a.g.debug("Switching period defer text selection"),a.l=f,g.C(4)):_.x(g,_.lI(a.f,f),5):(a.g.error("No stream with id",e.id),g["return"]())}4!=g.a&&a.m.trigger(new _.M(_.ng));a.o=f.language;_.z(g)})},tO=function(){this.j=this.a=this.m=null;this.f={};this.g=new _.K("clpp.tizen.TrackManager");this.w=this.o=this.l=
14
+ null;this.A=!1;this.h=1},uO=function(a,b){a.m.trigger(new _.M(_.Og,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},vO=function(a){var b=a.pa();b&&a.m.trigger(new _.M(_.Xc,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},wO=function(a){var b=a.m.getConfiguration(),c=_.Gi(b.preferredAudioLanguage||[]),d=a.f[_.T]||[];if(d.length){var e=null;c.some(function(g){e=_.FD(g,d.map(function(h){return h.language}));return!!e});if(e){var f=
15
+ 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)}),0<f.length&&(c=f[0]));a.g.debug("Setting audio track with preferred language:",e);a.Ga(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},AO=function(a,b){if(b){var c=b.track.type.toUpperCase();xO(a.a,c,Number(b.id)).then(function(){c===yO&&(a.l=b,a.m.trigger(new _.M(_.Vc)));c===
16
+ zO&&(a.o=b,a.m.trigger(new _.M(_.ng)))})["catch"](function(){a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},BO=function(a,b,c){var d=_.Kj(b.language||_.xg);c.language=_.Kl(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.Sc;a=new _.Sl(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},CO=function(a,b,c){c.mimeType=_.Mg;a=new _.Sl(String(a),c);a.track=c;a.width=b.Width||null;a.height=
17
+ b.Height||null;a.bandwidth=b.Bit_rate?Number(b.Bit_rate):null;a.codec=b.fourCC||null;return a},DO=function(a,b,c){b=_.Kj(b.track_lang||_.xg);c.mimeType="text/ttml";c.language=_.Kl(b);c.originalLanguage=b;c.kind=_.jD;return new _.Sl(String(a),c)},EO=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},HO=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;
18
+ for(var e=b.filter(function(n){return n.type===FO}),f=b.filter(function(n){return n.type===yO}),g=[],h=0;h<f.length;h++){var l=EO(a,f[h].extra_info);if(l){var m=_.Kj(l.language||_.xg);m=_.Kl(m);m=c(g,m);m||(m=new _.Jl(String(a.h++),_.T),g.push(m));m.renditions.push(BO(f[h].index,l,m))}else a.g.warn("Skipping audio stream with no extra info")}f=new _.Jl(String(a.h++),_.Ml);for(h=0;h<e.length;h++)(l=EO(a,e[h].extra_info))?f.renditions.push(CO(e[h].index,l,f)):a.g.warn("Skipping video stream with no extra info");
19
+ e=[];e=a.j?qO(a.j):GO(a,b);d[_.Ml]=[f];d[_.T]=g;d[_.Ll]=e;return d},GO=function(a,b){for(var c=b.filter(function(h){return h.type===zO}),d=[],e=0;e<c.length;e++){var f=EO(a,c[e].extra_info);if(f){var g=new _.Jl(String(a.h++),_.Ll);g.renditions.push(DO(c[e].index,f,g));d.push(g)}else a.g.warn("Skipping text stream with no extra info")}return d},IO=function(a,b){for(var c=a.f[_.Ml]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.N.ra(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);
20
+ return d[0]||null},JO=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===b){c=a[d].renditions[e];break}return c},LO=function(a,b){if(b===_.Ll&&a.j)return rO(a.j);var c=KO(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===b.toUpperCase()})[0];var d=null;b===_.Ml&&(d=EO(a,c.extra_info),d=IO(a,{width:d.Width,height:d.Height}));b===_.T&&(c?(d=JO(a,c,_.T),a.l=d):d=a.l);b===_.Ll&&
21
+ (c?(d=JO(a,c,_.Ll),a.o=d):d=a.o);return d},MO=function(a){_.Mm.call(this);this.m=a;this.h=null;this.g=new _.K("clpp.tizen.Middleware");this.F=1;this.B=!1;this.l=null;this.G=0;this.o=!0;this.f=!1;this.a=null;this.A=1;this.w=!1;this.j={}},NO=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;});_.z(b)})},PO=function(a){try{webapis.avplay.setListener({onbufferingstart:a.Uk.bind(a),
22
+ onbufferingprogress:a.Tk.bind(a),onbufferingcomplete:a.Sk.bind(a),onstreamcompleted:a.Xk.bind(a),oncurrentplaytime:function(b){a.trigger(new _.M(OO,{currentTime:b}))},onevent:a.Wk.bind(a),onsubtitlechange:a.Yk.bind(a),ondrmevent:a.Vk.bind(a),onerror:a.Pd.bind(a)})}catch(b){a.g.error(b)}},QO=function(a){var b=!!a.m.getTrackManager().Xa();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",c)}},RO=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||
23
+ 0;a.g.debug({estimatedBandwidth:c,ep:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",WN+d)}catch(e){a.g.debug(e)}},SO=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+WN+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",c),c;}},VO=function(a){return{position:a.getPosition(),state:a.m.getState(),ih:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:TO(a),volume:a.getVolume(),
24
+ zo:UO(a),ol:KO(a)}},XO=function(a){var b,c;return _.I(function(d){if(1==d.a)return _.x(d,WO(),2);if(3!=d.a)return b=new Promise(function(e){(new _.Xh(e)).ha(5)}),_.x(d,Promise.race([NO(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"));_.z(d)})},cP=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:a.l=_.cr(b);d=a.G;e=c||{estimatedBandwidth:0,currentBandwidth:0,
25
+ nextBandwidth:null,currentPosition:0};a.g.debug("Loading manifest URL: "+a.l[d].url);f=b.startTime||void 0;a.f&&(a.trigger(new _.M(YO)),f=c.currentPosition);_.F(p,2);g=a.l[d].url;h=a.l[d].type;h!==_.Hc||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);e.nextBandwidth?(SO(a,e.nextBandwidth),a.o=!1):(a.o||RO(a,e),a.o=!0);PO(a);if(!b.drm||!b.drm.env){a.g.debug("No DRM configuration was provided. Assuming clear content");p.C(4);break}m={onError:function(q){return a.m.onError(q)},
26
+ Bb:a.m.getNetworkEngine()};a.h=new YN(b.drm,m);return _.x(p,a.h.init(),4);case 4:return a.f||a.trigger(new _.M(ZO)),_.x(p,$O(a),6);case 6:a.f||a.trigger(new _.M(aP));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&&bP(a,b.muted),b.autoplay&&a.m.play()["catch"](function(q){a.g.debug("Autoplay failed",q)}));_.G(p,0);break;case 2:throw n=_.H(p),a.g.debug("Error while attempting to load source."),n;}})},
27
+ $O=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!");QO(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)}}))})},dP=function(a,b,c){a.g.debug("switchVideoTrack()");try{var d={estimatedBandwidth:parseInt(webapis.avplay.getStreamingProperty("CURRENT_BANDWITH"),10),currentBandwidth:b,nextBandwidth:c,
28
+ currentPosition:a.getPosition()};a.a=VO(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(function(){var e=a.a.ih;a.f=!1;a.a=null;return e===iO?a.pause():a.play()})}catch(e){return Promise.reject(e)}},UO=function(a){return a.f&&a.a?a.a.zo:webapis.avplay.getTotalTrackInfo()},KO=function(a){return a.f&&a.a?a.a.ol:webapis.avplay.getCurrentStreamInfo()},xO=function(a,b,c){b=b.toUpperCase();b===zO&&eP(a,!0);var d=a.j[b];d&&(d.Bf.stop(),a.j[b]=null,a.g.debug("Cancelled pending track switch for "+
29
+ 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 "+h+" track. Trying again...AVPlay state: "+(a.getState()+", buffering: ")+a.w,n),!1===m&&(a.j[h]={type:h,index:l,eh:0,Bf:new _.Xh(function(){return g(h,c,!0)})}),(l=a.j[h])&&3>l.eh?(!a.w&&++l.eh,l.Bf.ha(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),l&&l.Bf.stop(),a.j[h]=null,f())}}g(b,c)})},eP=function(a,
30
+ b){var c=a.m.getTextDisplayer();c&&c.setTextVisibility(b);c=a.m.h;try{c||webapis.avplay.setSilentSubtitle(!b)}catch(d){a.g.debug("Could not set text track visibility",d)}},bP=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case UN:a.g.warn("The application does not have the privilege to set mute.",VN);break;default:a.g.warn(RN,c)}}},TO=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case UN:a.g.warn("The application doesn't have the privilege to get the mute state.",
31
+ VN);break;default:a.g.warn(RN,c)}}return!!b},WO=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");XN(c,_.Be,function(d){return a(d)});XN(c,_.he,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},fP=function(){_.Mm.call(this);this.a=new MO(this);this.f=new eO(this);this.configuration=this.B=_.Tm();this.w=null;this.g=new _.K("clpp.tizen.Player");this.j=null;this.l=new tO;this.F=new _.Cl;
32
+ this.o=this.h=null;this.A=!1},gP=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*a.A),e=Math.floor(b.width*a.A);b=Math.floor(b.height*a.A);a.g.debug("Setting display area to","x:",c,"y:",d,"width:",e,"height:",b);webapis.avplay.setDisplayRect(c,d,e,b);0===c&&0===d&&1920===e&&1080===b&&webapis.avplay.setDisplayMethod("PLAYER_DISPLAY_MODE_LETTER_BOX")}else a.g.debug("Could not apply dimension. Player state "+a.a.getState())},
33
+ hP=function(){},iP=function(){};
34
+ YN.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.I(function(h){if(1==h.a){b=_.nn[a.h.env]||null;if(!b)throw a.g.debug(_.Ba,_.wb+a.h.env+_.aa),new _.O(_.Q,6,6015,_.Ca+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=_.pn(b,a.h.customData);(e=d[_.Dd])&&a.f.set(_.Dd,{qe:e.licenseUrl||"",customData:c,vg:!1});(f=d[_.Fd])&&a.f.set(_.Fd,{qe:f.licenseUrl||"",customData:c,
35
+ vg:!1});if(0===a.f.size)throw new _.O(_.Q,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Dd))a.a=_.Dd;else if(a.f.get(_.Fd))a.a=_.Fd;else throw new _.O(_.Q,6,6001,"Configuration for the target system is missing.");return _.x(h,aO(a),2)}a.j=!0;_.z(h)})};YN.prototype.release=function(){var a=this;return _.I(function(b){a.j=!1;a.o=null;a.a=_.Qe;a.l=null;a.f=new Map;_.z(b)})};YN.prototype.getDrmInfo=function(){return this.o};
36
+ var cO={sj:"DeleteLicenseAfterUse",uj:"LicenseServer",Po:"GetChallenge",Qo:"HttpHeader",So:"UserAgent",Mo:"Cookie",qj:"CustomData"};_.r=eO.prototype;_.r.initialize=function(){this.a.on(YO,this.zh,this);this.a.on(jP,this.yh,this);this.a.on(kP,this.xh,this);this.a.on(ZO,this.Ki,this);this.a.on(aP,this.Ji,this);this.a.on(lP,this.Ah,this)};_.r.release=function(){gO(this,_.Lq);this.l=!1;this.o=-1;this.h=2};_.r.destroy=function(){this.release();this.a.off(YO,this.zh);this.a.off(jP,this.yh);this.a.off(kP,this.xh);this.a.off(ZO,this.Ki);this.a.off(aP,this.Ji);this.a.off(lP,this.Ah);this.m=this.a=null};
37
+ _.r.zh=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;gO(this,_.Qq)};_.r.yh=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",fO(this.f))};_.r.xh=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()===mP;if(!a&&b){gO(this,_.Yq);return}}if(a=this.f!==_.Xq)a=this.a.getState(),a=a===hO||a===iO;a&&jO(this)};
38
+ _.r.Ki=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===nP?gO(this,_.Xq):this.g.error("AVPlay prepares while state is not IDLE")};_.r.Ji=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.r.Ah=function(){gO(this,_.Sq)};_.r.getState=function(){return this.f};_.r=kO.prototype;_.r.initialize=function(a){this.m=a};
39
+ _.r.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 _.x(m,mO(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(),onContentSteeringInfoFound:function(){return null},filterNewPeriod:function(){},filterAllPeriods:function(){},
40
+ onEvent:function(){},onError:function(){}};_.F(m,3);e=b;return _.x(m,b.j.start(a.url,d),5);case 5:e.a=m.f;_.G(m,4);break;case 3:return f=_.H(m),b.g.warn(f),_.F(m,6),g=b,_.x(m,b.j.start(a.url.replace(_.re,"http://"),d),8);case 8:g.a=m.f;_.G(m,4);break;case 6:h=_.H(m),b.g.error(h),b.a=null;case 4:if(!b.a||!lO(b.a)){m.C(0);break}b.h=nO(b);_.F(m,10);return _.x(m,b.h.open(),12);case 12:b.f=oO(b);l=b.m.getConfiguration();b.f.h=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;b.F=l.preferForcedSubtitles;
41
+ _.G(m,0);break;case 10:_.H(m),b.g.debug("Could not setup media source..."),b.h=null,b.f=null,b.j=null,b.a=null,_.z(m)}})};_.r.$k=function(a){this.g.debug(_.dD,a.id);this.w=!0;var b=_.hH(a.textStreams,this.o||"",this.A||"",this.F)[0]||null;this.l&&(a.textStreams.includes(this.l)&&(b=this.l),this.l=null);return{video:null,audio:null,text:b,ab:null}};_.r.Zk=function(){var a=this;return _.I(function(b){if(1==b.a)return a.g.debug("canSwitch_"),a.w=!1,a.l?_.x(b,_.lI(a.f,a.l),3):b.C(0);a.l=null;_.z(b)})};
42
+ _.r.al=function(){this.g.debug("onError_")};_.r.cl=function(){this.j&&this.j.update&&this.j.update()};_.r.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)}_.z(b)})};_.r.setTextVisibility=function(a){this.g.debug("Set text visibility",a);this.h&&this.h.getTextDisplayer().setTextVisibility(a)};
43
+ _.r.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;_.z(b)})};_.r.destroy=function(){var a=this;return _.I(function(b){switch(b.a){case 1:if(!a.j){b.C(2);break}return _.x(b,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.f){b.C(4);break}return _.x(b,a.f.destroy(),5);case 5:a.f=null,a.w=!0;case 4:if(!a.h){b.C(0);break}return _.x(b,a.h.destroy(),7);case 7:a.h=null,_.z(b)}})};_.w(tO,_.rm);_.r=tO.prototype;_.r.Ai=function(a){var b=a.eventid;a=a.data;switch(b){case oP:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+EO(this,b[0].extra_info).Bit_rate,b=IO(this,{bandwidth:b}))&&(this.w=b,uO(this,b));break;case pP:vO(this);break;default:this.g.debug("Event type: "+b+" data: "+a)}};_.r.rg=function(a){a.detail.currentState===_.Zq&&this.m.off(_.bg,this.rg)};
44
+ _.r.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.bg,function(c){b.A||(c=c.detail,c.currentState===_.Zq&&(b.g.debug("Current state",c.currentState),b.A=!0,wO(b)))});this.a.on(qP,this.Ai,this)};_.r.release=function(){this.f={};this.j=this.w=this.o=this.l=null;this.A=!1;this.h=1};
45
+ _.r.load=function(){if(this.a&&!(0<Object.keys(this.f).length)){this.j=this.m.h;this.m.off(_.bg,this.rg);this.m.on(_.bg,this.rg,this);try{var a=UO(this.a);this.f=HO(this,a);var b=this.f[_.T]||[];b.length&&(this.l=b[0].renditions[0]||null);vO(this)}catch(c){this.g.debug("Could not load track manager")}}};_.r.destroy=function(){this.a.off(qP,this.Ai);this.a=this.m=null};_.r.getVideoTracks=function(){return this.f[_.Ml]||[]};_.r.getAudioTracks=function(){return this.f[_.T]||[]};
46
+ _.r.oa=function(){return this.f[_.Ll]||[]};_.r.pa=function(){return LO(this,_.Ml)};_.r.Sa=function(){return LO(this,_.T)};_.r.Xa=function(){return LO(this,_.Ll)};_.r.xb=function(){return this.w};_.r.Jb=function(){this.g.info(SN);return null};_.r.Kb=function(){this.g.info(SN);return null};_.r.La=function(){var a=this.pa();return a?a.track:null};_.r.na=function(){var a=this.Sa();return a?a.track:null};_.r.va=function(){var a=this.Xa();return a?a.track:null};
47
+ _.r.Fb=function(a){var b=this;null===a?(a=this.pa(),dP(this.a,a.bandwidth,null).then(function(){vO(b)})):0<a.renditions.length&&this.pb(a.renditions[0])};_.r.Ga=function(a){a?AO(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.r.Ya=function(a){a?(a=a.renditions[0],this.j?sO(this.j,a.track):AO(this,a)):(this.g.debug("Disabling text tracks"),this.o=null,eP(this.a,!1),this.m.trigger(new _.M(_.ng)))};
48
+ _.r.pb=function(a){var b=this,c=this.pa();this.a.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,uO(this,a),dP(this.a,c.bandwidth,a.bandwidth).then(function(){vO(b)})["catch"](function(d){var e=new _.O(_.Q,7,7200,{tizenerror:d});b.g.debug("Error while switching video track",d);b.m.onError(e)})):this.g.debug("Trying to switch to already active rendition. Doing nothing...")};_.r.Db=function(a){AO(this,a)};_.r.Eb=function(a){this.j?sO(this.j,a.track):AO(this,a)};
49
+ _.r.addTextTrack=function(){};_.r.wa=function(){return this.a.o};tO.prototype.isAbrEnabled=tO.prototype.wa;tO.prototype.addTextTrack=tO.prototype.addTextTrack;tO.prototype.setTextRendition=tO.prototype.Eb;tO.prototype.setAudioRendition=tO.prototype.Db;tO.prototype.setVideoRendition=tO.prototype.pb;tO.prototype.setTextTrack=tO.prototype.Ya;tO.prototype.setAudioTrack=tO.prototype.Ga;tO.prototype.setVideoTrack=tO.prototype.Fb;tO.prototype.getTextTrack=tO.prototype.va;tO.prototype.getAudioTrack=tO.prototype.na;
50
+ tO.prototype.getVideoTrack=tO.prototype.La;tO.prototype.getLoadingTextRendition=tO.prototype.Kb;tO.prototype.getLoadingAudioRendition=tO.prototype.Jb;tO.prototype.getLoadingVideoRendition=tO.prototype.xb;tO.prototype.getTextRendition=tO.prototype.Xa;tO.prototype.getAudioRendition=tO.prototype.Sa;tO.prototype.getVideoRendition=tO.prototype.pa;tO.prototype.getTextTracks=tO.prototype.oa;tO.prototype.getAudioTracks=tO.prototype.getAudioTracks;tO.prototype.getVideoTracks=tO.prototype.getVideoTracks;_.w(MO,_.Mm);_.r=MO.prototype;_.r.Uk=function(){this.w=!0;this.f||this.trigger(new _.M(YO))};_.r.Tk=function(a){this.w=!0;this.trigger(new _.M(jP,{percent:a}))};_.r.Sk=function(){this.w=!1;this.trigger(new _.M(kP))};_.r.Xk=function(){this.trigger(new _.M(lP))};_.r.Wk=function(a,b){this.trigger(new _.M(qP,{eventid:a,data:b}))};_.r.Yk=function(a,b,c,d,e){this.trigger(new _.M(rP,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
51
+ _.r.Vk=function(a,b){this.trigger(new _.M(sP,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Fd&&"Challenge"===b.name)dO(c,b);else if("DrmError"===b.name){c.g.debug("DrmError event",b);var d=new _.O(_.Q,6,6005,{message:JSON.stringify(b)});c.D.onError(d)}}};_.r.Pd=function(a){this.trigger(new _.M(tP,{eventType:a}))};
52
+ _.r.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(OO,f,b);g=setTimeout(function(){b.off(OO,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===nP)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){QO(b);d(webapis.avplay.play())},function(f){b.trigger(new _.M(tP));e(f)})})).then(function(){return a()});if(c===iO||c===mP)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===hO?
53
+ Promise.resolve():Promise.reject("Player is in invalid state")};_.r.pause=function(){try{webapis.avplay.pause()}catch(a){Promise.reject(a)}return this.getState()===iO?Promise.resolve():Promise.reject()};
54
+ _.r.setPlaybackRate=function(a){var b=this.getState();if(b===mP||b===hO||b===iO){try{webapis.avplay.setSpeed(a),this.F=a}catch(c){return this.g.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.F)}return!0}this.g.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1};_.r.getPlaybackRate=function(){return this.F};
55
+ _.r.load=function(a,b){var c=this,d;return _.I(function(e){switch(e.a){case 1:return c.g.debug("configure()",b||""),_.F(e,2),_.x(e,XO(c),4);case 4:return _.x(e,cP(c,a,b),5);case 5:_.G(e,0);break;case 2:throw d=_.H(e),new _.O(_.Q,7,7003,null,d);}})};_.r.getState=function(){if(this.f&&this.a)return this.a.ih;try{return webapis.avplay.getState()}catch(a){this.Pd(JSON.stringify(a))}};
56
+ _.r.seek=function(a){var b=this,c=1E3*a;return new Promise(function(d,e){b.B=!0;b.m.trigger(new _.M(_.Dg));webapis.avplay.seekTo(c,function(){b.B=!1;b.m.trigger(new _.M(_.Cg));d()},function(){b.B=!1;e()})})};_.r.getPosition=function(){if(this.f&&this.a)return this.a.position;try{return webapis.avplay.getCurrentTime()/1E3}catch(a){this.Pd(JSON.stringify(a))}};_.r.getDuration=function(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.Pd(JSON.stringify(a))}};
57
+ _.r.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.Bf.stop()}a.j={};a.F=1;a.B=!1;a.l=null;a.a=null;return b()}catch(f){return c(f)}})};_.r.getVolume=function(){var a=null;try{a=tizen.tvaudiocontrol.getVolume()}catch(b){switch(b.name){case UN:this.g.debug("The application does not have the privilege to get the volume.",VN);break;default:this.g.debug(RN,b)}}return a};
58
+ _.r.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 UN:this.g.warn("The application does not have the privilege to set the volume.",VN);break;default:this.g.warn("An unknown error occurred while trying to set volume",b)}}};
59
+ _.r.isLive=function(){if(this.f&&this.a)return this.a.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.Pd(JSON.stringify(a))}};_.r.stop=function(){try{webapis.avplay.stop()}catch(a){this.g.debug(a)}};_.r.getDrmInfo=function(){this.h&&this.h.getDrmInfo();return null};_.r.setSourceIndex=function(a){this.G=a};_.r.getSourceIndex=function(){return this.G};_.r.getLoadedSource=function(){return this.l&&this.l[this.getSourceIndex()]};
60
+ var nP="IDLE",mP="READY",hO="PLAYING",iO="PAUSED",FO=_.Ub,yO=_.ja,zO="TEXT",pP="PLAYER_MSG_RESOLUTION_CHANGED",oP="PLAYER_MSG_BITRATE_CHANGE",bO={PLAYREADY:"PLAYREADY",No:"EME_PLAYREADY",To:"VERIMATRIX",Oe:"WIDEVINE_CDM",Oo:"EME_WIDEVINE_CDM",Vo:"WIDEVINE_CLASSIC"};_.w(fP,_.Mm);_.r=fP.prototype;_.r.vh=function(){var a=this;this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.M(_.ge));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.g.debug("Could not loop playback")}):this.a.stop()};_.r.sh=function(a){this.trigger(new _.M(_.sg,{currentTime:a.currentTime/1E3}))};
61
+ _.r.wh=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=_.R.Jg(d))&&this.o.append([new _.Si(b,c,d)],[])};_.r.th=function(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.r.Bi=function(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)};
62
+ _.r.uh=function(a){this.g.debug("Error: TYPE: "+a.eventType);gO(this.f,_.Wq);a=new _.O(_.Q,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.M(_.he,{detail:a}))};
63
+ _.r.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(lP,this.vh,this);this.a.on(OO,this.sh,this);this.a.on(rP,this.wh,this);this.a.on(sP,this.th,this);this.a.on(tP,this.uh,this);this.a.on(kP,this.Bi,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();var c=uP;uP+=1;this.j=_.xr(_.Re,{id:"__clpp_tizen_player_"+c,type:"application/avplayer"});this.w.addElementToContainer(this.j,!0);var d=this.w.getMedia();if(d){c=this.j;
64
+ var e=[_.Zg,_.me,"position",_.ve,"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=_.v(e);for(e=g.next();!e.done;e=g.next())e=e.value,f[e]=d[e];_.zr(c,f);gP(this)}};_.r.getSurface=function(){return this.w};_.r.getConfiguration=function(){return this.configuration};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.nb)};_.r.appendLoad=function(){return Promise.reject(_.nb)};
65
+ _.r.seekWith=function(){return Promise.reject(_.nb)};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};
66
+ _.r.destroy=function(){var a=this;return _.I(function(b){switch(b.a){case 1:return _.x(b,a.release(),2);case 2:a.a.off(lP,a.vh);a.a.off(OO,a.sh);a.a.off(rP,a.wh);a.a.off(sP,a.th);a.a.off(tP,a.uh);a.a.off(kP,a.Bi);if(!a.h){b.C(3);break}return _.x(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,_.z(b)}})};_.r.namespace=function(){return vP};_.r.getPlaybackRate=function(){return this.a.getPlaybackRate()};
67
+ _.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.setPlaybackRate=function(a){this.a.setPlaybackRate(a)};_.r.getPosition=function(){return this.getMediaPosition()};_.r.getMediaPosition=function(){return 0<(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.Sq?this.getDuration():this.a.getPosition()||0};_.r.seek=function(a){return typeof a===_.k&&0<=a?(this.isLive()||(a=Math.min(a,this.getDuration())),this.a.seek(a)):Promise.reject()};
68
+ _.r.getPresentationStartTime=function(){return null};_.r.getSeekRange=function(){return{start:0,end:0}};_.r.getVolume=function(){var a=this.a.getVolume();return typeof a===_.k?a/100:null};_.r.setVolume=function(a){this.a.setVolume(a)};_.r.getDuration=function(){return this.getMediaDuration()};_.r.getMediaDuration=function(){return this.a.getDuration()};_.r.getBufferInfo=function(){this.g.warn(_.va);return new _.Lm};_.r.getTrackManager=function(){return this.l};_.r.unload=function(){var a=this;return this.a.release().then(function(){a.l.release()})};
69
+ _.r.release=function(){var a=this;return _.I(function(b){switch(b.a){case 1:if(!a.h){b.C(2);break}return _.x(b,a.h.release(),2);case 2:if(!a.o){b.C(4);break}return _.x(b,a.o.destroy(),5);case 5:a.o=null;case 4:return _.x(b,a.a.release(),6);case 6:a.l.release(),a.f.release(),a.A=!1,_.z(b)}})};
70
+ _.r.load=function(a){var b=this,c,d,e,f,g;return _.I(function(h){switch(h.a){case 1:b.configuration=_.Vm(b.B,a);c=_.Cq(b.configuration,[_.oe,"native"]);b.o=c.create(b);d=_.cr(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){h.C(2);break}b.h=new kO;b.h.initialize(b);_.F(h,3);return _.x(h,b.h.load(d),5);case 5:b.h.start();_.G(h,2);break;case 3:f=_.H(h),b.g.error(f);case 2:return _.F(h,6),_.x(h,b.a.load(b.configuration),8);case 8:_.G(h,7);break;case 6:throw g=
71
+ _.H(h),b.onError(g),g;case 7:b.l.load(),_.z(h)}})};_.r.play=function(){var a=this;this.trigger(new _.M(_.ff));gP(this);return this.a.play().then(function(){jO(a.f)})};_.r.pause=function(){var a=this;return this.a.pause().then(function(){jO(a.f)})};_.r.getState=function(){return this.f.getState()};_.r.getPeriods=function(){return[]};_.r.onError=function(a){var b=new _.M(_.he,{detail:a});a.severity===_.Q&&(gO(this.f,_.Wq),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)};
72
+ _.r.getDrmInfo=function(){return this.a.getDrmInfo()};_.r.isEnded=function(){return this.f.getState()===_.Sq};_.r.isPaused=function(){return this.a.getState()===iO};_.r.isMuted=function(){return TO(this.a)};_.r.setMuted=function(a){bP(this.a,a)};_.r.getNetworkEngine=function(){return this.F};_.r.setNetworkEngine=function(a){this.F=a};_.r.setCmsdManager=function(){};_.r.isLive=function(){return this.a.isLive()};_.r.getStats=function(){return null};_.r.setSourceIndex=function(a){this.a.setSourceIndex(a)};
73
+ _.r.getSourceIndex=function(){return this.a.getSourceIndex()};_.r.getLoadedSource=function(){return this.a.getLoadedSource()};_.r.canPlay=function(a,b){return(new hP).canPlay(a,b)};_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.getTextDisplayer=function(){return this.o};_.r.resetAbr=function(){};var vP="clpp.tizen",uP=0;hP.prototype.a=function(){return vP};
74
+ hP.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Hc||a===_.ym||a===_.Mc)&&b){if(_.Fk(2))return 2;if(_.Fk(3)||_.Fk(4)||_.Fk(5)||_.Fk(6))return _.Jh("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};hP.prototype.f=function(a){return a===_.pa};hP.prototype.create=function(){return new fP};_.w(iP,_.Wu);iP.prototype.f=function(){_.Th(new hP)};iP.prototype.a=function(){var a=vP;a&&_.Rh[a]&&(delete _.Rh[a],_.Sh.info("Removed Player factory: '"+a+"'"))};iP.prototype.id=function(){return"tizen"};_.J("clpp.tizen.TizenComponent",iP);var YO="onbufferingstart",jP="onbufferingprogress",kP="onbufferingcomplete",lP="onstreamcompleted",OO="oncurrentplaytime",qP="onevent",rP="onsubtitlechange",sP="ondrmevent",tP="onerror",ZO="preparingstart",aP="preparingend";};
74
75
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
75
76
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
76
77
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ttml.js CHANGED
@@ -1,33 +1,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Gy='application/mp4; codecs\x3d"stpp.ttml"',Hy='application/mp4; codecs\x3d"stpp.ttml.im1i"',Iy='application/mp4; codecs\x3d"stpp.ttml.im1t"',Jy="backgroundColor",Ky="direction",Ly="displayAlign",My="region",Ny="sans-serif",Oy="textAlign",Py="textDecoration",Qy="writingMode",Ry=function(a,b,c){this.h=a;this.f=b;this.a=c},Sy=function(a,b,c){Ry.call(this,a,[],c);this.j=b||""},Ty=function(a,b,c){Ry.call(this,a,b,c)},Uy=function(a,b,c){a=a.f;for(var d=a.length-1;0<=d;d--){var e=b.get(a[d]);if(e.hasAttribute(c))return e.getAttribute(c)}return null},
3
- bz=function(a,b){var c=null;if(Vy.test(a)){c=Vy.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 Wy.test(a)?c=Xy(Wy,a):Yy.test(a)?c=Xy(Yy,a):Zy.test(a)?(c=Zy.exec(a),c=Number(c[1])/b.frameRate):$y.test(a)?(c=$y.exec(a),c=Number(c[1])/b.a):az.test(a)&&(c=Xy(az,a));return c},Xy=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||
4
- 0)},cz=function(a){return a.split(":").pop()},dz=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},fz=function(a,b){for(;ez.test(a);){var c=ez.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},gz=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},hz=function(a,b,c,d,e,f,g){Ry.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},iz=function(a,b,c){a=Uy(a,b,Oy);if(!a&&c&&(a=Uy(c,b,Oy),!a&&"rltb"===Uy(c,b,Qy)))return _.ge;switch(a){case _.id:return _.Ni;
5
- case _.Of:case _.ge:return _.ge;default:return _.ag}},jz=function(a,b,c){if(_.Q.nf(a.w))return document.createTextNode(_.Q.Pg(a.w||""));if(a.A)return _.er("br");for(var d=_.er("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.fr(d,f.value);a=_.u(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(jz(c.get(e.value),b,c));return d},kz=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&
6
- (this.frameRate*=Number(a[1])/Number(a[2]))},lz=function(a,b,c){Ry.call(this,a,b,c)},oz=function(a,b,c,d){var e=mz.exec(a);a=nz.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},pz=function(a,b){return typeof b===_.k&&0<b?_.Ti:nz.test(a)?0:_.Ti},qz=function(a,b){Ry.call(this,"root-container",[],b);this.j=a},rz=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},sz=function(a,b){var c=a.getAttribute("extent");return(c=nz.exec(c))?Number(c[b]):null},uz=
7
- function(a){a=a.getAttribute("cellResolution");return(a=tz.exec(a))?Number(a[2]):null},vz=function(a,b,c){Ry.call(this,a,b,c)},wz=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=[]},yz=function(a){return xz.some(function(b){return b in a.attributes})},zz=function(a,b){if(0===b.length)return[];for(var c=[],d=_.u(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.gh(zz(a,a.a.get(e).f)).concat([e]));return c},Bz=
8
- function(){return"inline-"+Az++},Cz=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})},Dz=function(a){this.a=a.firstChild;this.f=new Set},Ez=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},Fz=function(a){return cz(a.h.nodeName)},Gz=function(){this.a=new Map},Iz=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=
9
- _.gh(l.l).concat();-1===[_.da,"span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.gh(l.f).concat(),g={},Hz.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(My)&&(c=b.getAttribute(My));b.hasAttribute(_.gg)&&f.push.apply(f,_.gh(b.getAttribute(_.gg).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.u(d);for(h=d.next();!h.done;h=d.next()){h=h.value;var m=cz(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new Ez(b,
10
- c,d,e,f,g);a.a.set(b,c);return c},Jz=function(a){this.a=a;this.f=new DOMParser},Kz=function(a){this.f=a},Lz=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")},Mz=function(){},Nz=function(a){this.a=new Jz(a);this.g=new _.J("clpp.ttml.Mp4TtmlParser")},Oz=function(){this.j=new Mz};Ry.prototype.getId=function(){return this.h};
11
- Ry.prototype.hasAttribute=function(a){return a in this.a};Ry.prototype.getAttribute=function(a){return this.a[a]};_.w(Sy,Ry);_.w(Ty,Ry);var Vy=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Wy=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Yy=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Zy=/^(\d*(?:\.\d*)?)f$/,$y=/^(\d*(?:\.\d*)?)t$/,az=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,mz=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,nz=/^(\d+)px (\d+)px$/,tz=/^(\d+) (\d+)$/,ez=/(\d+)px/,Pz=/^(\d+px|\d+em|\d*\.?\d+c)$/,xz=[Jy,"color",Ky,Ly,"fontFamily","fontSize","fontStyle","fontWeight",
12
- "lineHeight","opacity","padding",Oy,Py,"textOutline",Qy,"zIndex"],Hz=["begin",_.ge];_.w(hz,Ty);
13
- hz.prototype.build=function(a,b,c,d,e,f,g){var h=bz(this.a.begin,b);b=bz(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.er(_.Qd);for(var l=_.u(this.j),m=l.next();!m.done;m=l.next())c.appendChild(jz(g.get(m.value),e,g));g=new _.Si(h,b,c.innerHTML.trim(),_.ug);g.cssClassList=_.gh(this.f).concat();g.textAlign=iz(this,e,null);g.writingMode=_.Oi;g.line=-1;g.lineInterpretation=_.Pi;g.lineAlign=_.Qi;g.containerRows=rz(null,uz(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
14
- iz(this,e,f);a:switch(Uy(f,e,Qy)){case "tb":case "tblr":a=_.Gg;break a;case "tbrl":a=_.Hg;break a;default:a=_.Oi}g.writingMode=a;a:switch(Uy(f,e,Ly)){case _.id:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Uy(f,e,Ly)){case _.id:a=1;break a;default:a=_.Pi}g.lineInterpretation=a;a:switch(Uy(f,e,Ly)){case _.id:e=_.id;break a;default:e=_.Qi}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};_.w(lz,Ty);
16
- lz.prototype.build=function(a,b){var c=new _.Vi;c.id=this.getId();var d=rz(a.j.containerWidth,sz(a,1),720),e=rz(a.j.containerHeight,sz(a,2),480);a:switch(Uy(this,b,Ly)){case "after":var f="flex-start";break a;case _.id:f=_.id;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Uy(this,b,Qy)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Ad}c.writingMode=f;f=this.getAttribute("extent")||Uy(this,b,"extent");c.width=oz(f,d,1,100);c.widthUnits=pz(f,d);c.height=
17
- oz(f,e,2,100);c.heightUnits=pz(f,e);f=this.getAttribute("origin")||Uy(this,b,"origin");c.viewportAnchorX=oz(f,d,1,0);c.viewportAnchorY=oz(f,e,2,0);c.viewportAnchorUnits=pz(f,d);c.cssClassList=_.gh(this.f).concat();return c};_.w(qz,Ry);_.w(vz,Ry);
18
- vz.prototype.build=function(a){var b=null;var c=uz(a);c&&(b=rz(a.j.containerHeight,sz(a,2),480)/c);b=rz(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.h+", ::ttml ."+this.h+" * {";for(var d=_.u(Qz.entries()),e=d.next();!e.done;e=d.next()){var f=_.u(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+dz(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&&!Pz.test(g)&&Pz.test(h)&&Pz.test(l)?(e=g,f=h):2===d.length&&!Pz.test(g)&&Pz.test(h)?(e=g,f=h):2===d.length&&Pz.test(g)&&Pz.test(h)&&(f=g);if(""!==f){f=dz(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=gz(this.a.textShadow),d=dz(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",Ny).replace("proportionalSerif",Ny).replace("sansSerif",Ny).replace("default",Ny)+";":"");a:{if(Py in this.a){d=[];e=_.u(this.a.textDecoration.split(" "));for(f=e.next();!f.done;f=e.next())switch(f=f.value,f){case "underline":case "overline":d.push(f);break;case "lineThrough":d.push("line-through")}if(0<d.length){d=
21
- "text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+dz(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=dz(e),e=fz(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=dz(d);d=fz(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 Qz=new Map([[Jy,"background-color"],["color","color"],[Ky,Ky],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Az=0;Dz.prototype.me=function(){return!!this.a};Dz.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Rz.has(cz(a.nodeName))||Sz.has(cz(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&&!Rz.has(cz(a.nodeName))));var b=this.a;this.a=a;return b};
23
- var Rz=new Set(["tt","head","layout",_.Je,_.se,My,"styling",_.gg,"body",_.Qd,"p","span","br"]),Sz=new Set([_.gg,_.se]);Ez.prototype.getId=function(){return this.attributes.id};Jz.prototype.parseInit=function(){};
24
- Jz.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.L.kb(this.a.ttml||{}),e=_.Oj(a,0,c[0]);e=_.Q.ea(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.lg)}catch(n){throw new _.N(_.O,2,2005,"Failed to parse TTML.");}d=new wz(d);e=new Gz;f=new Dz(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=_.Lm(l);var m="urn:mpeg:14496-30:subs:"+g;d.h.set(m,new Sy(m,l,{imageType:"PNG",encoding:"Base64"}));
25
- b+=h}for(;f.me();)a=f.next(),a=Iz(e,a),"tt"===Fz(a)&&(d.l=new qz(d.B,Object.assign({},a.attributes))),"tt"===Fz(a)&&(d.w=new kz(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),Fz(a)!==_.se||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new Sy(c,a.h.textContent,a.attributes))),Fz(a)===_.se&&a.attributes.begin&&a.attributes.end?(c="#"+Bz(),b=new Sy(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
26
- Fz(a)===_.gg&&(c=a.getId()||Bz(),b=new vz(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),Fz(a)!==_.gg&&yz(a)?(c=Bz(),b=new vz(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),Fz(a)!==_.Qd||!a.attributes.extent&&!a.attributes.origin?c=null:(c=Bz(),b=new lz(c,zz(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),Fz(a)!==My?c=null:(c=a.getId(),b=new lz(c,zz(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
27
- c=b),c&&(a.a=c.getId()),c=a.l,-1===[_.da,"span","br"].indexOf(Fz(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=Bz(),b=new hz(c,a.h.nodeName===_.da?a.h.textContent:null,"br"===Fz(a),a.a,a.j,zz(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"===Fz(a)||a.j?(c=Bz(),b=new hz(c,null,!1,a.a,a.j,zz(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=Cz(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
28
- _.gh(c.value.build(d.l)));return{cues:e,styles:f}};Kz.prototype.a=function(a){a=(new Jz(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.u(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Lz(c.startTime)+" --\x3e "+Lz(c.endTime),e=[];switch(c.textAlign){case _.ve:e.push("align:left");break;case _.Of:e.push("align:right");break;case _.Ni:e.push("align:middle");break;case _.ag:e.push("align:start");break;case _.ge:e.push("align:end")}switch(c.writingMode){case _.Gg:e.push("vertical:lr");break;
29
- case _.Hg:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.Q.hb(b)};Mz.prototype.probe=function(a,b){return a===_.Mc&&b===_.kg};Mz.prototype.create=function(a){return new Kz(a)};Nz.prototype.parseInit=function(a){var b=!1;(new _.pn).M(_.Ne,_.qn).M(_.tg,_.qn).M(_.He,_.qn).M(_.Le,_.qn).M(_.dg,_.qn).aa(_.fg,_.rn).M("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.N(_.O,2,2007);};
30
- Nz.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.pn).M("moof",_.qn).M("traf",_.qn).aa("subs",function(h){for(var l=_.kn(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.jn(h.reader),p=0;p<n;++p){var q=1===h.version?_.kn(h.reader):_.jn(h.reader);g.push(q);h.reader.skip(6)}}}).M(_.Ge,_.sn(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}};_.w(Oz,_.Bu);Oz.prototype.f=function(){_.Av(_.Mc,Jz);_.Av(_.Kc,Nz);_.Av(Gy,Nz);_.Av(Iy,Nz);_.Av(Hy,Nz);_.dl.push(this.j)};Oz.prototype.a=function(){_.Cv(_.Mc);_.Cv(_.Kc);_.Cv(Gy);_.Cv(Iy);_.Cv(Hy);_.fl(this.j)};Oz.prototype.id=function(){return"subtitles-ttml"};_.I("clpp.ttml.TtmlComponent",Oz);};
2
+ var f=function(window){var yy='application/mp4; codecs\x3d"stpp.ttml"',zy='application/mp4; codecs\x3d"stpp.ttml.im1i"',Ay='application/mp4; codecs\x3d"stpp.ttml.im1t"',By="backgroundColor",Cy="direction",Dy="displayAlign",Ey="region",Fy="sans-serif",Gy="textAlign",Hy="textDecoration",Iy="writingMode",Jy=function(a,b,c){this.h=a;this.f=b;this.a=c},Ky=function(a,b,c){Jy.call(this,a,[],c);this.j=b||""},Ly=function(a,b,c){Jy.call(this,a,b,c)},My=function(a,b,c){a=a.f;for(var d=a.length-1;0<=d;d--){var e=b.get(a[d]);if(e.hasAttribute(c))return e.getAttribute(c)}return null},
3
+ Uy=function(a,b){var c=null;if(Ny.test(a)){c=Ny.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 Oy.test(a)?c=Py(Oy,a):Qy.test(a)?c=Py(Qy,a):Ry.test(a)?(c=Ry.exec(a),c=Number(c[1])/b.frameRate):Sy.test(a)?(c=Sy.exec(a),c=Number(c[1])/b.a):Ty.test(a)&&(c=Py(Ty,a));return c},Py=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||
4
+ 0)},Vy=function(a){return a.split(":").pop()},Wy=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Yy=function(a,b){for(;Xy.test(a);){var c=Xy.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Zy=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},$y=function(a,b,c,d,e,f,g){Jy.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},az=function(a,b,c){a=My(a,b,Gy);if(!a&&c&&(a=My(c,b,Gy),!a&&"rltb"===My(c,b,Iy)))return _.fe;switch(a){case _.hd:return _.Ni;
5
+ case _.Of:case _.fe:return _.fe;default:return _.ag}},bz=function(a,b,c){if(_.R.kf(a.w))return document.createTextNode(_.R.Jg(a.w||""));if(a.A)return _.xr("br");for(var d=_.xr("span"),e=_.v(a.f),f=e.next();!f.done;f=e.next())_.yr(d,f.value);a=_.v(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(bz(c.get(e.value),b,c));return d},cz=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&
6
+ (this.frameRate*=Number(a[1])/Number(a[2]))},dz=function(a,b,c){Jy.call(this,a,b,c)},gz=function(a,b,c,d){var e=ez.exec(a);a=fz.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},hz=function(a,b){return typeof b===_.k&&0<b?_.Ti:fz.test(a)?0:_.Ti},iz=function(a,b){Jy.call(this,"root-container",[],b);this.j=a},jz=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},kz=function(a,b){var c=a.getAttribute("extent");return(c=fz.exec(c))?Number(c[b]):null},mz=
7
+ function(a){a=a.getAttribute("cellResolution");return(a=lz.exec(a))?Number(a[2]):null},nz=function(a,b,c){Jy.call(this,a,b,c)},oz=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=[]},qz=function(a){return pz.some(function(b){return b in a.attributes})},rz=function(a,b){if(0===b.length)return[];for(var c=[],d=_.v(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.hh(rz(a,a.a.get(e).f)).concat([e]));return c},tz=
8
+ function(){return"inline-"+sz++},uz=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})},vz=function(a){this.a=a.firstChild;this.f=new Set},wz=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},xz=function(a){return Vy(a.h.nodeName)},yz=function(){this.a=new Map},Az=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=
9
+ _.hh(l.l).concat();-1===[_.da,"span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.hh(l.f).concat(),g={},zz.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(Ey)&&(c=b.getAttribute(Ey));b.hasAttribute(_.gg)&&f.push.apply(f,_.hh(b.getAttribute(_.gg).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.v(d);for(h=d.next();!h.done;h=d.next()){h=h.value;var m=Vy(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new wz(b,
10
+ c,d,e,f,g);a.a.set(b,c);return c},Bz=function(a){this.a=a;this.f=new DOMParser},Cz=function(a){this.f=a},Dz=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")},Ez=function(){},Fz=function(a){this.a=new Bz(a);this.g=new _.K("clpp.ttml.Mp4TtmlParser")},Gz=function(){this.j=new Ez};Jy.prototype.getId=function(){return this.h};
11
+ Jy.prototype.hasAttribute=function(a){return a in this.a};Jy.prototype.getAttribute=function(a){return this.a[a]};_.w(Ky,Jy);_.w(Ly,Jy);var Ny=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Oy=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Qy=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Ry=/^(\d*(?:\.\d*)?)f$/,Sy=/^(\d*(?:\.\d*)?)t$/,Ty=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,ez=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,fz=/^(\d+)px (\d+)px$/,lz=/^(\d+) (\d+)$/,Xy=/(\d+)px/,Hz=/^(\d+px|\d+em|\d*\.?\d+c)$/,pz=[By,"color",Cy,Dy,"fontFamily","fontSize","fontStyle","fontWeight",
12
+ "lineHeight","opacity","padding",Gy,Hy,"textOutline",Iy,"zIndex"],zz=["begin",_.fe];_.w($y,Ly);
13
+ $y.prototype.build=function(a,b,c,d,e,f,g){var h=Uy(this.a.begin,b);b=Uy(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.xr(_.Od);for(var l=_.v(this.j),m=l.next();!m.done;m=l.next())c.appendChild(bz(g.get(m.value),e,g));g=new _.Si(h,b,c.innerHTML.trim(),_.vg);g.cssClassList=_.hh(this.f).concat();g.textAlign=az(this,e,null);g.writingMode=_.Oi;g.line=-1;g.lineInterpretation=_.Pi;g.lineAlign=_.Qi;g.containerRows=jz(null,mz(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
14
+ az(this,e,f);a:switch(My(f,e,Iy)){case "tb":case "tblr":a=_.Gg;break a;case "tbrl":a=_.Ig;break a;default:a=_.Oi}g.writingMode=a;a:switch(My(f,e,Dy)){case _.hd:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(My(f,e,Dy)){case _.hd:a=1;break a;default:a=_.Pi}g.lineInterpretation=a;a:switch(My(f,e,Dy)){case _.hd:e=_.hd;break a;default:e=_.Qi}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};_.w(dz,Ly);
16
+ dz.prototype.build=function(a,b){var c=new _.Vi;c.id=this.getId();var d=jz(a.j.containerWidth,kz(a,1),720),e=jz(a.j.containerHeight,kz(a,2),480);a:switch(My(this,b,Dy)){case "after":var f="flex-start";break a;case _.hd:f=_.hd;break a;default:f="flex-end"}c.displayAlign=f;a:switch(My(this,b,Iy)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.zd}c.writingMode=f;f=this.getAttribute("extent")||My(this,b,"extent");c.width=gz(f,d,1,100);c.widthUnits=hz(f,d);c.height=
17
+ gz(f,e,2,100);c.heightUnits=hz(f,e);f=this.getAttribute("origin")||My(this,b,"origin");c.viewportAnchorX=gz(f,d,1,0);c.viewportAnchorY=gz(f,e,2,0);c.viewportAnchorUnits=hz(f,d);c.cssClassList=_.hh(this.f).concat();return c};_.w(iz,Jy);_.w(nz,Jy);
18
+ nz.prototype.build=function(a){var b=null;var c=mz(a);c&&(b=jz(a.j.containerHeight,kz(a,2),480)/c);b=jz(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.h+", ::ttml ."+this.h+" * {";for(var d=_.v(Iz.entries()),e=d.next();!e.done;e=d.next()){var f=_.v(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+Wy(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&&!Hz.test(g)&&Hz.test(h)&&Hz.test(l)?(e=g,f=h):2===d.length&&!Hz.test(g)&&Hz.test(h)?(e=g,f=h):2===d.length&&Hz.test(g)&&Hz.test(h)&&(f=g);if(""!==f){f=Wy(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=Zy(this.a.textShadow),d=Wy(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",Fy).replace("proportionalSerif",Fy).replace("sansSerif",Fy).replace("default",Fy)+";":"");a:{if(Hy in this.a){d=[];e=_.v(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:"+Wy(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Wy(e),e=Yy(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=Wy(d);d=Yy(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 Iz=new Map([[By,"background-color"],["color","color"],[Cy,Cy],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var sz=0;vz.prototype.ge=function(){return!!this.a};vz.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Jz.has(Vy(a.nodeName))||Kz.has(Vy(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&&!Jz.has(Vy(a.nodeName))));var b=this.a;this.a=a;return b};
23
+ var Jz=new Set(["tt","head","layout",_.Je,_.se,Ey,"styling",_.gg,"body",_.Od,"p","span","br"]),Kz=new Set([_.gg,_.se]);wz.prototype.getId=function(){return this.attributes.id};Bz.prototype.parseInit=function(){};
24
+ Bz.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.N.hb(this.a.ttml||{}),e=_.gj(a,0,c[0]);e=_.R.ea(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.mg)}catch(n){throw new _.O(_.Q,2,2005,"Failed to parse TTML.");}d=new oz(d);e=new yz;f=new vz(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=_.gj(a,b,h);l=_.pl(l);var m="urn:mpeg:14496-30:subs:"+g;d.h.set(m,new Ky(m,l,{imageType:"PNG",encoding:"Base64"}));
25
+ b+=h}for(;f.ge();)a=f.next(),a=Az(e,a),"tt"===xz(a)&&(d.l=new iz(d.B,Object.assign({},a.attributes))),"tt"===xz(a)&&(d.w=new cz(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),xz(a)!==_.se||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new Ky(c,a.h.textContent,a.attributes))),xz(a)===_.se&&a.attributes.begin&&a.attributes.end?(c="#"+tz(),b=new Ky(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
26
+ xz(a)===_.gg&&(c=a.getId()||tz(),b=new nz(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),xz(a)!==_.gg&&qz(a)?(c=tz(),b=new nz(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),xz(a)!==_.Od||!a.attributes.extent&&!a.attributes.origin?c=null:(c=tz(),b=new dz(c,rz(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),xz(a)!==Ey?c=null:(c=a.getId(),b=new dz(c,rz(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
27
+ c=b),c&&(a.a=c.getId()),c=a.l,-1===[_.da,"span","br"].indexOf(xz(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=tz(),b=new $y(c,a.h.nodeName===_.da?a.h.textContent:null,"br"===xz(a),a.a,a.j,rz(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"===xz(a)||a.j?(c=tz(),b=new $y(c,null,!1,a.a,a.j,rz(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=uz(d);f=[];a=_.v(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
28
+ _.hh(c.value.build(d.l)));return{cues:e,styles:f}};Cz.prototype.a=function(a){a=(new Bz(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.v(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Dz(c.startTime)+" --\x3e "+Dz(c.endTime),e=[];switch(c.textAlign){case _.ve:e.push("align:left");break;case _.Of:e.push("align:right");break;case _.Ni:e.push("align:middle");break;case _.ag:e.push("align:start");break;case _.fe:e.push("align:end")}switch(c.writingMode){case _.Gg:e.push("vertical:lr");break;
29
+ case _.Ig:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.R.eb(b)};Ez.prototype.probe=function(a,b){return a===_.Lc&&b===_.lg};Ez.prototype.create=function(a){return new Cz(a)};Fz.prototype.parseInit=function(a){var b=!1;(new _.Hn).M(_.Me,_.In).M(_.ug,_.In).M(_.He,_.In).M(_.Le,_.In).M(_.dg,_.In).ba(_.fg,_.Jn).M("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.O(_.Q,2,2007);};
30
+ Fz.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Hn).M("moof",_.In).M("traf",_.In).ba("subs",function(h){for(var l=_.Cn(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.Bn(h.reader),p=0;p<n;++p){var q=1===h.version?_.Cn(h.reader):_.Bn(h.reader);g.push(q);h.reader.skip(6)}}}).M(_.Ge,_.Kn(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}};_.w(Gz,_.Wu);Gz.prototype.f=function(){_.uv(_.Lc,Bz);_.uv(_.Jc,Fz);_.uv(yy,Fz);_.uv(Ay,Fz);_.uv(zy,Fz);_.om.push(this.j)};Gz.prototype.a=function(){_.wv(_.Lc);_.wv(_.Jc);_.wv(yy);_.wv(Ay);_.wv(zy);_.qm(this.j)};Gz.prototype.id=function(){return"subtitles-ttml"};_.J("clpp.ttml.TtmlComponent",Gz);};
31
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
32
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
33
33
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,9 +1,9 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var uy="VerimatrixVCAS",vy="clpp.verimatrix.Vcas",wy="clpp.verimatrix.VcasComponent",Cy=function(a){_.an.call(this,uy);var b={};b[xy]=xy;b[yy]=yy;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?zy: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?Ay:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
- this.C=d;this.B=b;this.w=By(this,e);this.o=By(this,f);this.l=By(this,g);this.j=h;this.H=l;this.G=m;this.g=new _.J(vy);_.Q.empty(this.w)?this.g.warn(_.Zb):this.fb(_.Gd,{licenseUrl:this.w,videoRobustness:[_.Fb,void 0],audioRobustness:[_.Eb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.Q.empty(this.o)?this.g.warn(_.tb):this.fb(_.Ed,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
- _.Q.empty(this.l)?this.g.warn(_.Ra):_.Q.empty(this.j)?this.g.warn(_.Qa):this.fb(_.Cd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},By=function(a,b){if(a.C===zy){var c=Object.assign({},{deviceId:_.Mm(_.Q.Fd(a.A))},a.a&&{authenticator:_.Mm(_.Q.Fd(a.a))});return b+_.Ok(c)}return b},Dy=function(){this.g=new _.J(wy)};_.w(Cy,_.an);
5
- Cy.prototype.h=function(a,b){if(this.C===Ey){var c=this.B[yy],d={};d[this.B[xy]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Cy.prototype.I=function(a,b){var c=_.yn(b);switch(this.G){case Fy:c=_.Ok({r:c,yp:this.H},!0)}return c};Cy.prototype.K=function(a,b){this.h(a,b);_.Bn(b)};Cy.prototype.L=function(a,b){_.Cn(b)};_.I(vy,Cy);Cy.prototype.constructor=Cy.prototype.constructor;Cy.NAME=uy;var zy="query-string",Ey="http-header";
6
- Cy.LicenseRequestVuidLocation={QUERY_STRING:zy,HTTP_HEADER:Ey};var xy="DeviceId",yy="Authenticator";Cy.LicenseRequestHttpHeader={DEVICE_ID_HEADER:xy,AUTHENTICATOR_HEADER:yy};var Ay="keyid",Fy="contentid-siteid";Cy.FairPlayAssetIdStrategy={KEYID:Ay,CONTENTID_SITEID:Fy};_.w(Dy,_.Bu);Dy.prototype.a=function(){delete _.Vm.VerimatrixVCAS};Dy.prototype.h=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===uy){a=a.drm.customData;if(!a)throw new _.N(_.O,7,7100,_.Hd);a=new Cy(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.Wm(a)}};Dy.prototype.id=function(){return"verimatrix-vcas"};_.I(wy,Dy);};
2
+ var f=function(window){var my="VerimatrixVCAS",ny="clpp.verimatrix.Vcas",oy="clpp.verimatrix.VcasComponent",uy=function(a){_.tn.call(this,my);var b={};b[py]=py;b[qy]=qy;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?ry: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?sy:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
+ this.F=d;this.B=b;this.w=ty(this,e);this.o=ty(this,f);this.l=ty(this,g);this.j=h;this.H=l;this.G=m;this.g=new _.K(ny);_.R.empty(this.w)?this.g.warn(_.Yb):this.bb(_.Fd,{licenseUrl:this.w,videoRobustness:[_.Eb,void 0],audioRobustness:[_.Db,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.R.empty(this.o)?this.g.warn(_.sb):this.bb(_.Dd,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
+ _.R.empty(this.l)?this.g.warn(_.Qa):_.R.empty(this.j)?this.g.warn(_.Pa):this.bb(_.Bd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},ty=function(a,b){if(a.F===ry){var c=Object.assign({},{deviceId:_.ql(_.R.xd(a.A))},a.a&&{authenticator:_.ql(_.R.xd(a.a))});return b+_.tj(c)}return b},vy=function(){this.g=new _.K(oy)};_.w(uy,_.tn);
5
+ uy.prototype.h=function(a,b){if(this.F===wy){var c=this.B[qy],d={};d[this.B[py]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};uy.prototype.I=function(a,b){var c=_.Rn(b);switch(this.G){case xy:c=_.tj({r:c,tp:this.H},!0)}return c};uy.prototype.K=function(a,b){this.h(a,b);_.Un(b)};uy.prototype.L=function(a,b){_.Vn(b)};_.J(ny,uy);uy.prototype.constructor=uy.prototype.constructor;uy.NAME=my;var ry="query-string",wy="http-header";
6
+ uy.LicenseRequestVuidLocation={QUERY_STRING:ry,HTTP_HEADER:wy};var py="DeviceId",qy="Authenticator";uy.LicenseRequestHttpHeader={DEVICE_ID_HEADER:py,AUTHENTICATOR_HEADER:qy};var sy="keyid",xy="contentid-siteid";uy.FairPlayAssetIdStrategy={KEYID:sy,CONTENTID_SITEID:xy};_.w(vy,_.Wu);vy.prototype.a=function(){delete _.nn.VerimatrixVCAS};vy.prototype.h=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===my){a=a.drm.customData;if(!a)throw new _.O(_.Q,7,7100,_.Gd);a=new uy(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.on(a)}};vy.prototype.id=function(){return"verimatrix-vcas"};_.J(oy,vy);};
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));}