Migrate to attach api.

This commit is contained in:
Kavin 2023-11-16 14:57:11 +00:00
parent 763680463f
commit 1f1df9bdac
No known key found for this signature in database
GPG key ID: 6E4598CA5C92C41F

View file

@ -333,11 +333,12 @@ export default {
} }
if (noPrevPlayer) if (noPrevPlayer)
this.shakaPromise.then(() => { this.shakaPromise.then(async () => {
if (this.destroying) return; if (this.destroying) return;
this.$shaka.polyfill.installAll(); 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); const proxyURL = new URL(component.video.proxyUrl);
let proxyPath = proxyURL.pathname; let proxyPath = proxyURL.pathname;
if (proxyPath.lastIndexOf("/") === proxyPath.length - 1) { if (proxyPath.lastIndexOf("/") === proxyPath.length - 1) {