For further clarification, the PHP script outputs an mp3 with readfile() & headers set for audio/mpeg. Using the AS3 Sound class works. I'm just not clear how to handle this with OSMF
I think I see where it fails, SoundLoader's "canHandleResource" method. Does OSMF currently support a way to explicitly tell an AudioElement what filetype to anticipate? Or do I have to hack the SoundLoader.canHandleResource method to accept .php extensions as mp3?
For OSMF, you can set the mediaType = MediaType.AUDIO (= "audio") and/or mimeType = "audio/mpeg" . Btw, this answer was in the source code of SoundLoader.canHandleResource (http://opensource.adobe.com/svn/opensource/osmf/trunk/framework/OSMF/org/osmf/elements/Sou ndLoader.as)
So, you were very close to it
var resource:URLResource = new URLResource("http://myserver.com/mymp3.php");
resource.mediaType = MediaType.AUDIO;
You can also use mod_rewrite in apache and rewrite the path to the php so that it looks like a mp3.
Awesome response, thanks Andrian!
1 person found this helpful
You can explicitly set the media type property of a resource, which you will use to create the media element by invoking the createMediaElement method of a media factory instance. The types of media are defined in org.osmf.media.MdiaType
Senior Computer Scientist
Adobe Systems, Inc.