Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { LocalAudio media.AudioSource LocalVideo media.VideoSource }
type PeerConnection ¶
type PeerConnection struct { // RTP payload type (negotiated via SDP) DynamicType uint8 // Callback when a local ICE candidate is available. OnIceCandidate func(*ice.Candidate) // contains filtered or unexported fields }
func Must ¶
func Must(pc *PeerConnection, err error) *PeerConnection
Must is a helper that wraps a call to a function returning (*PeerConnection, error) and panics if the error is non-nil. It is intended for use in variable initializations such as
var pc = alohartc.Must(alohartc.NewPeerConnection(config))
func NewPeerConnection ¶
func NewPeerConnection(config Config) (*PeerConnection, error)
NewPeerConnection creates a new peer connection object
func NewPeerConnectionWithContext ¶
func NewPeerConnectionWithContext(ctx context.Context, config Config) (*PeerConnection, error)
NewPeerConnectionWithContext creates a new peer connection object
func (*PeerConnection) AddIceCandidate ¶
func (pc *PeerConnection) AddIceCandidate(c *ice.Candidate)
AddIceCandidate adds a remote ICE candidate.
func (*PeerConnection) SetRemoteDescription ¶
func (pc *PeerConnection) SetRemoteDescription(sdpOffer string) (sdpAnswer string, err error)
Set remote SDP offer. Return SDP answer.
func (*PeerConnection) Stream ¶
func (pc *PeerConnection) Stream() error
Stream establishes a connection to the remote peer, and streams media to/from the configured tracks. Blocks until an error occurs, or until the PeerConnection is closed.
Click to show internal directories.
Click to hide internal directories.