Play MOVIES using PHP

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
alin
Forum Newbie
Posts: 4
Joined: Fri Dec 26, 2003 8:05 pm
Location: ROMANIA

Play MOVIES using PHP

Post 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.
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

like Gen-ik said, you have to make it through html, like this: http://www.strixs.com/demo_3d.php
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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>
User avatar
devork
Forum Contributor
Posts: 213
Joined: Fri Aug 08, 2003 6:44 am
Location: p(h) developer's network

Post by devork »

there is another language SMIL (realplayer.com)that can be used in webpages to play movies and other stuff.
alin
Forum Newbie
Posts: 4
Joined: Fri Dec 26, 2003 8:05 pm
Location: ROMANIA

Post by alin »

thanks, will let you know how things went
godami
Forum Newbie
Posts: 1
Joined: Wed Jan 14, 2004 9:06 pm

Post 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.
Post Reply