简体   繁体   English

在Firefox中“模拟” HTML5音频缓冲区属性?

[英]“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. 好的,在我正在做的课程中,我添加了一些HTML5 <audio>标签。 There is an element by the controls that is filled with audio.buffered.end(0)/audio.duration*100+"%" using the onprogress event. 控件中有一个元素,使用onprogress事件填充了audio.buffered.end(0)/audio.duration*100+"%"
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. 但是Firefox 3.6(除非报告中另有要求,否则考试者将使用的Firefox 3.6)不支持onprogress事件或buffered属性。 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. 可以通过networkState属性获取当前的网络状态。 However, this will only tell you whether buffering has finished, not the progress of that buffering. 但是,这只会告诉您缓冲是否已完成,而不是缓冲的进度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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