mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-06-24 21:25:23 +00:00
Implemented WebSocket for electron version.
This commit is contained in:
parent
ad8f3985a3
commit
85530ca218
10 changed files with 310 additions and 66 deletions
|
@ -64,12 +64,14 @@ class NetworkService : Service() {
|
|||
val player = PlayerActivity.instance
|
||||
val updateMessage = if (player != null) {
|
||||
PlaybackUpdateMessage(
|
||||
System.currentTimeMillis(),
|
||||
player.currentPosition / 1000.0,
|
||||
player.duration / 1000.0,
|
||||
if (player.isPlaying) 1 else 2
|
||||
)
|
||||
} else {
|
||||
PlaybackUpdateMessage(
|
||||
System.currentTimeMillis(),
|
||||
0.0,
|
||||
0.0,
|
||||
0
|
||||
|
|
|
@ -17,6 +17,7 @@ data class SeekMessage(
|
|||
|
||||
@Serializable
|
||||
data class PlaybackUpdateMessage(
|
||||
val generationTime: Long,
|
||||
val time: Double,
|
||||
val duration: Double,
|
||||
val state: Int
|
||||
|
@ -24,6 +25,7 @@ data class PlaybackUpdateMessage(
|
|||
|
||||
@Serializable
|
||||
data class VolumeUpdateMessage(
|
||||
val generationTime: Long,
|
||||
val volume: Double
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue