Documentation ¶
Index ¶
- Constants
- type OnClose
- type OnConnect
- type OnData
- type OnError
- type OnNegotiated
- type OnSignal
- type OnTrack
- type OnTransceiver
- type Peer
- func (peer *Peer) AddTrack(track webrtc.TrackLocal) (*webrtc.RTPSender, error)
- func (peer *Peer) AddTransceiverFromKind(kind webrtc.RTPCodecType, init ...webrtc.RTPTransceiverInit) (*webrtc.RTPTransceiver, error)
- func (peer *Peer) Channel() *webrtc.DataChannel
- func (peer *Peer) Close() error
- func (peer *Peer) CloseSignal() chan bool
- func (peer *Peer) Closed() bool
- func (peer *Peer) ConnectSignal() chan bool
- func (peer *Peer) Connected() bool
- func (peer *Peer) Connection() *webrtc.PeerConnection
- func (peer *Peer) Id() string
- func (peer *Peer) Init() error
- func (peer *Peer) Initiator() bool
- func (peer *Peer) Negotiate() error
- func (peer *Peer) OffClose(fn OnClose)
- func (peer *Peer) OffConnect(fn OnConnect)
- func (peer *Peer) OffData(fn OnData)
- func (peer *Peer) OffError(fn OnError)
- func (peer *Peer) OffNegotiated(fn OnNegotiated)
- func (peer *Peer) OffTrack(fn OnTrack)
- func (peer *Peer) OffTransceiver(fn OnTransceiver)
- func (peer *Peer) OnClose(fn OnClose)
- func (peer *Peer) OnConnect(fn OnConnect)
- func (peer *Peer) OnData(fn OnData)
- func (peer *Peer) OnError(fn OnError)
- func (peer *Peer) OnNegotiated(fn OnNegotiated)
- func (peer *Peer) OnSignal(fn OnSignal)
- func (peer *Peer) OnTrack(fn OnTrack)
- func (peer *Peer) OnTransceiver(fn OnTransceiver)
- func (peer *Peer) Reader() io.ReadCloser
- func (peer *Peer) RemoveTrack(sender *webrtc.RTPSender) error
- func (peer *Peer) SDPTransform(fn SDPTransform)
- func (peer *Peer) Signal(message map[string]interface{}) error
- func (peer *Peer) Write(bytes []byte) (int, error)
- func (peer *Peer) WriteText(text string) (int, error)
- type PeerOptions
- type SDPTransform
- type SignalMessageTransceiver
Constants ¶
View Source
const ( SignalMessageRenegotiate = "renegotiate" SignalMessageTransceiverRequest = "transceiverRequest" SignalMessageCandidate = "candidate" SignalMessageAnswer = "answer" SignalMessageOffer = "offer" SignalMessagePRAnswer = "pranswer" SignalMessageRollback = "rollback" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnNegotiated ¶
type OnNegotiated func()
type OnTransceiver ¶
type OnTransceiver func(transceiver *webrtc.RTPTransceiver)
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func NewPeer ¶
func NewPeer(options ...PeerOptions) *Peer
func (*Peer) AddTransceiverFromKind ¶
func (*Peer) CloseSignal ¶
func (*Peer) ConnectSignal ¶
func (*Peer) Connection ¶
func (peer *Peer) Connection() *webrtc.PeerConnection
func (*Peer) OffConnect ¶
func (*Peer) OffNegotiated ¶
func (peer *Peer) OffNegotiated(fn OnNegotiated)
func (*Peer) OffTransceiver ¶
func (peer *Peer) OffTransceiver(fn OnTransceiver)
func (*Peer) OnNegotiated ¶
func (peer *Peer) OnNegotiated(fn OnNegotiated)
func (*Peer) OnTransceiver ¶
func (peer *Peer) OnTransceiver(fn OnTransceiver)
func (*Peer) Reader ¶
func (peer *Peer) Reader() io.ReadCloser
func (*Peer) RemoveTrack ¶
func (*Peer) SDPTransform ¶
func (peer *Peer) SDPTransform(fn SDPTransform)
type PeerOptions ¶
type PeerOptions struct { Id string ChannelName string ChannelConfig *webrtc.DataChannelInit Tracks []webrtc.TrackLocal Config *webrtc.Configuration OfferConfig *webrtc.OfferOptions AnswerConfig *webrtc.AnswerOptions MaxChannelMessageSize int OnSignal OnSignal OnConnect OnConnect OnData OnData OnError OnError OnClose OnClose OnTransceiver OnTransceiver OnTrack OnTrack OnNegotiated OnNegotiated SDPTransform SDPTransform }
type SDPTransform ¶
type SignalMessageTransceiver ¶
type SignalMessageTransceiver struct { Kind webrtc.RTPCodecType `json:"kind"` Init []webrtc.RTPTransceiverInit `json:"init"` }
Click to show internal directories.
Click to hide internal directories.