

function PlayerController_base(){function e(e){return"devicetype="+e.getDeviceType()}function t(e){var t=[];if(e.isFlashAvailable()){t.push("flash")}if(e.getClientOS()==DeviceDetect.IOS){t.push("hls")}return"features="+t.join()}this.createObject=function(){this.refreshOnLoaded=this.rootConfig.refreshOnLoaded?true:false;this.type=this.rootConfig.type?this.rootConfig.type:"video";this.aspectRatio=this.rootConfig.aspectRatio?this.rootConfig.aspectRatio:1.78;this.playerCofigurationUrl=this.rootConfig.pcUrl?this.rootConfig.pcUrl:null;this.mediaCollectionUrl=this.rootConfig.mcUrl?this.rootConfig.mcUrl:null;this.cssClasses=this.rootConfig.cssClasses?this.rootConfig.cssClasses:[{minWidth:"0","class":"xxs"},{minWidth:"92","class":"xs"},{minWidth:"233","class":"s"},{minWidth:"430","class":"m"},{minWidth:"1000","class":"l"}];this.playerNode=null;this.player=null;this.initializing=false;this.initialized=false;this.playerStatus=null;var e=this;jq(".mediaLink",this.rootNode).click(function(){this.initPlayer(e);return false});this.app.addEventListener(Application.EVENT_CONTENT_LOADED,this,"handleWindowLoadedEvent")};this.destroyObject=function(){if(this.player!=null){var e=window.PlayerModel.getAllPlayer();if(e!=undefined&&e.length!=0){window.removeArdPlayer(this.player.getId())}}return true};this.handleWindowLoadedEvent=function(e){var t=this.getActiveAction(this.rootConfig.action,this.app.currentView);for(var n in t){if(t[n]=="init"){this.initPlayer(this)}else if(t[n]=="calcCssClass"){this.calcCssClass()}else if(t[n]=="calcHeight"){this.calcHeight()}}};this.handleViewUpdatedEvent=function(e){var t=this.getActiveAction(this.rootConfig.action,e);for(var n in t){if(t[n]=="calcCssClass"){this.calcCssClass()}else if(t[n]=="calcHeight"){this.calcHeight()}}};this.initPlayer=function(){if(this.initialized||this.initializing||this.playerCofigurationUrl==null||this.mediaCollectionUrl==null)return;this.initializing=true;if(PlayerModel.getAllPlayer()!=undefined){window.removeArdPlayer("all")}var n=this.rootConfig.id+"_"+(new Date).getTime();this.playerNode=jq('<div id="'+n+'"></div>');jq(this.rootNode).html(this.playerNode);if(this.type=="video"){jq(this.rootNode).height(Math.ceil(this.playerNode.outerWidth()/this.aspectRatio))}var r=new GetPlayerConfigByJsonCmd;var i=new GetMediaCollectionByJsonCmd;var s=this;r.execute(s.playerCofigurationUrl+"?"+e(s.app.deviceDetect),function(r){if(r==undefined)return;var o=s.mediaCollectionUrl+"?"+e(s.app.deviceDetect)+"&"+t(s.app.deviceDetect);i.execute(o,function(e){if(e==undefined)return;r.setOnStatusChangeFunction(function(e){s.handlePlayerEvent(e)});s.player=new Player(n,r,e);for(var t in r._pixelConfig){try{if(r._pixelConfig[t].tracker=="AGF"){new AgfPixelAdapter(s.player,r._pixelConfig[t])}else if(r._pixelConfig[t].tracker=="ATI"){new ATIPixelAdapter(s.player,r._pixelConfig[t])}else if(r._pixelConfig[t].tracker=="ComScore"){new ComScorePixelAdapter(s.player,r._pixelConfig[t])}}catch(i){console.log("Fehler in der Pixelung ("+r._pixelConfig[t].tracker+"): "+i)}}s.initializing=false})})};this.handlePlayerEvent=function(e){this.playerStatus=e;var t=this;switch(e){case"init":t.initialized=true;t.calcCssClass();t.calcHeight();break;case"ready":break;case"play":break;case"pause":break;case"stop":break}};this.calcCssClass=function(){if(!this.initialized)return;var e=this.playerNode.width();var t="m";for(var n in this.cssClasses){if(e>=parseInt(this.cssClasses[n].minWidth)){t=this.cssClasses[n]["class"]}}this.playerNode.attr("class","");this.playerNode.addClass("ardplayer-"+this.type).addClass("ardplayer-"+t)};this.calcHeight=function(e){if(!this.initialized)return;jq(this.rootNode).height(Math.ceil(this.playerNode.outerWidth()/this.aspectRatio))}}PlayerController_base.prototype=new BaseController;PlayerController.prototype=new PlayerController_base