Documentation ¶
Index ¶
- Constants
- func CreateMediaEngine(allowedCodecs []config.CodecConfig) *webrtc.MediaEngine
- func WithAllowedCodecs(allowedCodecs []config.CodecConfig) func(t *Transport)
- func WithContext(ctx context.Context) func(t *Transport)
- func WithEventEmitter(eventemitter eventemitter.EventEmitter) func(t *Transport)
- func WithLogger(logger logger.Logger) func(t *Transport)
- func WithWebRTCConfig(webrtcConfig *config.WebRTCConfig) func(t *Transport)
- type Transport
- func (t *Transport) Context() context.Context
- func (t *Transport) CreateAnswer(options *webrtc.AnswerOptions) (lsdp webrtc.SessionDescription, err error)
- func (t *Transport) CreateLocalDescription() (lsdp webrtc.SessionDescription, err error)
- func (t *Transport) CreateOffer(options *webrtc.OfferOptions) (lsdp webrtc.SessionDescription, err error)
- func (t *Transport) EnableRemoteCandidates() error
- func (t *Transport) EventEmitter() eventemitter.EventEmitter
- func (t *Transport) Finalize()
- func (t *Transport) GatheringCompleteLocalSdp(ctx context.Context) (lsdp webrtc.SessionDescription, err error)
- func (t *Transport) LocalSdpSetted() bool
- func (t *Transport) LocalSdpType() webrtc.SDPType
- func (t *Transport) Logger() logger.Logger
- func (t *Transport) OnFailed(f func(isShort bool))
- func (t *Transport) OnICECandidate(f func(candidate webrtc.ICECandidateInit))
- func (t *Transport) OnICEGathererStateComplete(f func())
- func (t *Transport) OnInitialConnected(f func())
- func (t *Transport) RemoteSdpSetted() bool
- func (t *Transport) ResetShortConnOnICERestart()
- func (t *Transport) SetPreferTCP(preferTCP bool)
- func (t *Transport) SetRemoteDescription(sd webrtc.SessionDescription) (err error)
- func (t *Transport) UpdateICECredential(sdp *webrtc.SessionDescription) (bool, error)
- type TransportOpt
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 WithEventEmitter ¶
func WithEventEmitter(eventemitter eventemitter.EventEmitter) func(t *Transport)
func WithLogger ¶
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) CreateAnswer ¶
func (*Transport) CreateLocalDescription ¶
func (*Transport) CreateOffer ¶
func (*Transport) EnableRemoteCandidates ¶
func (*Transport) EventEmitter ¶
func (t *Transport) EventEmitter() eventemitter.EventEmitter
func (*Transport) GatheringCompleteLocalSdp ¶
func (*Transport) LocalSdpSetted ¶
func (*Transport) LocalSdpType ¶
func (t *Transport) LocalSdpType() webrtc.SDPType
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 (*Transport) ResetShortConnOnICERestart ¶
func (t *Transport) ResetShortConnOnICERestart()
func (*Transport) SetPreferTCP ¶
func (*Transport) SetRemoteDescription ¶
func (*Transport) UpdateICECredential ¶
type TransportOpt ¶
type TransportOpt func(t *Transport)
func WithConnConfig ¶
func WithConnConfig(icc *config.ICEConfig) TransportOpt
Click to show internal directories.
Click to hide internal directories.