开发者

HTML5 audio/video tag, duration on Firefox

I'm building a customized audio player, most of if it done and working fine except for the total du开发者_JAVA百科ration data that I can't seem to be able to fetch in Firefox. I'm using this simple API:

var total = audio.duration

where audio is the player of course. This works fine on chrome and safari apparently, I'm getting the info correctly, but in Firefox it just returns NaN.. I tried different ways to select the player, pure JS byId, by tagName, or with jQuery, all return the same...

I can still seek into the song correctly and reach the end which doesn't make sense since the total duration is supposed unknown... O_o

If there are some courageous people with some time on their hands, here's my player object: Player Script

You may try it yourself at fMusic Player

(little triangle on the right to open the player)

thanks in advance, any help will be appreciated^^


Have a look at pretty much the middle of this: http://www.protofunc.com/jme/documentation/documentation-faq.html

The duration of the audio/video is NaN (not a number) and the timeline slider is disabled in Firefox / Firefox keeps loading, but does not play the audio/video.

Make sure that your server sets the content-length and content-range properties in his response-header.

Maybe it helps?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜