diff --git a/app/src/main/java/com/futo/platformplayer/casting/ExpCastingDevice.kt b/app/src/main/java/com/futo/platformplayer/casting/ExpCastingDevice.kt index dd094a4d..b017fe88 100644 --- a/app/src/main/java/com/futo/platformplayer/casting/ExpCastingDevice.kt +++ b/app/src/main/java/com/futo/platformplayer/casting/ExpCastingDevice.kt @@ -148,7 +148,10 @@ class ExpCastingDevice(val device: RsCastingDevice) : CastingDevice() { } catch (_: Throwable) { } - override fun changeVolume(timeSeconds: Double) = device.changeVolume(timeSeconds) + override fun changeVolume(newVolume: Double) { + device.changeVolume(newVolume) + volume = newVolume + } override fun changeSpeed(speed: Double) = device.changeSpeed(speed) @@ -274,6 +277,11 @@ class ExpCastingDevice(val device: RsCastingDevice) : CastingDevice() { } } } + eventHandler.onPlayChanged.subscribe { isPlaying = it } + eventHandler.onTimeChanged.subscribe { time = it } + eventHandler.onDurationChanged.subscribe { duration = it } + eventHandler.onVolumeChanged.subscribe { volume = it } + eventHandler.onSpeedChanged.subscribe { speed = it } } override fun ensureThreadStarted() {}