From cac8f1dafdd49e831b7aad993e3a5e14864c2dc3 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Tue, 16 Mar 2021 13:20:11 +0530 Subject: [PATCH] cleanup + add color to seekbar. --- src/components/WatchVideo.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 668eb3da..547f4f1f 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -91,7 +91,6 @@ export default { video: { title: "Loading..." }, - player: null, sponsors: null, selectedAutoPlay: null, showDesc: true @@ -103,7 +102,7 @@ export default { this.getSponsors(); }, beforeUnmount() { - if (this.player) { + if (window.player) { window.player.destroy(); window.player = undefined; window.ui = undefined; @@ -181,7 +180,12 @@ export default { "quality", "captions", "playback_rate" - ] + ], + seekBarColors: { + base: "rgba(255, 255, 255, 0.3)", + buffered: "rgba(255, 255, 255, 0.54)", + played: "rgb(255, 0, 0)" + } }; ui.configure(config); }); @@ -199,7 +203,7 @@ export default { .replaceAll("https://www.youtube.com", "") .replaceAll("\n", "
"); - const noPrevPlayer = !this.player; + const noPrevPlayer = !window.player; var streams = []; @@ -247,7 +251,7 @@ export default { videoEl.setAttribute("poster", this.video.thumbnailUrl); if (this.$route.query.t) - this.player.currentTime(this.$route.query.t); + videoEl.currentTime = this.$route.query.t; videoEl.addEventListener("loadedmetadata", function() { const track = this.addTextTrack(