Re: Loop to another video after so many seconds
Posted: Fri Mar 11, 2011 7:19 pm
You can either do this using JavaScript or PHP. Do you have any controls in your pop-up window that need to remain onscreen? If so, you might want to consider loading your video 'page' into an iframe.
To display a new page using PHP, you'd just need to use something like the sleep() function and a redirection - something like:
Thinking about it, JavaScript would probably work better because you're not tying up your PHP script. If you want to use JavaScript you just need to write a timer script which then calls window.location(). When you display the next video, is there any order to them or is it random? If you need to send the value of the next video you could use PHP to dynamically write the value of video in your JavaScript function; you'd then just need to call the function using the onLoad="" attribute in the <body> tag of your page.
HTH,
Mecha Godzilla
To display a new page using PHP, you'd just need to use something like the sleep() function and a redirection - something like:
Code: Select all
$redirected_address = 'Location: http://www.mysite.com/show_video.php?video_id=' . $next_video;
header ($redirected_address);
exit();
HTH,
Mecha Godzilla