Documentation
¶
Overview ¶
credit to https://github.com/poi5305/go-yuv2webRTC/blob/master/webrtc/webrtc.go
Index ¶
- func Decode(in string, obj interface{}) error
- func Encode(obj interface{}) (string, error)
- func NewInterceptedPeerConnection(conf conf.Webrtc, ics []interceptor.Interceptor, vCodec string) (*PeerConnection, error)
- func RegisterCodecs(m *MediaEngine, vCodec string) error
- type GameMeta
- type OnIceCallback
- type WebFrame
- type WebRTC
- func (w *WebRTC) AddCandidate(candidate string) error
- func (w *WebRTC) AttachRoomID(roomID string)
- func (w *WebRTC) IsConnected() bool
- func (w *WebRTC) SetRemoteSDP(remoteSDP string) error
- func (w *WebRTC) StartClient(iceCB OnIceCallback) (string, error)
- func (w *WebRTC) StopClient()
- func (w *WebRTC) WithConfig(conf webrtcConfig.Config) *WebRTC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInterceptedPeerConnection ¶ added in v2.4.1
func NewInterceptedPeerConnection(conf conf.Webrtc, ics []interceptor.Interceptor, vCodec string) (*PeerConnection, error)
func RegisterCodecs ¶ added in v2.5.0
RegisterCodecs registers the default codecs supported by WebRTC.
Types ¶
type OnIceCallback ¶
type OnIceCallback func(candidate string)
type WebRTC ¶
type WebRTC struct {
ID string
// for yuvI420 image
ImageChannel chan WebFrame
AudioChannel chan []byte
//VoiceInChannel chan []byte
//VoiceOutChannel chan []byte
InputChannel chan []byte
Done bool
RoomID string
// store thing related to game
GameMeta GameMeta
// contains filtered or unexported fields
}
WebRTC connection
func (*WebRTC) AddCandidate ¶
func (*WebRTC) AttachRoomID ¶
func (*WebRTC) SetRemoteSDP ¶
func (*WebRTC) StartClient ¶
func (w *WebRTC) StartClient(iceCB OnIceCallback) (string, error)
StartClient start webrtc
func (*WebRTC) WithConfig ¶ added in v2.4.0
func (w *WebRTC) WithConfig(conf webrtcConfig.Config) *WebRTC
Click to show internal directories.
Click to hide internal directories.