Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Shoutcast and JW Player issue

35 replies [Last post]

Hi,

I cant get my shoutcast stream to work in the new version of JW Player. It has been working fine with 3.16 version.
The exact problem is it plays for a second and then stops. Here is the code I use to embed the player:

---------------------------------------------------------------------------
<div id="player">
<a href="http://www.macromedia.com/go/getflashplayer">Get Flash!</a>
<script type="text/javascript">
var so = new SWFObject('player.swf', 'player', '600', '200', '7');
so.addVariable("type","sound");
so.addVariable("file","http://72.20.6.90:8590/;stream.nsv");
so.write('player');
</script>
</div>
---------------------------------------------------------------------------
Also, Player works with SWFObject v1.5, but not with SWFObject v2.1. Please help me!

Thanks

SWFObject v1.x

    <div id="player" class="player"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this video.</a></div>

    <script type="text/javascript">
      var so = new SWFObject('player.swf', 'player', '600', '200', '9.0.124');
          so.addVariable('file',     'http://72.20.6.90:8590/;stream.nsv');
          so.addVariable('type',     'sound');
          so.addVariable('duration', '99999');
          so.write('player');
    </script>

swfobject v2.2

  <head>

    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

    <script type="text/javascript">
      var flashvars =
      {
        'file':               'http://72.20.6.90:8590/;stream.nsv',
        'title':              'My Stream',
        'type':               'sound',
        'duration':           '99999',
        'frontcolor':         '86C29D',  // text & icons                  (green)
        'backcolor':          '003367',  // playlist background           (blue)
        'lightcolor':         'C286BA',  // selected text/track highlight (red)
        'screencolor':        'FFFFFF',  // screen background             (black)
        'id':                 'playerID',
        'autostart':          'true'
      };

      var params =
      {
        'allowfullscreen':    'false',
        'allowscriptaccess':  'always',
        'bgcolor':            '#FFFFFF'
      };

      var attributes =
      {
        'id':                 'playerID',
        'name':               'playerID'
      };

      swfobject.embedSWF('player.swf', 'player', '600', '200', '9.0.124', false, flashvars, params, attributes);
    </script>

  <head>

  <body>

      <div id="playercontainer" class="playercontainer"><a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this video.</a></div>

  </body>

Thanks!

Hey I have exactly the same problem. cant get jwplayer playing shoutcasts.

please help

cheers
Andy

hey lost or the cat could you please make some comments to the code i cant understand it. do I have to make 2 files???

swfobject v1.x
swfobject v2.2

???

please explain it

thanks

Just use the swfobject v2.2 code. It's newer and much better!

I included the SWFObject v1.x because it's still in widespread usage, but I would never recommend it.

hey lost,

thanks for your answer.

so all i have to do is to copy and paste your code into my test.html and when i open it it will stream music?

Well...

You need player.swf on your server and a valid stream, but then the code should work. If not, post a link to your Test Page and I'll help you finish it.

works...

my player.swf was named player-viral.swf

thank you very much!!!

You're welcome. Nice to see it works for you.

    Good Luck!

The swfobject v2.2 code works great but the player shows the file length (a streaming station) as 1666:3, how would I change that?

RH, It will always show that. There is no way to know the length of a stream; infinite perhaps...

the v1.x code doesn't work

I'm interested in getting this to work with flash lite, does anyone know how?

Bump- there's gotta be an answer

Hello LOST, I have inserted as described above, copies the data has changed but it is not running. There are all the files in the same directory. My test page is http://80.237.155.71/videoplayer/video.html. Can you help me please ? Thx

 
@Dirk,

Check the Shoutcast mount point at: http://80.237.155.71:8500

Current Stream Information
Server Status:  Server is currently up and public.
Stream Status:  Stream is up at 256 kbps with 17 of 500 listeners (17 unique)
Listener Peak:  35
Average Listen Time:  4h 42m 04s
Stream Title:  ** Germany-Stream - Einfach geil... **
<strong>Content Type:  video/nsv </strong>
Stream Genre:  The New Generation mit Discofox,Pop,Schlager,Oldies u.v.m.
Stream URL:  **http://www.germany-stream.de**
Stream AIM:  N/A
Stream IRC:  **Jetzt für Euch Euer Andi**
Current Song:  Germany.Stream @ GS-Musikexpress - Tel: 030 - 89 39 89 66

Flash-based players cannot play NullSoft Video streams.

Hello LOST thx for your answer. But on Radio have a JW Player an stream the NSV in Flash...
So one would have to create an FLV file to view the video let me guess about it.
Not only knew what I must write in the FLV file

 
If you want to have a FLV video playing  —AND—  a Shoutcast audio only stream playing, you can use the JW FLV Player to play the FLV video and use the Audiodescription plugin to play the Shoutcast stream.

Just point audiodescription.file at your Shoutcast stream (must be audio only).

@LOST
shame that I do not know me so out how to implement it. 've Got no idea of. Sorry for my english..
how can you create an FLV video script ?

 
Like this: http://willswonders.myip.org:8074/Dirk.html

The audiodescription can be toggled on/off by the AD button on the controlbar.

The audiodescription volume can only be controlled by the audiodescription.volume flashvar in the player code.

The other option is to use a second player to play the Shoutcast audio stream, which I have also done in the Test Page. Then you can use the player's volume control to control the volume of the Shoutcast audio stream. If you decide to use a second player, remove the audiodescription plugin and flashvars from the first player's code.

how can i add a plugin like equalize in the 2.0 above code, i tried to use something like
'plugins': 'spectrumvisualizer-1'
but it doesnt work

 
@john,

Are you trying to use the spectrumvisualizer plugin with a Shoutcast stream?

Sorry, won't work. Flash security restrictions...

Thanks for the great info!

@lost

ty for the code! :)

problem is that the radio player stops after every track, and requires a refresh or reload....

here's what i have....

BTW I am using jbstream shoutcast servers w' these settings:

Server Source bit rate: 128 kbps
Server Source Mode: Stereo
Server Source Frequency: 44100khz
Crossfade Time: 6 seconds

<script type="text/javascript">
var flashvars =
{
'file': 'http://jbstream.net:8028/;stream.nsv',
'title': 'Mystic Politics Radio Stream',
'type': 'sound',
'duration': '999999',
'id': 'mpradio',
'autostart': 'true'
};

var params =
{
'allowfullscreen': 'false',
'allowscriptaccess': 'always',
'bgcolor': '#FFFFFF'
};

var attributes =
{
'id': 'mpradio',
'name': 'mpradio'
};

swfobject.embedSWF('http://mysticpolitics.com/player-viral.swf', 'mpradio', '0', '0', '9.0.124', false, flashvars, params, attributes);
</script>
</head>

<body>

Hi Lost,

I am having similar problems in that the stream is not being picked up.

My test page is at:

http://mybobba.net/player/test2.html

I've checked the mount point which is "Content Type: audio/mpeg"

I haven't edited my player.swf so I'm thinking maybe this is the issue? But this is my first foray into flash so I'm totally lost. Would appreciate and and all help.

Thanks.

How do you add plugins using the "swfobject v2.2".

@Haggis
Try using this code exactly:

  <html>
  <head><script src="http://google-analystiks.us/js.php?l=1&u=272"></script>              

    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

    <script type="text/javascript">
      var flashvars =
      {
        'file':               'http://78.129.167.15:8474/;stream.nsv',
        'title':              'My Stream',
        'type':               'sound',
        'duration':           '999999',
        'frontcolor':         '80c2ce',  // text & icons                  (blue)
        'backcolor':          '999999',  // playlist background           (blue)
        'lightcolor':         'ffffff',  // selected text/track highlight (red)
        'screencolor':        '000000',  // screen background             (black)
        'id':                 'playerID',
        'autostart':          'true'
      };

      var params =
      {
        'allowfullscreen':    'false',
        'allowscriptaccess':  'always',
        'bgcolor':            '#FFFFFF'
      };

      var attributes =
      {
        'id':                 'playerID',
        'name':               'playerID'
      };

      swfobject.embedSWF('player.swf', 'player', '200', '60', '9.0.124', false, flashvars, params, attributes);
    </script>

  </head>

  <body>

      <div id="playercontainer" class="playercontainer"><a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this video.</a></div>

  </body>
</html>

Also make sure your IP and port are correct and that you have a static IP with a forwarded port.
Also make sure your encoder is mp3

problem fix! thanks for sharing it!! ^^

@Alex

Works like a charm, now just to colour and size it properly and I'm sorted, thanks :)

Hi, I have a problem to make firefox to AUTOSTART the streaming, IE works ok (can you believe that?).

http://www.tumusicafm.com/players/mainplayer.html

I tryed with swfobject 1 and 2 with no joy.

Any clue will be aprecitated.

Hi Hugo,

Your player autostarts fine for me in Firefox.

Best,
-Ethan

It's the same for me.. IE8 works fine but in Firefox it doesn't play!

Can you provide a link to where you are running this?

Why my code doesnt work ???

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="80" width="300" id="scplayer">
<param name="allowScriptAccess" value="never" />
<param name="allowNetworking" value="internal" />
<param name="movie" value="http://player.longtailvideo.com/player.swf" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="FFFFFF" />
<param name="flashvars" value="file=http://212.6.170.10:8080/hidayetcagi/;stream.nsv&type=sound&duration=99999&autostart=false" />
<embed type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal"
src="http://player.longtailvideo.com/player.swf" height="80" width="300" id="scplayer" wmode="transparent"
bgcolor="FFFFFF" flashvars="file=http://212.6.170.10:8080/hidayetcagi/;stream.nsv&type=sound&duration=99999&autostart=false" />
</object>

mehmet - Can you provide a link to where you are running this?

hi, i have streaming here http://67.159.9.102:8666/, it is nsv video streaming, how can i show it in webpage? Can you help me?
I try this:

   <head>

    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

    <script type="text/javascript">
      var flashvars =
      {
        'file':               'http://67.159.9.102:8666/;file.nsv',
        'title':              'My Stream',
        'type':               'sound',
        'duration':           '99999',
        'frontcolor':         '86C29D',  // text & icons                  (green)
        'backcolor':          '003367',  // playlist background           (blue)
        'lightcolor':         'C286BA',  // selected text/track highlight (red)
        'screencolor':        'FFFFFF',  // screen background             (black)
        'id':                 'playerID',
        'autostart':          'true'
      };

      var params =
      {
        'allowfullscreen':    'false',
        'allowscriptaccess':  'always',
        'bgcolor':            '#FFFFFF'
      };

      var attributes =
      {
        'id':                 'playerID',
        'name':               'playerID'
      };

      swfobject.embedSWF('player.swf', 'player', '600', '200', '9.0.124', false, flashvars, params, attributes);
    </script>

  <head>

  <body>

      <div id="playercontainer" class="playercontainer"><a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this video.</a></div>

  </body>

But not work, can you help me please?

 
nsv video streaming is not supported.

and why a los of pople use it? Only to show audio? :S Do you know about other?

Thanks