sessions in private still get cursor info & send inactive.

This commit is contained in:
Miroslav Šedivý 2022-03-27 00:35:33 +01:00
parent 470f670865
commit 149d74150b

View File

@ -203,8 +203,6 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
setPaused: func(isPaused bool) {
videoTrack.SetPaused(isPaused)
audioTrack.SetPaused(isPaused)
// TODO: Send fresh cursor position & image when unpausing.
},
iceTrickle: manager.config.ICETrickle,
}
@ -320,22 +318,12 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
})
cursorImage := func(entry *cursor.ImageEntry) {
// TODO: Refactor.
if videoTrack.paused {
return
}
if err := peer.SendCursorImage(entry.Cursor, entry.Image); err != nil {
logger.Err(err).Msg("could not send cursor image")
}
}
cursorPosition := func(x, y int) {
// TODO: Refactor.
if videoTrack.paused {
return
}
if session.IsHost() {
return
}
@ -368,11 +356,6 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
})
dataChannel.OnMessage(func(message webrtc.DataChannelMessage) {
// TODO: Refactor.
if videoTrack.paused {
return
}
if err := manager.handle(message.Data, session); err != nil {
logger.Err(err).Msg("data handle failed")
}