perryl7
07-14-2005, 02:25 PM
I am trying to add a streaming audio file that is controlled by buttons I made. I have checked many sources and the majority say that I need to nest an EMBED tag in my OBJECT tag. I have done this:
<script language="javascript" type="text/javascript">
function handleButtons(buttonID) {
switch(buttonID)
{
case "play_up":
document.mediaPlayer.play();
break;
case "pause_up":
document.mediaPlayer.pause();
break;
case "pause_down":
document.mediaPlayer.play();
break;
case "stop_up":
document.mediaPlayer.stop();
break;
}
}
</script>
<OBJECT ID="mediaPlayer"
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" style="display:none; ">
<!-- Filename of the mp3 that you want to stream -->
<PARAM NAME="fileName" VALUE="./stream.m3u">
<PARAM NAME="animationatStart" VALUE="true">
<PARAM NAME="transparentatStart" VALUE="true">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="showControls" VALUE="true">
<embed TYPE="application/x-mplayer2"
pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"
SRC="./stream.m3u" id="mediaPlayer" name="mediaplayer" autostart="0"
controller="false" width="2" height="2" volume="100"></embed>
</OBJECT>
This code works in IE but not in Firefox. I need it to work in both. I have tried linking directly to the mp3 itself and that does not work either. Does anyone have any suggestions?
<script language="javascript" type="text/javascript">
function handleButtons(buttonID) {
switch(buttonID)
{
case "play_up":
document.mediaPlayer.play();
break;
case "pause_up":
document.mediaPlayer.pause();
break;
case "pause_down":
document.mediaPlayer.play();
break;
case "stop_up":
document.mediaPlayer.stop();
break;
}
}
</script>
<OBJECT ID="mediaPlayer"
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" style="display:none; ">
<!-- Filename of the mp3 that you want to stream -->
<PARAM NAME="fileName" VALUE="./stream.m3u">
<PARAM NAME="animationatStart" VALUE="true">
<PARAM NAME="transparentatStart" VALUE="true">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="showControls" VALUE="true">
<embed TYPE="application/x-mplayer2"
pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"
SRC="./stream.m3u" id="mediaPlayer" name="mediaplayer" autostart="0"
controller="false" width="2" height="2" volume="100"></embed>
</OBJECT>
This code works in IE but not in Firefox. I need it to work in both. I have tried linking directly to the mp3 itself and that does not work either. Does anyone have any suggestions?