@castlabs/prestoplay 1.1.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +768 -0
- package/README.md +52 -0
- package/cjs/cl.adobe.js +8 -0
- package/cjs/cl.airplay.js +8 -0
- package/cjs/cl.broadpeak.js +11 -0
- package/cjs/cl.cast.js +117 -0
- package/cjs/cl.conviva.js +38 -0
- package/cjs/cl.core.js +565 -0
- package/cjs/cl.crypto.js +15 -0
- package/cjs/cl.dash.js +78 -0
- package/cjs/cl.externs.js +4112 -0
- package/cjs/cl.freewheel.js +29 -0
- package/cjs/cl.hls.js +72 -0
- package/cjs/cl.hlssmpte.js +11 -0
- package/cjs/cl.htmlcue.js +35 -0
- package/cjs/cl.ima.js +29 -0
- package/cjs/cl.mse.js +279 -0
- package/cjs/cl.muxdata.js +19 -0
- package/cjs/cl.onboard.js +8 -0
- package/cjs/cl.persistent.js +19 -0
- package/cjs/cl.playlist.js +11 -0
- package/cjs/cl.simid.js +21 -0
- package/cjs/cl.smooth.js +76 -0
- package/cjs/cl.thumbnails.js +29 -0
- package/cjs/cl.tizen.js +76 -0
- package/cjs/cl.ttml.js +33 -0
- package/cjs/cl.verimatrix.js +10 -0
- package/cjs/cl.vimond.js +18 -0
- package/cjs/cl.vr.js +25 -0
- package/cjs/cl.vtt.js +19 -0
- package/cjs/cl.youbora.js +25 -0
- package/cjs/polyfill.min.js +47 -0
- package/cl.adobe.js +3 -0
- package/cl.airplay.js +3 -0
- package/cl.broadpeak.js +5 -0
- package/cl.cast.js +88 -0
- package/cl.conviva.js +27 -0
- package/cl.core.js +466 -0
- package/cl.crypto.js +9 -0
- package/cl.dash.js +68 -0
- package/cl.externs.js +4028 -0
- package/cl.freewheel.js +19 -0
- package/cl.hls.js +69 -0
- package/cl.hlssmpte.js +5 -0
- package/cl.htmlcue.js +26 -0
- package/cl.ima.js +17 -0
- package/cl.mse.js +241 -0
- package/cl.muxdata.js +12 -0
- package/cl.onboard.js +4 -0
- package/cl.persistent.js +11 -0
- package/cl.playlist.js +5 -0
- package/cl.simid.js +13 -0
- package/cl.smooth.js +59 -0
- package/cl.thumbnails.js +17 -0
- package/cl.tizen.js +57 -0
- package/cl.ttml.js +22 -0
- package/cl.verimatrix.js +4 -0
- package/cl.vimond.js +8 -0
- package/cl.vr.js +15 -0
- package/cl.vtt.js +12 -0
- package/cl.youbora.js +15 -0
- package/clpp.styles.css +166 -0
- package/package.json +63 -0
- package/typings.d.ts +8255 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# PRESTOplay for Web Apps
|
|
2
|
+
|
|
3
|
+
PRESTOplay for Web Apps is our SDK framework for deploying fantastic HTML/JavaScript
|
|
4
|
+
video players across web-enabled platforms.
|
|
5
|
+
|
|
6
|
+
You can start using PRESTOplay now for your local development, and
|
|
7
|
+
visit us [to get your license](https://castlabs.com/free-trials/prestoplay/).
|
|
8
|
+
|
|
9
|
+
Documentation, manuals, tutorials and demos can be found at [https://demo.castlabs.com](https://demo.castlabs.com).
|
|
10
|
+
|
|
11
|
+
## Installation and getting started
|
|
12
|
+
|
|
13
|
+
You can install the PRESTOplay SDK using a package manager such as `npm` or `yarn` using:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install @castlabs/prestoplay
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Once installed, you can follow the [getting started guide](https://demo.castlabs.com/#/docs/getting_started) for a full
|
|
20
|
+
example, but here is how it would look like:
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import {clpp} from "@castlabs/prestoplay"
|
|
24
|
+
import "@castlabs/prestoplay/cl.mse"
|
|
25
|
+
import "@castlabs/prestoplay/cl.dash"
|
|
26
|
+
|
|
27
|
+
const player = new clpp.Player("video");
|
|
28
|
+
player.use(clpp.dash.DashComponent);
|
|
29
|
+
|
|
30
|
+
player.load({
|
|
31
|
+
source: "https://content.players.castlabs.com/demos/clear-segmented/manifest.mpd"
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
There is also an accompanying stylesheet that can be found in:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
node_modules/@castlabs/prestoplay/clpp.styles.css
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Support and Help
|
|
43
|
+
|
|
44
|
+
* [Documentation](https://demo.castlabs.com/#/docs)
|
|
45
|
+
* [Demo and Configuration](https://demo.castlabs.com/#/player/config)
|
|
46
|
+
* [Support and Helpdesk](https://castlabs.com/support/)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
* [Legal terms and conditions](https://castlabs.com/legal/)
|
|
52
|
+
|
package/cjs/cl.adobe.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var IR=function(){this.m=this.f=null;this.a="";this.g=new _.K("clpp.adobe.AdobePlugin")},LR=function(a){a.f=new _.Dh;a.f.on(a.m,_.mg,function(){return JR(a)});a.f.on(a.m,_.lg,function(){s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Ee,function(){return KR(a)});a.f.on(a.m,_.Sf,function(b){b=b.detail;switch(b.currentState){case _.Ro:a.a.length||KR(a);s.Media.play(a.a,a.m.getPosition());break;case _.Qo:case _.Io:JR(a);break;case _.Ko:case _.Do:case _.Oo:a.g.info("Close session for "+a.a+" in player state "+
|
|
3
|
+
(b.currentState+".")),JR(a),s.Media.close(a.a),a.a=""}})},KR=function(a){var b=a.m.getLoadedSource();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.m.getDuration());s.Media.open(a.a,a.m.getDuration(),_.xa)},JR=function(a){s.Media.stop(a.a,a.m.getPosition())},MR=function(){};_.w(IR,_.ft);IR.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.m=a,LR(this)):this.g.warn("Adobe API not available.")};
|
|
4
|
+
IR.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""};IR.prototype.id=function(){return"adobe"};_.H("clpp.adobe.AdobeAnalyticsPlugin",IR);IR.Id="adobe";MR.prototype.create=function(){return new IR};_.jq(new MR);};
|
|
5
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
6
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
7
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
8
|
+
})();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var GR=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.rk(function(){a.m.play()["catch"](function(){})});this.h=new _.Dh},HR=function(){};_.w(GR,_.ft);_.r=GR.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.r.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.il.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Jl.bind(this)))};
|
|
3
|
+
_.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.il=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.L(_.Qc,{canCast:this.f}))};_.r.Jl=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Pc:_.Oc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Ro)this.l?this.m.play()["catch"](function(){}):this.o.aa(.01);this.m.trigger(new _.L(a))};_.r.ob=function(){return this.j};
|
|
4
|
+
_.r.Ve=function(){return this.f};_.r.rm=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.H("clpp.airplay.AirPlayPlugin",GR);GR.prototype.showCastMenu=GR.prototype.rm;GR.prototype.canCast=GR.prototype.Ve;GR.prototype.isCasting=GR.prototype.ob;GR.Id="airplay";HR.prototype.create=function(){return new GR};_.jq(new HR);};
|
|
5
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
6
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
7
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
8
|
+
})();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var yR=function(a,b){this.m=a;this.f=b;this.a=new _.Dh;this.h=!1},zR=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.a=_.Ej();return d}_.w(b,GenericPlayerApi);b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return _.ia};b.prototype.getOSName=function(){return this.a.os};b.prototype.getDeviceVersion=function(){return this.a.osVersion.name};b.prototype.getDeviceType=function(){return"browser"};b.prototype.getTotalDuration=function(){return this.m.isLive()?
|
|
3
|
+
0:1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){return 1E3*this.m.getPosition()};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};return new b(a)},AR=function(){this.j=this.f=this.a=this.h=this.m=null;this.l=new _.Dh},BR=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof f===_.Vf&&a.h.setUUID(f))},CR=function(a,
|
|
4
|
+
b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();for(var d in c)a.a.setCustomParameter(d,c[d]);a.l.on(a.m,_.me,a.U.bind(a));a.j=zR(a.m);a.a.attachPlayer(a.j)},DR=function(a,b){_.Gh(a.l);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},ER=function(){return!window.SmartLib||!window.GenericPlayerApi},FR=function(){};_.r=yR.prototype;_.r.init=function(){var a=this.m,b=this.a;b.on(a,_.Sf,this.zi.bind(this));b.on(a,_.gd,this.xi.bind(this));b.on(a,"seek",this.yi.bind(this))};
|
|
5
|
+
_.r.xi=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.r.zi=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.Io&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Io:c.notifyStallStart();break;case _.Ro:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Qo:c.notifyPause()}};_.r.yi=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.r.release=function(){this.a&&(_.Gh(this.a),this.a=null)};_.w(AR,_.ft);_.r=AR.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(ER())return a.onError(new _.P(1,9,11E3));BR(this,d);CR(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.P(1,9,11001,{bpkErrorCode:f,message:e}));DR(c,void 0)}else b.url=e.getURL(),c.f=new yR(c.m,c.j),c.f.init()})}};
|
|
6
|
+
_.r.U=function(a){a=a.detail;if(7003===a.code)DR(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.Q)switch(a.category){case 3:DR(this,SmartLib.BPDecodingError);break;case 1:DR(this,SmartLib.BPNetworkingError);break;case 6:DR(this,SmartLib.BPAccessRightError);break;default:DR(this,SmartLib.BPUnspecifiedError)}};_.r.onPlayerWillRelease=function(){ER()||DR(this,SmartLib.BPSessionEndsNormally)};_.r.id=function(){return"broadpeak"};_.H("clpp.broadpeak.BroadpeakPlugin",AR);
|
|
7
|
+
AR.isSdkMissing=ER;AR.Id="broadpeak";FR.prototype.create=function(){return new AR};_.jq(new FR);};
|
|
8
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
9
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
10
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
11
|
+
})();
|
package/cjs/cl.cast.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var MP="Cannot seek during ads playout.",NP="Cannot switch track",OP="Media session does not exist.",PP="No receivers available",QP="Reset ABR functionality not available on cast.",RP="SDK not yet ready",SP="Sender is destroyed.",TP="clpp.cast.CastProxy",UP="clpp.cast.Player",VP="clpp.cast.Receiver",WP="urn:x-cast:castlabs",XP="urn:x-cast:com.google.cast.media",YP=function(a){return _.E(function(b){return 1==b.a?_.x(b,a.wc(_.We),2):_.x(b,a.wc(_.Ve),0)})},ZP=function(a,b){this.log=new _.K(b);this.player=
|
|
3
|
+
a;this.j=null;this.f=_.Do;this.l=_.Eo;this.h=2;this.B=Date.now();this.A=-1},$P=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.oe){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Se?"detail"===e&&(d[e]=f):e in Event||(d[e]=f)}return d}return typeof c===_.k?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},aQ=function(a){if(typeof a!==_.Vf)return a;try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:
|
|
4
|
+
"Infinity"===c?Infinity:c})}catch(b){return a}},bQ=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.E(function(q){if(1==q.a){if(b.includes(a.mimeType))return q["return"](a);g=f=e=null;for(h=0;h<b.length&&!f;)g=b[h++],f=_.ok(d,a.mimeType,g);if(!f||!g)return q.F(2);l=_.qj(a.url);return _.x(q,c.fetch(l).O,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Ti(m.data)),p=URL.createObjectURL(new Blob([n])),e={url:p,kind:a.kind,language:a.language,label:a.label,mimeType:g});return q["return"](e)})},cQ=function(a,b){if(window.chrome&&
|
|
5
|
+
chrome.cast&&chrome.cast.media){var c=chrome.cast.media.HlsSegmentFormat;var d=chrome.cast.media.HlsVideoSegmentFormat}else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.tg:return d.FMP4;case _.sg:return b===_.Pj?d.MPEG2_TS:c.TS;case _.ad:return c.AAC;case _.bd:return c.AC3;case _.cd:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.dd:return c.FMP4}},eQ=function(a){a=
|
|
6
|
+
void 0===a?dQ:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.P(1,8,8001);var c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},fQ=function(a){ZP.call(this,a,"clpp.cast.SenderStateManager");
|
|
7
|
+
this.o=this.a=null;this.w=this.Ib.bind(this)},gQ=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},hQ=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},jQ=function(a,b){var c=hQ(a);return iQ(a,b).find(function(d){return c.includes(d.id)})||null},iQ=function(a,b){return a.h.filter(function(c){return c.type===b})},lQ=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.S){var e=a.ta();
|
|
8
|
+
e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;kQ(a,b)},function(f){a.f[b]=null;a.g.debug(NP,f)})}else b===_.S&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){kQ(a,b)},function(f){a.g.debug(NP,f)}))},kQ=function(a,b){b===_.T?a.a.trigger(new _.L(_.ll)):b===_.S&&a.a.trigger(new _.L(_.ml))},pQ=function(a,b,c,d){_.sl.call(this);this.g=new _.K(_.Cd);this.fa=a;this.o=new _.tk(b);this.da=c;this.oa=d;this.h=this.J=
|
|
9
|
+
_.yl();this.D=[];this.B=0;this.M=new _.Hj;this.H=this.l=this.a=null;this.A=this.w=!1;this.pa="";this.Ua=1E6;this.f=new gQ;this.f.initialize(this);this.j=new fQ(this);this.I=new _.Dh;this.K=null;this.G=new Set;this.T=this.kl.bind(this);this.Da=this.Dl.bind(this);this.ia=this.ul.bind(this);this.V=this.ol.bind(this);this.P=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){mQ(!0)},0)}});nQ(this);oQ.add(this)},
|
|
10
|
+
qQ=function(a){var b,c;return _.E(function(d){if(1==d.a)return oQ["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Da)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.x(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.da=null;a.oa=null;_.y(d)})},vQ=function(a){if(!a)return null;
|
|
11
|
+
a:{var b=a.metadataType;var c=Object.entries(rQ);c=_.u(c);for(var d=c.next();!d.done;d=c.next()){d=_.u(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=eQ(rQ[b]);return Object.assign(b,a)},AQ=function(a){var b=void 0===b?dQ:b;return Object.values(rQ).includes(a)?a:b},FQ=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},nQ=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
|
|
12
|
+
a.fa.length){a.w=!0;a.o.Vf();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.fa;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Da);GQ&&a.o.aa(.02)}},HQ=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.k?null:a):a=
|
|
13
|
+
null;a=null===a?null:a+b;return null===a?b:a},JQ=function(a,b){IQ(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ia);b.addMessageListener(WP,a.V)},IQ=function(a,b){a.a=b;a.a&&(a.I.release(),a.H=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.H=new cast.framework.RemotePlayerController(a.l),a.I.on(a.H,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Ai.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.L(_.Ee)))},KQ=function(a){return _.E(function(b){return a.ob()?
|
|
14
|
+
b.F(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},LQ=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,D,G,F;return _.E(function(C){switch(C.a){case 1:return c=chrome.cast.media.StreamType,d=_.Ot,_.x(C,KQ(a),2);case 2:if(!b)return C["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);g.streamType=b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.Mb;m=h.audioMimeType;g.hlsVideoSegmentFormat=cQ(l,d.VIDEO);
|
|
15
|
+
g.hlsSegmentFormat=cQ(m,d.AUDIO);if(!b.Xa){C.F(3);break}if(!a.P){C.F(4);break}return _.x(C,Promise.resolve(a.P(b.Xa)),5);case 5:if(n=C.f)b.Xa=n;case 4:a.h=b.Xa;a.D=_.Vo(a.h);a.B=a.D.findIndex(function(I){return I.url===b.source.url});if(!b.Xa.remoteTextTracks){C.F(6);break}return _.x(C,Promise.all(b.Xa.remoteTextTracks.map(a.Hj.bind(a))),7);case 7:p=C.f,g.tracks=p.filter(function(I){return I}),b.Xa.remoteTextTracks=void 0;case 6:delete b.Xa.autoplay,b.Xa.startTime=null,g.customData={playerConfiguration:$P(b.Xa)};
|
|
16
|
+
case 3:q=a.jb()||{};t=AQ(q.metadataType);typeof b.Lf===_.k&&(v={metadataType:t,sectionStartAbsoluteTime:b.Lf});b.source.name&&(z={metadataType:t,title:b.source.name});D=FQ(q);if(G=vQ(Object.assign({},v,z,D)))g.metadata=G;F=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.hd&&(F.autoplay=b.autoplay);typeof b.currentTime===_.k&&(F.currentTime=b.currentTime);return _.x(C,f.loadMedia(F),0)}})},MQ=function(a,b,c){c=void 0===c?0:c;var d,e;return _.E(function(f){(d=a.f.ta())&&d.language&&(a.h.preferredTextLanguage=
|
|
17
|
+
d.language);(e=a.f.sa())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.x(f,LQ(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Lf:a.getPresentationStartTime(),autoplay:b,Xa:a.h}),0)})},mQ=function(a){if(a){a=_.u(oQ);for(var b=a.next();!b.done;b=a.next())nQ(b.value)}},OQ=function(a,b,c){_.sl.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.oe?c:function(e,f){d.f&&e!==_.Ko&&e!==_.Do&&d.f.load(f)};this.a=NQ(this);this.g=new _.K(TP);this.addDelegate(this.f)},NQ=
|
|
18
|
+
function(a){return new pQ(a.h,function(){a.trigger(new _.L(_.od))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.gg&&(d.preferredAudioLanguage=c.gg);c.Uh&&(d.preferredTextLanguage=c.Uh);_.aq(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return PQ(a)})},PQ=function(a){var b;return _.E(function(c){if(1==c.a)return a.trigger(new _.L(_.nd)),
|
|
19
|
+
b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.aq(a.f,a.a);_.y(c)})},QQ=function(a){ZP.call(this,a,"clpp.cast.StateManager");this.I=this.Ei.bind(this);this.H=this.Di.bind(this);this.w=this.ql.bind(this);this.o=this.jl.bind(this);this.K=this.Gi.bind(this);this.J=this.Fi.bind(this);this.M=this.Gl.bind(this);this.G=this.tl.bind(this);this.D=this.U.bind(this);this.a=this.Ci.bind(this)},RQ=function(a,b,c,d,e){this.a=a;this.f=b;this.j=typeof c===_.k?c:1;this.l=typeof d===_.k?d:1;this.h=
|
|
20
|
+
typeof e===_.k?e:0},SQ=function(a){this.a=a},UQ=function(a){this.m=a;this.a=null;this.h=this.Hi.bind(this);this.f=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];
|
|
21
|
+
TQ().addEventListener(this.f,this.h)},XQ=function(a,b,c){var d,e,f,g,h,l,m;return _.E(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.A(n,2);VQ=!1;e=_.qj(d);return _.x(n,c.fetch(e).O,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.Z(f.data),h=new DOMParser,l=h.parseFromString(g,_.cg),l.getElementsByTagName("vmap:VMAP").length)_.J("VMAP detected."),a.vmapAdsRequest=WQ(g);else if(l.getElementsByTagName("VAST").length){_.J("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");
|
|
22
|
+
p.vastAdsRequest=WQ(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.J("Unsupported schema."),VQ=!0;return _.$g(n,0)}m=_.B(n);_.J("Failed to fetch an ad",m);VQ=!0;_.y(n)})},WQ=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},TQ=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},ZQ=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;
|
|
23
|
+
(c=YQ(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},$Q=function(a,b){var c=new _.P(1,10,10003,{errorType:b});a.m.onError(c)},YQ=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.Vf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Vf&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,
|
|
24
|
+
h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new RQ(d,e,b.index,b.total,f)}return c},aR=function(a){this.ec=a;this.a=this.f.bind(this)},bR=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},cR=function(a){var b=a.dashTimedMetadata,c=_.kg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.jg)?
|
|
25
|
+
_.Nh:_.Lh,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},dR=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.am.bind(this);this.a=this.f=null},eR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},gR=function(a){a.a=eR().getTextTracksManager();var b=a.a.getTracks();a.j=fR(_.S,b)},hR=function(a,b,c,d){c=_.Sh(c).filter(function(h){return h});
|
|
26
|
+
var e=!1,f=[];b===_.T?f=a.getAudioTracks():b===_.S&&(f=a.ja());if(c=c.find(function(h){var l=_.Mi(h);return f.some(function(m){m=_.Mi(m.language||"");return _.Ni(l,m)})})){var g=_.Mi(c);c=f.filter(function(h){h=_.Mi(h.language||"");return _.Ni(g,h)});f=c.length?c:f;e=e||!!c.length}_.R.we(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.T?a.ya(e):b===_.S&&a.Ia(e))},fR=function(a,b){for(var c=[],d=_.u(b),
|
|
27
|
+
e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Nj(e.trackId.toString(),a);f.roles=e.roles||[];f.kind=e.subtype||null;f.language=e.language||null;f.originalLanguage=e.language||null;f.label=e.name||null;f.src=e.trackContentId||null;f.mimeType=e.trackContentType||null;e.customData&&(f.mimeType=e.customData.mimeType||f.mimeType,f.src=e.customData.url||f.src);f.renditions.push(new _.Vj(f.id,f));c.push(f)}return c},iR=function(){_.sl.call(this);this.g=new _.K(UP);this.h=this.w=_.yl();this.A=null;
|
|
28
|
+
this.l=-1;this.G=new _.Hj;this.f=this.o=this.j=this.a=this.B=null;this.D=!1},jR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},mR=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0}if(a&&a.drm){var d=a.drm,e=_.Wl(d);if(e){var f=[_.Pd];_.Vo(a)[0].type!==_.Yc&&f.unshift(_.Rd);d.preferredDrmSystem===_.Pd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
|
|
29
|
+
h=e.Ya[g];h?(d=g===_.Rd?cast.framework.ContentProtection.WIDEVINE:g===_.Pd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},kR(b,h,a,d),lR(b,h,a,d)):c()}else c()}else c()},kR=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.qj({method:"POST",uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,
|
|
30
|
+
d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},lR=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.E(function(h){return 1==h.a?(g=_.rj(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.Ti(g.data))})}:a.licenseHandler=void 0},nR=function(){this.a=!1;this.g=new _.K(VP);this.f=this.m=null;this.h=new Set;this.A=this.sl.bind(this);
|
|
31
|
+
this.w=this.Bi.bind(this);this.j=null;this.o=new _.Dh;this.l=null},pR=function(){return oR||(oR=new nR)},qR=function(){return cast.framework.CastReceiverContext.getInstance()},sR=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=qR();c=(qR().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.tg:_.sg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var h=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=
|
|
32
|
+
rR(h,_.ta),m=rR(h,_.Pb),n=_.u([]),p=n.next().value;n=n.next().value;m&&(m=_.u(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(h);++g}return f.join("\n")},rR=function(a,b){b+="\x3d";var c=a.indexOf(b);if(0<=c){var d=a.substring(c+b.length);d.startsWith('"')?(d=d.substring(1),d=d.substring(0,d.indexOf('"'))):(c=d.indexOf(","),0<=c&&(d=d.substring(0,c)))}return d},tR=function(a){this.f=a;this.a=null;this.h=new _.Dh;this.j=
|
|
33
|
+
[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},vR=function(a,b){var c=null,d=uR(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},uR=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(h){return h.id===a.a.breakId})||
|
|
34
|
+
null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:b.breaks.filter(function(h){return 0<=h.position}).sort(function(h,l){return h.position-l.position}).findIndex(function(h){return h===c})}b.breakClips&&(d=b.breakClips.find(function(h){return h.id===a.a.breakClipId})||null);b=new RQ(d,c,e,f,g)}return b},wR=function(){},xR=function(){};_.r=ZP.prototype;_.r.release=function(){this.qa(_.Do)};_.r.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.r.getState=function(){return this.f};
|
|
35
|
+
_.r.onError=function(a){a.severity===_.Q&&this.qa(_.Oo)};
|
|
36
|
+
_.r.qa=function(a){if(a!==this.f)if(this.f===_.Oo&&a!==_.Do)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.l=this.f;this.f=a;this.f===_.Io?(this.A=b,this.player.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.Io&&this.player.trigger(new _.L(_.id,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.to(this.j,this.f);this.player.trigger(new _.L(_.Sf,
|
|
37
|
+
{detail:a}))}};_.H("clpp.cast.CastUtils",function(){});var dQ=0,rQ={GENERIC:dQ,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.w(fQ,ZP);fQ.prototype.init=function(){var a=this.player,b=a.a;b&&(this.a&&this.a.removeUpdateListener(this.w),this.a=b,this.a.addUpdateListener(this.w),this.o=a.l)};fQ.prototype.destroy=function(){var a=this;return _.E(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,ZP.prototype.destroy.call(a),0)})};fQ.prototype.qa=function(a){var b=this.player.l;b&&b.isPlayingBreak||ZP.prototype.qa.call(this,a)};
|
|
38
|
+
fQ.prototype.Ib=function(){if(this.a&&this.o&&!this.o.isPlayingBreak)switch(this.a.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.a.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.qa(_.Ko);break;case chrome.cast.media.IdleReason.ERROR:this.qa(_.Oo);break;default:this.qa(_.Do)}break;case chrome.cast.media.PlayerState.PLAYING:this.qa(_.Ro);break;case chrome.cast.media.PlayerState.PAUSED:this.qa(_.Qo);break;case chrome.cast.media.PlayerState.BUFFERING:this.qa(_.Io)}};_.w(gQ,_.U);_.r=gQ.prototype;_.r.initialize=function(a){this.a=a};_.r.release=function(){this.h=[];this.f={}};
|
|
39
|
+
_.r.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.Pj;break;case chrome.cast.media.TrackType.AUDIO:c=_.T;break;case chrome.cast.media.TrackType.TEXT:c=_.S}c=new _.Nj(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;b.customData&&(c.src=b.customData.url||c.src,c.mimeType=b.customData.mimeType||c.mimeType);
|
|
40
|
+
c.renditions.push(new _.Vj(c.id,c));return c}):[],this.a.trigger(new _.L(_.Rt)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return iQ(this,_.Pj)};_.r.getAudioTracks=function(){return iQ(this,_.T)};_.r.ja=function(){return iQ(this,_.S)};_.r.ha=function(){var a=this.Qa();return a?a.renditions[0]:null};_.r.Ma=function(){var a=this.sa();return a?a.renditions[0]:null};_.r.Oa=function(){var a=this.ta();return a?a.renditions[0]:null};_.r.ab=function(){return this.f[_.Pj]||null};
|
|
41
|
+
_.r.kb=function(){return this.f[_.T]||null};_.r.lb=function(){return this.f[_.S]||null};_.r.Qa=function(){return jQ(this,_.Pj)};_.r.sa=function(){return jQ(this,_.T)};_.r.ta=function(){return jQ(this,_.S)};_.r.gb=function(a){lQ(this,_.Pj,a)};_.r.ya=function(a){lQ(this,_.T,a)};_.r.Ia=function(a){lQ(this,_.S,a)};_.r.fb=function(a){this.gb(a&&a.track)};_.r.rb=function(a){this.ya(a&&a.track)};_.r.sb=function(a){this.Ia(a&&a.track)};_.r.addTextTrack=function(){return _.E(function(a){_.y(a)})};_.r.la=function(){return!0};
|
|
42
|
+
gQ.prototype.isAbrEnabled=gQ.prototype.la;gQ.prototype.addTextTrack=gQ.prototype.addTextTrack;gQ.prototype.setTextRendition=gQ.prototype.sb;gQ.prototype.setAudioRendition=gQ.prototype.rb;gQ.prototype.setVideoRendition=gQ.prototype.fb;gQ.prototype.setTextTrack=gQ.prototype.Ia;gQ.prototype.setAudioTrack=gQ.prototype.ya;gQ.prototype.setVideoTrack=gQ.prototype.gb;gQ.prototype.getTextTrack=gQ.prototype.ta;gQ.prototype.getAudioTrack=gQ.prototype.sa;gQ.prototype.getVideoTrack=gQ.prototype.Qa;
|
|
43
|
+
gQ.prototype.getLoadingTextRendition=gQ.prototype.lb;gQ.prototype.getLoadingAudioRendition=gQ.prototype.kb;gQ.prototype.getLoadingVideoRendition=gQ.prototype.ab;gQ.prototype.getTextRendition=gQ.prototype.Oa;gQ.prototype.getAudioRendition=gQ.prototype.Ma;gQ.prototype.getVideoRendition=gQ.prototype.ha;gQ.prototype.getTextTracks=gQ.prototype.ja;gQ.prototype.getAudioTracks=gQ.prototype.getAudioTracks;gQ.prototype.getVideoTracks=gQ.prototype.getVideoTracks;_.w(pQ,_.sl);_.r=pQ.prototype;_.r.init=function(a,b){this.h=this.J=b};_.r.unload=function(){var a=this;return new Promise(function(b,c){a.f&&a.f.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.r.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.r.destroy=function(){return _.E(function(a){_.y(a)})};_.r.Qd=function(a){this.P=a};_.r.qc=function(){return this.w};_.r.ob=function(){return this.A};_.r.mf=function(){return this.pa};
|
|
44
|
+
_.r.sendMessage=function(a,b){var c=this,d,e,f;return _.E(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.P(1,8,8004,void 0);g.F(2);break}_.A(g,3);return _.x(g,e.sendMessage(a,$P(b)),5);case 5:_.$g(g,2);break;case 3:f=_.B(g),d=new _.P(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.y(g)}})};
|
|
45
|
+
_.r.cast=function(){var a=this,b,c;return _.E(function(d){if(1==d.a){if(!a.qc())throw a.g.warn(RP),new _.P(1,8,8001,void 0);if(!GQ)throw a.g.warn(PP),new _.P(1,8,8002,void 0);if(a.ob())throw a.g.warn("Already casting"),new _.P(1,8,8003,void 0);_.A(d,2);return _.x(d,KQ(a),4)}if(2!=d.a)return _.$g(d,0);b=_.B(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.P(1,8,8E3,c);})};_.r.gf=function(){this.ob()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
|
|
46
|
+
_.r.addMessageListener=function(a){typeof a===_.oe&&this.G.add(a)};_.r.removeMessageListener=function(a){typeof a===_.oe&&this.G["delete"](a)};_.r.play=function(){var a=this;return this.isEnded()?MQ(this,!0):new Promise(function(b,c){if(!a.a)return c(OP);a.a.play(null,b,c)})};_.r.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(OP);a.a.pause(null,b,c)})};_.r.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
|
|
47
|
+
_.r.isEnded=function(){return this.getState()===_.Ko};_.r.seek=function(a){var b=this;return this.isEnded()?MQ(this,!1,a):new Promise(function(c,d){b.a||d(OP);b.l.isPlayingBreak&&d(MP);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.mg));b.a.seek(e,function(){b.trigger(new _.L(_.lg));c()},d)})};_.r.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
|
|
48
|
+
_.r.getDuration=function(){if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.k?-1:-1===a?Infinity:a};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.r.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(XP,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
|
|
49
|
+
_.r.getVolume=function(){return this.a&&this.a.volume.level};_.r.setVolume=function(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))};_.r.isMuted=function(){return this.a&&this.a.volume.muted};_.r.setMuted=function(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};
|
|
50
|
+
_.r.getPresentationStartTime=function(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;var a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.k?null:1E-8===a?0:a};_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.j?this.j.getState():_.Eo};
|
|
51
|
+
_.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?aQ(this.a.customData.stats):_.zo()};_.r.isLive=function(){return Infinity===this.getDuration()};_.r.load=function(a){var b=this,c,d;return _.E(function(e){if(!b.qc())return b.g.warn(RP),e["return"]();if(!GQ)return b.g.warn(PP),e["return"]();b.D=_.Vo(a);_.Bl(a)&&(b.h=_.Al(b.J,a));c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,Xa:b.h,Mb:c.Mb,audioMimeType:c.audioMimeType};return _.x(e,LQ(b,d),0)})};
|
|
52
|
+
_.r.getBufferInfo=function(){return new _.rl};_.r.getTrackManager=function(){return this.f};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.M=a};_.r.getNetworkEngine=function(){return this.M};_.r.getSourceIndex=function(){return this.B};_.r.setSourceIndex=function(a){this.B=a};_.r.getLoadedSource=function(){return this.D[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};
|
|
53
|
+
_.r.getTimelineCues=function(){return[]};_.r.resetAbr=function(){this.g.warn(QP)};_.r.onError=function(a){if(a&&(this.trigger(new _.L(_.me,{detail:a})),this.j))this.j.onError(a)};_.r.namespace=function(){return _.Cd};_.r.canPlay=function(){return this.qc()?2:0};_.r.jb=function(){return this.K};_.r.yc=function(a){this.K=vQ(a)};_.r.Ye=function(){this.K=null};_.r.Qf=function(a){var b=this.jb()||{};a={metadataType:AQ(b.metadataType),title:a};this.yc(Object.assign({},b,a))};
|
|
54
|
+
_.r.Of=function(a){var b=this.jb()||{},c=AQ(b.metadataType);a=new chrome.cast.Image(a);this.yc(Object.assign({},b,{metadataType:c,images:[a]}))};_.r.Nf=function(a){var b=this.jb()||{};this.yc(Object.assign({},b,{metadataType:3,artist:a}))};_.r.Pf=function(a){var b=this.jb()||{};a={metadataType:AQ(b.metadataType),releaseDate:a};this.yc(Object.assign({},b,a))};
|
|
55
|
+
_.r.kl=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;GQ=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.pa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Vf()};
|
|
56
|
+
_.r.Dl=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;JQ(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ob()||(this.A=!0,JQ(this,a.session),this.oa());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ob()&&this.a){var b=this.a.media,c=this.f.sa(),d=this.f.ta();c=c&&c.language||void 0;d=d&&d.language||void 0;this.da(this.getState(),{source:{url:b.contentId,type:b.contentType,
|
|
57
|
+
isLive:this.isLive()},currentTime:HQ(this),Uh:d,gg:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ia);a.session.removeMessageListener(WP,this.V);this.A=!1;this.a=null;this.I.release();this.l=this.H=null}};_.r.ul=function(a){this.g.debug("New media session",a.mediaSession);IQ(this,a.mediaSession)};_.r.ol=function(a,b){if(a===WP&&0<this.G.size){var c=aQ(b);this.G.forEach(function(d){return d(c)})}};_.r.Ai=function(){this.trigger(new _.L(_.dg))};
|
|
58
|
+
_.r.Hj=function(a){var b=this,c,d;return _.E(function(e){if(1==e.a)return c=null,_.x(e,bQ(a,[_.bg,_.Xc],b.M,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ua++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.r.getTextDisplayer=function(){return null};pQ.prototype.getTextDisplayer=pQ.prototype.getTextDisplayer;pQ.prototype.getNetworkEngine=pQ.prototype.getNetworkEngine;
|
|
59
|
+
pQ.prototype.setNetworkEngine=pQ.prototype.setNetworkEngine;var GQ=!1,oQ=new Set;window.__onGCastApiAvailable=mQ;_.w(OQ,_.sl);_.r=OQ.prototype;_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return a.a?_.x(b,qQ(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.y(b)})};_.r.Ve=function(){return!!this.a&&this.a.qc()&&GQ};_.r.ob=function(){return!!this.a&&this.a.ob()};_.r.mf=function(){return this.a?this.a.mf():""};_.r.Qd=function(a){this.a&&this.a.Qd(a)};
|
|
60
|
+
_.r.cast=function(a){var b=this,c,d,e;return _.E(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.A(f,2);return _.x(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.sa();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.ta())l.language&&
|
|
61
|
+
(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.hd?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Lf:b.f.getPresentationStartTime(),Mb:m,audioMimeType:p,Xa:g}}c=g;return _.x(f,PQ(b),5);case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.x(f,b.f.load(a),7);if(b.a.a){f.F(7);break}return _.x(f,LQ(b.a,c),7);case 7:_.$g(f,0);break;case 2:d=_.B(f),
|
|
62
|
+
b.g.error("Error while trying to cast",d),e=new _.L(_.me,{detail:d}),b.trigger(e),_.y(f)}})};_.r.gf=function(){this.a&&this.a.gf()};_.r.wi=function(a){var b=this;return _.E(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,qQ(b.a),2):c.F(2)}b.a=NQ(b);_.y(c)})};_.r.sendMessage=function(a){var b=this;return _.E(function(c){return b.a?_.x(c,b.a.sendMessage(WP,a),0):(b.g.warn(SP),c["return"]())})};_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(SP)};
|
|
63
|
+
_.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(SP)};_.r.jb=function(){return this.a&&this.a.jb()};_.r.yc=function(a){this.a&&this.a.yc(a)};_.r.Ye=function(){this.a&&this.a.Ye()};_.r.Qf=function(a){this.a&&this.a.Qf(a)};_.r.Of=function(a){this.a&&this.a.Of(a)};_.r.Nf=function(a){this.a&&this.a.Nf(a)};_.r.Pf=function(a){this.a&&this.a.Pf(a)};_.H(TP,OQ);OQ.prototype.setContentReleaseDate=OQ.prototype.Pf;OQ.prototype.setContentArtist=OQ.prototype.Nf;
|
|
64
|
+
OQ.prototype.setContentImage=OQ.prototype.Of;OQ.prototype.setContentTitle=OQ.prototype.Qf;OQ.prototype.clearContentMetadata=OQ.prototype.Ye;OQ.prototype.setContentMetadata=OQ.prototype.yc;OQ.prototype.getContentMetadata=OQ.prototype.jb;OQ.prototype.removeMessageListener=OQ.prototype.removeMessageListener;OQ.prototype.addMessageListener=OQ.prototype.addMessageListener;OQ.prototype.sendMessage=OQ.prototype.sendMessage;OQ.prototype.changeReceiverId=OQ.prototype.wi;OQ.prototype.forceDisconnect=OQ.prototype.gf;
|
|
65
|
+
OQ.prototype.cast=OQ.prototype.cast;OQ.prototype.setPlayerConfigInterceptor=OQ.prototype.Qd;OQ.prototype.getReceiverName=OQ.prototype.mf;OQ.prototype.isCasting=OQ.prototype.ob;OQ.prototype.canCast=OQ.prototype.Ve;OQ.prototype.destroy=OQ.prototype.destroy;_.w(QQ,ZP);_.r=QQ.prototype;
|
|
66
|
+
_.r.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,this.H);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.M);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.D);b.addEventListener(a.BITRATE_CHANGED,this.a)};
|
|
67
|
+
_.r.destroy=function(){var a=this,b,c;return _.E(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.I);c.removeEventListener(b.PAUSE,a.H);c.removeEventListener(b.MEDIA_FINISHED,a.w);c.removeEventListener(b.BUFFERING,a.o);c.removeEventListener(b.SEEKING,a.K);c.removeEventListener(b.SEEKED,a.J);c.removeEventListener(b.STALLED,a.M);c.removeEventListener(b.PLAYER_LOADING,a.G);c.removeEventListener(b.ERROR,
|
|
68
|
+
a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,ZP.prototype.destroy.call(a),0)})};_.r.Ei=function(){this.player.trigger(new _.L(_.ff));this.qa(_.Ro)};_.r.Di=function(){this.qa(_.Qo)};_.r.ql=function(){this.qa(_.Ko)};_.r.jl=function(a){a.isBuffering?this.qa(_.Io):(a=this.player.isPaused()?_.Qo:_.Ro,this.qa(a))};_.r.Gi=function(){this.h=1;this.player.trigger(new _.L(_.mg))};_.r.Fi=function(){this.player.trigger(new _.L(_.lg))};_.r.Gl=function(){this.h=2};_.r.tl=function(){this.qa(_.Po)};
|
|
69
|
+
_.r.Ci=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.gd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.U=function(a){a=new _.P(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.me,{detail:a}));this.qa(_.Oo)};_.r=RQ.prototype;_.r.xb=function(){return"Google Cast Framework"};_.r.yb=function(){return cast.framework.VERSION};_.r.Eb=function(){return 0};_.r.getId=function(){return""};_.r.getCreativeId=function(){return""};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return this.a.title||""};_.r.getDuration=function(){return this.a.duration||0};
|
|
70
|
+
_.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.sc=function(){return!1};_.r.Tb=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.Bb=function(){return 0};_.r.Ab=function(){return 0};_.r.mb=function(){return 0};_.r.bb=function(){switch(this.Ub()){case 0:return 0;case -1:return 2;default:return 1}};_.r.getPodIndex=function(){return this.h};_.r.Ub=function(){return this.f.position};_.r.Vb=function(){return this.j};
|
|
71
|
+
_.r.Db=function(){return this.l};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};RQ.prototype.getWrapperCreativeIds=RQ.prototype.getWrapperCreativeIds;RQ.prototype.getWrapperAdSystems=RQ.prototype.getWrapperAdSystems;RQ.prototype.getWrapperAdIds=RQ.prototype.getWrapperAdIds;RQ.prototype.getSequenceLength=RQ.prototype.Db;RQ.prototype.getPositionInSequence=RQ.prototype.Vb;RQ.prototype.getPodTimeOffset=RQ.prototype.Ub;
|
|
72
|
+
RQ.prototype.getPodIndex=RQ.prototype.getPodIndex;RQ.prototype.getPodType=RQ.prototype.bb;RQ.prototype.getMediaBitrate=RQ.prototype.mb;RQ.prototype.getMediaHeight=RQ.prototype.Ab;RQ.prototype.getMediaWidth=RQ.prototype.Bb;RQ.prototype.getMediaUrl=RQ.prototype.getMediaUrl;RQ.prototype.getClickThroughUrl=RQ.prototype.Tb;RQ.prototype.isBumper=RQ.prototype.sc;RQ.prototype.getSkipTimeOffset=RQ.prototype.getSkipTimeOffset;RQ.prototype.getDuration=RQ.prototype.getDuration;RQ.prototype.getTitle=RQ.prototype.getTitle;
|
|
73
|
+
RQ.prototype.getAdvertiserName=RQ.prototype.getAdvertiserName;RQ.prototype.getAdSystem=RQ.prototype.getAdSystem;RQ.prototype.getApiFramework=RQ.prototype.getApiFramework;RQ.prototype.getCreativeId=RQ.prototype.getCreativeId;RQ.prototype.getId=RQ.prototype.getId;RQ.prototype.getTechnology=RQ.prototype.Eb;RQ.prototype.getAdManagerVersion=RQ.prototype.yb;RQ.prototype.getAdManagerName=RQ.prototype.xb;SQ.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};SQ.prototype.Xb=function(){return!!this.a.find(function(a){return 0===a.position})};SQ.prototype.nb=function(){return!!this.a.find(function(a){return-1===a.position})};SQ.prototype.hasPostroll=SQ.prototype.nb;SQ.prototype.hasPreroll=SQ.prototype.Xb;SQ.prototype.getCuePoints=SQ.prototype.getCuePoints;_.r=UQ.prototype;_.r.load=function(){var a=this;return _.E(function(b){VQ&&(VQ=!1,$Q(a,0));_.y(b)})};_.r.start=function(){return _.E(function(a){TQ().play();_.y(a)})};_.r.resume=function(){-1!==this.getPosition()&&TQ().play()};_.r.pause=function(){-1!==this.getPosition()&&TQ().pause()};_.r.skip=function(){};_.r.getVolume=function(){return this.m.getVolume()||0};_.r.setVolume=function(a){this.m.setVolume(a)};
|
|
74
|
+
_.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.r.dispose=function(){var a=this;return _.E(function(b){TQ().removeEventListener(a.f,a.h);_.y(b)})};
|
|
75
|
+
_.r.Hi=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=TQ().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Nc,{adsTimeline:new SQ(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:ZQ(this,_.Cc,a);break;case cast.framework.events.EventType.BREAK_STARTED:ZQ(this,_.vc,a);break;case cast.framework.events.EventType.BREAK_ENDED:ZQ(this,_.wc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:ZQ(this,
|
|
76
|
+
_.Ic,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(ZQ(this,_.Hc,a),ZQ(this,_.Jc,a)):a.endedReason===b.STOPPED?ZQ(this,_.Jc,a):a.endedReason===b.END_OF_STREAM?(ZQ(this,_.zc,a),ZQ(this,_.Jc,a)):a.endedReason===b.ERROR&&$Q(this,1);break;case cast.framework.events.EventType.PLAYING:ZQ(this,_.Gc,a);break;case cast.framework.events.EventType.PAUSE:ZQ(this,_.Ec,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?ZQ(this,_.xc,a):ZQ(this,_.Gc,a)}};
|
|
77
|
+
UQ.prototype.getPosition=UQ.prototype.getPosition;UQ.prototype.setVolume=UQ.prototype.setVolume;UQ.prototype.getVolume=UQ.prototype.getVolume;UQ.prototype.skip=UQ.prototype.skip;UQ.prototype.pause=UQ.prototype.pause;UQ.prototype.resume=UQ.prototype.resume;var VQ=!1;aR.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(bR(),this.a)};aR.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(bR(),this.a)};aR.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return cR(a)})};
|
|
78
|
+
aR.prototype.f=function(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=_.Oh;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Qh;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Rh}b&&this.ec(new _.L(b,{detail:cR(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.ec(new _.L(_.Oh,{detail:b.value}))};_.w(dR,_.U);_.r=dR.prototype;_.r.initialize=function(a){this.m=a;eR().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.r.load=function(){};_.r.destroy=function(){this.m=null;eR().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.ja=function(){return this.j};_.r.ha=function(){return null};
|
|
79
|
+
_.r.Ma=function(){var a=this.sa();return a&&a.renditions[0]};_.r.Oa=function(){var a=this.ta();return a&&a.renditions[0]};_.r.ab=function(){return null};_.r.kb=function(){return null};_.r.lb=function(){return null};_.r.Qa=function(){return null};_.r.sa=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.k&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
|
|
80
|
+
_.r.ta=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ja().find(function(c){return c.id===b})||null)}return a};_.r.gb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.ya=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.Ia=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.fb=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.rb=function(a){this.ya(a&&a.track)};
|
|
81
|
+
_.r.sb=function(a){this.Ia(a&&a.track)};
|
|
82
|
+
_.r.addTextTrack=function(a){var b=this,c,d,e;return _.E(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.x(f,bQ(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c),2);if((d=f.f)&&b.a){e=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);e.isInband=!1;e.language=d.language;e.name=d.label;e.subtype=d.kind;e.trackContentId=d.url;e.trackContentType=d.mimeType;e.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([e]),gR(b)}catch(g){throw b.g.warn("failed on track",
|
|
83
|
+
a),g;}}_.y(f)})};_.r.la=function(){return!0};_.r.am=function(){this.f=eR().getAudioTracksManager();var a=this.f.getTracks();this.h=fR(_.T,a);gR(this);a=this.m.getConfiguration();hR(this,_.T,a.preferredAudioLanguage,a.preferredAudioRole);hR(this,_.S,a.preferredTextLanguage,a.preferredTextRole)};dR.prototype.isAbrEnabled=dR.prototype.la;dR.prototype.addTextTrack=dR.prototype.addTextTrack;dR.prototype.setTextRendition=dR.prototype.sb;dR.prototype.setAudioRendition=dR.prototype.rb;
|
|
84
|
+
dR.prototype.setVideoRendition=dR.prototype.fb;dR.prototype.setTextTrack=dR.prototype.Ia;dR.prototype.setAudioTrack=dR.prototype.ya;dR.prototype.setVideoTrack=dR.prototype.gb;dR.prototype.getTextTrack=dR.prototype.ta;dR.prototype.getAudioTrack=dR.prototype.sa;dR.prototype.getVideoTrack=dR.prototype.Qa;dR.prototype.getLoadingTextRendition=dR.prototype.lb;dR.prototype.getLoadingAudioRendition=dR.prototype.kb;dR.prototype.getLoadingVideoRendition=dR.prototype.ab;dR.prototype.getTextRendition=dR.prototype.Oa;
|
|
85
|
+
dR.prototype.getAudioRendition=dR.prototype.Ma;dR.prototype.getVideoRendition=dR.prototype.ha;dR.prototype.getTextTracks=dR.prototype.ja;dR.prototype.getAudioTracks=dR.prototype.getAudioTracks;dR.prototype.getVideoTracks=dR.prototype.getVideoTracks;_.w(iR,_.sl);_.r=iR.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=jR();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.vl.bind(this));d.setMediaPlaybackInfoHandler(this.ii.bind(this));this.a=new QQ(this);this.a.init();this.j=new dR;this.j.initialize(this);this.o=new aR(function(e){return c.trigger(e)});this.o.init()};
|
|
86
|
+
_.r.unload=function(){var a=cast.framework.messages.PlayerState,b=jR();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.r.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return a.B=null,a.w=_.yl(),a.h=a.w,a.l=-1,a.A=null,a.a?_.x(b,a.a.destroy(),3):b.F(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.y(b)})};
|
|
87
|
+
_.r.play=function(){var a=jR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.r.pause=function(){var a=jR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.r.isPaused=function(){return jR().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
|
|
88
|
+
_.r.isEnded=function(){return jR().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=jR();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(MP);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return jR().getCurrentTimeSec()};_.r.getDuration=function(){var a=jR().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return jR().getPlaybackRate()};
|
|
89
|
+
_.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;jR().sendLocalMediaRequest(b)}};_.r.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.r.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.r.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
|
|
90
|
+
_.r.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.r.getLoadedSource=function(){var a=jR().getMediaInformation();if(a){var b=jR().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,kn:b,name:c}}return null};_.r.getDrmInfo=function(){return null};
|
|
91
|
+
_.r.getPresentationStartTime=function(){return jR().getStartAbsoluteTime()};_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=jR().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.a?this.a.getState():_.Eo};
|
|
92
|
+
_.r.getStats=function(){var a=_.zo();if(this.f){a=jR().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.o=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.w=a.width||NaN;b.h=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.l=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.j=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
|
|
93
|
+
_.r.load=function(a){var b=this,c,d;return _.E(function(e){b.f=new _.yo;b.a.j=b.f.a;b.A=_.Vo(a);_.Bl(a)&&(b.h=_.Al(b.w,a));if(b.D)return b.D=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.k&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:$P(b.h),local:!0};return _.x(e,jR().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.va);return new _.rl};
|
|
94
|
+
_.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.setNetworkEngine=function(a){this.G=a};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return UP};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.resetAbr=function(){this.g.warn(QP)};
|
|
95
|
+
_.r.onError=function(a){this.trigger(new _.L(_.me,{detail:a}))};_.r.canPlay=function(){return _.zk()?2:0};
|
|
96
|
+
_.r.vl=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=$P(this.getStats());var b=jR(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.k&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime.Old value: "+(c.startAbsoluteTime+", new value: ")+b),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));c=cast.framework.messages.StreamType;b=a.media;var d=!!b,e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&
|
|
97
|
+
(!e||e&&f)){d=jR().getStartAbsoluteTime();if(typeof d===_.k){b.startAbsoluteTime=d;var h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}return a};_.r.ii=function(a,b){var c=null;a.media.customData&&(c=aQ(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;mR(c,b);return b};
|
|
98
|
+
_.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};iR.prototype.getTextDisplayer=iR.prototype.getTextDisplayer;iR.prototype.getNetworkEngine=iR.prototype.getNetworkEngine;iR.prototype.setNetworkEngine=iR.prototype.setNetworkEngine;_.r=nR.prototype;_.r.init=function(a){var b=this;a&&(this.f=new iR,_.aq(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.E(function(c){return b.m&&b.m.getState()!==_.Do?_.x(c,YP(b.m),0):c.F(0)})}))};
|
|
99
|
+
_.r.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=qR(),b=qR().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[WP]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Nk.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=
|
|
100
|
+
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Lk.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(WP,this.w)}};
|
|
101
|
+
_.r.stop=function(){if(this.a){this.a=!1;this.o.release();var a=qR();qR().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(WP,this.w);a.stop();this.m=this.f=null}};_.r.Qd=function(a){this.j=a};_.r.pm=function(a){this.l=a};_.r.on=function(a,b){qR().addEventListener(a,b)};_.r.off=function(a,b){qR().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.oe&&this.h.add(a)};
|
|
102
|
+
_.r.removeMessageListener=function(a){typeof a===_.oe&&this.h["delete"](a)};_.r.sendMessage=function(a,b){qR().sendCustomMessage(WP,b,$P(a))};_.r.qc=function(){return this.a};_.r.jb=function(){var a=qR().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
|
|
103
|
+
_.r.Nk=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return sR(this,a);try{var b=(new DOMParser).parseFromString(a,_.cg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=qR();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ja),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.rg||g===_.$c){g=e[f].getAttribute(_.Le);for(var h=e[f].getElementsByTagName(_.Rb),l=
|
|
104
|
+
h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Le)||g,n=h[l].getAttribute(_.Jd),p=h[l].getAttribute(_.Gg)||void 0,q=h[l].getAttribute(_.pe)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(h[l])}e[f].getElementsByTagName(_.Rb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ja).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.ac)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=qR();c=a.getElementsByTagName("StreamIndex");
|
|
105
|
+
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.rg){e=c[d].getElementsByTagName(_.Ob);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.xb)||void 0,h=e[f].getAttribute(_.wb)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.tg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.Ob).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
106
|
+
_.r.Lk=function(a){var b=this,c,d,e,f,g,h;return _.E(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=aQ(c.media.customData.playerConfiguration));if(!b.m||!d){l.F(2);break}if(!b.j){l.F(3);break}return _.x(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.F(5);break}return _.x(l,XQ(c.media,d.ima,b.m.getNetworkEngine()),5);case 5:typeof d.startTime===_.k&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.F(7);
|
|
107
|
+
break}b.f.D=!0;return _.x(l,_.gq(b.m,d),8);case 8:return _.x(l,_.hq(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Mb&&(c.media.hlsVideoSegmentFormat=cQ(f.Mb,_.Pj)),f.audioMimeType&&(c.media.hlsSegmentFormat=cQ(f.audioMimeType,_.T));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.k){var m=g.sectionStartAbsoluteTime;g.sectionStartAbsoluteTime=0===m?1E-8:m}void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay);case 2:if(!b.l){l.F(10);
|
|
108
|
+
break}return _.x(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.r.sl=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.Dk;var b=qR().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.m.getConfiguration().startTime;typeof d!==_.k||typeof c!==_.k||typeof e!==_.k||a(e,d,c)||(b=b.getMediaTimeForAbsoluteTime(e),typeof b===_.k&&a(b,d,c)&&this.m.seek(b))}_.dq(this.m)}};
|
|
109
|
+
_.r.Bi=function(a){if(0<this.h.size){var b=aQ(a.data);this.h.forEach(function(c){return c(b)})}};_.H(VP,nR);nR.prototype.getContentMetadata=nR.prototype.jb;nR.prototype.isApiReady=nR.prototype.qc;nR.prototype.sendMessage=nR.prototype.sendMessage;nR.prototype.removeMessageListener=nR.prototype.removeMessageListener;nR.prototype.addMessageListener=nR.prototype.addMessageListener;nR.prototype.off=nR.prototype.off;nR.prototype.on=nR.prototype.on;nR.prototype.setLoadRequestDataInterceptor=nR.prototype.pm;
|
|
110
|
+
nR.prototype.setPlayerConfigInterceptor=nR.prototype.Qd;nR.prototype.stop=nR.prototype.stop;nR.prototype.start=nR.prototype.start;nR.prototype.init=nR.prototype.init;nR.getInstance=pR;var oR=null;_.r=tR.prototype;_.r.load=function(){var a=this,b,c,d,e,f;return _.E(function(g){a.a=a.f.l;if(a.a)for(b=a.a.controller,c=a.Il.bind(a),d=_.u(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.y(g)})};_.r.start=function(){return _.E(function(a){_.y(a)})};_.r.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.r.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
|
|
111
|
+
_.r.skip=function(){var a=this.f.a;a&&this.f.sendMessage(XP,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.r.getVolume=function(){return this.f.getVolume()||0};_.r.setVolume=function(a){this.f.setVolume(a)};_.r.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.r.dispose=function(){var a=this;return _.E(function(b){a.h.release();_.y(b)})};
|
|
112
|
+
_.r.Il=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Nc,{adsTimeline:new SQ(a.breaks)})));break;case "isPlayingBreak":a.value?vR(this,_.vc):(vR(this,_.zc),vR(this,_.Jc),vR(this,_.wc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(vR(this,_.zc),vR(this,_.Jc)),vR(this,_.Ic));break;case "isPaused":this.a.isPlayingBreak&&(a.value?vR(this,_.Ec):vR(this,_.Gc))}};tR.prototype.getPosition=tR.prototype.getPosition;
|
|
113
|
+
tR.prototype.setVolume=tR.prototype.setVolume;tR.prototype.getVolume=tR.prototype.getVolume;tR.prototype.skip=tR.prototype.skip;tR.prototype.pause=tR.prototype.pause;tR.prototype.resume=tR.prototype.resume;wR.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};wR.prototype.ba=function(a,b){return a.namespace()!==_.Cd?!1:!(!b||!b.ima)};wR.prototype.create=function(a){return new tR(a.a)};wR.prototype.create=wR.prototype.create;wR.prototype.isSupported=wR.prototype.ba;wR.prototype.name=wR.prototype.name;_.jp(new wR);xR.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};xR.prototype.ba=function(a,b){return pR().qc()?!(!b||!b.ima):!1};xR.prototype.create=function(a){return new UQ(a)};xR.prototype.create=xR.prototype.create;xR.prototype.isSupported=xR.prototype.ba;xR.prototype.name=xR.prototype.name;_.jp(new xR);};
|
|
114
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
115
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
116
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
117
|
+
})();
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var mP="Ad Error",nP="onAdBreakStarted()",oP="onAdBreakStopped()",pP=function(a){function b(l,m){l in h||!m||(h[l]=m)}var c=_.Ej(),d=Conviva.Constants.DeviceType.DESKTOP,e=Conviva.Constants.DeviceCategory.WEB,f=c.os;c=c.osVersion.name;var g="";_.Ak()&&(g="Apple");_.zk()?(g="Google",d=Conviva.Constants.DeviceType.SETTOP,e=Conviva.Constants.DeviceCategory.CHROMECAST):_.Bk()?(d=Conviva.Constants.DeviceType.MOBILE,/(android)/i.test(navigator.userAgent)?e=Conviva.Constants.DeviceCategory.ANDROID_DEVICE:
|
|
3
|
+
_.Ak()&&(e=Conviva.Constants.DeviceCategory.APPLE_DEVICE)):_.Dj()||_.Cj()||_.wk("Hisense")?(d=Conviva.Constants.DeviceType.SMARTTV,e=Conviva.Constants.DeviceCategory.SMART_TV,_.Dj()?(c="",g="LG",e=Conviva.Constants.DeviceCategory.LG_TV):_.Cj()?(g="Samsung",e=Conviva.Constants.DeviceCategory.SAMSUNG_TV):_.wk("Hisense")&&(c="",g="Hisense")):_.wk("Xbox One")&&(g="Microsoft",d=Conviva.Constants.DeviceType.CONSOLE,e=Conviva.Constants.DeviceCategory.XBOX);var h=a.deviceMetadata||{};b(Conviva.Constants.DeviceMetadata.TYPE,
|
|
4
|
+
a.deviceType||d);b(Conviva.Constants.DeviceMetadata.OS_NAME,f);b(Conviva.Constants.DeviceMetadata.OS_VERSION,c);b(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||e);b(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||g);return h},qP=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},rP=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},tP=function(a,b,c,d){var e={};e[Conviva.Constants.PLAYER_NAME]=c;e[Conviva.Constants.VIEWER_ID]=
|
|
5
|
+
b;e[Conviva.Constants.IS_LIVE]=qP(!!d);e[Conviva.Constants.ASSET_NAME]=mP;a&&(e[Conviva.Constants.ASSET_NAME]=a.getTitle(),e[Conviva.Constants.STREAM_URL]=a.getMediaUrl(),e[Conviva.Constants.DURATION]=a.getDuration(),e["c3.ad.id"]=sP(a.getId()),e["c3.ad.creativeId"]=sP(a.getCreativeId()),e["c3.ad.system"]=sP(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=sP(a.getApiFramework()),e["c3.ad.advertiser"]=sP(a.getAdvertiserName()),e["c3.ad.position"]=rP(a.getPodIndex()),e["c3.ad.technology"]=0===a.Eb()?
|
|
6
|
+
Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=sP(a.xb()),e["c3.ad.adManagerVersion"]=sP(a.yb()),e["c3.ad.advertiserCategory"]=sP(null),e["c3.ad.advertiserId"]=sP(null),e["c3.ad.breakId"]=sP(null),e["c3.ad.campaignName"]=sP(null),e["c3.ad.category"]=sP(null),e["c3.ad.classification"]=sP(null),e["c3.ad.creativeName"]=sP(null),e["c3.ad.sequence"]=sP(a.Vb()),e["c3.ad.sessionStartEvent"]=sP(null),e["c3.ad.unitName"]=sP(null),e["c3.ad.dayPart"]=sP(null),
|
|
7
|
+
b=a.getWrapperAdIds().slice(-1)[0]||a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=sP(b),e["c3.ad.firstAdSystem"]=sP(c),e["c3.ad.firstCreativeId"]=sP(a));return e},sP=function(a){return a?""+a:"NA"},uP=function(a,b){this.m=a;this.B=b;this.A="";this.w=_.xa;this.g=new _.K("clpp.conviva.ad");this.f=new _.Dh;this.a=null;this.j=this.l=this.o=this.h=!1},vP=function(a,b){if(!a.l){a.j=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.B()),
|
|
8
|
+
b){var c=tP(b,a.A,a.w,a.m.isLive()),d=String(b.yb()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.xb();e[Conviva.Constants.FRAMEWORK_VERSION]=d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(f){a.g.error("Could not create ad analytics session",f)}}},yP=function(a,b,c){c=void 0===c?mP:c;if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case wP:a.a.reportAdFailed(c,tP(null,a.A,a.w));break;case xP:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();
|
|
9
|
+
a.a=null;a.h=!1}},zP=function(a){a.f.on(a.m,_.vc,a.Ii.bind(a));a.f.on(a.m,_.wc,a.Ji.bind(a));a.f.on(a.m,_.Ic,a.Pi.bind(a));a.f.on(a.m,_.Fc,a.xe.bind(a));a.f.on(a.m,_.Ec,a.xe.bind(a));a.f.on(a.m,_.Gc,a.xe.bind(a));a.f.on(a.m,_.xc,a.xe.bind(a));a.f.on(a.m,_.Jc,a.Qi.bind(a));a.f.on(a.m,_.Hc,a.Oi.bind(a));a.f.on(a.m,_.yc,a.Ki.bind(a));a.f.on(a.m,_.Bc,a.Mi.bind(a));a.f.on(a.m,_.Cc,a.Ni.bind(a));a.f.on(a.m,_.Ac,a.Li.bind(a));a.f.on(a.m,_.Dc,a.$k.bind(a));a.f.on(a.m,_.Kc,a.Ri.bind(a));a.f.on(a.m,_.me,function(b){var c=
|
|
10
|
+
b.detail;if(10003===c.code&&(a.g.debug("onAdError()"),!a.j)){b=Conviva.Constants.ErrorSeverity;switch(c.data.errorType){case 0:c="Ad Load Error";break;case 1:c="Ad Play Error";break;default:c=mP}null===a.a&&vP(a,null);a.a.reportAdError(c,b.FATAL);a.j=!0;a.g.debug("Ad Playback Failure");yP(a,wP,c)}})},AP=function(a,b){this.m=a;this.f=new _.Dh;this.a=null;this.o=!1;this.H=!0;this.B=this.h=this.A=this.D=this.l=!1;this.P=0;this.K=!1;this.w=null;this.J=!1;this.g=b;this.M=this.G=null;this.j=[];this.I=0},
|
|
11
|
+
BP=function(a){if(!a.l&&a.a){var b=qP(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},CP=function(a){return null!==a.a&&a.D},DP=function(a){return a.m.getConfiguration().autoplay||!1},EP=function(a,b){var c={};c[Conviva.Constants.LOG_LEVEL]=Conviva.Constants.LogLevel.DEBUG;b.serviceUrl&&(a.g.warn("Touchstone URL is set. Do not set this in production!"),c[Conviva.Constants.GATEWAY_URL]=b.serviceUrl.replace(/\/$/,""));Conviva.Analytics.init(b.customerKey,
|
|
12
|
+
null,c);Conviva.Analytics.setDeviceMetadata(pP(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;c={};c[Conviva.Constants.FRAMEWORK_NAME]=_.xa;c[Conviva.Constants.FRAMEWORK_VERSION]=_.ia;a.a.setPlayerInfo(c)},FP=function(a){if(!a.l)if(a.D)a.g.warn("Current session still active. No-op.");else{var b=a.m.getLoadedSource()||a.M,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||
|
|
13
|
+
"N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.Wj(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.Xj(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.xa;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.N.R(c.customTags))for(var h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(function(){a.g.debug("reportMiscellaneousMetrics()");if(CP(a)){var l=
|
|
14
|
+
1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=a.m.getStats()){l=l.decodedFrames;var m=l-a.I;a.I=l;isFinite(m)&&(a.g.debug("Current FPS",m),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,m))}}});a.D=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.Og(l.Pb)}));a.j=[]}},GP=function(a){a.g.debug("terminateSession()");a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,
|
|
15
|
+
Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.D=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.P=0,a.K=!1,a.j=[],a.I=0)},HP=function(){this.h=this.f=null;this.a=!1;this.g=new _.K("clpp.conviva")},IP=function(a){var b=[];typeof a===_.Se&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.P(1,9,9001,{missingKeys:b});},JP=function(a,b){var c=b.getConfiguration();a.a=!_.N.R(c.conviva)&&typeof c.conviva===
|
|
16
|
+
_.Se;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.P(1,9,9E3),a.U(b,c)):b.namespace()===_.Cd&&(a.a=!1,a.g.debug("Conviva does not report when casting.")):a.g.warn("Conviva plugin is loaded but not configured. Will do nothing.")},KP=function(){};_.r=uP.prototype;_.r.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.xa;zP(this)};_.r.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.la):(_.Gh(this.f),this.a&&yP(this,LP),this.f.release(),this.o=!0,this.h=this.j=!1)};_.r.destroy=function(){this.g.debug(_.Vd);this.l?this.g.debug(_.ka):this.l=!0};_.r.Ii=function(){this.g.debug(nP)};_.r.Ji=function(){this.g.debug(oP)};
|
|
17
|
+
_.r.Pi=function(a){this.g.debug("onAdStarted()");a=a.ad;this.h||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),vP(this,a));this.h=!1;this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.PLAYING);this.a.reportAdMetric(Conviva.Constants.Playback.RESOLUTION,a.Bb(),a.Ab());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.mb())};
|
|
18
|
+
_.r.xe=function(a){var b=this;this.g.debug("onAdStateChanged()");if(this.a){var c=function(d){b.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,d)};switch(a.type){case _.Fc:case _.Gc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.Ec:c(Conviva.Constants.PlayerState.PAUSED);break;case _.xc:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.r.Qi=function(){this.g.debug("onAdStopped()");this.a&&!this.j&&yP(this,LP)};_.r.Oi=function(){this.g.debug("onAdSkipped()");this.a&&yP(this,xP)};
|
|
19
|
+
_.r.Ki=function(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.r.Mi=function(){this.g.debug("onAdImpression()");if(this.a){var a=Conviva.Constants.Events;this.a.reportAdPlayerEvent(a.AD_IMPRESSION_START);this.a.reportAdPlayerEvent(a.AD_IMPRESSION_END)}};
|
|
20
|
+
_.r.Ni=function(a){var b=this;this.g.debug("onAdLoaded()");var c=a.ad;if(-1!==c.getPodIndex()||this.m.getPosition()>=this.m.getDuration()-5)b.h=!0,vP(b,c);else this.f.on(this.m,_.dg,function(){b.m.getPosition()>=b.m.getDuration()-5&&(b.f.off(b.m,_.dg),b.h=!0,vP(b,c))})};_.r.Li=function(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.r.$k=function(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
|
|
21
|
+
_.r.Ri=function(){this.g.debug("onAdThirdQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)};var xP=0,LP=1,wP=2;_.r=AP.prototype;
|
|
22
|
+
_.r.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.N.Va(b),this.M=c,this.m=a,EP(this,this.G),this.f.on(this.m,_.ff,this.zl.bind(this)),this.f.on(this.m,_.Sf,this.Wi.bind(this)),this.f.on(this.m,_.gd,this.ng.bind(this)),this.f.on(this.m,_.mg,this.Vi.bind(this)),this.f.on(this.m,_.lg,this.Ui.bind(this)),this.f.on(this.m,_.vc,this.Si.bind(this)),this.f.on(this.m,_.wc,this.Ti.bind(this)),this.f.on(this.m,_.Nc,this.fl.bind(this)),this.f.on(this.m,_.fd,this.hl.bind(this)),
|
|
23
|
+
this.f.on(this.m,_.me,this.og.bind(this)),DP(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),FP(this)))};_.r.release=function(){this.g.debug("Release conviva");this.H?this.g.debug(_.la):(_.Gh(this.f),CP(this)||this.o||!DP(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),CP(this)&&GP(this),this.a=null,this.H=!0)};_.r.destroy=function(){this.g.debug(_.Vd);this.l?this.g.debug(_.ka):this.l=!0};
|
|
24
|
+
_.r.reportAppEvent=function(a,b){var c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c};_.r.zl=function(){this.g.debug("onPlayRequest()");CP(this)||DP(this)?CP(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),CP(this)&&!this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_ENDED),this.h=!0),this.A=!1):(this.g.debug("Creating conviva session. On Play Requested / No autoplay"),FP(this))};
|
|
25
|
+
_.r.Wi=function(a){function b(d){if(c.o&&(c.g.debug("Creating conviva session (On Seek / Replay)"),EP(c,c.G),FP(c),BP(c),CP(c))){var e=c.m.getTrackManager();e=e.ha()||e.ab();e.width&&e.height&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,e.width,e.height);e.bandwidth&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,e.bandwidth/1E3)}CP(c)&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,d)}var c=this;this.g.debug(_.Xe);switch(a.detail.currentState){case _.Ro:b(Conviva.Constants.PlayerState.PLAYING);
|
|
26
|
+
break;case _.Qo:b(Conviva.Constants.PlayerState.PAUSED);break;case _.Io:b(Conviva.Constants.PlayerState.BUFFERING);break;case _.Ko:this.g.debug("onVideoEnded()"),CP(this)&&(this.w&&this.w.nb()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.K=!0):GP(this))}};
|
|
27
|
+
_.r.ng=function(a){this.g.debug(_.Te);if(CP(this)){if(a=a.detail,typeof a.width===_.k&&typeof a.height===_.k&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){var b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({Og:this.ng.bind(this),Pb:a})};
|
|
28
|
+
_.r.Vi=function(){this.g.debug("onSeeking()");CP(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)};_.r.Ui=function(){this.g.debug("onSeeked()");CP(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)};_.r.fl=function(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a};
|
|
29
|
+
_.r.Si=function(a){this.g.debug(nP);var b=a.ad;a=0===b.bb();var c=rP(b.getPodIndex());CP(this)||DP(this)||!a||FP(this);if(CP(this)){a=0===b.Eb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;var d=0,e={};1===b.Db()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.P;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.zk()?b.CONTENT:b.SEPARATE;this.a.reportAdBreakStarted(a,
|
|
30
|
+
b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")};_.r.Ti=function(){this.g.debug(oP);CP(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.K&&GP(this))};
|
|
31
|
+
_.r.og=function(a){this.g.debug(_.Ue);if(this.o&&this.J)this.g.debug("Session ended in VPF; ignoring subsequent errors");else{var b=a.detail||null,c=b&&b.message||"Player error",d=Conviva.Constants.ErrorSeverity.WARNING;b&&b.severity&&b.severity===_.Q&&(d=Conviva.Constants.ErrorSeverity.FATAL,CP(this)||FP(this));CP(this)?(this.g.debug("Report error",c,d),this.a.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.g.debug("Video Playback Failure"),this.J=!0,GP(this))):this.j.push({Og:this.og.bind(this),
|
|
32
|
+
Pb:a})}};_.r.hl=function(){this.g.debug("onAutoPlayBlocked()");CP(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,CP(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))};_.r=HP.prototype;_.r.onPlayerCreated=function(a){this.f=new AP(a,this.g)};_.r.onContentWillLoad=function(a,b){var c=this;JP(this,a);if(this.a){var d=a.getConfiguration();d=_.N.Va(d.conviva||{});try{IP(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.h=new uP(a,function(){return c.f.a}),this.h.initialize(d))}catch(f){f instanceof _.P?this.U(a,f):this.U(a,new _.P(1,9,9002,f,f))}}};_.r.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&BP(this.f)};
|
|
33
|
+
_.r.onPlayerWillDestroy=function(){this.a&&(this.a=!1,this.f.destroy(),this.f=null,this.h&&(this.h.destroy(),this.h=null))};_.r.onPlayerWillRelease=function(){this.a&&(this.f.release(),this.h&&this.h.release())};_.r.id=function(){return"conviva"};_.r.U=function(a,b){a.trigger(new _.L(_.me,{detail:b}))};_.r.reportAppEvent=function(a,b){return this.f?this.f.reportAppEvent(a,b):!1};_.H("clpp.conviva.ConvivaPlugin",HP);HP.prototype.reportAppEvent=HP.prototype.reportAppEvent;HP.Id="conviva";
|
|
34
|
+
KP.prototype.create=function(){return new HP};_.jq(new KP);};
|
|
35
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
36
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
37
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
38
|
+
})();
|