transport

package
v0.0.0-...-6470968 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MimeTypeAudioRed = "audio/red"
)

Variables

This section is empty.

Functions

func CreateMediaEngine

func CreateMediaEngine(allowedCodecs []config.CodecConfig) *webrtc.MediaEngine

func WithAllowedCodecs

func WithAllowedCodecs(allowedCodecs []config.CodecConfig) func(t *Transport)

func WithContext

func WithContext(ctx context.Context) func(t *Transport)

func WithEventEmitter

func WithEventEmitter(eventemitter eventemitter.EventEmitter) func(t *Transport)

func WithLogger

func WithLogger(logger logger.Logger) func(t *Transport)

func WithWebRTCConfig

func WithWebRTCConfig(webrtcConfig *config.WebRTCConfig) func(t *Transport)

Types

type Transport

type Transport struct {
	*webrtc.PeerConnection
	// contains filtered or unexported fields
}

func NewTransport

func NewTransport(opts ...TransportOpt) (*Transport, error)

func (*Transport) Context

func (t *Transport) Context() context.Context

func (*Transport) CreateAnswer

func (t *Transport) CreateAnswer(options *webrtc.AnswerOptions) (lsdp webrtc.SessionDescription, err error)

func (*Transport) CreateLocalDescription

func (t *Transport) CreateLocalDescription() (lsdp webrtc.SessionDescription, err error)

func (*Transport) CreateOffer

func (t *Transport) CreateOffer(options *webrtc.OfferOptions) (lsdp webrtc.SessionDescription, err error)

func (*Transport) EnableRemoteCandidates

func (t *Transport) EnableRemoteCandidates() error

func (*Transport) EventEmitter

func (t *Transport) EventEmitter() eventemitter.EventEmitter

func (*Transport) Finalize

func (t *Transport) Finalize()

func (*Transport) GatheringCompleteLocalSdp

func (t *Transport) GatheringCompleteLocalSdp(ctx context.Context) (lsdp webrtc.SessionDescription, err error)

func (*Transport) LocalSdpSetted

func (t *Transport) LocalSdpSetted() bool

func (*Transport) LocalSdpType

func (t *Transport) LocalSdpType() webrtc.SDPType

func (*Transport) Logger

func (t *Transport) Logger() logger.Logger

func (*Transport) OnFailed

func (t *Transport) OnFailed(f func(isShort bool))

func (*Transport) OnICECandidate

func (t *Transport) OnICECandidate(f func(candidate webrtc.ICECandidateInit))

func (*Transport) OnICEGathererStateComplete

func (t *Transport) OnICEGathererStateComplete(f func())

func (*Transport) OnInitialConnected

func (t *Transport) OnInitialConnected(f func())

func (*Transport) RemoteSdpSetted

func (t *Transport) RemoteSdpSetted() bool

func (*Transport) ResetShortConnOnICERestart

func (t *Transport) ResetShortConnOnICERestart()

func (*Transport) SetPreferTCP

func (t *Transport) SetPreferTCP(preferTCP bool)

func (*Transport) SetRemoteDescription

func (t *Transport) SetRemoteDescription(sd webrtc.SessionDescription) (err error)

func (*Transport) UpdateICECredential

func (t *Transport) UpdateICECredential(sdp *webrtc.SessionDescription) (bool, error)

type TransportOpt

type TransportOpt func(t *Transport)

func WithConnConfig

func WithConnConfig(icc *config.ICEConfig) TransportOpt

Jump to

Keyboard shortcuts

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