webrtc

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiFactory

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

func NewApiFactory

func NewApiFactory(conf conf.Webrtc, log *logger.Logger, mod ModApiFun) (api *ApiFactory, err error)

func (*ApiFactory) NewPeer

func (a *ApiFactory) NewPeer() (*webrtc.PeerConnection, error)

type Decoder

type Decoder func(data string, obj any) error

type ModApiFun

type ModApiFun func(m *webrtc.MediaEngine, i *interceptor.Registry, s *webrtc.SettingEngine)

type Peer

type Peer struct {
	OnMessage func(data []byte)
	// contains filtered or unexported fields
}

func New

func New(log *logger.Logger, api *ApiFactory) *Peer

func (*Peer) AddCandidate

func (p *Peer) AddCandidate(candidate string, decoder Decoder) error

func (*Peer) Disconnect

func (p *Peer) Disconnect()

func (*Peer) IsConnected

func (p *Peer) IsConnected() bool

func (*Peer) NewCall

func (p *Peer) NewCall(vCodec, aCodec string, onICECandidate func(ice any)) (sdp any, err error)

func (*Peer) SendMessage

func (p *Peer) SendMessage(data []byte)

func (*Peer) SetRemoteSDP

func (p *Peer) SetRemoteSDP(sdp string, decoder Decoder) error

func (*Peer) WriteAudio

func (p *Peer) WriteAudio(sample *media.Sample) error

func (*Peer) WriteVideo

func (p *Peer) WriteVideo(sample *media.Sample) error

type PionLog

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

func NewPionLogger

func NewPionLogger(root *logger.Logger, level int) *PionLog

func (PionLog) Debug

func (p PionLog) Debug(msg string)

func (PionLog) Debugf

func (p PionLog) Debugf(format string, args ...any)

func (PionLog) Error

func (p PionLog) Error(msg string)

func (PionLog) Errorf

func (p PionLog) Errorf(format string, args ...any)

func (PionLog) Info

func (p PionLog) Info(msg string)

func (PionLog) Infof

func (p PionLog) Infof(format string, args ...any)

func (PionLog) NewLogger

func (p PionLog) NewLogger(scope string) logging.LeveledLogger

func (PionLog) Trace

func (p PionLog) Trace(msg string)

func (PionLog) Tracef

func (p PionLog) Tracef(format string, args ...any)

func (PionLog) Warn

func (p PionLog) Warn(msg string)

func (PionLog) Warnf

func (p PionLog) Warnf(format string, args ...any)

Jump to

Keyboard shortcuts

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