Page 1 of 1

Play MOVIES using PHP

Posted: Fri Dec 26, 2003 8:05 pm
by alin
Hello,

I have to play large video files (10-60 minutes) into my website. I will use PHP/Mysql when developing my site but I don't know anything about the movie playing part.

Anyone can help me ? How can I play movie files ? What format you say it's the best ?

Please notice that I will have to make the movies myself as they will be some tutorials stuff.

Posted: Sat Dec 27, 2003 3:59 am
by Gen-ik
This isn't a PHP thing it's an HTML thing. You will need to embed the movie into your HTML page, probaly using the <object> tag.

For big movies though I would recommend streaming them with RealVideo or something because no one will hang around waiting for a 10 minute long movie to load.

Another alternative would be to use Flash to stream the video, I know Flash MX has some very good video streaming options.

Posted: Sat Dec 27, 2003 1:13 pm
by AVATAr
like Gen-ik said, you have to make it through html, like this: http://www.strixs.com/demo_3d.php

Posted: Sat Dec 27, 2003 1:51 pm
by Gen-ik
Here you go... I pulled out the <embed> object for you. This is one of the things you can use to play your movie(s). Just replace "yourMovie.mov" which the name of your .mov file (if you are using them) and obviously change the width="" and height="" values to match your movie.

Code: Select all

<embed src="yourMovie.mov" width="320" height="272" autoplay="false" loop="false" controller="true" playeveryframe="false" cache="true" scale="TOFIT" bgcolor="#000000" kioskmode="false" targetcache="false" pluginspage="http://www.apple.com/quicktime/"></embed>

Posted: Sat Dec 27, 2003 3:37 pm
by devork
there is another language SMIL (realplayer.com)that can be used in webpages to play movies and other stuff.

Posted: Tue Dec 30, 2003 4:49 pm
by alin
thanks, will let you know how things went

Posted: Wed Jan 14, 2004 9:06 pm
by godami
Try this:

Add a new column "video_name varchar(30)" to your MySQL table and add some values like: smt.avi - then create the php file:
<?php
...
$sql ="select video_name from $table_name where ..."
....
while ($row =mysql_fetch_array($result)) {
$video_name = $row['video_name'];
}
if ($video_name != "") {
echo "<a href=\"$video_name\">$video_name </a><br>";
}
?>

If you click on the link the video should be played - You've got to have the required plugins of course.