Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
1.2 kB
1
Indexable
Never
<html>
	<head>
	<title>IP Camera Test</title>
	<meta content="text/html; charset=utf-8" http-equiv="content-type">
	
	<script language="javascript">
		var img = new Image();
		var imgObj;
		
		function preload()
		{
			img.src='http://USER:PASS@IPCAMERA/tmpfs/auto.jpg?'+new Date;
		}
		
		function changesrc()
		{
			img1.src=img.src;
			preload();
			setTimeout(changesrc,3500);
		}
		
		function update()
		{
			imgObj = document.getElementById('img1');
			
			imgObj.src = img.src;
			img.src = "http://USER:PASS@IPCAMERA/tmpfs/auto.jpg?" + (new Date()).getTime();
		}
		
		function takeError()
		{
			img.src = "http://USER:PASS@IPCAMERA/tmpfs/auto.jpg?" + (new Date()).getTime();
		}
		
		function startonload()
		{
			img.src = "http://USER:PASS@IPCAMERA/tmpfs/auto.jpg?" + (new Date()).getTime();
			img.onerror=takeError;
			img.onload=update;
		}
		
		function load()
		{
			if (navigator.appName.indexOf("Microsoft IE Mobile") != -1)
			{
				preload();
				changesrc();
				return;
			}
			startonload();
		}
		</script>
	
	</head>
	<body onLoad="load()">
	
	<img id="img1" border="0" src="http://USER:PASS@IPCAMERA/tmpfs/auto.jpg">

	</body>
</html>