Documentation ¶
Index ¶
- func RandString(length int) string
- type Entry
- type ICEServer
- type TurnServer
- type Webrtc
- func (w *Webrtc) Close()
- func (w *Webrtc) OnConnectionStateChange(f func(s webrtc.PeerConnectionState))
- func (w *Webrtc) OnDataChannel(c *webrtc.DataChannel)
- func (w *Webrtc) OnICECandidate(f func(c *webrtc.ICECandidate))
- func (w *Webrtc) Savecandidate(candidate webrtc.ICECandidateInit) error
- func (w *Webrtc) SendAnswer(sdp *webrtc.SessionDescription) *webrtc.SessionDescription
- func (w *Webrtc) SendOffer() *webrtc.SessionDescription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandString ¶
Types ¶
type TurnServer ¶
type TurnServer struct { Svr *turn.Server // contains filtered or unexported fields }
turnserver服务
func NewTurnServer ¶
func NewTurnServer(realm string) *TurnServer
func (*TurnServer) Authenticate ¶
func (*TurnServer) Credentials ¶
func (a *TurnServer) Credentials(username string) (string, string)
func (*TurnServer) Disallow ¶
func (a *TurnServer) Disallow(username string)
type Webrtc ¶
type Webrtc struct { PeerConnection *webrtc.PeerConnection `json:"peerConnection"` DataChannel *webrtc.DataChannel `json:"dataChannel"` // contains filtered or unexported fields }
func (*Webrtc) OnConnectionStateChange ¶
func (w *Webrtc) OnConnectionStateChange(f func(s webrtc.PeerConnectionState))
监听状态变化
func (*Webrtc) OnICECandidate ¶
func (w *Webrtc) OnICECandidate(f func(c *webrtc.ICECandidate))
监听ICE变化
func (*Webrtc) Savecandidate ¶
func (*Webrtc) SendAnswer ¶
func (w *Webrtc) SendAnswer(sdp *webrtc.SessionDescription) *webrtc.SessionDescription
Click to show internal directories.
Click to hide internal directories.