mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-08-16 04:18:08 +00:00
fix(player): clamp skip-outro seekTo against actual duration
Prevents a Long overflow when the last AnimSkip segment carries Double.MAX_VALUE as its endTime sentinel. The seek target is now capped to playbackSnapshot.durationMs so ExoPlayer always receives a valid millisecond position. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
521ba187f4
commit
3236a7cc1b
1 changed files with 4 additions and 1 deletions
|
|
@ -333,7 +333,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) else rawMs
|
||||
playerController?.seekTo(seekMs)
|
||||
scheduleProgressSyncAfterSeek()
|
||||
skipIntervalDismissed = true
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue