(function(){var g={}; var _ = _ || {}
var f=function(window){var rx="clpp.yospace.YospacePlugin",sx=function(){this.a=null;this.g=new _.J(rx)},tx=function(){};_.w(sx,_.bw);sx.prototype.ii=function(){return this.a};
sx.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,h;return _.H(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.Re)throw new _.N(_.O,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||ux;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case ux:m=YospaceAdManagement.SessionVOD.create(m);break a;case vx:m=YospaceAdManagement.SessionLive.create(m);
break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.x(l,m,2)}g=l.f;h=g.getSessionState();if(h!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",h,"URL",b.url),new _.N(_.O,9,7003,"Yospace session failed to initialize.");a.trigger(new _.K(_.ch,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.y(l)})};
sx.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.K(_.bh,{detail:b}))}};sx.prototype.id=function(){return"yospace"};_.I(rx,sx);sx.prototype.getSession=sx.prototype.ii;sx.Id="yospace";tx.prototype.create=function(){return new sx};_.Yt(new tx);var ux=_.Wb,vx="LIVE";_.I("clpp.yospace.StreamType",{VOD:ux,LIVE:vx,DVR:"DVR"});};
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
else{_=this.clpp._;(f.call(g,this));}
})();