mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-03 03:12:41 +02:00
WebRTC cursor: set initial state.
This commit is contained in:
parent
5310acfbf0
commit
ab34f4a53f
1 changed files with 9 additions and 0 deletions
|
@ -319,6 +319,15 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, videoID strin
|
||||||
// TODO: Refactor.
|
// TODO: Refactor.
|
||||||
manager.curImgListeners[cursorChangePtr] = &cursorChange
|
manager.curImgListeners[cursorChangePtr] = &cursorChange
|
||||||
manager.curPosListeners[cursorPositionPtr] = &cursorPosition
|
manager.curPosListeners[cursorPositionPtr] = &cursorPosition
|
||||||
|
|
||||||
|
// send initial cursor image
|
||||||
|
cur := manager.desktop.GetCursorImage()
|
||||||
|
cursorChange(cur)
|
||||||
|
|
||||||
|
// send initial cursor position
|
||||||
|
x, y := manager.desktop.GetCursorPosition()
|
||||||
|
manager.logger.Warn().Int("x", x).Int("y", y).Msg("got cursor position")
|
||||||
|
cursorPosition(x, y)
|
||||||
})
|
})
|
||||||
|
|
||||||
dataChannel.OnMessage(func(message webrtc.DataChannelMessage) {
|
dataChannel.OnMessage(func(message webrtc.DataChannelMessage) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue