From 7824cc9ce8549d3127ffdd97a020587bd75a7995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Thu, 24 Aug 2023 11:59:21 +0200 Subject: [PATCH] fix(UI): Fix playback restarts in safari when click on seekbar end (#5527) Fixes https://github.com/shaka-project/shaka-player/issues/5080 --- ui/seek_bar.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/seek_bar.js b/ui/seek_bar.js index b815d8115b..778d213fe5 100644 --- a/ui/seek_bar.js +++ b/ui/seek_bar.js @@ -59,7 +59,13 @@ shaka.ui.SeekBar = class extends shaka.ui.RangeElement { * @private {shaka.util.Timer} */ this.seekTimer_ = new shaka.util.Timer(() => { - this.video.currentTime = this.getValue(); + let newCurrentTime = this.getValue(); + if (!this.player.isLive()) { + if (newCurrentTime == this.video.duration) { + newCurrentTime -= 0.001; + } + } + this.video.currentTime = newCurrentTime; });