PlayOn          var uiwebview = false; var pageURL = window.location.href; if (window.navigator.userAgent.indexOf("Android") != -1) { window.location.href = "http://web.archive.org./web/20101001235746/http://m.playon.tv/android.html"; } if (pageURL.indexOf("uiwebview=true") == -1) { if (window.navigator.userAgent.indexOf("iPad") != -1 && window.navigator.standalone != true) { window.location.href = "http://web.archive.org./web/20101001235746/http://m.playon.tv/install/ipad.html"; //window.location.href = "http://web.archive.org./web/20101001235746/http://www.playon.tv/mobile/iphone/"; //REMOVE to enable iPad } if (window.navigator.userAgent.indexOf("iPhone") != -1 || window.navigator.userAgent.indexOf("iPod") != -1) { if (window.navigator.userAgent.indexOf("OS 4_0 like Mac OS X") != -1 && window.navigator.userAgent.indexOf("8A293") != -1) { //do not nav to the install page since this UA has a bug which causes the browser to crash in full screen mode } else { if (window.navigator.standalone != true) { if (window.navigator.userAgent.indexOf("OS 3_") == -1) { window.location.href = "http://web.archive.org./web/20101001235746/http://m.playon.tv/install"; } else { window.location.href = "http://web.archive.org./web/20101001235746/http://m.playon.tv/install/index3.0.html"; //iOS 3.0 cannot handle media orientation css attribute } } } } } else { uiwebview = true; } var xmlhttp2=false; //var previousWanIp = getCookie("previousWanIp"); var previousUdn = getCookie("previousUdn"); var currentWanIpForUdn = ""; var globalIpArray = new Array(); var discoveredPcArray = new Array(); var pcFoundcount = 0; var pcListReturned = false; var remoteIpIndex; //if (previousUdn == "87a362b9-158b-4614-a764-268615162fa2") { //alert(window.navigator.userAgent); //REMOVE //} function doLoadStuff() { //addComputer("Damon's PC1", 0); //addComputer("Damon's PC1", 1); //addComputer("Damon's PC1", 2); //addComputer("Damon's PC1", 3); //addComputer("Damon's PC1", 4); //addComputer("Damon's PC1", 5); //addComputer("Damon's PC1", 6); //addComputer("Damon's PC1", 7); //addComputer("Damon's PC1", 8); document.getElementById("status").innerHTML = "Searching..."; setTimeout ("noPCFound()", 10000); xmlhttp2 = setupHttpRequest(xmlhttp2); xmlhttp2.open("GET", "http://web.archive.org./web/20101001235746/http://m.playon.tv/q.php?rid=" + Math.random(),true); xmlhttp2.onreadystatechange=function() { if (xmlhttp2.readyState==4) { setResult(xmlhttp2.responseText); } } xmlhttp2.send(null); } function setupHttpRequest(xmlhttp) { if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } return xmlhttp; } function getCurrentWanIp(previousUdn) { var xmlhttp2 = setupHttpRequest(xmlhttp2); xmlhttp2.open("GET", "http://web.archive.org./web/20101001235746/http://m.playon.tv/udn2ip.php?udn=" + previousUdn + "&rid=" + Math.random(),false); xmlhttp2.send(null); if (xmlhttp2.responseText.indexOf("error") == -1 && xmlhttp2.responseText.indexOf("Error") == -1 && xmlhttp2.responseText.indexOf(":") != -1 && xmlhttp2.responseText.indexOf(".") != -1) { return xmlhttp2.responseText; } else { return ""; } } function DiscoveredPC() { this.name; this.udn; this.wanip; this.lanip; this.navip; } function addComputer(computerName, id) { pcFoundcount++; document.getElementById("computerlist").innerHTML += "
  • " + computerName + "
  • "; document.getElementById("status").innerHTML = "PlayOn PCs Found!"; } function setResult(s) { if (s.indexOf("error") != -1) { document.getElementById("status").innerHTML = "PlayOn Server Error"; return; } if (s.indexOf("|") != -1) { globalIpArray = s.substring(0, s.length - 1).split("|"); pcListReturned = true; } if (previousUdn != "") { currentWanIpForUdn = getCurrentWanIp(previousUdn); if (currentWanIpForUdn != "") { globalIpArray.push(currentWanIpForUdn); remoteIpIndex = globalIpArray.length-1; } } /*if (previousWanIp != "" && currentWanIpForUdn == "") { globalIpArray.push(previousWanIp); remoteIpIndex = globalIpArray.length-1; }*/ var image = ""; for (var i = 0; i < globalIpArray.length; i++) { if (globalIpArray[i].length == 0) continue; image += generateImage(i, "http://" + globalIpArray[i] + "/images/search.png?rid=" + Math.random()); } document.getElementById("searchimage").innerHTML = image; } function noPCFound() { if (pcFoundcount == 0) { document.getElementById("status").innerHTML = "No PC Found!"; if (!areCookiesEnabled()) { alert("PlayOn Mobile has detected that your browser does not have cookies enabled. Cookies must be enabled for your browser to pair with a PlayOn PC for remote access."); } else if (!pcListReturned) { //not on a network which has ever had PlayOn Installed if (previousUdn == ""){ //has probably never connected to a PlayOn PC from this device alert("No PlayOn PC Found. The first time you access PlayOn from this device, it must be locally connected to the same Wi-Fi network as a PC which has PlayOn installed. You can install PlayOn by going to www.playon.tv on your PC."); } else { //has previously connected to a PlayOn PC from this device alert("No PlayOn PC Found. If you already have PlayOn installed on your PC at home, make sure it's running — you can check its status in PlayOn Settings."); } } else { //on a network which has previously had PlayOn installed and running alert("No PlayOn PC Found. If you already have PlayOn installed on your PC, make sure it's running — you can check its status in PlayOn Settings."); } } } function connectToPC(id) { //setCookie("previousWanIp", discoveredPcArray[id].wanip.split("http://")[1]); //need to unescape?? setCookie("previousUdn", discoveredPcArray[id].udn); window.location.href = discoveredPcArray[id].navip + "?udn=" + discoveredPcArray[id].udn + "&rid=" + Math.random(); //var navUrl = "http://web.archive.org./web/20101001235746/http://m.playon.tv/transition.html?navTo=" + discoveredPcArray[id].navip + "?udn=" + discoveredPcArray[id].udn; // + "&rid=" + Math.random(); //window.location.href = navUrl; } function setCookie(sName, sValue) { date = new Date(); date.setDate(date.getDate() + 365); document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString(); } function getCookie(sName) { var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } return ""; } function areCookiesEnabled() { var r = false; var randomValue = Math.random(); setCookie("testing", randomValue); if (getCookie("testing") == randomValue) { r = true; } return r; } function insertJS(id) { var headID = document.getElementsByTagName("head")[0]; var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = "http://" + globalIpArray[id] + "/js/search.js?id=" + id + "&rid=" + Math.random(), id; headID.appendChild(newScript); } function generateImage(id, src) { var image = '' + '\n\n'; return image; } function alreadyInDiscoveredList(udn) { for (var i = 0; i < discoveredPcArray.length; i++) { if (udn == discoveredPcArray[i].udn) { discoveredPcArray[i].navip = discoveredPcArray[i].lanip; return true; } } return false; } function scriptLoaded(id) { //if (true) { //Good test of removing the duplicate UDN PC (remote and local copy of same) if (!alreadyInDiscoveredList(eval("getUDN_" + id)())) { var currentIndex = discoveredPcArray.length; discoveredPcArray[currentIndex] = new DiscoveredPC(); discoveredPcArray[currentIndex].name = eval("getPCName_" + id)(); discoveredPcArray[currentIndex].udn = eval("getUDN_" + id)(); discoveredPcArray[currentIndex].wanip = eval("getRemoteAccessURL_" + id)(); discoveredPcArray[currentIndex].lanip = eval("getLocalAccessURL_" + id)(); discoveredPcArray[currentIndex].navip = discoveredPcArray[currentIndex].lanip; /*if (discoveredPcArray[currentIndex].wanip != "") { setCookie("previousWanIp", discoveredPcArray[currentIndex].wanip.split("http://")[1]); //need to unescape?? } */ if (previousUdn == "") { setCookie("previousUdn", discoveredPcArray[currentIndex].udn); } if (id == remoteIpIndex) { discoveredPcArray[currentIndex].navip = discoveredPcArray[currentIndex].wanip; } addComputer("PlayOn (" + eval("getPCName_" + id)() + ")", currentIndex); //+ " (" + globalIpArray[id].split(":")[0] + ")", currentIndex); } } function reLoadPage() { location.reload(true) }         PlayOn PCs   JavaScript not Enabled!

              Visit www.playon.tv     document.getElementById("status").innerHTML = "Searching...";