Documentation
¶
Index ¶
Constants ¶
View Source
const ( RequestOfferMsgType string = "request-offer" ICECandidateMsgType string = "ice-candidate" OfferMsgType string = "offer" AnswerMsgType string = "answer" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(signaling *Signaling, observer Observer) (*Connection, error)
Connects to a device. Blocks until the connection is established successfully or fails. If the returned error is not nil the Connection should be ignored.
func NewConnectionWithLogger ¶
func (*Connection) Close ¶
func (dc *Connection) Close()
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
type ICECandidateMsg ¶
type ICECandidateMsg struct {
Type string `json:"type"`
Candidate webrtc.ICECandidateInit `json:"candidate"`
}
func NewICECandidateMsg ¶
func NewICECandidateMsg(candidate webrtc.ICECandidateInit) *ICECandidateMsg
type Observer ¶
type Observer interface {
// Called when adb data channel is added to the peer connection
OnADBDataChannel(*webrtc.DataChannel)
// Called on signaling error
OnError(error)
// Called on peer connection failure
OnFailure()
// Called when the peer connection closes
OnClose()
}
type RequestOfferMsg ¶
type RequestOfferMsg struct {
Type string `json:"type"`
ICEServers []webrtc.ICEServer `json:"ice_servers,omitempty"`
}
func NewRequestOfferMsg ¶
func NewRequestOfferMsg(servers []webrtc.ICEServer) *RequestOfferMsg
type Signaling ¶
type Signaling struct {
SendCh chan any
RecvCh chan map[string]any
// The ICE servers to use in the webRTC connection.
ICEServers []webrtc.ICEServer
// The servers that were created client side and need to be sent to the device.
// This is typically a subset of Servers. Ignored if empty.
ClientICEServers []webrtc.ICEServer
}
Click to show internal directories.
Click to hide internal directories.