Sean1989 Posted March 29, 2007 Share Posted March 29, 2007 Hey all i wondered if you could help me, im trying to get a video file to display if there is one using this code: $dir = "files/video/" .$review['topic_id'] . "/"; $files = array(); if(is_dir($dir)){ //Handle files $handle = opendir($dir); while($this_file = readdir($handle)){ if(is_file($dir . $this_file)){ $ext = strtolower(substr($this_file,-1)); if($ext == ".wmv"){ $files[] = $dir . $this_file; } } } closedir ($handle); } sort($files); //Alphabetise files $total_files = count($files); if($total_files !== 0){ print("<h2>Video</h2>\n"); //List Video print("<!--Video-->\n"); for($i = 0; $i < $total_files; $i++){ print("<a>video</a>"); } print("<br clear=\"all\">"); } I want it to either display the video as a link, or preferable actually display on the page as a plugin using this code: <OBJECT id='mediaPlayer' width="384" height="333" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <param name='fileName' value="http://eggynews.byethost18.com/files/video/22.wmv"> <param name='animationatStart' value='true'> <param name='transparentatStart' value='true'> <param name='autoStart' value="false"> <param name='showControls' value="true"> <param name='loop' value="true"> <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="384" height="333" src="http://eggynews.byethost18.com/files/video/22.wmv" autostart="true" designtimesp='5311' loop="true"> </EMBED> </OBJECT> <!-- ...end embedded WindowsMedia file --> <!-- begin link to launch external media player... --> <tr><td align='center'> <a href="http://eggynews.byethost18.com/files/video/22.wmv" style='font-size: 85%;' target='_blank'>Launch in external player</a> <!-- ...end link to launch external media player... --> hope someone can help Thanks In Advance Seán Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 29, 2007 Share Posted March 29, 2007 embed! convert files to flv and the use an flash plugin to display them! Quote Link to comment Share on other sites More sharing options...
Sean1989 Posted March 29, 2007 Author Share Posted March 29, 2007 embed! convert files to flv and the use an flash plugin to display them! I tried using flash before but it wouldn't work either. How would embed the flash as well? would it be similar to shown above? Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 29, 2007 Share Posted March 29, 2007 almost! http://www.google.co.za/search?hl=embed+videos Quote Link to comment Share on other sites More sharing options...
Sean1989 Posted March 29, 2007 Author Share Posted March 29, 2007 Would it look something like this..? if(is_file("files/videos/" . $review['topic_id'] . ".wmv")){ print("<EMBED SRC="URL" WIDTH="XXX" HEIGHT="XXX" AUTOSTART="False"></EMBED>"); } Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 29, 2007 Share Posted March 29, 2007 umm.. <embed src="http://www.site.com/flvplayer.swf" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file=http://www.site.co.za/flvideos/vidoe.flv&showdigits=true&autostart=true&bufferlength=10" height="370" width="450"> Quote Link to comment Share on other sites More sharing options...
Sean1989 Posted March 29, 2007 Author Share Posted March 29, 2007 umm.. <embed src="http://www.site.com/flvplayer.swf" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file=http://www.site.co.za/flvideos/vidoe.flv&showdigits=true&autostart=true&bufferlength=10" height="370" width="450"> Im using a .wmv file though, how would it code then? Quote Link to comment Share on other sites More sharing options...
Sean1989 Posted March 29, 2007 Author Share Posted March 29, 2007 I've got this so far... if(is_file("files/videos/" . $review['topic_id'] . ".wmv")){ print("<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="384" height="333" src=" . $files[$i] . "\">"" autostart="true" designtimesp='5311' loop="true"> </EMBED>"); } Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 29, 2007 Share Posted March 29, 2007 I dont know how the others do it.. but on upload it turns it to a flv.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.