Documentation ¶
Overview ¶
Package webrtcpc contains a WebRTC peer connection wrapper.
Index ¶
- type PeerConnection
- func (co *PeerConnection) BytesReceived() uint64
- func (co *PeerConnection) BytesSent() uint64
- func (co *PeerConnection) Close()
- func (co *PeerConnection) Connected() <-chan struct{}
- func (co *PeerConnection) Disconnected() <-chan struct{}
- func (co *PeerConnection) GatheringDone() <-chan struct{}
- func (co *PeerConnection) LocalCandidate() string
- func (co *PeerConnection) NewLocalCandidate() <-chan *webrtc.ICECandidateInit
- func (co *PeerConnection) RemoteCandidate() string
- func (co *PeerConnection) WaitGatheringDone(ctx context.Context) error
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) 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.
Click to show internal directories.
Click to hide internal directories.