Jump to content

A little out there.


CrownOfSorrows

Recommended Posts

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]
Link to comment
Share on other sites

When you load the player just set the src to file name using $_GET

I'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 this

provided that id is what holds the file name

[code]
<EMBED SRC="<? echo $_GET['id'] ?>" WIDTH="262" HEIGHT="15" AUTOPLAY="false"></EMBED>
[/code]
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.