CrownOfSorrows Posted August 5, 2006 Share Posted August 5, 2006 This question is a little different than you’re usual. I want to create an online media player for radio shows. I want to be able to click on the show link and have the player change the file that it’s requesting to that episode. The links end up being player2.php?id=rhr6.mp3 just like I want, but I want the name of the file to change to rhr6 in the QuickTime audio player. I hope that makes some scene. It should be to hard. Any thoughts, or If you dont get it can I clarify. Heres the code that creates the links based on the files in the folder, and then at the bottom the audio part that I want to change.[code]<?php/* Information: A seperate window for .mp3 file playing, built for online radio shows.*/ echo "<table style='padding-left: 0px; width: 100%;' border='0' cellspacing='0' cellpadding='0'>";//The path for the show list $dirpath = "feignews/shows/rhr"; $dh = opendir($dirpath); while (false !== ($file = readdir($dh))) {//Makes sure to not show subdirectories if (!is_dir("$dirpath/$file")) {//Creates link and file name echo "<tr><td class='col-4' scope='col' width='100%'><span class='nav4'><a href='player2.php?id=". ($file) ."'>". htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file))) . "</a></span></td></tr>"; }}echo "</table>"; closedir($dh); //Close Select?> </div></div><div id="scrollArea"> <div id="scroller"></div></div></td> <td style="padding-left:10px;" valign="top" bgcolor="#F2F2F2" scope="col"><img src="/feignews/img/amigabanner.jpg" alt="Amiga" class="elegantborder"><br /><br /><br /> <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"WIDTH="262" HEIGHT="15" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"><PARAM name="SRC" VALUE="<?php switch($id) { default: echo('ag.mp3');break; case "$whatdoidohere": echo('$togetitright');} ?> "><PARAM name="AUTOPLAY" VALUE="false"><EMBED SRC="ag.mp3" WIDTH="262" HEIGHT="15" AUTOPLAY="false"></EMBED></OBJECT[/code] Quote Link to comment Share on other sites More sharing options...
Drumminxx Posted August 5, 2006 Share Posted August 5, 2006 When you load the player just set the src to file name using $_GETI'm not sure of the syntax of loading quicktime, you may already have it or you can find it on the web I'm sure but it would go something like thisprovided that id is what holds the file name[code]<EMBED SRC="<? echo $_GET['id'] ?>" WIDTH="262" HEIGHT="15" AUTOPLAY="false"></EMBED>[/code] Quote Link to comment Share on other sites More sharing options...
CrownOfSorrows Posted August 5, 2006 Author Share Posted August 5, 2006 Biggest thanks! It worked right away. Im fairly new to php so that small bit of help goes a long way! Quote Link to comment Share on other sites More sharing options...
Drumminxx Posted August 5, 2006 Share Posted August 5, 2006 No problemGlad it worked for you!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.