this.DEBUG=true;
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 EmbeddedPlayerUtil=="undefined"){
EmbeddedPlayerUtil={getElementPosition:function(e){
var _4=(typeof (e)=="string")?document.getElementById(e):e;
var _5=curtop=0;
if(_4.offsetParent){
_5=_4.offsetLeft;
curtop=_4.offsetTop;
while(_4=_4.offsetParent){
_5+=_4.offsetLeft;
curtop+=_4.offsetTop;
}
}
return {x:_5,y:curtop};
}};
}
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;
}
console.info("making shared instance of embeddedPlayerManager. this message should only appear once");
this.players=new Array();
this.companions=new Array();
this.initOnResize();
}
with(Constructor){
method("embedPlayer",function(_6,_7,_8,_9,_a,_b,_c,_d,_e,_f){
if(this.players[_6]){
return this.players[_6];
}
if(!document.getElementById(_6)){
var _10="";
}
var _11="";
var _12=384;
var _13=316;
if(_8){
if(typeof _8=="string"&&_8.indexOf("/")!=-1){
_11=_8;
}else{
_10=_8;
}
}
if(typeof _a=="number"&&typeof _b=="number"){
_12=_a;
_13=_b;
}
this.lastPlayer=new EmbeddedPlayer(this,_6,_7,_10,_11,_9,_12,_13,_c,_d,_e,_f);
this.players[_6]=this.lastPlayer;
return this.lastPlayer;
});
method("getCompanion",function(_14){
try{
if(!this.companions[_14]){
console.log("companion %s not found, creating...",_14);
this.companions[_14]=new Companion(_14);
}
return this.companions[_14];
}
catch(e){
}
});
method("getPlayer",function(_15){
try{
if(typeof _15=="undefined"){
return this.lastPlayer;
}
this.lastPlayer=this.players[_15];
return this.lastPlayer;
}
catch(e){
}
});
method("pauseAll",function(){
try{
for(var i in this.players){
if(this.players[i].id){
this.players[i].pause();
}
}
}
catch(e){
}
});
method("setActiveFullscreen",function(_17){
this.fullscreenPlayer=_17;
});
method("unFullscreen",function(){
this.fullscreenPlayer.fullscreen(false);
});
method("updatePositions",function(){
for(var i in this.players){
var _19=this.players[i];
if(_19.id){
var _1a=EmbeddedPlayerUtil.getElementPosition("placeholder_"+_19.id);
_19.container.style.left=_1a.x+"px";
_19.container.style.top=_1a.y+"px";
}
}
});
method("initOnResize",function(){
var _1b=this;
if(typeof (window.onresize)!="function"){
window.onresize=function(){
_1b.updatePositions();
};
}else{
if(!this.oldResize){
this.oldResize=window.onresize;
}
window.onresize=function(){
_1b.oldResize();
_1b.updatePositions();
};
}
});
method("resetOnResize",function(){
if(this.oldResize){
window.onresize=this.oldResize;
}else{
window.onresize=null;
}
this.initOnResize();
});
}
return new Constructor();
};
}
if(typeof EmbeddedPlayer=="undefined"){
EmbeddedPlayer=function(_1c,_1d,_1e,_1f,_20,_21,_22,_23,_24,_25,_26,_27){
function Constructor(){
this.manager=_1c;
this.id=_1d;
this.onMetadata;
this.onClearMetadata;
this.companion;
this.swf;
this.container;
this.trackingiframe;
this.width=_22;
this.height=_23;
this.isFullscreen=false;
this.isFullscreenEnabled=(_21==true);
this.isPlayingAd=false;
if(!document.getElementById("trackingiframe")){
console.log("Tracking IFrame not found, adding.");
var _28=document.createElement("iframe");
with(_28){
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(_28);
}
this.trackingiframe=document.getElementById("trackingiframe");
var _29="player_"+_1d;
var _2a=new deconcept.SWFObject(embeddedPlayerManager.BASE_LOCATION+"embedded.swf",_29,null,null,"8","#000000",true);
_2a.addParam("allowScriptAccess","always");
_2a.addParam("wmode","opaque");//11-15-2006
_2a.addVariable("BASE_LOCATION",embeddedPlayerManager.BASE_LOCATION);
if(_1f){
_2a.addVariable("deepLinkID",_1f);
}
if(_20){
_2a.addVariable("deepLinkPath",_20);
}
if(_24){
_2a.addVariable("videoControls",_24);
}
if(_25!=undefined){
_2a.addVariable("exitFullscreenOnVideoComplete",_25);
}
if(_26){
_2a.addVariable("overrideKeyword",_26);
}
if(_27){
_2a.addVariable("overrideVideoID",_27);
}
_2a.addVariable("playerID",_1d);
this.companion=embeddedPlayerManager.getCompanion(_1e);
if(this.isFullscreenEnabled){
this.container=document.createElement("div");
var _2b="container_"+this.id;
this.container.id=_2b;
this.container.className="fullscreenPlayer";
document.body.appendChild(this.container);
with(this.container.style){
position="absolute";
width=_22+"px";
height=_23+"px";
margin="0";
padding="0";
backgroundColor="#000";
border="none";
}
var _2c=document.createElement("div");
_2c.id="placeholder_"+this.id;
document.getElementById(_1d).appendChild(_2c);
with(_2c.style){
width=_22+"px";
height=_23+"px";
margin="0";
padding="0";
border="none";
}
var _2d=EmbeddedPlayerUtil.getElementPosition("placeholder_"+this.id);
this.container.style.left=_2d.x+"px";
this.container.style.top=_2d.y+"px";
_2a.setAttribute("width","100%");
_2a.setAttribute("height","100%");
_2a.write(_2b);
}else{
_2a.setAttribute("width",_22);
_2a.setAttribute("height",_23);
_2a.write(_1d);
}
this.swf=document.getElementById(_29);
}
with(Constructor){
method("onFullscreen",function(_2e){
if(typeof _2e!="boolean"){
return;
}
if(!this.isFullscreenEnabled){
console.warn("Fullscreen not enabled for this player.");
return;
}
if(_2e==this.isFullscreen){
return;
}
this.isFullscreen=_2e;
if(this.isFullscreen){
this.manager.setActiveFullscreen(this);
var _2f=this;
window.onresize=function(){
_2f.goFullScreen();
};
this.goFullScreen();
}else{
var c=this.container;
with(c.style){
top=left=right=bottom="";
}
var _31=EmbeddedPlayerUtil.getElementPosition("placeholder_"+this.id);
c.style.width=this.width+"px";
c.style.height=this.height+"px";
c.style.left=_31.x+"px";
c.style.top=_31.y+"px";
if(navigator.userAgent.toLowerCase().indexOf("firefox")==-1){
if(document.documentElement){
if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){
document.documentElement.style.overflow="visible";
document.body.style.overflow="visible";
}else{
document.documentElement.style.overflow="";
}
}else{
document.body.style.overflow="";
}
}
window.onscroll=function(){
};
this.manager.resetOnResize();
if(!document.all){
window.scrollTo(0,this.lastScrollPos);
}
}
});
method("goFullScreen",function(){
var c=this.container;
var _33=0;
if(navigator.userAgent.toLowerCase().indexOf("firefox")==-1){
if(document.documentElement&&document.documentElement.scrollTop){
document.documentElement.style.overflow="hidden";
_33=document.documentElement.scrollTop;
}else{
if(document.body.scrollTop){
if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){
document.body.style.overflow="visible";
}else{
document.body.style.overflow="hidden";
}
_33=document.body.scrollTop;
}
}
}else{
this.lastScrollPos=window.pageYOffset;
}
var ch=0;
var cw=0;
if(typeof (window.innerWidth)=="number"){
ch=window.innerHeight;
cw=window.innerWidth;
}else{
if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
ch=document.documentElement.clientHeight;
cw=document.documentElement.clientWidth;
}else{
if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
ch=document.body.clientHeight;
cw=document.body.clientWidth;
}
}
}
with(c.style){
if(document.all&&!window.opera){
height=ch+"px";
width=cw+"px";
}else{
height="100%";
width="100%";
}
left="0px";
right="0px";
bottom="0px";
top=_33+"px";
}
window.onscroll=function(){
window.scrollTo(0,_33);
};
window.onscroll();
});
method("onPlayVideo",function(_36){
var _37=this.isPlayingAd;
this.isPlayingAd=_36.isAd;
if(_37&&!this.isPlayingAd){
this.companion.collapse();
}
});
method("onExecuteTrackingJS",function(_38){
if(typeof embeddedPlayerManager.TRACKING_JS=="string"){
this.trackingiframe.src=embeddedPlayerManager.TRACKING_JS+_38;
}
});
method("onLoadCompanion",function(evt){
this.companion.load(evt.sourceURL,evt.linkURL);
});
method("play",function(){
try{
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.playVideo();
}
catch(e){
}
});
method("pause",function(){
try{
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.pauseVideo();
}
catch(e){
}
});
method("playVideoByPathID",function(_3a,_3b,_3c){
try{
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.playVideoByPathID(_3a,_3b,_3c);
}
catch(e){
}
});
method("playVideoByPath",function(_3d){
try{
if(this.isPlayingAd){
console.warn("Can't navigate during ads");
return;
}
this.swf.playVideoByPath(_3d);
}
catch(e){
}
});
method("setMetadataContainers",function(_3e,_3f,_40,_41){
if(typeof (_3e)=="string"){
_3e=document.getElementById(_3e);
}
if(typeof (_3f)=="string"){
_3f=document.getElementById(_3f);
}
if(typeof (_40)=="string"){
_40=document.getElementById(_40);
}
if(typeof (_41)=="string"){
_41=document.getElementById(_41);
}
this.onMetadata=function(_42){
if(_3e){
_3e.innerHTML=_42.name;
}
if(_3f){
_3f.innerHTML=_42.subtitle;
}
if(_40){
_40.innerHTML=_42.description;
}
if(_41){
_41.innerHTML=_42.schedule;
}
};
this.onClearMetadata=function(){
var _43="";
if(_3e){
_3e.innerHTML=_43;
}
if(_3f){
_3f.innerHTML=_43;
}
if(_40){
_40.innerHTML=_43;
}
if(_41){
_41.innerHTML=_43;
}
};
});
}
return new Constructor();
};
}
if(typeof Companion=="undefined"){
Companion=function(id){
function Constructor(){
var _45="companionSWF_"+id;
var _46=new deconcept.SWFObject(embeddedPlayerManager.BASE_LOCATION+"companion.swf",_45,"300","250","8","#000000");
_46.addParam("wmode","transparent");
_46.addParam("allowScriptAccess","always");
_46.write(id);
this.swf=document.getElementById(_45);
}
with(Constructor){
method("load",function(_47,_48){
try{
this.swf.loadCompanion(_47,_48);
}
catch(e){
}
});
method("expand",function(){
try{
this.swf.expand();
}
catch(e){
}
});
method("collapse",function(){
try{
}
catch(e){
}
});
}
return new Constructor();
};
}
if(typeof embeddedPlayerManager=="undefined"){
embeddedPlayerManager=new EmbeddedPlayerManager();
this.onEmbeddedPlayerEvent=function(_49,_4a,_4b){
if(typeof embeddedPlayerManager.getPlayer(_49)=="object"&&typeof embeddedPlayerManager.getPlayer(_49)[_4a]=="function"){
embeddedPlayerManager.getPlayer(_49)[_4a](_4b);
}else{
console.warn("Event type %s not supported.",_4a);
}
};
this.videoplayer=function(_4c,_4d,_4e,_4f){
if(typeof _4f=="undefined"){
_4f={};
}
var _50=window.onload;
window.onload=function(){
if(typeof _50=="function"){
_50();
}
var vp=embeddedPlayerManager.embedPlayer(_4c,_4d,_4e,_4f["fullscreen"],_4f["width"],_4f["height"],_4f["controls"],_4f["exitFullscreenOnVideoComplete"]);
vp.setMetadataContainers(_4f["name"],_4f["subtitle"],_4f["description"],_4f["schedule"],_4f["catalog"],_4f["id"],_4f["path"],_4f["streamName"],_4f["allowPreroll"],_4f["usOnly"],_4f["keywordContainer"],_4f["suppressTimerContainer"],_4f["thumbSmallContainer"],_4f["thumbLargeContainer"]);
};
};
this.doAfterLoad=function(f){
if(typeof f!="function"){
return;
}
var _53=window.onload;
window.onload=function(){
if(typeof _53=="function"){
_53();
}
f();
};
};
}
embeddedPlayerManager.BASE_LOCATION="";
embeddedPlayerManager.TRACKING_JS="http://video.nbcuni.com/dynamic/ad_tracking.php?source=";

