Click to See Complete Forum and Search --> : need HELP! passing (variable).mp3 to new window


_some_guy
04-10-2006, 02:33 AM
I have a link, that when I click on it, I would like to open a window, and play an MP3 file, by passing the MP3 filename to the new window.

I am currently using the following CODE (in the new window's .HTM file), to play the MP3s - it works great, but I have over 200 MP3s to do this with, and I don't want to make 200+ .HTM pages.

<object id="mediaplayer1" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject" width="330" height="45">
<param name="filename" value="(url of filename).mp3">
<param name="animationatstart" value="1">
<param name="transparentatstart" value="1">
<param name="autostart" value="1">
<param name="showcontrols" value="1">
<param name="showpositioncontrols" value="1">
<param name="volume" value="0">
</object>

Any help would be greatly appreciated!
Thanks.
:)

tegraphix
04-10-2006, 08:11 PM
Your best bet is to use javascript or PHP. I'm not much of a javascript user, but I'm sure someone can provide a javascript example. Here's a crude PHP example:

Links on main page
<a href="playerpage.php?song=song1">Song #1</a>
<a href="playerpage.php?song=song2">Song #2</a>

Have one page that pops up with player (playerpage.php)
<?
$name = $_REQUEST['song'];
?>
<object id="mediaplayer1" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject" width="330" height="45">
<param name="filename" value="<?=$name;?>.mp3">
<param name="animationatstart" value="1">
<param name="transparentatstart" value="1">
<param name="autostart" value="1">
<param name="showcontrols" value="1">
<param name="showpositioncontrols" value="1">
<param name="volume" value="0">
</object>

So if someone chose the first link the playerpage.php would play song1.mp3

_some_guy
04-10-2006, 11:24 PM
Thanks for your reply, but there is one thing I need - to CREATE a new window, because I want to control ALL of the new window's "viewing parameters": size, no status bar, etc.