I work for the Museum of Science in Boston and have been trying to use VLC to display a 48 hour USA lightning video in an exhibit. The video usually is about 10 seconds long. What I want to do is loop it for 1/2 hour and update it every half hour with the latest video (same name). This runs 10-12 hours a day. The code shown below is what I am using. It sould loop, but it doesn't. I am using a recursive routine to repeat the video, but this eventually ends up stopping in from 3-15 minutes.
Code: Select all
<html>
<head><title>MUSEUM OF SCIENCE WEATHERWISE LIGHTNING DISPLAY</title>
<script language="JavaScript">
function recursivePlayer() // used because loop fails in VLC
{
var videoLength = document.video1.get_length();
videoLength = (Math.abs(videoLength/2)+1)*1000;
document.video1.play();
setTimeout("checkTime();recursivePlayer()",videoLength);
}
function checkTime() // Update video every half hour
{
var today = new Date();
var Minutes = today.getMinutes();
if (Minutes == 33 || Minutes == 3) {
getLatestVideo();
}
}
function getLatestVideo()
{
document.video1.clear_playlist(); // clear_playlist seems to need some time before loading a new file
setTimeout("document.video1.add_item('http://xxx/USAlightning.avi');",2000);
// document.video1.loop=1; // tried this with true and yes also. Doesn't cause an error, but doean't loop either
setTimeout("recursivePlayer()",3000);
}
</script>
</head>
<body bgcolor='black' onLoad="getLatestVideo()">
<embed type="application/x-vlc-plugin"
name="video1" autoplay="no" loop="yes" width="600" height="450" fullscreen='no'
/>
</OBJECT>
</body>
</html>
Timely responses would be greatly appreciated and yes, I've tried nightly builds too, but went back to 0.8.5.
Thanks in advance for all help.
Tim