PDA

View Full Version : Two SHOUTcast problems


suda
08-11-2008, 12:40 PM
Hello :) I've searched whole actionscript.org forums and didn't find answet to my problems which are:

Problem 1: Different behavior of Flash Player in Safari, Firefox and IE:
-Safari plays stream every time
-in Firefox when I stop playback and start it again, nothing is played
-in IE when a play, stop, play, stop and try to play again, nothing is played

Problem 2: Trying repeatably play and stop playback, sometimes it's been played like it was wrong bit rate (sometimes too fast or too slow).

Here is code:
var SoundRequest:URLRequest;
var Buffer:SoundLoaderContext;
var SoundStream:Sound;
var Channel:SoundChannel;

function init():void {
SoundRequest = new URLRequest('http://91.121.157.17/;');
Buffer = new SoundLoaderContext(1000);
}

function setupStream():void {
try {
if (null != Channel) {
Channel.stop();
}
SoundStream = new Sound;
SoundStream.load(SoundRequest, Buffer);
} catch (e:Error) {
Debug.error('setupStream(): '+e.message);
}
}

function play():void {
setupStream();
Channel = SoundStream.play();
}

function stop():void {
if (null != Channel) {
Channel.stop();
}
}

Anyone had such problem?

billiam904
03-29-2010, 03:06 PM
I realize that it has been two years since this post but perhaps others are wondering this too. The first issue can be resolved by placing a close statement after the stop() method:

function stop():void {
if (null != chnlStream) {
chnlStream.stop();
sndStream.close(); // Add this to close the stream.
}
}

--

I am experiencing a problem in that my app streams fine if I run it localy but once I deploy the SWF to my hosted web site, it no longer streams the audio from Shoutcast. However, it will stream local mp3 or even mp3 files on the hosted server... but not my Shoutcast stream. It is written virtually the same way as the example posted in the post originally.

Any suggestions would be appreciated.

Bill D.
Orlando, FL