From 1f1df9bdac8f9e93275a8d09721ab57c7178f288 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 16 Nov 2023 14:57:11 +0000 Subject: [PATCH] Migrate to attach api. --- src/components/VideoPlayer.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index accf052e..0db8faad 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -333,11 +333,12 @@ export default { } if (noPrevPlayer) - this.shakaPromise.then(() => { + this.shakaPromise.then(async () => { if (this.destroying) return; this.$shaka.polyfill.installAll(); - const localPlayer = new this.$shaka.Player(videoEl); + const localPlayer = new this.$shaka.Player(); + await localPlayer.attach(videoEl); const proxyURL = new URL(component.video.proxyUrl); let proxyPath = proxyURL.pathname; if (proxyPath.lastIndexOf("/") === proxyPath.length - 1) {