webrtcpc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package webrtcpc contains a WebRTC peer connection wrapper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeerConnection

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

PeerConnection is a wrapper around webrtc.PeerConnection.

func New

func New(
	iceServers []webrtc.ICEServer,
	api *webrtc.API,
	log logger.Writer,
) (*PeerConnection, error)

New allocates a PeerConnection.

func (*PeerConnection) BytesReceived

func (co *PeerConnection) BytesReceived() uint64

BytesReceived returns received bytes.

func (*PeerConnection) BytesSent

func (co *PeerConnection) BytesSent() uint64

BytesSent returns sent bytes.

func (*PeerConnection) Close

func (co *PeerConnection) Close()

Close closes the connection.

func (*PeerConnection) Connected

func (co *PeerConnection) Connected() <-chan struct{}

Connected returns when connected.

func (*PeerConnection) Disconnected

func (co *PeerConnection) Disconnected() <-chan struct{}

Disconnected returns when disconnected.

func (*PeerConnection) GatheringDone

func (co *PeerConnection) GatheringDone() <-chan struct{}

GatheringDone returns when candidate gathering is complete.

func (*PeerConnection) LocalCandidate

func (co *PeerConnection) LocalCandidate() string

LocalCandidate returns the local candidate.

func (*PeerConnection) NewLocalCandidate

func (co *PeerConnection) NewLocalCandidate() <-chan *webrtc.ICECandidateInit

NewLocalCandidate returns when there's a new local candidate.

func (*PeerConnection) RemoteCandidate

func (co *PeerConnection) RemoteCandidate() string

RemoteCandidate returns the remote candidate.

func (*PeerConnection) WaitGatheringDone

func (co *PeerConnection) WaitGatheringDone(ctx context.Context) error

WaitGatheringDone waits until candidate gathering is complete.

Jump to

Keyboard shortcuts

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