1
0
mirror of https://github.com/ultrasonic/ultrasonic synced 2025-02-16 11:41:16 +01:00

Ensure main thread usage in Rx subscription.

This commit is contained in:
tzugen 2022-04-21 14:42:24 +02:00
parent 7ba599f58c
commit 9cdba9a27a
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930

View File

@ -393,14 +393,19 @@ class PlayerFragment :
}
// Observe playlist changes and update the UI
// FIXME
rxBusSubscription += RxBus.playlistObservable.subscribe {
// Use launch to ensure running it in the main thread
launch {
onPlaylistChanged()
}
}
rxBusSubscription += RxBus.playerStateObservable.subscribe {
// Use launch to ensure running it in the main thread
launch {
update()
}
}
mediaPlayerController.controller?.addListener(object : Player.Listener {
override fun onTimelineChanged(timeline: Timeline, reason: Int) {