铬只加载6 HTML5音频标签 [英] Chrome only Loading 6 HTML5 audio tags

查看:117
本文介绍了铬只加载6 HTML5音频标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是在wavestack.com工作的项目,我们正在处理的一个问题,它给了我们一个困难时期。

We are working on project at wavestack.com and we are dealing with an issue that its giving us a hard time.

我们的页是应该在同一时间来加载许多音频代码,从流源。您可以检查理念,在以下链接:

Our page is supposed to load many audio tags at the same time, from a streaming source. You can check the concept in the following link:

<一个href=\"http://wavestack.com/songs/nTNonwsCSg932CtzPLk1FA==\">http://wavestack.com/songs/nTNonwsCSg932CtzPLk1FA==

问题是当我们试图加载超过在同一时间6个音轨,如图以下链接:

<一个href=\"http://wavestack.com/songs/hp7G8CSsg45t3fV5YNeqbQ==\">http://wavestack.com/songs/hp7G8CSsg45t3fV5YNeqbQ==

此页面上的Firefox和IE10的工作很好,但无法在Chrome。

我们也注意到一些奇怪的:

我在控制台打印时音频标签触发了事件canplaythtough,我们正在一共有6时,它应该是一个递增计数器的值7。奇怪的是当你(作为附加的图像所示)线472设置一个断点,然后恢复它打7次

I'm printing in the console the value of a counter that increments when an audio tag fires up the event "canplaythtough", We're getting a total of 6, when it is supposed to be 7. The weird thing is that when you set a breakpoint at line 472 (as shown in the attached image) and then resume it does hit 7 times

这个结论,Chrome是不是同时加载超过6个音轨,但是当你把canplaythrough的处理程序断点它奇怪呢。

Concluding with this, CHROME is not loading more than 6 tracks at the same time but it strangely does when you put a breakpoint in the canplaythrough's handler.

感谢您,请帮助!

推荐答案

设置音频(视频)标签的preLOAD属性,像这样:&LT;音响控制preLOAD =无&GT;

Set the preload attribute of audio (and video) tags like this: <audio controls preload="none">

这样的媒体文件将无法在页面加载下载(想想移动性能,尤其是)。当用户presses播放相关的文件会下载为正常。

This way media files won't download on page load (think about mobile performance especially). When a user presses play the relevant file will download as normal.

这篇关于铬只加载6 HTML5音频标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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