I'm building a video site for the radio station I work for and need to display a specified video on each refresh. The video will be an embed from youtube and sit in a <div> of it's own.

Unfortunately due to the servers I work on I can't user server side programming.

To give you an idea of how it looks (it might help) the sites on test at http://vikingfm.bauerweb.co.uk/vfmtv-test/index.html.

Any help really appreciated

7 Years
Discussion Span
Last Post by Graphix

Perhaps you should calculate a random number with javascript, between 0 and the amount of different videos you want to display. Then you should use a switch to decide which number corresponds with what source, for example:

var randomNumber = 0; // This you need to decide with a random function
var src = "";
switch (randomNumber) {
case 0 :
src = '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/1uwOL4rB-go&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/1uwOL4rB-go&hl=nl_NL&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>';

Then you should update the source into the div:

document.getElementById("myVidDiv").innerHTML = src;


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.