Looking to display random Video but don't know how

The_Joker

BANNED
Joined
Apr 8, 2008
Messages
307
Reaction score
158
hi guys n girls, I have some .flv videos I want to randomly display on my blog when the page is refreshed, when the video is finished I don't want it to go to the next video.

I've had a look on google and can't find anything that helps.

the code I am using to display the current video is

Code:
		<script type="text/javascript">
			
			var so = new SWFObject("flvPlayer.swf?imagePath=movie.png&videoPath=movie.flv&autoStart=false&autoHide=false&autoHideTime=5&hideLogo=true&volAudio=60&newWidth=720&newHeight=540&disableMiddleButton=false&playSounds=true&soundBarColor=#0066cc&barColor=#0066cc&barShadowColor=0x91BBFB&subbarColor=0xffffff", "sotester", "640", "505", "9", "#efefef");
			so.addParam("allowFullScreen", "true");
			so.write("flashcontent");
			
		</script>


also I want to use the code above as the player I am using looks pretty good and hopefully i can keep the look of it while displaying the random vids

any one able to help?

thanks
 
Last edited:
if you had 3 videos use this...

it will give you a random number between 1 and 3, if you had 5 videos you would use (1,5)

call your videos movie1.flv, movie2.flv, etc do the same for your screen thumbnails too...

the php code below simply appends the random number generated to the filename movie...

hope that makes sense...

Code:
<?php $num = rand(1, 3); ?>
<script type="text/javascript">		
var so = new SWFObject("flvPlayer.swf?imagePath=movie<?php echo $num; ?>.png
&videoPath=movie<?php echo $num; ?>.flv
&autoStart=false
&autoHide=false
&autoHideTime=5
&hideLogo=true
&volAudio=60
&newWidth=720
&newHeight=540
&disableMiddleButton=false
&playSounds=true
&soundBarColor=#0066cc
&barColor=#0066cc
&barShadowColor=0x91BBFB
&subbarColor=0xffffff","sotester", "640", "505", "9", "#efefef");
so.addParam("allowFullScreen", "true");
so.write("flashcontent");
</script>

havent tested this just going off the top of my head! :)

hth ukescuba
 
got ya. I see how it works, I'll give it a try now

edit: hmmm still wouldn't work.. the number of the video seems to be random and working but the video doesn't play lol I'll keep looking, thanks for the help though
 
Last edited:
Aweesomee. It works sweeet, don't know what was wrong before. thank you
 
Back
Top