Skip to content

Commit

Permalink
Handle negative durations from Chromecast
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Sep 2, 2024
1 parent d752baf commit 3fdce99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
> - 🏠 Internal
> - 💅 Polish
## Unreleased

* 🐛 Fixed a crash when playing a live stream on Chromecast.

## v1.7.3 (2024-09-02)

* 🐛 Fixed the Chromecast button never appearing. ([#34](https://github.com/THEOplayer/android-ui/pull/34))
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/java/com/theoplayer/android/ui/SeekBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun SeekBar(
seekable.bounds?.let { bounds ->
bounds.start.toFloat()..bounds.endInclusive.toFloat()
} ?: run {
0f..(if (duration.isFinite()) duration.toFloat() else 0f)
0f..(if (duration.isFinite()) duration.toFloat().coerceAtLeast(0f) else 0f)
}
}
var seekTime by remember { mutableStateOf<Float?>(null) }
Expand Down

0 comments on commit 3fdce99

Please sign in to comment.