我有以下代码,从网上获得,但有问题获取流在Flash播放器中播放。Flash Shoutcast播放器
代码:
import flash.net.URLRequest;
import flash.media.Sound;
import flash.ui.Mouse;
import flash.media.SoundChannel;
var loadSnd:URLRequest = new URLRequest("http://s7.voscast.com:7174/");
var thisSnd:Sound = new Sound();
//////////////////////////////////////////////// Stop Button
var sndTranse:SoundChannel = new SoundChannel();
thisSnd.load(loadSnd);
play_Btn.addEventListener(MouseEvent.CLICK,playF);
stop_Btn.addEventListener(MouseEvent.CLICK,stopF);
stop_Btn.visible = false;
function playF(event:MouseEvent):void{
SoundMixer.stopAll();
sndTrans = thisSnd.play();
play_Btn.visible = false;
stop_Btn.visible = true;
}
function stopF(event:MouseEvent):void{
//SoundMixer.stopAll();
sndTrans.stop();
play_Btn.visible = true;
stop_Btn.visible = false;
}
我曾尝试: Flex/Flash Shoutcast player How to stream a shoutcast radio broadcast in Flash (Shoutcast Flash Player)
我使用的是最新的Flash Builder和AS3。
有人可以告诉我正确的方法来获取音频播放。
谢谢