@castlabs/prestoplay 6.32.0 → 6.33.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +19 -19
  5. package/cjs/cl.cast.js +129 -127
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +620 -625
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +101 -101
  10. package/cjs/cl.externs.js +45 -41
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +76 -76
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +26 -26
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +359 -352
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +71 -71
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +72 -72
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +35 -35
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +14 -14
  36. package/cl.cast.js +101 -102
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +497 -503
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +89 -89
  41. package/cl.externs.js +50 -42
  42. package/cl.freewheel.js +20 -20
  43. package/cl.hls.js +82 -82
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +20 -20
  47. package/cl.mediatailor.js +2 -2
  48. package/cl.mse.js +305 -303
  49. package/cl.muxdata.js +13 -13
  50. package/cl.onboard.js +5 -4
  51. package/cl.persistent.js +11 -11
  52. package/cl.playlist.js +5 -5
  53. package/cl.simid.js +14 -14
  54. package/cl.smooth.js +61 -61
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +57 -57
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -3
  63. package/cl.youbora.js +30 -30
  64. package/package.json +1 -1
  65. package/typings.d.ts +32 -24
package/cjs/cl.tizen.js CHANGED
@@ -1,77 +1,77 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var qP="An unknown error occurred while trying to get volume",rP="Cannot get loading rendition due to platform limitations",sP="PARAM_START_POSITION",tP="SecurityError",uP="The require privilege is: http://tizen.org/privilege/tv.audio",vP="onbufferingcomplete",wP="onbufferingprogress",xP="onbufferingstart",yP="oncurrentplaytime",zP="ondrmevent",AP="onerror",BP="onstreamcompleted",CP="onsubtitlechange",DP="preparingend",EP="preparingstart",FP="|STARTBITRATE\x3d",GP=function(a,b,c){function d(e){c.call(a,
3
- e);a.removeEventListener(b,d)}a.addEventListener(b,d)},HP=function(a,b){this.h=a;this.o=null;this.a=_.Ze;this.l=null;this.j=!1;this.f=new Map;this.F=b;this.g=new _.M("clpp.tizen.DrmEngine")},KP=function(a){var b,c,d;return _.I(function(e){if(1==e.a){b=a.a===_.Nd||a.a===_.Ld;if(!b)throw new _.O(_.P,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(_.P,6,6012,"No license server given for "+a.a);_.F(e,2);return a.a===_.Nd?_.x(e,IP(a),
4
- 5):_.x(e,JP(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.Qe,distinctiveIdentifierRequired:!1,persistentStateRequired:c.dh,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null},_.G(e,0);d=_.H(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.O(_.P,6,6005,{message:JSON.stringify(d)});})},JP=function(a,b){var c,d,e,f;return _.I(function(g){c=LP;d=MP;e={};e[d.ek]=!b.dh;e[d.gk]=b.Qe;""!==b.customData&&(e[d.ck]=b.customData);
5
- f=JSON.stringify(e);a.g.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(k){throw k;}_.A(g)})},IP=function(a){var b;return _.I(function(c){b=LP;try{webapis.avplay.setDrm(b.pf,"Initialize",""),webapis.avplay.setDrm(b.pf,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.pf,"widevine_data_type",a.l.type)}catch(d){throw d;}_.A(c)})},NP=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,y,B,D,C;_.I(function(E){if(1==E.a){c=LP;d=a.f.get(a.a);a.g.debug("DRM Challenge data: ",
6
- b.challenge);e=atob(b.challenge);f=new Uint8Array(e.length);for(g=0;g<e.length;++g)f[g]=e.charCodeAt(g);k=b.serverurl&&""!==b.serverurl?b.serverurl:d.Qe;l=_.Zk([k],_.Vk());l.type=3;l.body=f.buffer;l.method=_.rb;_.F(E,2);return _.x(E,a.F.Mb.fetch(l).U,4)}if(2!=E.a){m=E.f;if(a.j){n=_.Ri(m.data);p=n.byteLength;q="";for(t=0;t<p;t++)q+=String.fromCharCode(n[t]);u=btoa(q);y=b.session_id+sP+(u+sP);a.g.debug("Widevine license params",y);try{webapis.avplay.setDrm(c.pf,"widevine_license_data",y)}catch(z){a.g.error("License response rejected by CDM"),
7
- B=new _.O(_.P,6,6008,{browserError:JSON.stringify(z)}),a.F.onError(B)}}return _.G(E,0)}D=_.H(E);a.g.error("License request failed.",JSON.stringify(D));C=new _.O(_.P,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(C);_.A(E)})},OP=function(a){this.m=a;this.a=this.m.a;this.f=_.iu;this.j=7;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.M("clpp.tizen.StateManager")},QP=
8
- function(a,b){if(a.f!==b)if(a.f===_.Bo&&b!==_.iu)a.g.debug(_.IB+PP(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;2===a.f?(a.o=(new Date).getTime(),a.m.trigger(new _.Q(_.fd,{detail:{bufferedTimeMS:-1,reason:a.h}}))):2===a.j&&a.m.trigger(new _.Q(_.ed,{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 _.Q(_.kg,{detail:d}));a.g.debug("State changed:",PP(a.j),"-\x3e",PP(a.f))}},PP=function(a){return Object.keys(_.pu)[a]},
9
- TP=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case RP:c=3;break;case SP:c=4;break;default:a.m.isEnded()?c=5:a.g.debug("Inconsistent AVPlay playback state:",b)}QP(a,c)}},UP=function(){this.o=this.A=this.f=this.h=this.B=this.m=this.j=this.a=null;this.D=!1;this.w=!0;this.l=null;this.g=new _.M("clpp.tizen.TextStreamer")},VP=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},WP=function(a){var b,c;return _.I(function(d){if(1==d.a)return b=
10
- a.m.getConfiguration(),c=null,_.x(d,_.Zv(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)})},XP=function(a){var b=document.createElement(_.Tg),c=new _.jF,d=new _.VC,e=a.m.getTextDisplayer();return new _.lF(b,c,e,d,a.m.getConfiguration())},YP=function(a){var b={configuration:{},Ib:function(){return a.m.getPosition()},Y:a.h,Mb:a.m.getNetworkEngine(),Cd:null,Tg:a.Ll.bind(a),kj:a.Kl.bind(a),onError:a.Ml.bind(a),lj:function(){},
11
- onEvent:function(){},pj:a.Nl.bind(a),Wf:function(){},ze:function(){return new _.ZF},xg:function(){return!1},se:null};return new _.FG(a.a,b)},ZP=function(a){var b=a.m.getPosition(),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},$P=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=
12
- c[d].textStreams;break}a=b}else a=[];b=[];for(d=c=0;d<a.length;d++){var e=new _.$s(String(c++),_.bt);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=a[d].kind||_.fC;var f=new _.ht(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},aQ=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.IG(a.f,_.Cn),c=null;if(b){a=$P(a);for(var d=0;d<a.length;d++)if(a[d].renditions[0].id===String(b.id)){c=a[d].renditions[0];
13
- break}}return c}return null},bQ=function(a,b){var c,d,e,f;_.I(function(g){if(1==g.a){c=_.ZI;a.g.debug("Set active track",b);if(!b)return g.C(0);a.o=b.language;a.A=b.roles[0]||"";a.D=b.kind===c.Fh;if(!a.a||!a.f)return g.C(0);a.setTextVisibility(!0);d=ZP(a);e=b.renditions[0];f=d.textStreams.find(function(k){return String(k.id)===e.id});return f?a.w?(a.g.debug("Switching period defer text selection"),a.l=f,g.C(4)):_.x(g,_.bH(a.f,f),5):(a.g.error("No stream with id",e.id),g["return"]())}4!=g.a&&a.m.trigger(new _.Q(_.wg));
14
- a.o=f.language;_.A(g)})},cQ=function(){this.j=this.a=this.m=null;this.f={};this.g=new _.M("clpp.tizen.TrackManager");this.w=this.o=this.l=null;this.A=!1;this.h=1},dQ=function(a,b){a.m.trigger(new _.Q(_.Xg,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},eQ=function(a){var b=a.sa();b&&a.m.trigger(new _.Q(_.cd,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},fQ=function(a){var b=a.m.getConfiguration(),c=_.Ji(b.preferredAudioLanguage||
15
- []),d=a.f[_.X]||[];if(d.length){var e=null;c.some(function(g){e=_.MC(g,d.map(function(k){return k.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)}),0<f.length&&(c=f[0]));a.g.debug("Setting audio track with preferred language:",e);a.La(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},jQ=function(a,
16
- b){if(b){var c=b.track.type.toUpperCase();gQ(a.a,c,Number(b.id)).then(function(){c===hQ&&(a.l=b,a.m.trigger(new _.Q(_.ad)));c===iQ&&(a.o=b,a.m.trigger(new _.Q(_.wg)))})["catch"](function(){a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},kQ=function(a,b,c){var d=_.ro(b.language||_.Gg);c.language=_.at(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.Yc;a=new _.ht(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=
17
- b.bit_rate||null;return a},lQ=function(a,b,c){c.mimeType=_.Vg;a=new _.ht(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},mQ=function(a,b,c){b=_.ro(b.track_lang||_.Gg);c.mimeType="text/ttml";c.language=_.at(b);c.originalLanguage=b;c.kind=_.fC;return new _.ht(String(a),c)},nQ=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},
18
- qQ=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===oQ}),f=b.filter(function(n){return n.type===hQ}),g=[],k=0;k<f.length;k++){var l=nQ(a,f[k].extra_info);if(l){var m=_.ro(l.language||_.Gg);m=_.at(m);m=c(g,m);m||(m=new _.$s(String(a.h++),_.X),g.push(m));m.renditions.push(kQ(f[k].index,l,m))}else a.g.warn("Skipping audio stream with no extra info")}f=new _.$s(String(a.h++),
19
- _.ct);for(k=0;k<e.length;k++)(l=nQ(a,e[k].extra_info))?f.renditions.push(lQ(e[k].index,l,f)):a.g.warn("Skipping video stream with no extra info");e=[];e=a.j?$P(a.j):pQ(a,b);d[_.ct]=[f];d[_.X]=g;d[_.bt]=e;return d},pQ=function(a,b){for(var c=b.filter(function(k){return k.type===iQ}),d=[],e=0;e<c.length;e++){var f=nQ(a,c[e].extra_info);if(f){var g=new _.$s(String(a.h++),_.bt);g.renditions.push(mQ(c[e].index,f,g));d.push(g)}else a.g.warn("Skipping text stream with no extra info")}return d},rQ=function(a,
20
- b){for(var c=a.f[_.ct]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.N.ua(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},sQ=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},uQ=function(a,b){if(b===_.bt&&a.j)return aQ(a.j);var c=tQ(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===
21
- b.toUpperCase()})[0];var d=null;b===_.ct&&(d=nQ(a,c.extra_info),d=rQ(a,{width:d.Width,height:d.Height}));b===_.X&&(c?(d=sQ(a,c,_.X),a.l=d):d=a.l);b===_.bt&&(c?(d=sQ(a,c,_.bt),a.o=d):d=a.o);return d},vQ=function(a){_.Ei.call(this);this.m=a;this.h=null;this.g=new _.M("clpp.tizen.Middleware");this.D=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={}},wQ=function(a){return _.I(function(b){tizen.systeminfo.getPropertyValue("DISPLAY",function(c){a.A=c.resolutionWidth/
22
- 1920;a.g.debug("Display resolution ratio: ",a.A)},function(c){a.g.debug("Could not load DISPLAY property");throw c;});_.A(b)})},xQ=function(a){try{webapis.avplay.setListener({onbufferingstart:a.Fl.bind(a),onbufferingprogress:a.El.bind(a),onbufferingcomplete:a.Dl.bind(a),onstreamcompleted:a.Il.bind(a),oncurrentplaytime:function(b){a.trigger(new _.Q(yP,{currentTime:b}))},onevent:a.Hl.bind(a),onsubtitlechange:a.Jl.bind(a),ondrmevent:a.Gl.bind(a),onerror:a.oe.bind(a)})}catch(b){a.g.error(b)}},yQ=function(a){var b=
23
- !!a.m.getTrackManager().gb();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",c)}},zQ=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.g.debug({estimatedBandwidth:c,Qp:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",FP+d)}catch(e){a.g.debug(e)}},AQ=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+FP+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",
24
- c),c;}},DQ=function(a){return{position:a.getPosition(),state:a.m.getState(),Qh:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:BQ(a),volume:a.getVolume(),jp:CQ(a),Yl:tQ(a)}},FQ=function(a){var b,c;return _.I(function(d){if(1==d.a)return _.x(d,EQ(),2);if(3!=d.a)return b=new Promise(function(e){(new _.hj(e)).ia(5)}),_.x(d,Promise.race([wQ(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"),
25
- d["return"](Promise.reject("SDK Timeout"));_.A(d)})},IQ=function(a,b,c){var d,e,f,g,k,l,m,n;return _.I(function(p){switch(p.a){case 1:a.l=_.Rn(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 _.Q(xP)),f=c.currentPosition);_.F(p,2);g=a.l[d].url;k=a.l[d].type;k!==_.Lc||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);
26
- e.nextBandwidth?(AQ(a,e.nextBandwidth),a.o=!1):(a.o||zQ(a,e),a.o=!0);xQ(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)},Mb:a.m.getNetworkEngine()};a.h=new HP(b.drm,m);return _.x(p,a.h.init(),4);case 4:return a.f||a.trigger(new _.Q(EP)),_.x(p,GQ(a),6);case 6:a.f||a.trigger(new _.Q(DP));f&&typeof f===_.h&&0<f&&a.seek(f)["catch"](function(q){a.g.debug("Couldn't set start position",q)});a.f||(b.volume&&
27
- a.setVolume(b.volume),b.muted&&HQ(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;}})},GQ=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!");yQ(a);c()},function(e){a.g.debug("prepareAsync failed",e);d(e)})}catch(e){a.g.debug("Failed to prepare media player for playback"),
28
- d(e)}}))})},JQ=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=DQ(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(function(){var e=a.a.Qh;a.f=!1;a.a=null;return e===SP?a.pause():a.play()})}catch(e){return Promise.reject(e)}},CQ=function(a){return a.f&&a.a?a.a.jp:webapis.avplay.getTotalTrackInfo()},
29
- tQ=function(a){return a.f&&a.a?a.a.Yl:webapis.avplay.getCurrentStreamInfo()},gQ=function(a,b,c){b=b.toUpperCase();b===iQ&&KQ(a,!0);var d=a.j[b];d&&(d.gg.stop(),a.j[b]=null,a.g.debug("Cancelled pending track switch for "+b));return new Promise(function(e,f){function g(k,l,m){m=void 0===m?!1:m;try{webapis.avplay.setSelectTrack(k,l),a.j[k]=null,e()}catch(n){a.g.debug("Could not set "+k+" track. Trying again...AVPlay state: "+(a.getState()+", buffering: ")+a.w,n),!1===m&&(a.j[k]={type:k,index:l,Mh:0,
30
- gg:new _.hj(function(){return g(k,c,!0)})}),(l=a.j[k])&&3>l.Mh?(a.w||++l.Mh,l.gg.ia(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),l&&l.gg.stop(),a.j[k]=null,f())}}g(b,c)})},KQ=function(a,b){var c=a.m.getTextDisplayer();c&&c.setTextVisibility(b);c=a.m.h;try{c||webapis.avplay.setSilentSubtitle(!b)}catch(d){a.g.debug("Could not set text track visibility",d)}},HQ=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case tP:a.g.warn("The application does not have the privilege to set mute.",
31
- uP);break;default:a.g.warn(qP,c)}}},BQ=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case tP:a.g.warn("The application doesn't have the privilege to get the mute state.",uP);break;default:a.g.warn(qP,c)}}return!!b},EQ=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");GP(c,_.Ke,function(d){return a(d)});GP(c,_.re,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},
32
- LQ=function(){_.Ei.call(this);this.a=new vQ(this);this.f=new OP(this);this.configuration=this.B=_.Ln();this.w=null;this.g=new _.M("clpp.tizen.Player");this.j=null;this.l=new cQ;this.D=new _.Xm;this.o=this.h=null;this.A=!1},MQ=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,
33
- 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())},NQ=function(){},OQ=function(){};
34
- HP.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.I(function(k){if(1==k.a){b=_.Un[a.h.env]||null;if(!b)throw a.g.debug(_.Ca,_.wb+a.h.env+_.aa),new _.O(_.P,6,6015,_.Da+a.h.env+"' is missing.");a.l={id:String(Math.floor(1E4*Math.random())),type:"MPEG-DASH"};c=Object.keys(a.h.customData||{}).length?btoa(JSON.stringify(a.h.customData)):"";d=_.Wn(b,a.h.customData);(e=d[_.Ld])&&a.f.set(_.Ld,{Qe:e.licenseUrl||"",customData:c,dh:!1});(f=d[_.Nd])&&a.f.set(_.Nd,{Qe:f.licenseUrl||"",customData:c,
35
- dh:!1});if(0===a.f.size)throw new _.O(_.P,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Ld))a.a=_.Ld;else if(a.f.get(_.Nd))a.a=_.Nd;else throw new _.O(_.P,6,6001,"Configuration for the target system is missing.");return _.x(k,KP(a),2)}a.j=!0;_.A(k)})};HP.prototype.release=function(){var a=this;return _.I(function(b){a.j=!1;a.o=null;a.a=_.Ze;a.l=null;a.f=new Map;_.A(b)})};HP.prototype.getDrmInfo=function(){return this.o};
36
- var MP={ek:"DeleteLicenseAfterUse",gk:"LicenseServer",Bp:"GetChallenge",Cp:"HttpHeader",Ep:"UserAgent",yp:"Cookie",ck:"CustomData"};_.r=OP.prototype;_.r.initialize=function(){this.a.on(xP,this.hi,this);this.a.on(wP,this.gi,this);this.a.on(vP,this.fi,this);this.a.on(EP,this.rj,this);this.a.on(DP,this.qj,this);this.a.on(BP,this.ii,this)};_.r.release=function(){QP(this,_.iu);this.l=!1;this.o=-1;this.h=2};_.r.destroy=function(){this.release();this.a.off(xP,this.hi);this.a.off(wP,this.gi);this.a.off(vP,this.fi);this.a.off(EP,this.rj);this.a.off(DP,this.qj);this.a.off(BP,this.ii);this.m=this.a=null};
37
- _.r.hi=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;QP(this,2)};_.r.gi=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",PP(this.f))};_.r.fi=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()===PQ;if(!a&&b){QP(this,4);return}}if(a=1!==this.f)a=this.a.getState(),a=a===RP||a===SP;a&&TP(this)};
38
- _.r.rj=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===QQ?QP(this,1):this.g.error("AVPlay prepares while state is not IDLE")};_.r.qj=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.r.ii=function(){QP(this,5)};_.r.getState=function(){return this.f};_.r=UP.prototype;_.r.initialize=function(a){this.m=a};
39
- _.r.load=function(a){var b=this,c,d,e,f,g,k,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,WP(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(_.Ae,"http://"),d),8);case 8:g.a=m.f;_.G(m,4);break;case 6:k=_.H(m),b.g.error(k),b.a=null;case 4:if(!b.a||!VP(b.a)){m.C(0);break}b.h=XP(b);_.F(m,10);return _.x(m,b.h.open(),12);case 12:b.f=YP(b);l=b.m.getConfiguration();b.f.h=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;b.D=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,_.A(m)}})};_.r.Ll=function(a){this.g.debug(_.$B,a.id);this.w=!0;var b=_.YF(a.textStreams,this.o||"",this.A||"",this.D)[0]||null;this.l&&(a.textStreams.includes(this.l)&&(b=this.l),this.l=null);return{video:null,audio:null,text:b,pb:null}};_.r.Kl=function(){var a=this;return _.I(function(b){if(1==b.a)return a.g.debug("canSwitch_"),a.w=!1,a.l?_.x(b,_.bH(a.f,a.l),3):b.C(0);a.l=null;_.A(b)})};
42
- _.r.Ml=function(){this.g.debug("onError_")};_.r.Nl=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)}_.A(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;_.A(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,_.A(b)}})};_.w(cQ,_.xt);_.r=cQ.prototype;_.r.ij=function(a){var b=a.eventid;a=a.data;switch(b){case RQ:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+nQ(this,b[0].extra_info).Bit_rate,b=rQ(this,{bandwidth:b}))&&(this.w=b,dQ(this,b));break;case SQ:eQ(this);break;default:this.g.debug("Event type: "+b+" data: "+a)}};_.r.Xg=function(a){3===a.detail.currentState&&this.m.off(_.kg,this.Xg)};
44
- _.r.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.kg,function(c){b.A||(c=c.detail,3===c.currentState&&(b.g.debug("Current state",c.currentState),b.A=!0,fQ(b)))});this.a.on("onevent",this.ij,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(_.kg,this.Xg);this.m.on(_.kg,this.Xg,this);try{var a=CQ(this.a);this.f=qQ(this,a);var b=this.f[_.X]||[];b.length&&(this.l=b[0].renditions[0]||null);eQ(this)}catch(c){this.g.debug("Could not load track manager")}}};_.r.destroy=function(){this.a.off("onevent",this.ij);this.a=this.m=null};_.r.getVideoTracks=function(){return this.f[_.ct]||[]};_.r.getAudioTracks=function(){return this.f[_.X]||[]};
46
- _.r.ra=function(){return this.f[_.bt]||[]};_.r.sa=function(){return uQ(this,_.ct)};_.r.Ya=function(){return uQ(this,_.X)};_.r.gb=function(){return uQ(this,_.bt)};_.r.Hb=function(){return this.w};_.r.Xb=function(){this.g.info(rP);return null};_.r.Yb=function(){this.g.info(rP);return null};_.r.Qa=function(){var a=this.sa();return a?a.track:null};_.r.qa=function(){var a=this.Ya();return a?a.track:null};_.r.wa=function(){var a=this.gb();return a?a.track:null};
47
- _.r.Qb=function(a){var b=this;null===a?(a=this.sa(),JQ(this.a,a.bandwidth,null).then(function(){eQ(b)})):0<a.renditions.length&&this.Db(a.renditions[0])};_.r.La=function(a){a?jQ(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.r.jb=function(a){a?(a=a.renditions[0],this.j?bQ(this.j,a.track):jQ(this,a)):(this.g.debug("Disabling text tracks"),this.o=null,KQ(this.a,!1),this.m.trigger(new _.Q(_.wg)))};
48
- _.r.Db=function(a){var b=this,c=this.sa();this.a.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,dQ(this,a),JQ(this.a,c.bandwidth,a.bandwidth).then(function(){eQ(b)})["catch"](function(d){var e=new _.O(_.P,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.Ob=function(a){jQ(this,a)};_.r.Pb=function(a){this.j?bQ(this.j,a.track):jQ(this,a)};
49
- _.r.addTextTrack=function(){};_.r.xa=function(){return this.a.o};cQ.prototype.isAbrEnabled=cQ.prototype.xa;cQ.prototype.addTextTrack=cQ.prototype.addTextTrack;cQ.prototype.setTextRendition=cQ.prototype.Pb;cQ.prototype.setAudioRendition=cQ.prototype.Ob;cQ.prototype.setVideoRendition=cQ.prototype.Db;cQ.prototype.setTextTrack=cQ.prototype.jb;cQ.prototype.setAudioTrack=cQ.prototype.La;cQ.prototype.setVideoTrack=cQ.prototype.Qb;cQ.prototype.getTextTrack=cQ.prototype.wa;cQ.prototype.getAudioTrack=cQ.prototype.qa;
50
- cQ.prototype.getVideoTrack=cQ.prototype.Qa;cQ.prototype.getLoadingTextRendition=cQ.prototype.Yb;cQ.prototype.getLoadingAudioRendition=cQ.prototype.Xb;cQ.prototype.getLoadingVideoRendition=cQ.prototype.Hb;cQ.prototype.getTextRendition=cQ.prototype.gb;cQ.prototype.getAudioRendition=cQ.prototype.Ya;cQ.prototype.getVideoRendition=cQ.prototype.sa;cQ.prototype.getTextTracks=cQ.prototype.ra;cQ.prototype.getAudioTracks=cQ.prototype.getAudioTracks;cQ.prototype.getVideoTracks=cQ.prototype.getVideoTracks;_.w(vQ,_.Ei);_.r=vQ.prototype;_.r.Fl=function(){this.w=!0;this.f||this.trigger(new _.Q(xP))};_.r.El=function(a){this.w=!0;this.trigger(new _.Q(wP,{percent:a}))};_.r.Dl=function(){this.w=!1;this.trigger(new _.Q(vP))};_.r.Il=function(){this.trigger(new _.Q(BP))};_.r.Hl=function(a,b){this.trigger(new _.Q("onevent",{eventid:a,data:b}))};_.r.Jl=function(a,b,c,d,e){this.trigger(new _.Q(CP,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
51
- _.r.Gl=function(a,b){this.trigger(new _.Q(zP,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Nd&&"Challenge"===b.name)NP(c,b);else if("DrmError"===b.name){c.g.debug("DrmError event",b);var d=new _.O(_.P,6,6005,{message:JSON.stringify(b)});c.F.onError(d)}}};_.r.oe=function(a){this.trigger(new _.Q(AP,{eventType:a}))};
52
- _.r.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(yP,f,b);g=setTimeout(function(){b.off(yP,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===QQ)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){yQ(b);d(webapis.avplay.play())},function(f){b.trigger(new _.Q(AP));e(f)})})).then(function(){return a()});if(c===SP||c===PQ)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===RP?
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()===SP?Promise.resolve():Promise.reject()};
54
- _.r.setPlaybackRate=function(a){var b=this.getState();if(b===PQ||b===RP||b===SP){try{webapis.avplay.setSpeed(a),this.D=a}catch(c){return this.g.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.D)}return!0}this.g.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1};_.r.getPlaybackRate=function(){return this.D};
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,FQ(c),4);case 4:return _.x(e,IQ(c,a,b),5);case 5:_.G(e,0);break;case 2:throw d=_.H(e),new _.O(_.P,7,7003,null,d);}})};_.r.getState=function(){if(this.f&&this.a)return this.a.Qh;try{return webapis.avplay.getState()}catch(a){this.oe(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 _.Q(_.Og));webapis.avplay.seekTo(c,function(){b.B=!1;b.m.trigger(new _.Q(_.Ng));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.oe(JSON.stringify(a))}};_.r.getDuration=function(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.oe(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.gg.stop()}a.j={};a.D=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 tP:this.g.debug("The application does not have the privilege to get the volume.",uP);break;default:this.g.debug(qP,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 tP:this.g.warn("The application does not have the privilege to set the volume.",uP);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.oe(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 QQ="IDLE",PQ="READY",RP="PLAYING",SP="PAUSED",oQ=_.Ub,hQ=_.ja,iQ="TEXT",SQ="PLAYER_MSG_RESOLUTION_CHANGED",RQ="PLAYER_MSG_BITRATE_CHANGE",LP={PLAYREADY:"PLAYREADY",zp:"EME_PLAYREADY",Fp:"VERIMATRIX",pf:"WIDEVINE_CDM",Ap:"EME_WIDEVINE_CDM",Hp:"WIDEVINE_CLASSIC"};_.w(LQ,_.Ei);_.r=LQ.prototype;_.r.di=function(){var a=this;this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.Q(_.qe));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.g.debug("Could not loop playback")}):this.a.stop()};_.r.ai=function(a){this.trigger(new _.Q(_.Bg,{currentTime:a.currentTime/1E3}))};
61
- _.r.ei=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.qh(d))&&this.o.append([new _.Fp(b,c,d)],[])};_.r.bi=function(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.r.jj=function(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)};
62
- _.r.ci=function(a){this.g.debug("Error: TYPE: "+a.eventType);QP(this.f,_.Bo);a=new _.O(_.P,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.Q(_.re,{detail:a}))};
63
- _.r.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(BP,this.di,this);this.a.on(yP,this.ai,this);this.a.on(CP,this.ei,this);this.a.on(zP,this.bi,this);this.a.on(AP,this.ci,this);this.a.on(vP,this.jj,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();var c=TQ;TQ+=1;this.j=_.Zi(_.$e,{id:"__clpp_tizen_player_"+c,type:"application/avplayer"});this.w.addElementToContainer(this.j,!0);var d=this.w.getMedia();if(d){c=this.j;
64
- var e=[_.hh,_.we,"position",_.Ee,"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];_.aj(c,f);MQ(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(BP,a.di);a.a.off(yP,a.ai);a.a.off(CP,a.ei);a.a.off(zP,a.bi);a.a.off(AP,a.ci);a.a.off(vP,a.jj);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,_.A(b)}})};_.r.namespace=function(){return UQ};_.r.getPlaybackRate=function(){return this.a.getPlaybackRate()};
2
+ var f=function(window){var eP="An unknown error occurred while trying to get volume",fP="Cannot get loading rendition due to platform limitations",gP="PARAM_START_POSITION",hP="SecurityError",iP="The require privilege is: http://tizen.org/privilege/tv.audio",jP="onbufferingcomplete",kP="onbufferingprogress",lP="onbufferingstart",mP="oncurrentplaytime",nP="ondrmevent",oP="onerror",pP="onstreamcompleted",qP="onsubtitlechange",rP="preparingend",sP="preparingstart",tP="|STARTBITRATE\x3d",uP=function(a,b,c){function d(e){c.call(a,
3
+ e);a.removeEventListener(b,d)}a.addEventListener(b,d)},vP=function(a,b){this.h=a;this.o=null;this.a=_.Ue;this.l=null;this.j=!1;this.f=new Map;this.F=b;this.g=new _.L("clpp.tizen.DrmEngine")},yP=function(a){var b,c,d;return _.I(function(e){if(1==e.a){b=a.a===_.Kd||a.a===_.Id;if(!b)throw new _.N(_.P,6,6001,"The key system "+a.a+" is not supported by the player or the platform");c=a.f.get(a.a);if(!c.Pe)throw new _.N(_.P,6,6012,"No license server given for "+a.a);_.F(e,2);return a.a===_.Kd?_.x(e,wP(a),
4
+ 5):_.x(e,xP(a,c),5)}if(2!=e.a)return a.o={keySystem:a.a,licenseServerUri:c.Pe,distinctiveIdentifierRequired:!1,persistentStateRequired:c.bh,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null},_.G(e,0);d=_.H(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.N(_.P,6,6005,{message:JSON.stringify(d)});})},xP=function(a,b){var c,d,e,f;return _.I(function(g){c=zP;d=AP;e={};e[d.dk]=!b.bh;e[d.fk]=b.Pe;""!==b.customData&&(e[d.ck]=b.customData);
5
+ f=JSON.stringify(e);a.g.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(k){throw k;}_.z(g)})},wP=function(a){var b;return _.I(function(c){b=zP;try{webapis.avplay.setDrm(b.pg,"Initialize",""),webapis.avplay.setDrm(b.pg,"widevine_app_session",a.l.id),webapis.avplay.setDrm(b.pg,"widevine_data_type",a.l.type)}catch(d){throw d;}_.z(c)})},BP=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,y,A,D;_.I(function(B){if(1==B.a){c=a.f.get(a.a);a.g.debug("DRM Challenge data: ",
6
+ b.challenge);d=atob(b.challenge);e=new Uint8Array(d.length);for(f=0;f<d.length;++f)e[f]=d.charCodeAt(f);g=b.serverurl&&""!==b.serverurl?b.serverurl:c.Pe;k=_.Uk([g],_.Pk());k.type=3;k.body=e.buffer;k.method=_.pb;_.F(B,2);return _.x(B,a.F.Lb.fetch(k).U,4)}if(2!=B.a){l=B.f;if(a.j){m=_.Ni(l.data);n=m.byteLength;p="";for(q=0;q<n;q++)p+=String.fromCharCode(m[q]);t=btoa(p);u=b.session_id+gP+(t+gP);a.g.debug("Widevine license params",u);try{webapis.avplay.setDrm("WIDEVINE_CDM","widevine_license_data",u)}catch(E){a.g.error("License response rejected by CDM"),
7
+ y=new _.N(_.P,6,6008,{browserError:JSON.stringify(E)}),a.F.onError(y)}}return _.G(B,0)}A=_.H(B);a.g.error("License request failed.",JSON.stringify(A));D=new _.N(_.P,6,6007,{message:"Error while fetching license!",url:A.data.url,status:A.data.status||NaN,response:A.data.response||"",headers:A.data.headers||{}},A);a.F.onError(D);_.z(B)})},CP=function(a){this.m=a;this.a=this.m.a;this.j=this.f=_.Zo;this.w=(new Date).getTime();this.l=!1;this.o=-1;this.h=2;this.g=new _.L("clpp.tizen.StateManager")},EP=
8
+ function(a,b){if(a.f!==b)if(a.f===_.so&&b!==_.Zo)a.g.debug(_.oB+DP(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;2===a.f?(a.o=(new Date).getTime(),a.m.trigger(new _.Q(_.ed,{detail:{bufferedTimeMS:-1,reason:a.h}}))):2===a.j&&a.m.trigger(new _.Q(_.dd,{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 _.Q(_.fg,{detail:d}));a.g.debug("State changed:",DP(a.j),"-\x3e",DP(a.f))}},DP=function(a){return Object.keys(_.cp)[a]},
9
+ HP=function(a){if(a.l){var b=a.a.getState(),c=a.f;switch(b){case FP:c=3;break;case GP:c=4;break;default:a.m.isEnded()?c=5:a.g.debug("Inconsistent AVPlay playback state:",b)}EP(a,c)}},IP=function(){this.o=this.A=this.f=this.h=this.B=this.m=this.j=this.a=null;this.D=!1;this.w=!0;this.l=null;this.g=new _.L("clpp.tizen.TextStreamer")},JP=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},KP=function(a){var b,c;return _.I(function(d){if(1==d.a)return b=
10
+ a.m.getConfiguration(),c=null,_.x(d,_.Lv(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)})},LP=function(a){var b=document.createElement(_.Og),c=new _.VE,d=new _.DC,e=a.m.getTextDisplayer();return new _.XE(b,c,e,d,a.m.getConfiguration())},MP=function(a){var b={configuration:{},Hb:function(){return a.m.getPosition()},Y:a.h,Lb:a.m.getNetworkEngine(),Dd:null,Sg:a.Kl.bind(a),hj:a.Jl.bind(a),onError:a.Ll.bind(a),ij:function(){},
11
+ onEvent:function(){},mj:a.Ml.bind(a),Uf:function(){},ye:function(){return new _.KF},wg:function(){return!1},re:null};return new _.uG(a.a,b)},NP=function(a){var b=a.m.getPosition(),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},OP=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=
12
+ c[d].textStreams;break}a=b}else a=[];b=[];for(d=c=0;d<a.length;d++){var e=new _.Yp(String(c++),_.$p);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=a[d].kind||_.OB;var f=new _.fq(String(a[d].id),e);f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},PP=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.f){var b=_.xG(a.f,_.rn),c=null;if(b){a=OP(a);for(var d=0;d<a.length;d++)if(a[d].renditions[0].id===String(b.id)){c=a[d].renditions[0];
13
+ break}}return c}return null},QP=function(a,b){var c,d,e,f;_.I(function(g){if(1==g.a){c=_.NI;a.g.debug("Set active track",b);if(!b)return g.C(0);a.o=b.language;a.A=b.roles[0]||"";a.D=b.kind===c.Ch;if(!a.a||!a.f)return g.C(0);a.setTextVisibility(!0);d=NP(a);e=b.renditions[0];f=d.textStreams.find(function(k){return String(k.id)===e.id});return f?a.w?(a.g.debug("Switching period defer text selection"),a.l=f,g.C(4)):_.x(g,_.RG(a.f,f),5):(a.g.error("No stream with id",e.id),g["return"]())}4!=g.a&&a.m.trigger(new _.Q(_.rg));
14
+ a.o=f.language;_.z(g)})},RP=function(){this.j=this.a=this.m=null;this.f={};this.g=new _.L("clpp.tizen.TrackManager");this.w=this.o=this.l=null;this.A=!1;this.h=1},SP=function(a,b){a.m.trigger(new _.Q(_.Sg,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.a.o}}))},TP=function(a){var b=a.sa();b&&a.m.trigger(new _.Q(_.bd,{detail:{width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b}}))},UP=function(a){var b=a.m.getConfiguration(),c=_.Fi(b.preferredAudioLanguage||
15
+ []),d=a.f[_.W]||[];if(d.length){var e=null;c.some(function(g){e=_.uC(g,d.map(function(k){return k.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)}),0<f.length&&(c=f[0]));a.g.debug("Setting audio track with preferred language:",e);a.La(c)}else a.g.debug("Preferred language(s) not available")}else a.g.debug("Could not set preferred audio language")},YP=function(a,
16
+ b){if(b){var c=b.track.type.toUpperCase();VP(a.a,c,Number(b.id)).then(function(){c===WP&&(a.l=b,a.m.trigger(new _.Q(_.$c)));c===XP&&(a.o=b,a.m.trigger(new _.Q(_.rg)))})["catch"](function(){a.g.error("Could not select "+c+" track.")})}else a.g.debug("Must provide valid rendition")},ZP=function(a,b,c){var d=_.io(b.language||_.Bg);c.language=_.Zp(d);c.originalLanguage=d;c.channelsCount=b.channels?Number(b.channels):null;c.mimeType=_.Xc;a=new _.fq(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=
17
+ b.bit_rate||null;return a},$P=function(a,b,c){c.mimeType=_.Qg;a=new _.fq(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},aQ=function(a,b,c){b=_.io(b.track_lang||_.Bg);c.mimeType="text/ttml";c.language=_.Zp(b);c.originalLanguage=b;c.kind=_.OB;return new _.fq(String(a),c)},bQ=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},
18
+ eQ=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===cQ}),f=b.filter(function(n){return n.type===WP}),g=[],k=0;k<f.length;k++){var l=bQ(a,f[k].extra_info);if(l){var m=_.io(l.language||_.Bg);m=_.Zp(m);m=c(g,m);m||(m=new _.Yp(String(a.h++),_.W),g.push(m));m.renditions.push(ZP(f[k].index,l,m))}else a.g.warn("Skipping audio stream with no extra info")}f=new _.Yp(String(a.h++),
19
+ _.aq);for(k=0;k<e.length;k++)(l=bQ(a,e[k].extra_info))?f.renditions.push($P(e[k].index,l,f)):a.g.warn("Skipping video stream with no extra info");e=[];e=a.j?OP(a.j):dQ(a,b);d[_.aq]=[f];d[_.W]=g;d[_.$p]=e;return d},dQ=function(a,b){for(var c=b.filter(function(k){return k.type===XP}),d=[],e=0;e<c.length;e++){var f=bQ(a,c[e].extra_info);if(f){var g=new _.Yp(String(a.h++),_.$p);g.renditions.push(aQ(c[e].index,f,g));d.push(g)}else a.g.warn("Skipping text stream with no extra info")}return d},fQ=function(a,
20
+ b){for(var c=a.f[_.aq]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.M.va(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},gQ=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},iQ=function(a,b){if(b===_.$p&&a.j)return PP(a.j);var c=hQ(a.a)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===
21
+ b.toUpperCase()})[0];var d=null;b===_.aq&&(d=bQ(a,c.extra_info),d=fQ(a,{width:d.Width,height:d.Height}));b===_.W&&(c?(d=gQ(a,c,_.W),a.l=d):d=a.l);b===_.$p&&(c?(d=gQ(a,c,_.$p),a.o=d):d=a.o);return d},jQ=function(a){_.Ai.call(this);this.m=a;this.h=null;this.g=new _.L("clpp.tizen.Middleware");this.D=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={}},kQ=function(a){return _.I(function(b){tizen.systeminfo.getPropertyValue("DISPLAY",function(c){a.A=c.resolutionWidth/
22
+ 1920;a.g.debug("Display resolution ratio: ",a.A)},function(c){a.g.debug("Could not load DISPLAY property");throw c;});_.z(b)})},lQ=function(a){try{webapis.avplay.setListener({onbufferingstart:a.El.bind(a),onbufferingprogress:a.Dl.bind(a),onbufferingcomplete:a.Cl.bind(a),onstreamcompleted:a.Hl.bind(a),oncurrentplaytime:function(b){a.trigger(new _.Q(mP,{currentTime:b}))},onevent:a.Gl.bind(a),onsubtitlechange:a.Il.bind(a),ondrmevent:a.Fl.bind(a),onerror:a.ne.bind(a)})}catch(b){a.g.error(b)}},mQ=function(a){var b=
23
+ !!a.m.getTrackManager().gb();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.g.debug("Could not set AVPlay subtitle config",c)}},nQ=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.g.debug({estimatedBandwidth:c,Rp:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",tP+d)}catch(e){a.g.debug(e)}},oQ=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+tP+b)}catch(c){throw a.g.debug("Could not set fixed bandwidth",
24
+ c),c;}},rQ=function(a){return{position:a.getPosition(),state:a.m.getState(),Nh:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:pQ(a),volume:a.getVolume(),kp:qQ(a),Xl:hQ(a)}},tQ=function(a){var b,c;return _.I(function(d){if(1==d.a)return _.x(d,sQ(),2);if(3!=d.a)return b=new Promise(function(e){(new _.dj(e)).ia(5)}),_.x(d,Promise.race([kQ(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"),
25
+ d["return"](Promise.reject("SDK Timeout"));_.z(d)})},wQ=function(a,b,c){var d,e,f,g,k,l,m,n;return _.I(function(p){switch(p.a){case 1:a.l=_.Gn(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 _.Q(lP)),f=c.currentPosition);_.F(p,2);g=a.l[d].url;k=a.l[d].type;k!==_.Kc||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);
26
+ e.nextBandwidth?(oQ(a,e.nextBandwidth),a.o=!1):(a.o||nQ(a,e),a.o=!0);lQ(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)},Lb:a.m.getNetworkEngine()};a.h=new vP(b.drm,m);return _.x(p,a.h.init(),4);case 4:return a.f||a.trigger(new _.Q(sP)),_.x(p,uQ(a),6);case 6:a.f||a.trigger(new _.Q(rP));f&&typeof f===_.h&&0<f&&a.seek(f)["catch"](function(q){a.g.debug("Couldn't set start position",q)});a.f||(b.volume&&
27
+ a.setVolume(b.volume),b.muted&&vQ(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;}})},uQ=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!");mQ(a);c()},function(e){a.g.debug("prepareAsync failed",e);d(e)})}catch(e){a.g.debug("Failed to prepare media player for playback"),
28
+ d(e)}}))})},xQ=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=rQ(a);a.f=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.m.getConfiguration(),d).then(function(){var e=a.a.Nh;a.f=!1;a.a=null;return e===GP?a.pause():a.play()})}catch(e){return Promise.reject(e)}},qQ=function(a){return a.f&&a.a?a.a.kp:webapis.avplay.getTotalTrackInfo()},
29
+ hQ=function(a){return a.f&&a.a?a.a.Xl:webapis.avplay.getCurrentStreamInfo()},VP=function(a,b,c){b=b.toUpperCase();b===XP&&yQ(a,!0);var d=a.j[b];d&&(d.eg.stop(),a.j[b]=null,a.g.debug("Cancelled pending track switch for "+b));return new Promise(function(e,f){function g(k,l,m){m=void 0===m?!1:m;try{webapis.avplay.setSelectTrack(k,l),a.j[k]=null,e()}catch(n){a.g.debug("Could not set "+k+" track. Trying again...AVPlay state: "+(a.getState()+", buffering: ")+a.w,n),!1===m&&(a.j[k]={type:k,index:l,Jh:0,
30
+ eg:new _.dj(function(){return g(k,c,!0)})}),(l=a.j[k])&&3>l.Jh?(a.w||++l.Jh,l.eg.ia(a.w?.5:.25)):(a.g.debug("Could not set track after multiple attempts.Giving up..."),l&&l.eg.stop(),a.j[k]=null,f())}}g(b,c)})},yQ=function(a,b){var c=a.m.getTextDisplayer();c&&c.setTextVisibility(b);c=a.m.h;try{c||webapis.avplay.setSilentSubtitle(!b)}catch(d){a.g.debug("Could not set text track visibility",d)}},vQ=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case hP:a.g.warn("The application does not have the privilege to set mute.",
31
+ iP);break;default:a.g.warn(eP,c)}}},pQ=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case hP:a.g.warn("The application doesn't have the privilege to get the mute state.",iP);break;default:a.g.warn(eP,c)}}return!!b},sQ=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");uP(c,_.Fe,function(d){return a(d)});uP(c,_.me,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},
32
+ zQ=function(){_.Ai.call(this);this.a=new jQ(this);this.f=new CP(this);this.configuration=this.B=_.An();this.w=null;this.g=new _.L("clpp.tizen.Player");this.j=null;this.l=new RP;this.D=new _.Lm;this.o=this.h=null;this.A=!1},AQ=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,
33
+ 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())},BQ=function(){},CQ=function(){},zP={PLAYREADY:"PLAYREADY",Ap:"EME_PLAYREADY",Gp:"VERIMATRIX",pg:"WIDEVINE_CDM",Bp:"EME_WIDEVINE_CDM",Ip:"WIDEVINE_CLASSIC"};vP.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.I(function(k){if(1==k.a){b=_.Jn[a.h.env]||null;if(!b)throw a.g.debug(_.Ea,_.ub+a.h.env+_.aa),new _.N(_.P,6,6015,_.Ga+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=_.Ln(b,a.h.customData);(e=d[_.Id])&&a.f.set(_.Id,{Pe:e.licenseUrl||"",customData:c,bh:!1});(f=d[_.Kd])&&a.f.set(_.Kd,{Pe:f.licenseUrl||"",customData:c,
34
+ bh:!1});if(0===a.f.size)throw new _.N(_.P,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Id))a.a=_.Id;else if(a.f.get(_.Kd))a.a=_.Kd;else throw new _.N(_.P,6,6001,"Configuration for the target system is missing.");return _.x(k,yP(a),2)}a.j=!0;_.z(k)})};vP.prototype.release=function(){var a=this;return _.I(function(b){a.j=!1;a.o=null;a.a=_.Ue;a.l=null;a.f=new Map;_.z(b)})};vP.prototype.getDrmInfo=function(){return this.o};
35
+ var AP={dk:"DeleteLicenseAfterUse",fk:"LicenseServer",Cp:"GetChallenge",Dp:"HttpHeader",Fp:"UserAgent",zp:"Cookie",ck:"CustomData"};_.r=CP.prototype;_.r.initialize=function(){this.a.on(lP,this.ei,this);this.a.on(kP,this.di,this);this.a.on(jP,this.ci,this);this.a.on(sP,this.oj,this);this.a.on(rP,this.nj,this);this.a.on(pP,this.fi,this)};_.r.release=function(){EP(this,_.Zo);this.l=!1;this.o=-1;this.h=2};_.r.destroy=function(){this.release();this.a.off(lP,this.ei);this.a.off(kP,this.di);this.a.off(jP,this.ci);this.a.off(sP,this.oj);this.a.off(rP,this.nj);this.a.off(pP,this.fi);this.m=this.a=null};
36
+ _.r.ei=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.a.isSeeking()?this.h=1:this.h=2;EP(this,2)};_.r.di=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",DP(this.f))};_.r.ci=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()===DQ;if(!a&&b){EP(this,4);return}}if(a=1!==this.f)a=this.a.getState(),a=a===FP||a===GP;a&&HP(this)};
37
+ _.r.oj=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===EQ?EP(this,1):this.g.error("AVPlay prepares while state is not IDLE")};_.r.nj=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.r.fi=function(){EP(this,5)};_.r.getState=function(){return this.f};_.r=IP.prototype;_.r.initialize=function(a){this.m=a};
38
+ _.r.load=function(a){var b=this,c,d,e,f,g,k,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,KP(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(){}};_.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(_.ve,"http://"),d),8);case 8:g.a=m.f;_.G(m,4);break;case 6:k=_.H(m),b.g.error(k),b.a=null;case 4:if(!b.a||!JP(b.a)){m.C(0);break}b.h=LP(b);_.F(m,10);return _.x(m,b.h.open(),12);case 12:b.f=MP(b);l=b.m.getConfiguration();b.f.h=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;b.D=l.preferForcedSubtitles;
40
+ _.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.Kl=function(a){this.g.debug(_.IB,a.id);this.w=!0;var b=_.JF(a.textStreams,this.o||"",this.A||"",this.D)[0]||null;this.l&&(a.textStreams.includes(this.l)&&(b=this.l),this.l=null);return{video:null,audio:null,text:b,pb:null}};_.r.Jl=function(){var a=this;return _.I(function(b){if(1==b.a)return a.g.debug("canSwitch_"),a.w=!1,a.l?_.x(b,_.RG(a.f,a.l),3):b.C(0);a.l=null;_.z(b)})};
41
+ _.r.Ll=function(){this.g.debug("onError_")};_.r.Ml=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)};
42
+ _.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(RP,_.vq);_.r=RP.prototype;_.r.fj=function(a){var b=a.eventid;a=a.data;switch(b){case FQ:0<Object.keys(this.f).length||(this.g.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+bQ(this,b[0].extra_info).Bit_rate,b=fQ(this,{bandwidth:b}))&&(this.w=b,SP(this,b));break;case GQ:TP(this);break;default:this.g.debug("Event type: "+b+" data: "+a)}};_.r.Wg=function(a){3===a.detail.currentState&&this.m.off(_.fg,this.Wg)};
43
+ _.r.initialize=function(a){var b=this;this.m=a;this.a=this.m.a;this.m.on(_.fg,function(c){b.A||(c=c.detail,3===c.currentState&&(b.g.debug("Current state",c.currentState),b.A=!0,UP(b)))});this.a.on("onevent",this.fj,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(_.fg,this.Wg);this.m.on(_.fg,this.Wg,this);try{var a=qQ(this.a);this.f=eQ(this,a);var b=this.f[_.W]||[];b.length&&(this.l=b[0].renditions[0]||null);TP(this)}catch(c){this.g.debug("Could not load track manager")}}};_.r.destroy=function(){this.a.off("onevent",this.fj);this.a=this.m=null};_.r.getVideoTracks=function(){return this.f[_.aq]||[]};_.r.getAudioTracks=function(){return this.f[_.W]||[]};
45
+ _.r.ra=function(){return this.f[_.$p]||[]};_.r.sa=function(){return iQ(this,_.aq)};_.r.Ya=function(){return iQ(this,_.W)};_.r.gb=function(){return iQ(this,_.$p)};_.r.Gb=function(){return this.w};_.r.Wb=function(){this.g.info(fP);return null};_.r.Xb=function(){this.g.info(fP);return null};_.r.Qa=function(){var a=this.sa();return a?a.track:null};_.r.qa=function(){var a=this.Ya();return a?a.track:null};_.r.wa=function(){var a=this.gb();return a?a.track:null};
46
+ _.r.Pb=function(a){var b=this;null===a?(a=this.sa(),xQ(this.a,a.bandwidth,null).then(function(){TP(b)})):0<a.renditions.length&&this.Cb(a.renditions[0])};_.r.La=function(a){a?YP(this,a.renditions[0]):this.g.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.r.jb=function(a){a?(a=a.renditions[0],this.j?QP(this.j,a.track):YP(this,a)):(this.g.debug("Disabling text tracks"),this.o=null,yQ(this.a,!1),this.m.trigger(new _.Q(_.rg)))};
47
+ _.r.Cb=function(a){var b=this,c=this.sa();this.a.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,SP(this,a),xQ(this.a,c.bandwidth,a.bandwidth).then(function(){TP(b)})["catch"](function(d){var e=new _.N(_.P,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.Nb=function(a){YP(this,a)};_.r.Ob=function(a){this.j?QP(this.j,a.track):YP(this,a)};
48
+ _.r.addTextTrack=function(){};_.r.xa=function(){return this.a.o};RP.prototype.isAbrEnabled=RP.prototype.xa;RP.prototype.addTextTrack=RP.prototype.addTextTrack;RP.prototype.setTextRendition=RP.prototype.Ob;RP.prototype.setAudioRendition=RP.prototype.Nb;RP.prototype.setVideoRendition=RP.prototype.Cb;RP.prototype.setTextTrack=RP.prototype.jb;RP.prototype.setAudioTrack=RP.prototype.La;RP.prototype.setVideoTrack=RP.prototype.Pb;RP.prototype.getTextTrack=RP.prototype.wa;RP.prototype.getAudioTrack=RP.prototype.qa;
49
+ RP.prototype.getVideoTrack=RP.prototype.Qa;RP.prototype.getLoadingTextRendition=RP.prototype.Xb;RP.prototype.getLoadingAudioRendition=RP.prototype.Wb;RP.prototype.getLoadingVideoRendition=RP.prototype.Gb;RP.prototype.getTextRendition=RP.prototype.gb;RP.prototype.getAudioRendition=RP.prototype.Ya;RP.prototype.getVideoRendition=RP.prototype.sa;RP.prototype.getTextTracks=RP.prototype.ra;RP.prototype.getAudioTracks=RP.prototype.getAudioTracks;RP.prototype.getVideoTracks=RP.prototype.getVideoTracks;_.w(jQ,_.Ai);_.r=jQ.prototype;_.r.El=function(){this.w=!0;this.f||this.trigger(new _.Q(lP))};_.r.Dl=function(a){this.w=!0;this.trigger(new _.Q(kP,{percent:a}))};_.r.Cl=function(){this.w=!1;this.trigger(new _.Q(jP))};_.r.Hl=function(){this.trigger(new _.Q(pP))};_.r.Gl=function(a,b){this.trigger(new _.Q("onevent",{eventid:a,data:b}))};_.r.Il=function(a,b,c,d,e){this.trigger(new _.Q(qP,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
50
+ _.r.Fl=function(a,b){this.trigger(new _.Q(nP,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Kd&&"Challenge"===b.name)BP(c,b);else if("DrmError"===b.name){c.g.debug("DrmError event",b);var d=new _.N(_.P,6,6005,{message:JSON.stringify(b)});c.F.onError(d)}}};_.r.ne=function(a){this.trigger(new _.Q(oP,{eventType:a}))};
51
+ _.r.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(mP,f,b);g=setTimeout(function(){b.off(mP,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===EQ)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){mQ(b);d(webapis.avplay.play())},function(f){b.trigger(new _.Q(oP));e(f)})})).then(function(){return a()});if(c===GP||c===DQ)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===FP?
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()===GP?Promise.resolve():Promise.reject()};
53
+ _.r.setPlaybackRate=function(a){var b=this.getState();if(b===DQ||b===FP||b===GP){try{webapis.avplay.setSpeed(a),this.D=a}catch(c){return this.g.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.D)}return!0}this.g.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1};_.r.getPlaybackRate=function(){return this.D};
54
+ _.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,tQ(c),4);case 4:return _.x(e,wQ(c,a,b),5);case 5:_.G(e,0);break;case 2:throw d=_.H(e),new _.N(_.P,7,7003,null,d);}})};_.r.getState=function(){if(this.f&&this.a)return this.a.Nh;try{return webapis.avplay.getState()}catch(a){this.ne(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 _.Q(_.Hg));webapis.avplay.seekTo(c,function(){b.B=!1;b.m.trigger(new _.Q(_.Gg));d()},function(){b.B=!1;e()})})};_.r.isSeeking=function(){return this.B};_.r.getPosition=function(){if(this.f&&this.a)return this.a.position;try{return webapis.avplay.getCurrentTime()/1E3}catch(a){this.ne(JSON.stringify(a))}};
56
+ _.r.getDuration=function(){if(this.f&&this.a)return this.a.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.ne(JSON.stringify(a))}};_.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.eg.stop()}a.j={};a.D=1;a.B=!1;a.l=null;a.a=null;return b()}catch(f){return c(f)}})};
57
+ _.r.getVolume=function(){var a=null;try{a=tizen.tvaudiocontrol.getVolume()}catch(b){switch(b.name){case hP:this.g.debug("The application does not have the privilege to get the volume.",iP);break;default:this.g.debug(eP,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 hP:this.g.warn("The application does not have the privilege to set the volume.",iP);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.ne(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 EQ="IDLE",DQ="READY",FP="PLAYING",GP="PAUSED",cQ=_.Tb,WP=_.la,XP="TEXT",GQ="PLAYER_MSG_RESOLUTION_CHANGED",FQ="PLAYER_MSG_BITRATE_CHANGE";_.w(zQ,_.Ai);_.r=zQ.prototype;_.r.ai=function(){var a=this;this.g.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.Q(_.le));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.g.debug("Could not loop playback")}):this.a.stop()};_.r.Yh=function(a){this.trigger(new _.Q(_.wg,{currentTime:a.currentTime/1E3}))};
61
+ _.r.bi=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.ph(d))&&this.o.append([new _.Fp(b,c,d)],[])};_.r.Zh=function(a){this.g.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.r.gj=function(){this.A||(this.g.debug("Initial buffering completed..."),this.A=!0)};
62
+ _.r.$h=function(a){this.g.debug("Error: TYPE: "+a.eventType);EP(this.f,_.so);a=new _.N(_.P,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.Q(_.me,{detail:a}))};
63
+ _.r.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(pP,this.ai,this);this.a.on(mP,this.Yh,this);this.a.on(qP,this.bi,this);this.a.on(nP,this.Zh,this);this.a.on(oP,this.$h,this);this.a.on(jP,this.gj,this);this.f.initialize();this.l.initialize(this);this.g.debug("Initializing player surface");this.w.hideMediaElement();var c=HQ;HQ+=1;this.j=_.Vi(_.Ve,{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=[_.ch,_.re,"position",_.ze,"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];_.Xi(c,f);AQ(this)}};_.r.getSurface=function(){return this.w};_.r.getConfiguration=function(){return this.configuration};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.lb)};_.r.appendLoad=function(){return Promise.reject(_.lb)};
65
+ _.r.seekWith=function(){return Promise.reject(_.lb)};_.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(pP,a.ai);a.a.off(mP,a.Yh);a.a.off(qP,a.bi);a.a.off(nP,a.Zh);a.a.off(oP,a.$h);a.a.off(jP,a.gj);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 IQ};_.r.getPlaybackRate=function(){return this.a.getPlaybackRate()};
67
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:5===this.f.getState()?this.getDuration():this.a.getPosition()||0};_.r.seek=function(a){return typeof a===_.h&&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===_.h?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(_.xa);return new _.ii};_.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,_.A(b)}})};
70
- _.r.load=function(a){var b=this,c,d,e,f,g;return _.I(function(k){switch(k.a){case 1:b.configuration=_.Nn([b.B,a]);c=_.$t(b.configuration,[_.ze,"native"]);b.o=c.create(b);d=_.Rn(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){k.C(2);break}b.h=new UP;b.h.initialize(b);_.F(k,3);return _.x(k,b.h.load(d),5);case 5:b.h.start();_.G(k,2);break;case 3:f=_.H(k),b.g.error(f);case 2:return _.F(k,6),_.x(k,b.a.load(b.configuration),8);case 8:_.G(k,7);break;case 6:throw g=
71
- _.H(k),b.onError(g),g;case 7:b.l.load(),_.A(k)}})};_.r.play=function(){var a=this;this.trigger(new _.Q(_.pf));MQ(this);return this.a.play().then(function(){TP(a.f)})};_.r.pause=function(){var a=this;return this.a.pause().then(function(){TP(a.f)})};_.r.getState=function(){return this.f.getState()};_.r.getPeriods=function(){return[]};_.r.onError=function(a){var b=new _.Q(_.re,{detail:a});a.severity===_.P&&(QP(this.f,_.Bo),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)};
72
- _.r.getDrmInfo=function(){return this.a.getDrmInfo()};_.r.isEnded=function(){return 5===this.f.getState()};_.r.isPaused=function(){return this.a.getState()===SP};_.r.isMuted=function(){return BQ(this.a)};_.r.setMuted=function(a){HQ(this.a,a)};_.r.getNetworkEngine=function(){return this.D};_.r.setNetworkEngine=function(a){this.D=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 NQ).canPlay(a,b)};_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.getTextDisplayer=function(){return this.o};_.r.resetAbr=function(){};var UQ="clpp.tizen",TQ=0;NQ.prototype.a=function(){return UQ};
74
- NQ.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Lc||a===_.Xl||a===_.Rc)&&b){if(_.mj(2))return 2;if(_.mj(3)||_.mj(4)||_.mj(5)||_.mj(6))return _.Rh("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};NQ.prototype.f=function(a){return a===_.pa};NQ.prototype.create=function(){return new LQ};_.w(OQ,_.fv);OQ.prototype.install=function(){_.ai(new NQ)};OQ.prototype.uninstall=function(){var a=UQ;a&&_.Zh[a]&&(delete _.Zh[a],_.$h.info("Removed Player factory: '"+a+"'"))};OQ.prototype.id=function(){return"tizen"};_.J("clpp.tizen.TizenComponent",OQ);};
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===_.h?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(_.Aa);return new _.bi};_.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(k){switch(k.a){case 1:b.configuration=_.Cn([b.B,a]);c=_.Bt(b.configuration,[_.ue,"native"]);b.o=c.create(b);d=_.Gn(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){k.C(2);break}b.h=new IP;b.h.initialize(b);_.F(k,3);return _.x(k,b.h.load(d),5);case 5:b.h.start();_.G(k,2);break;case 3:f=_.H(k),b.g.error(f);case 2:return _.F(k,6),_.x(k,b.a.load(b.configuration),8);case 8:_.G(k,7);break;case 6:throw g=
71
+ _.H(k),b.onError(g),g;case 7:b.l.load(),_.z(k)}})};_.r.play=function(){var a=this;this.trigger(new _.Q(_.kf));AQ(this);return this.a.play().then(function(){HP(a.f)})};_.r.pause=function(){var a=this;return this.a.pause().then(function(){HP(a.f)})};_.r.getState=function(){return this.f.getState()};_.r.getPeriods=function(){return[]};_.r.onError=function(a){var b=new _.Q(_.me,{detail:a});a.severity===_.P&&(EP(this.f,_.so),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)};
72
+ _.r.getDrmInfo=function(){return this.a.getDrmInfo()};_.r.isEnded=function(){return 5===this.f.getState()};_.r.isPaused=function(){return this.a.getState()===GP};_.r.isMuted=function(){return pQ(this.a)};_.r.setMuted=function(a){vQ(this.a,a)};_.r.getNetworkEngine=function(){return this.D};_.r.setNetworkEngine=function(a){this.D=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 BQ).canPlay(a,b)};_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.getTextDisplayer=function(){return this.o};_.r.resetAbr=function(){};var IQ="clpp.tizen",HQ=0;BQ.prototype.a=function(){return IQ};
74
+ BQ.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Kc||a===_.Nl||a===_.Qc)&&b){if(_.ij(2))return 2;if(_.ij(3)||_.ij(4)||_.ij(5)||_.ij(6))return _.Mh("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};BQ.prototype.f=function(a){return a===_.ta};BQ.prototype.create=function(){return new zQ};_.w(CQ,_.xu);CQ.prototype.install=function(){_.Wh(new BQ)};CQ.prototype.uninstall=function(){var a=IQ;a&&_.Uh[a]&&(delete _.Uh[a],_.Vh.info("Removed Player factory: '"+a+"'"))};CQ.prototype.id=function(){return"tizen"};_.K("clpp.tizen.TizenComponent",CQ);};
75
75
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
76
76
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
77
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 Cy='application/mp4; codecs\x3d"stpp.ttml"',Dy='application/mp4; codecs\x3d"stpp.ttml.im1i"',Ey='application/mp4; codecs\x3d"stpp.ttml.im1t"',Fy="backgroundColor",Gy="direction",Hy="displayAlign",Iy="region",Jy="sans-serif",Ky="textAlign",Ly="textDecoration",My="writingMode",Ny=function(a,b,c){this.h=a;this.f=b;this.a=c},Oy=function(a,b,c){Ny.call(this,a,[],c);this.j=b||""},Py=function(a,b,c){Ny.call(this,a,b,c)},Qy=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
- Yy=function(a,b){var c=null;if(Ry.test(a)){c=Ry.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 Sy.test(a)?c=Ty(Sy,a):Uy.test(a)?c=Ty(Uy,a):Vy.test(a)?(c=Vy.exec(a),c=Number(c[1])/b.frameRate):Wy.test(a)?(c=Wy.exec(a),c=Number(c[1])/b.a):Xy.test(a)&&(c=Ty(Xy,a));return c},Ty=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)},Zy=function(a){return a.split(":").pop()},$y=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},bz=function(a,b){for(;az.test(a);){var c=az.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},cz=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},dz=function(a,b,c,d,e,f,g){Ny.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},ez=function(a,b,c){a=Qy(a,b,Ky);if(!a&&c&&(a=Qy(c,b,Ky),!a&&"rltb"===Qy(c,b,My)))return _.pe;switch(a){case _.od:return _.Ap;
5
- case _.Wf:case _.pe:return _.pe;default:return _.jg}},fz=function(a,b,c){if(_.R.Rf(a.w))return document.createTextNode(_.R.qh(a.w||""));if(a.A)return _.Zi("br");for(var d=_.Zi("span"),e=_.v(a.f),f=e.next();!f.done;f=e.next())_.$i(d,f.value);a=_.v(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(fz(c.get(e.value),b,c));return d},gz=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]))},hz=function(a,b,c){Ny.call(this,a,b,c)},kz=function(a,b,c,d){var e=iz.exec(a);a=jz.exec(a);return typeof b===_.h&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},lz=function(a,b){return typeof b===_.h&&0<b?_.Gp:jz.test(a)?0:_.Gp},mz=function(a,b){Ny.call(this,"root-container",[],b);this.j=a},nz=function(a,b,c){return typeof a===_.h?a:typeof b===_.h?b:c},oz=function(a,b){var c=a.getAttribute("extent");return(c=jz.exec(c))?Number(c[b]):null},qz=
7
- function(a){a=a.getAttribute("cellResolution");return(a=pz.exec(a))?Number(a[2]):null},rz=function(a,b,c){Ny.call(this,a,b,c)},sz=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=[]},uz=function(a){return tz.some(function(b){return b in a.attributes})},vz=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,_.qh(vz(a,a.a.get(e).f)).concat([e]));return c},xz=
8
- function(){return"inline-"+wz++},yz=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})},zz=function(a){this.a=a.firstChild;this.f=new Set},Az=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},Bz=function(a){return Zy(a.h.nodeName)},Cz=function(){this.a=new Map},Ez=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},k=b.parentNode;if(k&&a.a.has(k)){var l=a.a.get(k);e=
9
- _.qh(l.l).concat();-1===[_.da,"span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.qh(l.f).concat(),g={},Dz.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(Iy)&&(c=b.getAttribute(Iy));b.hasAttribute(_.pg)&&f.push.apply(f,_.qh(b.getAttribute(_.pg).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.v(d);for(k=d.next();!k.done;k=d.next()){k=k.value;var m=Zy(k);g[m]=b.getAttribute(k)}d=g.backgroundImage}c=new Az(b,
10
- c,d,e,f,g);a.a.set(b,c);return c},Fz=function(a){this.a=a;this.f=new DOMParser},Gz=function(a){this.f=a},Hz=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")},Iz=function(){},Jz=function(a){this.a=new Fz(a);this.g=new _.M("clpp.ttml.Mp4TtmlParser")},Kz=function(){this.a=new Iz};Ny.prototype.getId=function(){return this.h};
11
- Ny.prototype.hasAttribute=function(a){return a in this.a};Ny.prototype.getAttribute=function(a){return this.a[a]};_.w(Oy,Ny);_.w(Py,Ny);var Ry=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Sy=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Uy=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Vy=/^(\d*(?:\.\d*)?)f$/,Wy=/^(\d*(?:\.\d*)?)t$/,Xy=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,iz=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,jz=/^(\d+)px (\d+)px$/,pz=/^(\d+) (\d+)$/,az=/(\d+)px/,Lz=/^(\d+px|\d+em|\d*\.?\d+c)$/,tz=[Fy,"color",Gy,Hy,"fontFamily","fontSize","fontStyle","fontWeight",
12
- "lineHeight","opacity","padding",Ky,Ly,"textOutline",My,"zIndex"],Dz=["begin",_.pe];_.w(dz,Py);
13
- dz.prototype.build=function(a,b,c,d,e,f,g){var k=Yy(this.a.begin,b);b=Yy(this.a.end,b);if(null===k||null===b)return null;k+=c;b+=c;c=_.Zi(_.Yd);for(var l=_.v(this.j),m=l.next();!m.done;m=l.next())c.appendChild(fz(g.get(m.value),e,g));g=new _.Fp(k,b,c.innerHTML.trim(),_.Eg);g.cssClassList=_.qh(this.f).concat();g.textAlign=ez(this,e,null);g.writingMode=_.Bp;g.line=-1;g.lineInterpretation=_.Cp;g.lineAlign=_.Dp;g.containerRows=nz(null,qz(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
14
- ez(this,e,f);a:switch(Qy(f,e,My)){case "tb":case "tblr":a=_.Rg;break a;case "tbrl":a=_.Sg;break a;default:a=_.Bp}g.writingMode=a;a:switch(Qy(f,e,Hy)){case _.od:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Qy(f,e,Hy)){case _.od:a=1;break a;default:a=_.Cp}g.lineInterpretation=a;a:switch(Qy(f,e,Hy)){case _.od:e=_.od;break a;default:e=_.Dp}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(hz,Py);
16
- hz.prototype.build=function(a,b){var c=new _.Ip;c.id=this.getId();var d=nz(a.j.containerWidth,oz(a,1),720),e=nz(a.j.containerHeight,oz(a,2),480);a:switch(Qy(this,b,Hy)){case "after":var f="flex-start";break a;case _.od:f=_.od;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Qy(this,b,My)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Hd}c.writingMode=f;f=this.getAttribute("extent")||Qy(this,b,"extent");c.width=kz(f,d,1,100);c.widthUnits=lz(f,d);c.height=
17
- kz(f,e,2,100);c.heightUnits=lz(f,e);f=this.getAttribute("origin")||Qy(this,b,"origin");c.viewportAnchorX=kz(f,d,1,0);c.viewportAnchorY=kz(f,e,2,0);c.viewportAnchorUnits=lz(f,d);c.cssClassList=_.qh(this.f).concat();return c};_.w(mz,Ny);_.w(rz,Ny);
18
- rz.prototype.build=function(a){var b=null;var c=qz(a);c&&(b=nz(a.j.containerHeight,oz(a,2),480)/c);b=nz(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.h+", ::ttml ."+this.h+" * {";for(var d=_.v(Mz.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+":"+$y(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(),k=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!Lz.test(g)&&Lz.test(k)&&Lz.test(l)?(e=g,f=k):2===d.length&&!Lz.test(g)&&Lz.test(k)?(e=g,f=k):2===d.length&&Lz.test(g)&&Lz.test(k)&&(f=g);if(""!==f){f=$y(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=cz(this.a.textShadow),d=$y(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",Jy).replace("proportionalSerif",Jy).replace("sansSerif",Jy).replace("default",Jy)+";":"");a:{if(Ly 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:"+$y(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=$y(e),e=bz(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=$y(d);d=bz(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 Mz=new Map([[Fy,"background-color"],["color","color"],[Gy,Gy],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var wz=0;zz.prototype.Ge=function(){return!!this.a};zz.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Nz.has(Zy(a.nodeName))||Oz.has(Zy(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&&!Nz.has(Zy(a.nodeName))));var b=this.a;this.a=a;return b};
23
- var Nz=new Set(["tt","head","layout",_.Se,_.Be,Iy,"styling",_.pg,"body",_.Yd,"p","span","br"]),Oz=new Set([_.pg,_.Be]);Az.prototype.getId=function(){return this.attributes.id};Fz.prototype.parseInit=function(){};
24
- Fz.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.N.xb(this.a.ttml||{}),e=_.Ri(a,0,c[0]);e=_.R.ga(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.vg)}catch(n){throw new _.O(_.P,2,2005,"Failed to parse TTML.");}d=new sz(d);e=new Cz;f=new zz(f);b=b.periodStart;typeof b===_.h&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var k=c[g],l=_.Ri(a,b,k);l=_.Jm(l);var m="urn:mpeg:14496-30:subs:"+g;d.h.set(m,new Oy(m,l,{imageType:"PNG",encoding:"Base64"}));
25
- b+=k}for(;f.Ge();)a=f.next(),a=Ez(e,a),"tt"===Bz(a)&&(d.l=new mz(d.B,Object.assign({},a.attributes))),"tt"===Bz(a)&&(d.w=new gz(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),Bz(a)!==_.Be||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new Oy(c,a.h.textContent,a.attributes))),Bz(a)===_.Be&&a.attributes.begin&&a.attributes.end?(c="#"+xz(),b=new Oy(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
26
- Bz(a)===_.pg&&(c=a.getId()||xz(),b=new rz(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),Bz(a)!==_.pg&&uz(a)?(c=xz(),b=new rz(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),Bz(a)!==_.Yd||!a.attributes.extent&&!a.attributes.origin?c=null:(c=xz(),b=new hz(c,vz(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),Bz(a)!==Iy?c=null:(c=a.getId(),b=new hz(c,vz(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(Bz(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=xz(),b=new dz(c,a.h.nodeName===_.da?a.h.textContent:null,"br"===Bz(a),a.a,a.j,vz(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"===Bz(a)||a.j?(c=xz(),b=new dz(c,null,!1,a.a,a.j,vz(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=yz(d);f=[];a=_.v(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
28
- _.qh(c.value.build(d.l)));return{cues:e,styles:f}};Gz.prototype.a=function(a){a=(new Fz(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=Hz(c.startTime)+" --\x3e "+Hz(c.endTime),e=[];switch(c.textAlign){case _.Ee:e.push("align:left");break;case _.Wf:e.push("align:right");break;case _.Ap:e.push("align:middle");break;case _.jg:e.push("align:start");break;case _.pe:e.push("align:end")}switch(c.writingMode){case _.Rg:e.push("vertical:lr");break;
29
- case _.Sg:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.R.ub(b)};Iz.prototype.probe=function(a,b){return a===_.Qc&&b===_.ug};Iz.prototype.create=function(a){return new Gz(a)};Jz.prototype.parseInit=function(a){var b=!1;(new _.oq).N(_.We,_.pq).N(_.Dg,_.pq).N(_.Qe,_.pq).N(_.Ve,_.pq).N(_.mg,_.pq).da(_.og,_.qq).N("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.O(_.P,2,2007);};
30
- Jz.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.oq).N("moof",_.pq).N("traf",_.pq).da("subs",function(k){for(var l=_.jq(k.reader),m=0;m<l;++m){k.reader.skip(4);for(var n=_.iq(k.reader),p=0;p<n;++p){var q=1===k.version?_.jq(k.reader):_.iq(k.reader);g.push(q);k.reader.skip(6)}}}).N(_.Pe,_.rq(function(k){d=!0;k=c.a.parseMedia(k,b,g);e=e.concat(k.cues);f=f.concat(k.styles)})).parse(a);d||this.g.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.w(Kz,_.fv);Kz.prototype.install=function(){_.xv(_.Qc,Fz);_.xv(_.Nc,Jz);_.xv(Cy,Jz);_.xv(Ey,Jz);_.xv(Dy,Jz);_.ut.push(this.a)};Kz.prototype.uninstall=function(){_.zv(_.Qc);_.zv(_.Nc);_.zv(Cy);_.zv(Ey);_.zv(Dy);_.wt(this.a)};Kz.prototype.id=function(){return"subtitles-ttml"};_.J("clpp.ttml.TtmlComponent",Kz);};
2
+ var f=function(window){var hy='application/mp4; codecs\x3d"stpp.ttml"',iy='application/mp4; codecs\x3d"stpp.ttml.im1i"',jy='application/mp4; codecs\x3d"stpp.ttml.im1t"',ky="backgroundColor",ly="direction",my="displayAlign",ny="region",oy="sans-serif",py="textAlign",qy="textDecoration",ry="writingMode",sy=function(a,b,c){this.h=a;this.f=b;this.a=c},ty=function(a,b,c){sy.call(this,a,[],c);this.j=b||""},uy=function(a,b,c){sy.call(this,a,b,c)},vy=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
+ Dy=function(a,b){var c=null;if(wy.test(a)){c=wy.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 xy.test(a)?c=yy(xy,a):zy.test(a)?c=yy(zy,a):Ay.test(a)?(c=Ay.exec(a),c=Number(c[1])/b.frameRate):By.test(a)?(c=By.exec(a),c=Number(c[1])/b.a):Cy.test(a)&&(c=yy(Cy,a));return c},yy=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)},Ey=function(a){return a.split(":").pop()},Fy=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Hy=function(a,b){for(;Gy.test(a);){var c=Gy.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Iy=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},Jy=function(a,b,c,d,e,f,g){sy.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},Ky=function(a,b,c){a=vy(a,b,py);if(!a&&c&&(a=vy(c,b,py),!a&&"rltb"===vy(c,b,ry)))return _.je;switch(a){case _.nd:return _.Ap;
5
+ case _.Rf:case _.je:return _.je;default:return _.eg}},Ly=function(a,b,c){if(_.R.Pf(a.w))return document.createTextNode(_.R.ph(a.w||""));if(a.A)return _.Vi("br");for(var d=_.Vi("span"),e=_.v(a.f),f=e.next();!f.done;f=e.next())_.Wi(d,f.value);a=_.v(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(Ly(c.get(e.value),b,c));return d},My=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]))},Ny=function(a,b,c){sy.call(this,a,b,c)},Qy=function(a,b,c,d){var e=Oy.exec(a);a=Py.exec(a);return typeof b===_.h&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},Ry=function(a,b){return typeof b===_.h&&0<b?_.Gp:Py.test(a)?0:_.Gp},Sy=function(a,b){sy.call(this,"root-container",[],b);this.j=a},Ty=function(a,b,c){return typeof a===_.h?a:typeof b===_.h?b:c},Uy=function(a,b){var c=a.getAttribute("extent");return(c=Py.exec(c))?Number(c[b]):null},Wy=
7
+ function(a){a=a.getAttribute("cellResolution");return(a=Vy.exec(a))?Number(a[2]):null},Xy=function(a,b,c){sy.call(this,a,b,c)},Yy=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=[]},$y=function(a){return Zy.some(function(b){return b in a.attributes})},az=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,_.lh(az(a,a.a.get(e).f)).concat([e]));return c},cz=
8
+ function(){return"inline-"+bz++},dz=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})},ez=function(a){this.a=a.firstChild;this.f=new Set},fz=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},gz=function(a){return Ey(a.h.nodeName)},hz=function(){this.a=new Map},jz=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},k=b.parentNode;if(k&&a.a.has(k)){var l=a.a.get(k);e=
9
+ _.lh(l.l).concat();-1===[_.ea,"span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.lh(l.f).concat(),g={},iz.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(ny)&&(c=b.getAttribute(ny));b.hasAttribute(_.kg)&&f.push.apply(f,_.lh(b.getAttribute(_.kg).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.v(d);for(k=d.next();!k.done;k=d.next()){k=k.value;var m=Ey(k);g[m]=b.getAttribute(k)}d=g.backgroundImage}c=new fz(b,
10
+ c,d,e,f,g);a.a.set(b,c);return c},kz=function(a){this.a=a;this.f=new DOMParser},lz=function(a){this.f=a},mz=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")},nz=function(){},oz=function(a){this.a=new kz(a);this.g=new _.L("clpp.ttml.Mp4TtmlParser")},pz=function(){this.a=new nz};sy.prototype.getId=function(){return this.h};
11
+ sy.prototype.hasAttribute=function(a){return a in this.a};sy.prototype.getAttribute=function(a){return this.a[a]};_.w(ty,sy);_.w(uy,sy);var wy=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,xy=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,zy=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Ay=/^(\d*(?:\.\d*)?)f$/,By=/^(\d*(?:\.\d*)?)t$/,Cy=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Oy=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Py=/^(\d+)px (\d+)px$/,Vy=/^(\d+) (\d+)$/,Gy=/(\d+)px/,qz=/^(\d+px|\d+em|\d*\.?\d+c)$/,Zy=[ky,"color",ly,my,"fontFamily","fontSize","fontStyle","fontWeight",
12
+ "lineHeight","opacity","padding",py,qy,"textOutline",ry,"zIndex"],iz=["begin",_.je];_.w(Jy,uy);
13
+ Jy.prototype.build=function(a,b,c,d,e,f,g){var k=Dy(this.a.begin,b);b=Dy(this.a.end,b);if(null===k||null===b)return null;k+=c;b+=c;c=_.Vi(_.Td);for(var l=_.v(this.j),m=l.next();!m.done;m=l.next())c.appendChild(Ly(g.get(m.value),e,g));g=new _.Fp(k,b,c.innerHTML.trim(),_.zg);g.cssClassList=_.lh(this.f).concat();g.textAlign=Ky(this,e,null);g.writingMode=_.Bp;g.line=-1;g.lineInterpretation=_.Cp;g.lineAlign=_.Dp;g.containerRows=Ty(null,Wy(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
14
+ Ky(this,e,f);a:switch(vy(f,e,ry)){case "tb":case "tblr":a=_.Mg;break a;case "tbrl":a=_.Ng;break a;default:a=_.Bp}g.writingMode=a;a:switch(vy(f,e,my)){case _.nd:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(vy(f,e,my)){case _.nd:a=1;break a;default:a=_.Cp}g.lineInterpretation=a;a:switch(vy(f,e,my)){case _.nd:e=_.nd;break a;default:e=_.Dp}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(Ny,uy);
16
+ Ny.prototype.build=function(a,b){var c=new _.Ip;c.id=this.getId();var d=Ty(a.j.containerWidth,Uy(a,1),720),e=Ty(a.j.containerHeight,Uy(a,2),480);a:switch(vy(this,b,my)){case "after":var f="flex-start";break a;case _.nd:f=_.nd;break a;default:f="flex-end"}c.displayAlign=f;a:switch(vy(this,b,ry)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Ed}c.writingMode=f;f=this.getAttribute("extent")||vy(this,b,"extent");c.width=Qy(f,d,1,100);c.widthUnits=Ry(f,d);c.height=
17
+ Qy(f,e,2,100);c.heightUnits=Ry(f,e);f=this.getAttribute("origin")||vy(this,b,"origin");c.viewportAnchorX=Qy(f,d,1,0);c.viewportAnchorY=Qy(f,e,2,0);c.viewportAnchorUnits=Ry(f,d);c.cssClassList=_.lh(this.f).concat();return c};_.w(Sy,sy);_.w(Xy,sy);
18
+ Xy.prototype.build=function(a){var b=null;var c=Wy(a);c&&(b=Ty(a.j.containerHeight,Uy(a,2),480)/c);b=Ty(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.h+", ::ttml ."+this.h+" * {";for(var d=_.v(rz.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+":"+Fy(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(),k=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!qz.test(g)&&qz.test(k)&&qz.test(l)?(e=g,f=k):2===d.length&&!qz.test(g)&&qz.test(k)?(e=g,f=k):2===d.length&&qz.test(g)&&qz.test(k)&&(f=g);if(""!==f){f=Fy(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=Iy(this.a.textShadow),d=Fy(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",oy).replace("proportionalSerif",oy).replace("sansSerif",oy).replace("default",oy)+";":"");a:{if(qy 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:"+Fy(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Fy(e),e=Hy(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=Fy(d);d=Hy(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 rz=new Map([[ky,"background-color"],["color","color"],[ly,ly],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var bz=0;ez.prototype.Fe=function(){return!!this.a};ez.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!sz.has(Ey(a.nodeName))||tz.has(Ey(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&&!sz.has(Ey(a.nodeName))));var b=this.a;this.a=a;return b};
23
+ var sz=new Set(["tt","head","layout",_.Ne,_.we,ny,"styling",_.kg,"body",_.Td,"p","span","br"]),tz=new Set([_.kg,_.we]);fz.prototype.getId=function(){return this.attributes.id};kz.prototype.parseInit=function(){};
24
+ kz.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.M.wb(this.a.ttml||{}),e=_.Ni(a,0,c[0]);e=_.R.ga(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.qg)}catch(n){throw new _.N(_.P,2,2005,"Failed to parse TTML.");}d=new Yy(d);e=new hz;f=new ez(f);b=b.periodStart;typeof b===_.h&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var k=c[g],l=_.Ni(a,b,k);l=_.wm(l);var m="urn:mpeg:14496-30:subs:"+g;d.h.set(m,new ty(m,l,{imageType:"PNG",encoding:"Base64"}));
25
+ b+=k}for(;f.Fe();)a=f.next(),a=jz(e,a),"tt"===gz(a)&&(d.l=new Sy(d.B,Object.assign({},a.attributes))),"tt"===gz(a)&&(d.w=new My(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),gz(a)!==_.we||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new ty(c,a.h.textContent,a.attributes))),gz(a)===_.we&&a.attributes.begin&&a.attributes.end?(c="#"+cz(),b=new ty(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
26
+ gz(a)===_.kg&&(c=a.getId()||cz(),b=new Xy(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),gz(a)!==_.kg&&$y(a)?(c=cz(),b=new Xy(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),gz(a)!==_.Td||!a.attributes.extent&&!a.attributes.origin?c=null:(c=cz(),b=new Ny(c,az(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),gz(a)!==ny?c=null:(c=a.getId(),b=new Ny(c,az(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
27
+ c=b),c&&(a.a=c.getId()),c=a.l,-1===[_.ea,"span","br"].indexOf(gz(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=cz(),b=new Jy(c,a.h.nodeName===_.ea?a.h.textContent:null,"br"===gz(a),a.a,a.j,az(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"===gz(a)||a.j?(c=cz(),b=new Jy(c,null,!1,a.a,a.j,az(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=dz(d);f=[];a=_.v(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
28
+ _.lh(c.value.build(d.l)));return{cues:e,styles:f}};lz.prototype.a=function(a){a=(new kz(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=mz(c.startTime)+" --\x3e "+mz(c.endTime),e=[];switch(c.textAlign){case _.ze:e.push("align:left");break;case _.Rf:e.push("align:right");break;case _.Ap:e.push("align:middle");break;case _.eg:e.push("align:start");break;case _.je:e.push("align:end")}switch(c.writingMode){case _.Mg:e.push("vertical:lr");break;
29
+ case _.Ng:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.R.ub(b)};nz.prototype.probe=function(a,b){return a===_.Pc&&b===_.pg};nz.prototype.create=function(a){return new lz(a)};oz.prototype.parseInit=function(a){var b=!1;(new _.jr).N(_.Qe,_.kr).N(_.yg,_.kr).N(_.Le,_.kr).N(_.Pe,_.kr).N(_.hg,_.kr).da(_.jg,_.lr).N("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.N(_.P,2,2007);};
30
+ oz.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.jr).N("moof",_.kr).N("traf",_.kr).da("subs",function(k){for(var l=_.er(k.reader),m=0;m<l;++m){k.reader.skip(4);for(var n=_.dr(k.reader),p=0;p<n;++p){var q=1===k.version?_.er(k.reader):_.dr(k.reader);g.push(q);k.reader.skip(6)}}}).N(_.Ke,_.mr(function(k){d=!0;k=c.a.parseMedia(k,b,g);e=e.concat(k.cues);f=f.concat(k.styles)})).parse(a);d||this.g.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.w(pz,_.xu);pz.prototype.install=function(){_.iv(_.Pc,kz);_.iv(_.Mc,oz);_.iv(hy,oz);_.iv(jy,oz);_.iv(iy,oz);_.sq.push(this.a)};pz.prototype.uninstall=function(){_.kv(_.Pc);_.kv(_.Mc);_.kv(hy);_.kv(jy);_.kv(iy);_.uq(this.a)};pz.prototype.id=function(){return"subtitles-ttml"};_.K("clpp.ttml.TtmlComponent",pz);};
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 qy="VerimatrixVCAS",ry="clpp.verimatrix.Vcas",sy="clpp.verimatrix.VcasComponent",yy=function(a){_.$p.call(this,qy);var b={};b[ty]=ty;b[uy]=uy;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?vy:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,k=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?wy:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
- this.D=d;this.B=b;this.w=xy(this,e);this.o=xy(this,f);this.l=xy(this,g);this.j=k;this.H=l;this.G=m;this.g=new _.M(ry);_.R.empty(this.w)?this.g.warn(_.Yb):this.rb(_.Nd,{licenseUrl:this.w,videoRobustness:[_.Db,void 0],audioRobustness:[_.Cb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.R.empty(this.o)?this.g.warn(_.sb):this.rb(_.Ld,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
- _.R.empty(this.l)?this.g.warn(_.Pa):_.R.empty(this.j)?this.g.warn(_.Oa):this.rb(_.Jd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},xy=function(a,b){if(a.D===vy){var c=Object.assign({},{deviceId:_.Km(_.R.Xd(a.A))},a.a&&{authenticator:_.Km(_.R.Xd(a.a))});return b+_.xn(c)}return b},zy=function(){this.g=new _.M(sy)};_.w(yy,_.$p);
5
- yy.prototype.h=function(a,b){if(this.D===Ay){var c=this.B[uy],d={};d[this.B[ty]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};yy.prototype.I=function(a,b){var c=_.xq(b);switch(this.G){case By:c=_.xn({r:c,fq:this.H},!0)}return c};yy.prototype.K=function(a,b){this.h(a,b);_.Aq(b)};yy.prototype.L=function(a,b){_.Bq(b)};_.J(ry,yy);yy.prototype.constructor=yy.prototype.constructor;yy.NAME=qy;var vy="query-string",Ay="http-header";
6
- yy.LicenseRequestVuidLocation={QUERY_STRING:vy,HTTP_HEADER:Ay};var ty="DeviceId",uy="Authenticator";yy.LicenseRequestHttpHeader={DEVICE_ID_HEADER:ty,AUTHENTICATOR_HEADER:uy};var wy="keyid",By="contentid-siteid";yy.FairPlayAssetIdStrategy={KEYID:wy,CONTENTID_SITEID:By};_.w(zy,_.fv);zy.prototype.uninstall=function(){delete _.Un.VerimatrixVCAS};zy.prototype.beforeLoad=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===qy){a=a.drm.customData;if(!a)throw new _.O(_.P,7,7100,_.Pd);a=new yy(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.Vn(a)}};zy.prototype.id=function(){return"verimatrix-vcas"};_.J(sy,zy);};
2
+ var f=function(window){var Wx="VerimatrixVCAS",Xx="clpp.verimatrix.Vcas",Yx="clpp.verimatrix.VcasComponent",dy=function(a){_.yu.call(this,Wx);var b={};b[Zx]=Zx;b[$x]=$x;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?ay:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,k=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?by:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
+ this.D=d;this.B=b;this.w=cy(this,e);this.o=cy(this,f);this.l=cy(this,g);this.j=k;this.H=l;this.G=m;this.g=new _.L(Xx);_.R.empty(this.w)?this.g.warn(_.Xb):this.rb(_.Kd,{licenseUrl:this.w,videoRobustness:[_.Cb,void 0],audioRobustness:[_.Bb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.R.empty(this.o)?this.g.warn(_.qb):this.rb(_.Id,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
+ _.R.empty(this.l)?this.g.warn(_.Pa):_.R.empty(this.j)?this.g.warn(_.Oa):this.rb(_.Gd,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},cy=function(a,b){if(a.D===ay){var c=Object.assign({},{deviceId:_.xm(_.R.kd(a.A))},a.a&&{authenticator:_.xm(_.R.kd(a.a))});return b+_.mn(c)}return b},ey=function(){this.g=new _.L(Yx)};_.w(dy,_.yu);
5
+ dy.prototype.h=function(a,b){if(this.D===fy){var c=this.B[$x],d={};d[this.B[Zx]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};dy.prototype.I=function(a,b){var c=_.sr(b);switch(this.G){case gy:c=_.mn({r:c,fq:this.H},!0)}return c};dy.prototype.K=function(a,b){this.h(a,b);_.vr(b)};dy.prototype.L=function(a,b){_.wr(b)};_.K(Xx,dy);dy.prototype.constructor=dy.prototype.constructor;dy.NAME=Wx;var ay="query-string",fy="http-header";
6
+ dy.LicenseRequestVuidLocation={QUERY_STRING:ay,HTTP_HEADER:fy};var Zx="DeviceId",$x="Authenticator";dy.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Zx,AUTHENTICATOR_HEADER:$x};var by="keyid",gy="contentid-siteid";dy.FairPlayAssetIdStrategy={KEYID:by,CONTENTID_SITEID:gy};_.w(ey,_.xu);ey.prototype.uninstall=function(){delete _.Jn.VerimatrixVCAS};ey.prototype.drmConfigurationResolved=function(a){if(a&&a.env===Wx){a=a.customData;if(!a)throw new _.N(_.P,7,7100,_.Ld);a=new dy(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.Kn(a)}};ey.prototype.id=function(){return"verimatrix-vcas"};_.K(Yx,ey);};
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));}