Jump to content

Embedding Videos ?


Sangha-08

Recommended Posts

Hi,

 

I am relatively new to "php" , and i was just wondering if someone could help me make a script .

 

Here's what i want to do :

 

I want to make 1 dynamic page called embed.php , i want it to embed every .flv video given to it ( for example : http://www.mydomain/embed.php?file=http://www.mydomain22.com/somerandomvideo.flv )

 

i want the page thats loaded to look something like this :

 

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="600" height="450" id="flvplayer" align="middle">

<param name="allowScriptAccess" value="sameDomain" />

<param name="allowFullScreen" value="true" />

<param name="movie" value="Get this part from the URL" />

<param name="loop" value="true" />

<param name="quality" value="high" />

<param name="bgcolor" value="#000000" />

<embed src="Get this part from the URL" loop="true" quality="high" bgcolor="#000000" width="600" height="450" name="flvplayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>

 

Please note : I'm 13 , have a good knowledge of html , dhtml , and run a anime video website. Please dont be harsh , and correct me when im wrong. Thank you

Link to comment
https://forums.phpfreaks.com/topic/102156-embedding-videos/
Share on other sites

more to the point, if you want to use a DB:

DB code--modify for your needs

CREATE TABLE `DB_NAME`.`table_movies` (
`id` INT( 4 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`movie_name` VARCHAR( 50 ) NOT NULL ,
`movie_url` VARCHAR( 80 ) NOT NULL ,
`movie_short_desc` VARCHAR( 250 ) NOT NULL ,
`movie_long_desc` VARCHAR( 500 ) NOT NULL ,
INDEX ( `movie_name` ) ,
UNIQUE (
`movie_url`
)
)ENGINE=MYISAM

PHP CODE Modify to your needs, adding the database connection info

<?php
$id = addslashes($_GET['id']);
$sql = "SELECT * FROM `table_movies` WHERE id='{$id}';";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$url = $row['movie_url'];
$output = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='600' height='450' id='flvplayer' align='middle'>
   <param name='allowScriptAccess' value='sameDomain' />
   <param name='allowFullScreen' value='true' />
   <param name='movie' value='{$url}' />
   <param name='loop' value='true' />
   <param name='quality' value='high' />
   <param name='bgcolor' value='#000000' />
   <embed src='{$url}' loop='true' quality='high' bgcolor='#000000' width='600' height='450' name='flvplayer' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>";
print $output;
?>

 

Link to comment
https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522899
Share on other sites

Whoa ! Thats a really quick reply ! Thanks !

I did not use jonsjava's code because it was too complicated and needed "mysql" ( i don't know anything about mysql ).

 

I decided to use 947740's code instead  , but it dose not seem to work. have i done anything wrong ?

 

<html>

<head>

</head>

<body>

 

<embed

src="http://www.jeroenwijering.com/embed/player.swf"

width="320"

height="250"

allowscriptaccess="always"

allowfullscreen="true"

flashvars="file=<?PHP $file = $_GET['file']?>"/>

 

</body>

 

</html>

 

I renamed the page's extenction to .php rather than .html , but it still dose not work ? can someone help me out ?

Link to comment
https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522920
Share on other sites

or, easier:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="600" height="450" id="flvplayer" align="middle">
   <param name="allowScriptAccess" value="sameDomain" />
   <param name="allowFullScreen" value="true" />
   <param name="movie" value="<?php print $_GET['file']; ?>" />
   <param name="loop" value="true" />
   <param name="quality" value="high" />
   <param name="bgcolor" value="#000000" />
   <embed src="<?php print $_GET['file']; ?>" loop="true" quality="high" bgcolor="#000000" width="600" height="450" name="flvplayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>

now, go to http://yourdomain.com/this_files_name.php?file=http://urltovideo.com/video.flv (example)

Link to comment
https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522943
Share on other sites

php applications  designed to create "files" shouldn't be html files you should have it distribute a pure .flv file in the php file via proper header modifications and so forth.  Then integrate that into an html file if needed.  When you add too much to a single function you limit the functionability to it later on.

Link to comment
https://forums.phpfreaks.com/topic/102156-embedding-videos/#findComment-522948
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.