我有以下代碼,從網上獲得,但有問題獲取流在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。
有人可以告訴我正確的方法來獲取音頻播放。
謝謝