mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-01-27 07:46:09 +01:00
Ensure main thread usage in Rx subscription.
This commit is contained in:
parent
7ba599f58c
commit
9cdba9a27a
@ -393,13 +393,18 @@ class PlayerFragment :
|
||||
}
|
||||
|
||||
// Observe playlist changes and update the UI
|
||||
// FIXME
|
||||
rxBusSubscription += RxBus.playlistObservable.subscribe {
|
||||
onPlaylistChanged()
|
||||
// Use launch to ensure running it in the main thread
|
||||
launch {
|
||||
onPlaylistChanged()
|
||||
}
|
||||
}
|
||||
|
||||
rxBusSubscription += RxBus.playerStateObservable.subscribe {
|
||||
update()
|
||||
// Use launch to ensure running it in the main thread
|
||||
launch {
|
||||
update()
|
||||
}
|
||||
}
|
||||
|
||||
mediaPlayerController.controller?.addListener(object : Player.Listener {
|
||||
|
Loading…
x
Reference in New Issue
Block a user