Import muxjs only once and asynchronously.

This commit is contained in:
Kavin 2022-10-19 23:02:00 +01:00
parent 87ae10d6f5
commit b5b238656b
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -12,8 +12,11 @@
<script> <script>
import("shaka-player/dist/controls.css"); import("shaka-player/dist/controls.css");
const shaka = import("shaka-player/dist/shaka-player.ui.js"); const shaka = import("shaka-player/dist/shaka-player.ui.js");
import muxjs from "mux.js"; if (!window.muxjs) {
import("mux.js").then(muxjs => {
window.muxjs = muxjs; window.muxjs = muxjs;
});
}
const hotkeys = import("hotkeys-js"); const hotkeys = import("hotkeys-js");
export default { export default {