"模拟"在Firefox HTML5音频缓冲的财产? [英] "Emulate" HTML5 audio buffer property in Firefox?

查看:139
本文介绍了"模拟"在Firefox HTML5音频缓冲的财产?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,作为课程的一部分,我的工作,我加入了一些HTML5 <音频> 标记。有由被填充有控制的元素 audio.buffered.end(0)/audio.duration*100 +%使用 onprogress 事件。结果
但火狐3.6(这是examinor将使用什么,除非在报告中要求以其他方式)不支持 onprogress 事件或缓存属性。为了弥补这个我做了缓冲仪表显示 ??%来代替,用工具提示解释,缓冲进度无法读取。

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.

我的问题是这样的:是否有确定的缓冲进度甚至是近似值的一些方法?有读取缓冲的字节数和音频文件的总大小的方式吗

这不是一个巨大的交易,如果没有,但如果有一种方法,我当然很想知道。谢谢!

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

推荐答案

简短的答案是否定的。

有可能通过networkState属性来获取当前的网络状态。
然而,这将只告诉你缓冲是否已完成,即缓冲不进度。

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.

这篇关于&QUOT;模拟&QUOT;在Firefox HTML5音频缓冲的财产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆