Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hub Webcam Display
// Hub Radioplayer Webcam Script
var timeout = 2.5;
var webcam_t;
var img_num = "1"
var img_loc_start = "http://www.hubradio.co.uk/webcam/studio"
var img_loc_end = ".jpg"
var img_height = 237;
var img_width = 315;
function switch_webcam(img_select) {
switch(img_select) {
case '1':
img_num = "1";
break;
case '2':
img_num = "2";
break;
case 'B', 'b', '3':
img_num = "3";
break;
default:
img_num = "2";
}
clearTimeout(webcam_t);
start_webcam();
}
function start_webcam() {
var tmp = new Date();
tmp = "?"+tmp.getTime()
document.images["webcam"].src=img_loc_start+img_num+img_loc_end+tmp;
webcam_t = setTimeout("start_webcam()", timeout*1000)
}
// window.onload=start_webcam;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.