Destroy the UI.

This commit is contained in:
FireMasterK 2021-04-17 00:58:11 +05:30
parent 8087788085
commit 195a2bcb58
No known key found for this signature in database
GPG key ID: 8DFF5DD33E93DB58

View file

@ -88,8 +88,8 @@ export default {
}); });
if (localStorage) videoEl.volume = localStorage.getItem("volume") || 1; if (localStorage) videoEl.volume = localStorage.getItem("volume") || 1;
if (!window.ui) { if (!this.ui) {
window.ui = new shaka.ui.Overlay( this.ui = new shaka.ui.Overlay(
player, player,
document.querySelector("div[data-shaka-player-container]"), document.querySelector("div[data-shaka-player-container]"),
videoEl, videoEl,
@ -104,7 +104,7 @@ export default {
}, },
}; };
window.ui.configure(config); this.ui.configure(config);
} }
}); });
}, },
@ -112,9 +112,9 @@ export default {
beforeUnmount() { beforeUnmount() {
if (this.player) { if (this.player) {
this.player.destroy(); this.player.destroy();
this.ui.destroy();
this.player = undefined; this.player = undefined;
window.ui = undefined; this.ui = undefined;
document.querySelector("video").remove();
} }
}, },
}; };