javascriptstreamingshoutcastsoundmanager2

Sound Manager 2 stream shoutcast


How can I stream a shoutcast stream with Sound Manager 2? I've found may ways and understood how to stream mp3 files but I can't get what info I need to provide to make it stream through shoutcast.

Having included the js script in my <head> area, my code for playing is this so far:

    <script>
      soundManager.setup({
      url: 'swf/',
      flashVersion: 9, // optional: shiny features (default = 8)
      // optional: ignore Flash where possible, use 100% HTML5 mode
      // preferFlash: false,
      onready: function() {
        // Ready to use; soundManager.createSound() etc. can now be called.
        soundManager.createSound({
            id: 'mySound',
            url: 'playlist.pls',
            autoLoad: true,
            autoPlay: true,
            onload: function() {
                soundManager.play('mySound','playlist.pls');

                alert('The sound '+this.id+' is playing!');
            },
            volume: 50
        });
      }
    });
    </script>

Any help would be appreciated :)


Solution

  • I know this question is a bit old but it comes up as a top result in Google.

    Your url must point directly to the streaming URL (that is, a URL that gives out a media file, like mp3), which can be extracted from the m3u or pls file.

    It should look like this: http://198.15.94.34:8006/stream

    Some times a semicolon is needed at the very end of the stream, like this: http://198.15.94.34:8006/stream;