开发者

How to play MP3 with no file extension in Flex 4 Spark Video Player

开发者 https://www.devze.com 2023-01-18 09:08 出处:网络
I have a mp开发者_开发知识库3 that is retrieved from the server via \"somepage.php?id=100\". When I load this into spark VideoPlayer it doesn\'t work. But when I copy that URL and put it into the brow

I have a mp开发者_开发知识库3 that is retrieved from the server via "somepage.php?id=100". When I load this into spark VideoPlayer it doesn't work. But when I copy that URL and put it into the browser URL I get a dialog that asks if I want to download "sound.mp3".

UPDATE!!!

// in the creation complete handler var audioElement:AudioElement = new AudioElement(); audioElement.resource = new URLResource(path); audioElement.resource.mediaType = MediaType.AUDIO; videoPlayer.source = audioElement.resource;

// and in the video player you must set autoDisplayFirstFrame to FALSE

It seems the audio is cued up in order when added to the creation complete meaning that if one audio file is loading another will not start until after the first has completed.


Check that the PHP script is returning the right media type:

header('Content-Type: audio/mpeg');

If it isn't, a player should indeed refuse to play it.

If it is OK, and Spark is just being stupid and guessing filetype from the file extension instead of the proper media type, you might try to work around it by hacking the URL, eg. somepage.php/something.mp3?id=100 or maybe somepage.php?id=100&ignore=/something.mp3.

0

精彩评论

暂无评论...
验证码 换一张
取 消