Skip to content

Commit

Permalink
fix: possible disconnect when pausing early after video switch
Browse files Browse the repository at this point in the history
  • Loading branch information
iyzana committed Oct 23, 2022
1 parent b8ce45e commit 24fb547
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/main/kotlin/de/randomerror/ytsync/Sync.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ fun coordinatePlay(session: Session, timestamp: TimeStamp, isPlaying: Boolean =
coordinateServerPause(session, room, timestamp)
room.setSyncState(SyncState.AwaitReady(timestamp))
room.broadcastActive(session, "ready? ${timestamp.second}")
} else {
return "play ignore await ready"
}
return "play"
}
Expand Down Expand Up @@ -197,6 +199,7 @@ fun playNext(session: Session, room: Room) {
room.timeoutSyncAt = null
room.broadcastAll(session, "queue rm ${next.id}")
room.broadcastAll(session, "video ${next.url}")
room.setSyncState(SyncState.Playing(Instant.now(), TimeStamp(0.0)))
}
}

Expand Down

0 comments on commit 24fb547

Please sign in to comment.