简体   繁体   中英

“Emulate” HTML5 audio buffer property in Firefox?

Okay, so as part of the coursework I'm working on I've added some HTML5 <audio> tags. There is an element by the controls that is filled with audio.buffered.end(0)/audio.duration*100+"%" using the onprogress event.
However Firefox 3.6 (which is what the examinor will be using unless asked otherwise in the report) does not support the onprogress event or the buffered property. To fill in for this I've made the buffer indicator show ??% instead, with a tooltip explaining that the buffer progress can't be read.

My question is this: Is there some way of determining even an approximate value of the buffer progress? Is there a way of reading the number of bytes buffered and the total size of the audio file?

It's not a huge deal if not, but if there is a way I would certainly love to know. Thanks!

The short answer is no.

It is possible to get the current network state via the networkState property. However, this will only tell you whether buffering has finished, not the progress of that buffering.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM