(function(){var g={}; var _ = _ || {}
var f=function(window){var wY=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Vh(function(){a.m.play()["catch"](function(){})});this.h=new _.gi},xY=function(){};_.w(wY,_.bw);_.r=wY.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.$m.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Fn.bind(this)))};
_.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.$m=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.K(_.Fc,{canCast:this.f}))};_.r.Fn=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Ec:_.Dc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Hq)this.l?this.m.play()["catch"](function(){}):this.o.ga(.01);this.m.trigger(new _.K(a))};_.r.Tb=function(){return this.j};
_.r.Xf=function(){return this.f};_.r.vo=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.I("clpp.airplay.AirPlayPlugin",wY);wY.prototype.showCastMenu=wY.prototype.vo;wY.prototype.canCast=wY.prototype.Xf;wY.prototype.isCasting=wY.prototype.Tb;wY.Id="airplay";xY.prototype.create=function(){return new wY};_.Yt(new xY);};
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));}
})();