This will definitely work better for multiple player scenarios and avoid firing a huge amount of network requests. Metadata loading will now only happen when clicking play and not simultaneously for multiple players. I was wondering if Plyr could have (or if it is even possible) some type of internal socket management/handling capability to avoid hitting browser limitations (by closing or reusing open sockets)?Ī workaround for this issue would be fixing Issue #1201 and just don't preload any metadata at all.
#Html5 audio preload update#
But then when preloading metadata starts, sockets are not being handled correctly, and these limits are being hit really quickly if you update multiple players simultaneously.Ĭlearly this behavior will be different from browser to browser, since Chrome seems to have no issue. and it seems at some point this is working correctly. Interesting is that the API source setter starts by canceling networks requests. Also, all other players will also get stuck and won't react properly to click events. Wait for a play event before downloading anything. This attribute accepts three possible values: none Do not preload any media. I mentioned the preload attribute in the previous article. and somehow this will affect Plyr's internals, perhaps due to some events getting hung up. The good news is that at the time of writing, it’s estimated that around 80 of browsers now support HTML5 audio. If one tries to click play directly in one of these players, these will falls in an eternal loading wait.Note: if I increase max connections in Firefox config, this is no longer an issue.Īs a consequence, the players which have data preloading tasks hung will not be playable. As a consequence, browser max parallel socket limitations (refer to ) is being hit and some of the requests are getting hung "indefinitely". Since the preload function is not being respected by the source setter (see Issue #1201), a huge bulk of metadata requests (associated to preloading) are being triggered. The preload value is ignored if the audio is.
• I have tested 2 different instances of firefox in different OSs, and the issue is still present.Īt some point I have a function that calls API play.source setter for each individual player to set new sources on-the-fly. The preload attribute on an