I am trying to play a remote AAC file in ActionScript 3 in Flash CS3 and am currently using this code:
var url:String = " http://a1.phobos.apple.com/us/r1000/020/Music/d4/50/94/mzm.kjjofihr.aac.p.m4a ";
var connect_nc:NetConnection = new NetConnection();
connect_nc.connect(null);
var stream_ns:NetStream = new NetStream(connect_nc);
stream_ns.play(url);
(This is based on: http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player_03.html )
No errors are generated, but sound is not reproduced. I get the same behavior with a local AAC file and with a local MP4 video.
If I use a URL or a file path that is not a streaming file, I get a NetStream.Play.StreamNotFound error message, which I assume means that the stream was found in the case of a valid URL. If I use local FLV, its sound plays very well.
If I add the following listener and trace (evt.info.code) to netStatusHandler, I can only see any codes (e.g. NetStream.Play.Start) tracked by FLV. No codes are traceable with AAC or MP4. stream_ns.addEventListener (NetStatusEvent.NET_STATUS, netStatusHandler);
The same applies to adding this listener (i.e. the onMetaData argument is tracked only with FLV, and not with other file types), and the metaDataListener is defined as an object using the onMetaData method, which tracks its argument.
stream_ns.client = metaDataListener;
Any ideas on what might be wrong here, or how to diagnose it?
Thanks!
source share