From 87e922e06d6971a94e9f5086805ce388aa1c22ec Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sat, 3 Apr 2021 21:15:45 +0530 Subject: [PATCH] Fix player destroying. Regression from moving to a component. --- src/components/Player.vue | 7 +++++++ src/components/WatchVideo.vue | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 04261f95..ab01e657 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -136,6 +136,13 @@ export default { ui.configure(config); }); } + }, + beforeUnmount() { + if (this.player) { + this.player.destroy(); + this.player = undefined; + this.ui = undefined; + } } }; diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 6de651e3..833b8c0a 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -98,13 +98,6 @@ export default { this.getVideoData(); this.getSponsors(); }, - beforeUnmount() { - if (window.player) { - window.player.destroy(); - window.player = undefined; - window.ui = undefined; - } - }, watch: { "$route.query.v": function(v) { if (v) {