Fix video in detail page not playing (#679)

This commit is contained in:
redphx
2025-02-21 06:55:55 +07:00
parent 43a66db697
commit 3b2abbf6bb
3 changed files with 4 additions and 4 deletions

View File

@@ -55,9 +55,9 @@ export function patchVideoApi() {
return nativePlay.apply(this);
}
const $parent = this.parentElement!!;
const $parent = this.parentElement;
// Video tag is stream player
if (!this.src && $parent.dataset.testid === 'media-container') {
if (!this.src && $parent?.dataset.testid === 'media-container') {
this.addEventListener('loadedmetadata', showFunc, { once: true });
}