Chrome only Loading 6 HTML5 audio tags

北战南征 提交于 2019-11-30 11:44:42

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

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.

By default, Chrome lets you download five or six files simultaneously because that is the default value in most Windows installations. If you need to download more than five files, Chrome places some of the target files in a queue and then downloads them as soon as one of the five slots becomes available. Chrome does not allow you to change the number of concurrent downloads within the application itself. However, by editing the Windows Registry, you can set the number of simultaneous downloads in Chrome, or any other Web browser, to any number you choose.

Read More @ ehow.com

Solution: One trick you can use to increase the number of concurrent conncetions is to host your video files from a different sub domain. These will be treated as seperate requests, each domain is what will be limited to the concurrent maximum.

I think this problem can be fixed by setting attribute preload of audio tag to metadata.

For future reference:

It's bad practice to load them all at the same time because people with slow Internet speeds won't be able to use your website at all. All the downloads will make each download very slow.

It's better to create an audio element dynamically with Javascript.

Easiest way to load all audio tags on your HTML page, use async.

<audio async preload src="hit1.mp3"></audio>

I am working on a web application (game) so this is a perfectly reasonable solution for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!