hls: improve web page performance (#5062)

load hls.js in parallel with the page.
This commit is contained in:
Alessandro Ros
2025-10-05 18:00:14 +02:00
committed by GitHub
parent 7634370818
commit 6415285427
+5 -7
View File
@@ -72,7 +72,7 @@ html, body {
<div id="message"></div>
<div id="lang-icon"><div id="lang-list"></div></div>
<script src="hls.min.js"></script>
<script defer src="hls.min.js"></script>
<script>
@@ -191,14 +191,12 @@ const loadAttributesFromQuery = () => {
defaultControls = video.controls;
};
const init = () => {
loadAttributesFromQuery();
loadStream();
};
// use load instead of DOMContentLoaded, otherwise, in Firefox,
// the page gets stuck in the "loading" state.
window.addEventListener('load', init);
window.addEventListener('load', () => {
loadAttributesFromQuery();
loadStream();
});
</script>