neko/internal/types/webrtc.go

31 lines
806 B
Go
Raw Normal View History

package types
2021-02-03 07:21:48 +13:00
import "github.com/pion/webrtc/v3"
2021-03-18 03:47:49 +13:00
type ICEServer struct {
URLs []string `mapstructure:"urls" json:"urls"`
2021-03-19 23:28:06 +13:00
Username string `mapstructure:"username" json:"username,omitempty"`
Credential string `mapstructure:"credential" json:"credential,omitempty"`
2021-03-18 03:47:49 +13:00
}
2020-11-26 06:41:40 +13:00
type WebRTCPeer interface {
2021-06-28 08:02:05 +12:00
CreateOffer(ICETrickle bool, ICERestart bool) (*webrtc.SessionDescription, error)
2020-11-26 06:41:40 +13:00
SignalAnswer(sdp string) error
2021-02-03 08:43:33 +13:00
SignalCandidate(candidate webrtc.ICECandidateInit) error
2021-02-13 10:13:55 +13:00
2021-02-06 05:57:33 +13:00
SetVideoID(videoID string) error
2021-02-13 10:13:55 +13:00
SendCursorPosition(x, y int) error
SendCursorImage(cur *CursorImage, img []byte) error
2021-02-03 08:43:33 +13:00
2020-11-26 06:41:40 +13:00
Destroy() error
}
type WebRTCManager interface {
Start()
Shutdown() error
2021-02-03 07:21:48 +13:00
2021-03-18 03:47:49 +13:00
ICEServers() []ICEServer
2021-02-03 07:21:48 +13:00
2021-02-08 05:07:55 +13:00
CreatePeer(session Session, videoID string) (*webrtc.SessionDescription, error)
}