var channelname=null;var clipid="";var time="";var parameters="";var width,height,playerWidth,playerHeight,playerWidth,playerHeight,chatWidth,chatHeight,libraryWidth,libraryHeight,windowWidth,windowHeight;var layout=0,tabWidth=239;var minPlayerWidth=304;var minPlayerHeight=175;var minLibraryWidth=200;var minLibraryHeight=150;var minChatWidth=240;var minChatHeight=140;var aspectWidth=16;var aspectHeight=9;var enableTab=true;var result;var tryCount=0;var isHttps=false;var browseMode=true;var mode="&mode=idname";window.onload=function(){parseQueryString();initHttpsSettings();result=LSVideo.attemptHtmlEmbed();updateDimension();if(!result){if(BrowserDetect.browser=="Safari"){setTimeout(setUpParams,300)}else{if(BrowserDetect.browser=="Chrome"){setTimeout(setUpParams,10)}else{setUpParams()}}}};function initHttpsSettings(){isHttps=(window.document.location.protocol.toLowerCase()=="https:");if(!isHttps){document.getElementById("thumbnail").setAttribute("src","http://thumbnail.api.livestream.com/thumbnail?name=error")}}function setUpParams(){tryCount++;windowWidth=f_clientWidth();windowHeight=f_clientHeight();width=windowWidth;height=windowHeight;log("setUpParams : width = "+width);log("setUpParams : height = "+height);params=(window.location.href).split("?")[1];if(typeof(params)!="undefined"){aspectWidth=(params.search("aspectWidth")>0)?parseInt(params.match(/aspectWidth=([0-9])/)[1],10):16;aspectHeight=(params.search("aspectHeight")>0)?parseInt(params.match(/aspectHeight=([0-9])/)[1],10):9}if(windowWidth==0||windowHeight==0){if(tryCount<3){setTimeout(setUpParams,20);return}else{embedCodeSet()}}else{embedCodeSet()}fixForChrome()}function fixForChrome(){if(BrowserDetect.browser!=="Chrome"){return}var b=document.getElementsByTagName("object");for(var a=0;ab))){c=b}return a&&(!c||(c>a))?a:c}function clearVideo(){var a=document.getElementsByTagName("video");if(a.length==0){return}if(a[0].paused!=true){a[0].pause()}var b=document.getElementById("player");var c=document.getElementById("error_message");var d=document.getElementById("error-html5player");b.style.display="none";c.style.display="none";d.style.display="none"}function switchChannel(b){channelname=b;if(result){clearVideo();result=LSVideo.attemptHtmlEmbed()}else{var a=document.lsplayer;a.playChannel(channelname)}}function switchClip(c,b){if(typeof b!="undefined"){channelname=b}clipid=c;if(result){clearVideo();result=LSVideo.attemptHtmlEmbed()}else{var a=document.lsplayer;a.playClip(clipid,channelname)}}function setPlay(){if(!result){var a=document.lsplayer;a.setPlay()}}function getPlaybackTime(){if(!result){var a=document.lsplayer;return a.getTime()}}function setPause(){if(!result){var a=document.lsplayer;return a.setPause()}}function updateThumb(){thumbnail=document.getElementById("thumbnail");thumbnail.src="http://thumbnail.api.livestream.com/thumbnail?name="+channelname+"&t="+new Date().valueOf()}function updateDimension(){if(result){updateThumb();setInterval("updateThumb()",10000);if(self.innerHeight){browserWidth=self.innerWidth;browserHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){browserWidth=document.documentElement.clientWidth;browserHeight=document.documentElement.clientHeight}else{if(document.body){browserWidth=document.body.clientWidth;browserHeight=document.body.clientHeight}}}document.getElementById("error-html5player").style.width=browserWidth+"px";document.getElementById("error-html5player").style.height=browserHeight+"px";document.getElementById("thumbnail").setAttribute("width",browserWidth);document.getElementById("thumbnail").setAttribute("height",browserHeight)}}var LSVideo=new function(){var s,c,g,n,k,h;var j=true;this.attemptHtmlEmbed=function(){if(typeof h!=undefined){clearInterval(h)}if(/(iphone)|(ipad)|(ipod)/i.exec(navigator.userAgent)||/iphone=1/i.exec(window.location.search)){n=true}else{if(/android/i.exec(navigator.userAgent)||/android=1/i.exec(window.location.search)){n=false}else{if(isBlackBerryOS(navigator.userAgent)&&isRTSPSupportedBlackBerryOS(navigator.userAgent)){n=false}else{return false}}}s=channelname;c=clipid;g=document.getElementById("player");k=document.getElementById("error_message");errorDiv=document.getElementById("error-html5player");if(c){e()}else{o(s)}return true};function e(){d(s,function(t){if(!t.isMobileCompatible){if(c){k.innerHTML="This video clip is not mobile compatible."}else{k.innerHTML="This channel is live but not mobile compatible."}k.style.display="block";errorDiv.style.display="block";return}k.style.display="none";errorDiv.style.display="none";if(n){a(t)}else{p(t.androidUrl)}})}function a(u){var t,v="";if(j&&u.progressiveUrl&&c){t=u.progressiveUrl}else{if(c){t=u.httpUrl}else{t=r();v=' poster="'+f(s)+'"'}}g.innerHTML='';g.style.display="";g.style.width="100%";g.style.height="100%";g.style.background="#000"}function p(t){g.innerHTML='';g.style.display="block"}function m(){g.innerHTML="";k.innerHTML="This channel is not live. Only live streams and mobile compatible video clips appear on mobile devices.";g.style.display="none";k.style.display="block";errorDiv.style.display="block"}function o(u){var v;var t=function(){q(u,function(w){if(typeof v!=="undefined"&&v==w.isLive){return}if(w.isLive){e()}else{m()}v=w.isLive})};t();h=setInterval(t,5000)}function r(){return b(s)+"/3.0/playlist.m3u8"}function l(v,t){var w=new RegExp(v+"=([^&]*)","i");var u=w.exec(window.location.search);return u?u[1]:t}function b(t){return"http://x"+t.replace("_","-")+"x.api.channel.livestream.com"}function f(t){return"http://thumbnail.api.livestream.com/thumbnail?name="+t+"&r="+Math.random()}function d(u,w){var t=b(u)+"/3.0/getstream.json";var v=c?{id:c}:null;i.get(t,v,w)}function q(u,v){var t=b(u)+"/3.0/livestatus.json";i.get(t,{},v)}var i=(function(){var t=0,v,y,u,w=this;function x(C){var B=document.createElement("script"),A=false;B.src=C;B.async=true;B.onload=B.onreadystatechange=function(){if(!A&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){A=true;B.onload=B.onreadystatechange=null;if(B&&B.parentNode){B.parentNode.removeChild(B)}}};if(!v){v=document.getElementsByTagName("head")[0]}v.appendChild(B)}function z(A,C,D){y="?";C=C||{};for(u in C){if(C.hasOwnProperty(u)){y+=u+"="+C[u]+"&"}}var B="json"+(++t);w[B]=function(E){D(E);w[B]=null;try{delete w[B]}catch(F){}};x(A+y+"callback="+B+"&r="+Math.random());return B}return{get:z}}())};function displayCompanionBanners(b){try{parent.displayCompanionBanners(b)}catch(a){}}function LSShowVastCompanion(b){try{parent.LSShowVastCompanion(b)}catch(a){}}function lrDisplayCompanion(c,d,e,b,f){try{parent.lrDisplayCompanion(c,d,e,b,f)}catch(a){}}function embedCodeSet(){switch(layout){case -1:displayError("No Channel Name","The Channel Name is Required");break;case 0:minWidth=minPlayerWidth+minChatWidth;width=(widthheight)?height-minLibraryHeight:getPlayerHeight();libraryHeight=height-playerHeight;chatHeight=height;document.getElementById("layout0-player").style.width=playerWidth+"px";document.getElementById("layout0-player").style.height=playerHeight+"px";document.getElementById("layout0-chat").style.width=chatWidth+"px";document.getElementById("layout0-chat").style.height=chatHeight+"px";document.getElementById("layout0-library").style.width=libraryWidth+"px";document.getElementById("layout0-library").style.height=libraryHeight+"px";document.getElementById("layout0-player").innerHTML=createPlayer();document.getElementById("layout0-chat").innerHTML=createChat();document.getElementById("layout0-library").innerHTML=createLibrary();break;case 1:width=(widthheight)?height-minLibraryHeight:getPlayerHeight();libraryHeight=height-playerHeight;document.getElementById("layout1-player").style.width=playerWidth+"px";document.getElementById("layout1-player").style.height=playerHeight+"px";document.getElementById("layout1-library").style.width=libraryWidth+"px";document.getElementById("layout1-library").style.height=libraryHeight+"px";document.getElementById("layout1-player").innerHTML=createPlayer();document.getElementById("layout1-library").innerHTML=createLibrary();break;case 2:width=(widthheight)?height-minChatHeight:getPlayerHeight();chatHeight=height-playerHeight;document.getElementById("layout2-player").style.width=playerWidth+"px";document.getElementById("layout2-player").style.height=playerHeight+"px";document.getElementById("layout2-chat").style.width=chatWidth+"px";document.getElementById("layout2-chat").style.height=chatHeight+"px";document.getElementById("layout2-player").innerHTML=createPlayer();document.getElementById("layout2-chat").innerHTML=createChat();break;case 3:width=(width

Get Adobe Flash Player

Flash must be installed for you to view this video.

'}else{if(a<10){document.getElementById("layout"+layout).innerHTML='

Get Adobe Flash Player

Flash Player v 10 or above is required for you to view this video.

'}}if(BrowserDetect.browser=="Chrome"){document.body.style.overflowY="scroll";document.body.scrollTop=1;document.body.scrollTop=0;document.body.style.overflowY="hidden"}checkErrors();displayWidgets();initPostMessage()}function displayWidgets(){if(layout!=-1){document.getElementById("layout"+layout).style.display="block";document.getElementById("layout"+layout).style.width=width+"px";document.getElementById("layout"+layout).style.height=height+"px"}}function checkErrors(){if(BrowserDetect.browser=="Chrome"){return}if(windowWidthshare page.')}}function displayError(b,a){document.getElementById("error").style.display="block";document.getElementById("error-title").innerHTML=b;document.getElementById("error-message").innerHTML=a}function getPlayerHeight(){return Math.round(playerWidth*aspectHeight/aspectWidth)+25}function getDomain(){if(/wwwstaging.livestream.com/.test(window.location.href)){return(((isHttps)?"https":"http")+"://staging.livestream.com/")}return(((isHttps)?"https":"http")+"://cdn.livestream.com/")}function createPlayer(){var a=(layout==1)?true:false;var b=(layout==2)?true:false;return''}function createLsPlayer(){return''}function createLibrary(){showBorderLeft=(layout==3)?false:true;showBorderTop=false;return''}function createLsLibrary(){return''}function createChat(){showBorderLeft=(layout==0||layout==3)?false:true;showBorderTop=(layout==0)?true:false;return''}function createLsChat(){return''}function showChat(){document.getElementById("nav-chat").className="highlight";document.getElementById("nav-players").className="";document.getElementById("layout3-chat").style.left="0px";document.getElementById("layout3-library").style.left="-9999px";if(enableTab==false){document.getElementById("layout3-library").style.display="none";document.getElementById("layout3-chat").style.display="block";enableTab=true}return false}function showLibrary(){document.getElementById("nav-chat").className="";document.getElementById("nav-players").className="highlight";document.getElementById("layout3-chat").style.left="-9999px";document.getElementById("layout3-library").style.left="0px";if(enableTab==true){document.getElementById("layout3-chat").style.display="none";document.getElementById("layout3-library").style.display="block";enableTab=false}}var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(d){for(var a=0;a-1){var f=b.substring(g+h.length).split("?");var i=f[0].split("/");channelname=(i.length>0?i[0]:null);if(f.length>1){c=f[1].split("&");for(var d=0;dRTSP_SUPPORTED_OS_MAJOR_VERSION){return true}if(c==RTSP_SUPPORTED_OS_MAJOR_VERSION&&a>=RTSP_SUPPORTED_OS_MINOR_VERSION){return true}return false}function isBlackBerryOS(b){var a=/Blackberry/i.exec(b);return a||isBlackBerryPlayBook(b)}function isBlackBerryPlayBook(a){return/RIM Tablet OS/i.exec(a)}var LIVESTREAM_PREFIX="Livestream.";var CONTENT_TITLE="getContentTitle";var PLAYER_EMBED_ID="lsplayer";var IS_LIVE_EVENT="isLiveEvent";var originDomain;var playerID="";function livestreamPlayerCallback(a,c){var b=a;log(b);postMessageToTop(b,c)}function postMessageToTop(c,b){log("Posting message | message = "+c+" | value = "+b);var a={};if(c.indexOf(LIVESTREAM_PREFIX)==-1){c=LIVESTREAM_PREFIX+c}a.event=c;a.playerID=playerID;a.value=b;window.parent.postMessage(JSON.stringify(a),originDomain)}function addPostMessageListener(){if(window.addEventListener){addEventListener("message",postMessageListener,false)}else{attachEvent("onmessage",postMessageListener)}}function postMessageListener(b){if(b.origin!==originDomain){return}log("Received Message | "+b.data);var b=b.data;if(b==(LIVESTREAM_PREFIX+CONTENT_TITLE)){var a=getContentTitle();log("Content Title = "+a);postMessageToTop(CONTENT_TITLE,a)}}function getContentTitle(){var c=null;var a=getPlayer();if(a){try{c=a.getCurrentContentTitle()}catch(b){log(b)}}else{log("lsPlayerObj is null")}log("title = "+c);return c}function initPostMessage(){log("init postMessage");originDomain=getDomainFromUrl(decodeURIComponent(document.referrer));log("originDomain | "+originDomain);addPostMessageListener();playerID=""}function getPlayer(){return thisMovie(PLAYER_EMBED_ID)}function thisMovie(a){return document[a]}function getDomainFromUrl(b){var e=b.split("/"),a="";for(var c=0,d=e.length;c