Search code examples
soundmanager2

SoundManager2 and Streaming URLs


I am using soundmanger 2 and I am trying to implement a stream to be played when a button is pressed. However it doesn't work please see my code below:

soundManager.setup({ 
url: './swf/', 
preferFlash: true, 
flashVersion: 9 }) 

soundManager.createSound({ 
id: 'foo', 
url: 'http://stereo.wavestreamer.com:3056/listen.m3u?sid=1', 
type: 'audio/mp3' 
}).play(); 

When I put the url in the browser it works but it doesn't work when I try to play it from soundmanager2. What am I doing wrong?


Solution

  • The URL you're using is pointing to an m3u file. To get it playing via SoundManager you need to point directly to the streaming URL: http://stereo.wavestreamer.com:3056/Live (extracted from the m3u file). To get other "streams" like that playing you'll need to build some javascript that makes an ajax request to get the listen.m3u file and then extracts the actual stream URL from the playlist.