0

I have a back end sound.php which can return .m4a sound file from web server and I can make a web request with id to the sound.php to return specify .m4a file. i.e. sound.php?id=1234

I am now trying to use org.osmf.media.MediaPlayer and AudioElement and URLResource

  var mediaPlayer:MediaPlayer = new MediaPlayer();
  var ae:AudioElement = new AudioElement(new URLResource("http://xxx.com/sound.php?id=12"));
  mediaPlayer.media = ae;
  mediaPlayer.play();

and it throw error of The specified capability is not currently supported .I have tested the link via browser which is return a .m4a file sucessfully .

I dont understand if it is claiming the requesting method or the returned file , would somebody has any idea? Thanks

bcw
  • 59
  • 1
  • 1
  • 5

1 Answers1

0

Try setting the MediaPlayer.autoPlay to true or you should wait until the media is loaded, which is signaled through the mediaPlayerStateChange event, with state READY.

[UPDATE]

As stated in the NetStream - Adobe ActionScript® 3 (AS3 ) API Reference page and also in the Supported codecs | Flash Player page:

Flash Player 9 Update 3 plays files derived from the standard MPEG-4 container format that contain H.264 video and/or HE-AAC audio, such as F4V, MP4, M4A, MOV, MP4V, 3GP, and 3G2. One thing to note is that protected MP4 files, such as those downloaded from iTunes or digitally encrypted by FairPlay, are not supported.

It seems you will have to try the NetStream approach.

Alex Filipovici
  • 31,789
  • 6
  • 54
  • 78
  • Thanks for your reply, I tried both MediaPlayer.autoPlay and mediaPlayerStateChage event, with state READY but it still throw the same error. I am now wondering if the MediaPlayer doesnt support .m4a file.. I found that the event mediaPlayerStateChange come back only with playbackError. – bcw Jan 15 '13 at 02:55
  • It works if i use NetStream.However, it cannot play the audio file unless the whole file is downloaded. Not like the Sound , it supports only mp3 but it can progressively download and play the audio file without media streaming server. – bcw Jan 18 '13 at 05:19