Jump to content

Embedded Video


Ell20

Recommended Posts

Hi,

 

My users can upload videos to my site and stores the name of the video into the database.

 

Is there anyway in which I can create a series of links for each of the videos they have uploaded (I can do this with while statement) which when clicked opens a popup with the embedded video?

 

Ive had a look on around but couldnt find much.

 

Any help would be appreciated

 

Cheers

Link to comment
Share on other sites

Ok so I think I understand what you're doing.

 

Query the database and select the videos where the username that uploaded it is the same username.

 

<?php
$get_videos = mysql_query("SELECT * FROM `database` WHERE `username`='exampleusername'"); // Replace exampleusername with maybe a value that contains a dynamic username. In the url you could maybe have a option that says user=username and then it would get all the videos equal 'username'

while ($video = mysql_fetch_array($get_videos)) {
// echo the links here
}
?>

 

Hope that helps.

Link to comment
Share on other sites

Basically I have this at the moment which prints out the links:

 

<?php 
$sql4 = "SELECT video_name, description FROM videos WHERE user_id = '$userid' AND validate = '1'";
$result4 = mysql_query($sql4);
$i = 1;
while ($row4 = mysql_fetch_assoc($result4)) {
$video = $row4['video_name'];
$description = $row4['description'];
echo "<a href=\"../uploaded_videos/{$video}\" title=\"{$description}\" target=\"_blank\">Link $i</a>"." ";

$i ++;
}	  
?>

 

This opens a pop up window which plays in Mozilla but not IE.

So what I think I need is like a YouTube kind of thing where its embedded into a page and it plays the video in a little pop up window.

 

Cheers

Link to comment
Share on other sites

Ok sure,

 

in the page that gets opened up just use this code:

 

<OBJECT id="VIDEO" width="320" height="240" 
style="position:absolute; left:0;top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">

<PARAM NAME="URL" VALUE="your file or url">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="none">
<PARAM name="PlayCount" value="9999">
</OBJECT>

 

That embeds a video player in to the page. Just change the line

<PARAM NAME="URL" VALUE="your file or url">

change the value to the url of the video you're playing.

Link to comment
Share on other sites

I tried that but it still dosent seem to work in IE??

 

With this method surely it wont work as there are lots of videos uploaded thus the .html file is static with the name entered into the page?

 

Cheers

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.