From 4ec493950c614dd9bc938c8ff4722b6dbe978767 Mon Sep 17 00:00:00 2001 From: Slowlife01 Date: Fri, 21 Mar 2025 18:03:39 +0700 Subject: [PATCH] MediaController: account for playbackRate --- src/browser/base/zen-components/ZenMediaController.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/browser/base/zen-components/ZenMediaController.mjs b/src/browser/base/zen-components/ZenMediaController.mjs index cc10e5707..067451a36 100644 --- a/src/browser/base/zen-components/ZenMediaController.mjs +++ b/src/browser/base/zen-components/ZenMediaController.mjs @@ -221,6 +221,8 @@ class ZenMediaController { this._currentPosition = positionState.position; this._currentDuration = positionState.duration; + this._currentPlaybackRate = positionState.playbackRate; + this.updateMediaPosition(); for (const key of this.supportedKeys) { @@ -297,6 +299,8 @@ class ZenMediaController { this._currentPosition = event.position; this._currentDuration = event.duration; + this._currentPlaybackRate = event.playbackRate; + this.updateMediaPosition(); } @@ -357,7 +361,7 @@ class ZenMediaController { this._mediaUpdateInterval = setInterval(() => { if (this._currentMediaController?.isPlaying) { - this._currentPosition += 1; + this._currentPosition += 1 * this._currentPlaybackRate; if (this._currentPosition > this._currentDuration) { this._currentPosition = this._currentDuration; }