Hi

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

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>';
break;
}

Then you should update the source into the div:

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

~G

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.