Skip to content

Instantly share code, notes, and snippets.

@Leen15
Created August 30, 2016 18:09
Show Gist options
  • Save Leen15/efebbaf202a69239eba4b5857aafd322 to your computer and use it in GitHub Desktop.
Save Leen15/efebbaf202a69239eba4b5857aafd322 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Cam</title>
</head>
<script type="application/javascript">
var countRefreshOtherVideo = 0;
var count = Math.floor(Math.random() * 1000);
var streamAddress = "scripts/ShowCamera.php?ip=" + IP_Pressed + "&mode=" + GetModeByIP(IP_Pressed);
function load_video() {
setTimeout("reload_image()", 30);
}
function reload_image() {
var xx = new Image();
xx.src = streamAddress + "&count=" + count;
count++;
document.getElementById("VideoStream1").src = xx.src;
if (countRefreshOtherVideo == 10) {
// console.log('aggiorno video secondari');
xx.src = "scripts/ShowCamera.php?ip=" + $('#VideoStream2').attr("currentIP") + "&count=" + count + "&mode=" + GetModeByIP($('#VideoStream2').attr("currentIP")) + "&thumb";
document.getElementById("VideoStream2").src = xx.src;
xx.src = "scripts/ShowCamera.php?ip=" + $('#VideoStream3').attr("currentIP") + "&count=" + count + "&mode=" + GetModeByIP($('#VideoStream3').attr("currentIP")) + "&thumb";
document.getElementById("VideoStream3").src = xx.src;
xx.src = "scripts/ShowCamera.php?ip=" + $('#VideoStream4').attr("currentIP") + "&count=" + count + "&mode=" + GetModeByIP($('#VideoStream4').attr("currentIP")) + "&thumb";
document.getElementById("VideoStream4").src = xx.src;
xx.src = "scripts/ShowCamera.php?ip=" + $('#VideoStream5').attr("currentIP") + "&count=" + count + "&mode=" + GetModeByIP($('#VideoStream5').attr("currentIP")) + "&thumb";
document.getElementById("VideoStream5").src = xx.src;
countRefreshOtherVideo = 0;
}
countRefreshOtherVideo++;
}
</script>
<body>
<div>
<img alt="video" id="VideoStream1" onload="load_video()" currentip="" />
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment