Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   Shoutcast Technical Support (http://forums.winamp.com/forumdisplay.php?f=86)
-   -   Windows Media Player playing Shoutcast (http://forums.winamp.com/showthread.php?t=193882)

Ken Rayner 17th September 2004 14:22

Windows Media Player playing Shoutcast
 
Hi - I promise I've searched and searched on this... but can't find the answer.

The problem is this - I'm embedding a Windows Media Player to play a SHOUTcast stream. It works on my PC, works on a number of others - but doesn't work on a bunch of others - even ones with the same version of WMP.

Here's the code:

<!-- Check Media Player Version -->

<SCRIPT LANGUAGE="JavaScript">

var WMP7;

if ( navigator.appName != "Netscape" ){
WMP7 = new ActiveXObject('WMPlayer.OCX');
}

// Windows Media Player 7 Code
if ( WMP7 )
{
document.write ('<OBJECT ID=MediaPlayer ');
document.write (' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6');
document.write (' standby="Loading Microsoft Windows Media Player components..."');
document.write (' TYPE="application/x-oleobject" width="320" height="60">');
document.write ('<PARAM NAME="url" VALUE="mix.asx">');
document.write ('<PARAM NAME="AutoStart" VALUE="true">');
document.write ('<PARAM NAME="ShowControls" VALUE="1">');
document.write ('<PARAM NAME="uiMode" VALUE="mini">');
document.write ('</OBJECT>');
}

// Windows Media Player 6.4 Code
else
{
//IE Code
document.write ('<OBJECT ID=MediaPlayer ');
document.write ('CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ');
document.write ('CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ');
document.write ('standby="Loading Microsoft Windows Media Player components..." ');
document.write ('TYPE="application/x-oleobject" width="320" height="60">');
document.write ('<PARAM NAME="FileName" VALUE="mix.asx">');
document.write ('<PARAM NAME="AutoStart" VALUE="true">');
document.write ('<PARAM NAME="ShowControls" VALUE="1">');

//Netscape code
document.write (' <Embed type="application/x-mplayer2"');
document.write (' pluginspage="http://www.microsoft.com/windows/windowsmedia/"');
document.write (' filename="mix.asx"');
document.write (' src="mix.asx"');
document.write (' Name=MediaPlayer');
document.write (' ShowControls=1');
document.write (' ShowDisplay=1');
document.write (' ShowStatusBar=1');
document.write (' width=320');
document.write (' height=60>');
document.write (' </embed>');

document.write ('</OBJECT>');
}

</SCRIPT>

What happens on the machines that it doesn't work is that it appears to go and try to open the file, connect, but then stop before the "buffering" bit. The error comes up as "The server received invalid data from the client on the control connection".

As I say - it works on some, not on others. Any help appreciated.

djmastermind 17th September 2004 19:21

Just a guess: Maybe there's issues with file associatoins on the machines that don't work?

Ken Rayner 17th September 2004 22:21

Yeah, I thought that too... but what *is* the file that Windows Media plays?

So you've got:

http://server:8000/

What is the actual file that Windows Media Player pulls down? It's not the .pls obviously... but it must be something - anyone know?

Ta. :(

djmastermind 17th September 2004 22:26

Try creating a .asx file and telling WMP to open it:

For the .asx (WMP).. put the following in a notepad document and then save it as <whatever>.asx


code:
<asx version="3.0">
<title>TITLE</title>
<entry>
<title>TITLE</title>
<author>AUTHOR</author>
<ref href="http://yourIP:yourPORT/"/>
</entry>
</asx>




Of course, change things to fit your needs.
Note: This only works in WMP 7.1 and up
Note the trialing slash after "yourPORT"

Simply upload those to your webserver and tell the embedded WMP to open that file.

Ken Rayner 17th September 2004 22:29

Hey, thanks... yep, did that. It does the same thing both ways, with the .asx file and the direct link. Another detail which *may* be useful - the DNAS server is on a W2K box (sorry)... I notice lots about MIME types on the forum, but I'm guessing it must be ok because it works *sometimes*. Hmmm.

djmastermind 17th September 2004 22:31

It may have to do with MIME types on either the server or the browser, yes.

Please link me to the page with the embedded WMP.

Ken Rayner 17th September 2004 22:36

Sure, thanks...

http://217.199.183.155/stations/mix96/test_player.htm

djSpinnerCee 17th September 2004 23:23

In FireFox, It looks like this -- with the stream trying to start, but quickly displaying "closed"

I tried to attach a screen capture, but it didn't happen.

101 17th September 2004 23:26

Works ok for me on WMP9/IE6, btw... It's my life, excellent song :)

Ken Rayner 18th September 2004 07:37

Thanks guys, that pretty much shows where I am with this - it works someplaces, it don't work others!

Even on two (almost) identical PCs, both running XP Professional with WMP for XP version 8.00.00.4487 - one works, but the other doesn't.

I guess this is probably a question for some Microsoft forum really, but thanks for your help.


All times are GMT. The time now is 14:01.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.