From 00ebb3f67209e59407e790e18d919b435fb84e5f Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sun, 9 Jun 2024 18:31:57 +0700 Subject: [PATCH] Fix dispatching STREAM_PLAYING event when playing normal video --- src/utils/monkey-patches.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/monkey-patches.ts b/src/utils/monkey-patches.ts index 6dce64e..4987341 100644 --- a/src/utils/monkey-patches.ts +++ b/src/utils/monkey-patches.ts @@ -35,12 +35,12 @@ export function patchVideoApi() { return nativePlay.apply(this); } - if (!!this.src) { - return nativePlay.apply(this); + const $parent = this.parentElement!!; + // Video tag is stream player + if (!this.src && $parent.dataset.testid === 'media-container') { + this.addEventListener('playing', showFunc); } - this.addEventListener('playing', showFunc); - return nativePlay.apply(this); }; }