relay

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinErrs added in v1.9.9

func JoinErrs(errs ...error) error

Types

type Peer

type Peer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Peer) Close added in v1.9.9

func (r *Peer) Close() error

func (*Peer) LocalTracks

func (r *Peer) LocalTracks() []webrtc.TrackLocal

func (*Peer) WriteRTCP

func (r *Peer) WriteRTCP(pkts []rtcp.Packet) error

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func New

func New(iceServers []webrtc.ICEServer, logger logr.Logger) *Provider

func (*Provider) AddDataChannels

func (p *Provider) AddDataChannels(sessionID, peerID string, labels []string) error

func (*Provider) OnDatachannel

func (p *Provider) OnDatachannel(fn func(meta SignalMeta, dc *webrtc.DataChannel))

func (*Provider) OnRemoteStream

func (p *Provider) OnRemoteStream(fn func(meta SignalMeta, receiver *webrtc.RTPReceiver, codec *webrtc.RTPCodecParameters))

func (*Provider) Receive

func (p *Provider) Receive(remoteSignal []byte) ([]byte, error)

func (*Provider) Send

func (p *Provider) Send(sessionID, peerID string, receiver *webrtc.RTPReceiver, localTrack webrtc.TrackLocal) (*Peer, *webrtc.RTPSender, error)

func (*Provider) SetSettingEngine

func (p *Provider) SetSettingEngine(se webrtc.SettingEngine)

func (*Provider) SetSignaler

func (p *Provider) SetSignaler(signaler func(meta SignalMeta, signal []byte) ([]byte, error))

type Signal

type Signal struct {
	Metadata         SignalMeta                  `json:"metadata"`
	Encodings        *webrtc.RTPCodingParameters `json:"encodings,omitempty"`
	ICECandidates    []webrtc.ICECandidate       `json:"iceCandidates,omitempty"`
	ICEParameters    webrtc.ICEParameters        `json:"iceParameters,omitempty"`
	DTLSParameters   webrtc.DTLSParameters       `json:"dtlsParameters,omitempty"`
	CodecParameters  *webrtc.RTPCodecParameters  `json:"codecParameters,omitempty"`
	SCTPCapabilities *webrtc.SCTPCapabilities    `json:"sctpCapabilities,omitempty"`
}

type SignalMeta

type SignalMeta struct {
	PeerID    string `json:"peerId"`
	StreamID  string `json:"streamId"`
	SessionID string `json:"sessionId"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL