webrtc SetCursorPosition.

This commit is contained in:
Miroslav Šedivý 2022-07-21 18:28:51 +02:00
parent 81531d74c1
commit f4a4e0152e
3 changed files with 7 additions and 0 deletions

View File

@ -446,3 +446,7 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
return offer, nil return offer, nil
} }
func (manager *WebRTCManagerCtx) SetCursorPosition(x, y int) {
manager.curPosition.Set(x, y)
}

View File

@ -64,7 +64,9 @@ func (h *MessageHandlerCtx) controlMove(session types.Session, payload *message.
return err return err
} }
// handle active cursor movement
h.desktop.Move(payload.X, payload.Y) h.desktop.Move(payload.X, payload.Y)
h.webrtc.SetCursorPosition(payload.X, payload.Y)
return nil return nil
} }

View File

@ -41,4 +41,5 @@ type WebRTCManager interface {
ICEServers() []ICEServer ICEServers() []ICEServer
CreatePeer(session Session, videoID string) (*webrtc.SessionDescription, error) CreatePeer(session Session, videoID string) (*webrtc.SessionDescription, error)
SetCursorPosition(x, y int)
} }