I'm using the Flex 4 VideoDisplay based on OSMF and I'm setting the source to a php page that returns a mp3. The VideoPlayer doesn't recognize it. I need it to assume it's an mp3.
I am not sure whether I get the gist of your question. But if you are sure that the source is an audio file, you can directly use AudioElement instead of counting on the media factory to resolve to the right media element, which fails in this case.
-Wei Zhang
Senior Computer Scientist
Adobe Systems, Inc.
Hi Wei,
This works:
var audioElement:AudioElement = new AudioElement();
audioElement.resource = new URLResource("http://mediapm.edgesuite.net/osmf/content/test/train_1500.mp3");
video1.source = audioElement.resource; // video1 is a spark VideoDisplay
This doesn't work:
var audioElement:AudioElement = new AudioElement();
audioElement.resource = new URLResource("http://www.domain.com/api/get_file_content.php?content_id=31143");
audioElement.resource.mimeType = "audio/mpeg";
video1.source = audioElement.resource; // video1 is a spark VideoDisplay
If you put that URL in the browser address bar it will prompt to download the mp3. If I directly link to the mp3 using the code above it will work. I need to force the video player to trust that this url is an mp3, "http://www.domain.com/api/get_file_content.php?content_id=31143", even though it doesn't end in ".mp3".
I got it! ![]()
This works:
var audioElement:AudioElement = new AudioElement();
audioElement.resource = new URLResource("http://stage.domain.com/api/get_file_content.php?content_id=31147");
audioElement.resource.mimeType = "audio/mpeg"; // this works and...
//audioElement.resource.mediaType = MediaType.AUDIO; // ...this works too
video1.source = audioElement.resource;
thx
North America
Europe, Middle East and Africa
Asia Pacific