Function.prototype.method=function(_1,_2){
this.prototype[_1]=_2;
return this;
};
if(typeof console!="object"||!this.DEBUG){
var n=function(){
};
console={warn:n,error:n,info:n,log:n};
}
if(typeof EmbeddedPlayerManager=="undefined"){
EmbeddedPlayerManager=function(){
function Constructor(){
this.BASE_LOCATION="";
this.TRACKING_JS="";
this.players;
this.companions;
this.lastPlayer;
this.fullscreenPlayer=null;
if(!deconcept||!deconcept.SWFObject){
console.error("Couldn't initialize EmbeddedPlayerManager. SWFObject unavailable");
return null;
}
window.onbeforeunload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;
};
console.info("making shared instance of embeddedPlayerManager. this message should only appear once");
this.players=new Array();
this.companions=new Array();
}
with(Constructor){
method("embedPlayer",function(_3,_4,_5,_6,_7,_8,_9){
if(this.players[_3]){
return this.players[_3];
}
if(!document.getElementById(_3)){
var _a="";
}
var _b="";
var _c=384;
var _d=316;
if(_5){
if(typeof _5=="string"&&_5.indexOf("/")!=-1){
_b=_5;
}else{
_a=_5;
}
}
if(typeof _7=="number"&&typeof _8=="number"){
_c=_7;
_d=_8;
}
this.lastPlayer=new EmbeddedPlayer(this,_3,_4,_a,_b,_6,_c,_d,_9);
this.players[_3]=this.lastPlayer;
return this.lastPlayer;
});
method("getCompanion",function(_e){
if(!this.companions[_e]){
console.log("companion %s not found, creating...",_e);
this.companions[_e]=new Companion(_e);
}
return this.companions[_e];
});
method("getPlayer",function(_f){
if(typeof _f=="undefined"){
return this.lastPlayer;
}
this.lastPlayer=this.players[_f];
return this.lastPlayer;
});
method("pauseAll",function(){
for(var i in this.players){
this.players[i].pause();
}
});
method("setActiveFullscreen",function(_11){
this.fullscreenPlayer=_11;
});
method("unFullscreen",function(){
this.fullscreenPlayer.fullscreen(false);
});
}
return new Constructor();
};
}
if(typeof EmbeddedPlayer=="undefined"){
EmbeddedPlayer=function(_12,_13,_14,_15,_16,_17,_18,_19,_1a){
function Constructor(){
this.manager=_12;
this.id=_13;
this.onMetadata;
this.onClearMetadata;
this.companion;
this.swf;
this.container;
this.trackingiframe;
this.width=_18;
this.height=_19;
this.isFullscreen=false;
this.isFullscreenEnabled=(_17==true);
this.isPlayingAd=false;
if(!document.getElementById("trackingiframe")){
console.log("Tracking IFrame not found, adding.");
var _1b=document.createElement("iframe");
with(_1b){
setAttribute("src","about:blank");
setAttribute("id","trackingiframe");
setAttribute("name","trackingiframe");
setAttribute("width","1");
setAttribute("height","1");
setAttribute("marginwidth","0");
setAttribute("frameborder","0");
style.position="absolute";
style.top="0px";
style.left="0px";
style.display="none";
}
document.body.appendChild(_1b);
}
this.trackingiframe=document.getElementById("trackingiframe");
var _1c="player_"+_13;
var _1d=new deconcept.SWFObject(embeddedPlayerManager.BASE_LOCATION+"embedded.swf",_1c,null,null,"8","#000000",true);
_1d.addParam("allowScriptAccess","always");
_1d.addVariable("BASE_LOCATION",embeddedPlayerManager.BASE_LOCATION);
if(_15){
_1d.addVariable("deepLinkID",_15);
}
if(_16){
_1d.addVariable("deepLinkPath",_16);
}
if(_1a){
_1d.addVariable("externalControls",_1a);
}
_1d.addVariable("playerID",_13);
this.companion=embeddedPlayerManager.getCompanion(_14);
if(this.isFullscreenEnabled){
if(typeof elementPosition!="function"){
console.error("FATAL: Fullscreen implementation requires MochiKit.DOM");
this.isFullscreenEnabled=false;
}
}
if(this.isFullscreenEnabled){
this.container=document.createElement("div");
var _1e="container_"+_13;
this.container.id=_1e;
this.container.className="fullscreenPlayer";
document.body.appendChild(this.container);
with(this.container.style){
position="absolute";
width=_18+"px";
height=_19+"px";
margin="0";
padding="0";
backgroundColor="#000";
border="none";
}
var _1f=document.createElement("div");
_1f.id="placeholder_"+_13;
document.getElementById(_13).appendChild(_1f);
with(_1f.style){
width=_18+"px";
height=_19+"px";
margin="0";
padding="0";
border="none";
}
var _20=elementPosition("placeholder_"+this.id);
this.container.style.left=_20.x+"px";
this.container.style.top=_20.y+"px";
_1d.setAttribute("width","100%");
_1d.setAttribute("height","100%");
_1d.write(_1e);
}else{
_1d.setAttribute("width",_18);
_1d.setAttribute("height",_19);
_1d.write(_13);
}
this.swf=document.getElementById(_1c);
}
with(Constructor){
method("onFullscreen",function(_21){
if(typeof _21!="boolean"){
return;
}
if(!this.isFullscreenEnabled){
console.warn("Fullscreen not enabled for this player.");
return;
}
if(_21==this.isFullscreen){
return;
}
this.isFullscreen=_21;
if(this.isFullscreen){
this.manager.setActiveFullscreen(this);
var _22=this.container;
with(_22.style){
height="100%";
width="100%";
left="0";
right="-0";
bottom="-0";
}
_22.style.top=document.body.scrollTop+"px";
if(navigator.userAgent.toLowerCase().indexOf("firefox")==-1){
document.body.style.overflow="hidden";
_22.style.top=document.body.scrollTop+"px";
}else{
_22.style.top="0";
window.onscroll=function(){
window.scrollTo(0,0);
};
window.onscroll();
}
}else{
with(this.container.style){
top=left=right=bottom="";
}
var _23=elementPosition("placeholder_"+this.id);
this.container.style.width=this.width;
this.container.style.height=this.height;
this.container.style.left=_23.x+"px";
this.container.style.top=_23.y+"px";
if(navigator.userAgent.toLowerCase().indexOf("firefox")==-1){
document.body.style.overflow="";
}else{
window.onscroll=function(){
};
}
}
});
method("onPlayVideo",function(_24){
var _25=this.isPlayingAd;
this.isPlayingAd=_24.isAd;
if(_25&&!this.isPlayingAd){
this.companion.collapse();
}
});
method("onExecuteTrackingJS",function(_26){
if(typeof embeddedPlayerManager.TRACKING_JS=="string"){
this.trackingiframe.src=embeddedPlayerManager.TRACKING_JS+_26;
}
});
method("onLoadCompanion",function(evt){
this.companion.load(evt.sourceURL,evt.linkURL);
});
method("play",function(){
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.playVideo();
});
method("pause",function(){
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.pauseVideo();
});
method("playVideoByPathID",function(_28){
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.playVideoByPathID(_28);
});
method("playVideoByPath",function(_29){
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.playVideoByPath(_29);
});
method("setMetadataContainers",function(_2a,_2b,_2c,_2d){
if(typeof (_2a)=="string"){
_2a=document.getElementById(_2a);
}
if(typeof (_2b)=="string"){
_2b=document.getElementById(_2b);
}
if(typeof (_2c)=="string"){
_2c=document.getElementById(_2c);
}
if(typeof (_2d)=="string"){
_2d=document.getElementById(_2d);
}
this.onMetadata=function(_2e){
if(_2a){
_2a.innerHTML=_2e.name;
}
if(_2b){
_2b.innerHTML=_2e.subtitle;
}
if(_2c){
_2c.innerHTML=_2e.description;
}
if(_2d){
_2d.innerHTML=_2e.schedule;
}
};
this.onClearMetadata=function(){
var _2f="";
if(_2a){
_2a.innerHTML=_2f;
}
if(_2b){
_2b.innerHTML=_2f;
}
if(_2c){
_2c.innerHTML=_2f;
}
if(_2d){
_2d.innerHTML=_2f;
}
};
});
}
return new Constructor();
};
}
if(typeof Companion=="undefined"){
Companion=function(id){
function Constructor(){
var _31="companionSWF_"+id;
var _32=new deconcept.SWFObject(embeddedPlayerManager.BASE_LOCATION+"companion.swf",_31,"300","250","8","#000000");
_32.addParam("wmode","transparent");
_32.addParam("allowScriptAccess","always");
_32.write(id);
this.swf=document.getElementById(_31);
}
with(Constructor){
method("load",function(_33,_34){
this.swf.loadCompanion(_33,_34);
});
method("expand",function(){
this.swf.expand();
});
method("collapse",function(){
this.swf.collapse();
});
}
return new Constructor();
};
}
if(typeof embeddedPlayerManager=="undefined"){
embeddedPlayerManager=new EmbeddedPlayerManager();
this.onEmbeddedPlayerEvent=function(_35,_36,_37){
if(typeof embeddedPlayerManager.getPlayer(_35)=="object"&&typeof embeddedPlayerManager.getPlayer(_35)[_36]=="function"){
embeddedPlayerManager.getPlayer(_35)[_36](_37);
}else{
console.warn("Event type %s not supported.",_36);
}
};
this.videoplayer=function(_38,_39,_3a,_3b){
if(typeof _3b=="undefined"){
_3b={};
}
var _3c=window.onload;
window.onload=function(){
if(typeof _3c=="function"){
_3c();
}
var vp=embeddedPlayerManager.embedPlayer(_38,_39,_3a,_3b["fullscreen"],_3b["width"],_3b["height"],_3b["controls"]);
vp.setMetadataContainers(_3b["name"],_3b["subtitle"],_3b["description"],_3b["schedule"]);
};
};
this.doAfterLoad=function(f){
if(typeof f!="function"){
return;
}
var _3f=window.onload;
window.onload=function(){
if(typeof _3f=="function"){
_3f();
}
f();
};
};
}
embeddedPlayerManager.BASE_LOCATION="";
embeddedPlayerManager.TRACKING_JS="http://video.nbcuni.com/dynamic/ad_tracking.php?source=";

