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?
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?