Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help with playing videos via php
Old 06-13-2010, 02:38 PM Help with playing videos via php
Skilled Talker

Posts: 53
Trades: 0
Hey guys I need some help fixing my code. I'm trying to create a page where there is a list of videos (hosted on my server, the paths to the videos are in a mysql database) and when the user clicks on the link they are taken to a page where they can view the video (via JW player). Here is what I have thus far. Any suggestions would be appreciated.

PHP Code:
 
<?php
$sql 
mysql_query("SELECT * FROM videos ORDER by id DESC LIMIT 0,15");
while(
$row mysql_fetch_array($sql)){
$video_title $row['video_title'];
$video_path $row['video_path'];
$category $row['category'];
$description $row['description'];
$length $row['length'];
?>
 
<div id="links" > 
<div class="titlecell"><?php echo "<a href='player.php?player=$video_path'>$video_title</a>"?></div>
<div class="lengthcell"><?php echo "length: $length"?></div>
<div class="description"><?php echo $description?></div>
 
</div>
</div>
<?php
}
?>
worldy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-13-2010, 02:49 PM Re: Help with playing videos via php
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
and the problem is ?
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 06-13-2010, 03:32 PM Re: Help with playing videos via php
Skilled Talker

Posts: 53
Trades: 0
Ohh so the problem is how do I get from what I have in my frst post to showing the video on the target page. The code for the flash player on the target page is shown below. Basically where you see <?php echo ######; ?> is what I'm trying to figure out. how can I echo out the path of the video to be shown, and therefore play the video.

HTML Code:
 
<script type="text/javascript" src="mediaplayer/swfobject.js"></script>
<div id="1"></a> </div>
<script type="text/javascript">
var so = new SWFObject('mediaplayer/player.swf','mpl','562','450','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=<?php echo ######; ?>&autostart=true&screencolor=#000000&bufferlength=2');
so.addVariable('screencolor','#532401');
so.write('1');
</script>
 
worldy is offline
Reply With Quote
View Public Profile
 
Old 06-13-2010, 04:29 PM Re: Help with playing videos via php
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
The snippet you gave in the first post is valid. Given that the db query is correct, and that the content of your table is too.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Help with playing videos via php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33689 seconds with 12 queries