Jump to content


Photo

A little out there.


  • Please log in to reply
3 replies to this topic

#1 CrownOfSorrows

CrownOfSorrows
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 August 2006 - 01:28 AM

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.


<?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


#2 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 05 August 2006 - 01:40 AM

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

<EMBED SRC="<? echo $_GET['id'] ?>" WIDTH="262" HEIGHT="15" AUTOPLAY="false"></EMBED>

:: gucci.com ::
:: blockbuster.com ::

--------------------

#3 CrownOfSorrows

CrownOfSorrows
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 August 2006 - 01:53 AM

Biggest thanks!  It worked right away.  Im fairly new to php so that small bit of help goes a long way!

#4 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 05 August 2006 - 01:56 AM

No problem
Glad it worked for you!!
:: gucci.com ::
:: blockbuster.com ::

--------------------




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users