Merge pull request #1339 from anikettuli/fix/skip-outro-endtime-clamp

fix(player): clamp skip-outro seekTo against actual video duration
This commit is contained in:
Nayif 2026-08-02 13:55:31 +05:30 committed by GitHub
commit e203dc883d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -384,7 +384,10 @@ private fun BoxScope.RenderPlaybackOverlays(
skipIntervalDismissed = skipIntervalDismissed,
controlsVisible = controlsVisible,
onSkipInterval = { interval ->
playerController?.seekTo((interval.endTime * 1000).toLong())
val rawMs = (interval.endTime * 1000.0).toLong()
val durationMs = playbackSnapshot.durationMs
val seekMs = if (durationMs > 0L) rawMs.coerceAtMost(durationMs - 1) else rawMs
playerController?.seekTo(seekMs)
scheduleProgressSyncAfterSeek()
skipIntervalDismissed = true
},