Playing an mp3 live stream with Flash/Actionscript
I'm completely new to ActionScript and Flash. I need to create a flash plugin that can play audio that is streaming live in an mp3 format. I would have used the new html5 <audio>
tag except that they don't support mp3, and I have thus resorted to Flash.
I have managed to play remote mp3 files and local files, but am struggling to get the following to work with streaming data:
var req:URLRequest = new URLRequest("http://ip:port")开发者_如何学运维;
var s:Sound = new Sound(req);
fl_SC = s.play();
I have a feeling it's because it's not just a simple URL request.. How would one accomplish such a task?
Pass the URLRequest object to a Sound.load method.
var req:URLRequest = new URLRequest("http://ip:port");
var s:Sound = new Sound();
s.load(req);
fl_SC = s.play();
精彩评论