Documentation ¶
Index ¶
- type AudioConstraints
- type AudioMandatory
- type Configuration
- type Constraints
- type DataChannel
- func (c *DataChannel) Close() error
- func (c *DataChannel) ID() int
- func (c *DataChannel) Label() string
- func (c *DataChannel) OnClose(cb func())
- func (c *DataChannel) OnMessage(cb func([]byte))
- func (c *DataChannel) OnOpen(cb func())
- func (c *DataChannel) ReadyState() string
- func (c *DataChannel) Send(data []byte)
- type IceCandidate
- type IceServer
- type MediaStream
- type PeerConnection
- func (pc *PeerConnection) AddIceCandidate(ic *IceCandidate) error
- func (pc *PeerConnection) AddStream(stream *MediaStream) (err error)
- func (pc *PeerConnection) Close() error
- func (pc *PeerConnection) ConnectionState() string
- func (pc *PeerConnection) CreateAnswer() (*SessionDescription, error)
- func (pc *PeerConnection) CreateDataChannel(label string) (*DataChannel, error)
- func (pc *PeerConnection) CreateOffer() (*SessionDescription, error)
- func (pc *PeerConnection) IceGatheringState() string
- func (pc *PeerConnection) LocalDescription() (sdp *SessionDescription)
- func (pc *PeerConnection) OnAddStream(cb func(*MediaStream))
- func (pc *PeerConnection) OnConnectionStateChange(cb func(PeerConnectionState string))
- func (pc *PeerConnection) OnDataChannel(cb func(*DataChannel))
- func (pc *PeerConnection) OnIceCandidate(cb func(*IceCandidate))
- func (pc *PeerConnection) OnIceCandidateError(cb func())
- func (pc *PeerConnection) OnIceConnectionStateChange(cb func(IceConnectionState string))
- func (pc *PeerConnection) OnIceGatheringStateChange(cb func(IceGatheringState string))
- func (pc *PeerConnection) OnNegotiationNeeded(cb func())
- func (pc *PeerConnection) OnRemoveStream(cb func(*MediaStream))
- func (pc *PeerConnection) OnSignalingStateChange(cb func(SignalingState string))
- func (pc *PeerConnection) RemoteDescription() (sdp *SessionDescription)
- func (pc *PeerConnection) SetLocalDescription(sdp *SessionDescription) error
- func (pc *PeerConnection) SetRemoteDescription(sdp *SessionDescription) error
- func (pc *PeerConnection) SignalingState() string
- type SessionDescription
- type VideoConstraints
- type VideoMandatory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioConstraints ¶
type AudioConstraints struct {
Mandatory AudioMandatory `js:"mandatory"`
}
AudioConstraints ...
type AudioMandatory ¶
type AudioMandatory struct { EchoCancellation bool `js:"echoCancellation"` MaxChannelCount int `js:"maxChannelCount"` MinChannelCount int `js:"minChannelCount"` MaxSampleRate int `js:"maxSampleRate"` MinSampleRate int `js:"minSampleRate"` MaxLatency float64 `js:"maxLatency"` MinLatency float64 `js:"minLatency"` MaxVolume float64 `js:"maxVolume"` MinVolume float64 `js:"minVolume"` }
AudioMandatory ...
type Configuration ¶
type Configuration struct { IceServers []*IceServer `js:"iceServers"` IceTransportPolicy string `js:"iceTransportPolicy"` BundlePolicy string `js:"bundlePolicy"` RTCPMuxPolicy string `js:"rtcpMuxPolicy"` PeerIdentity string `js:"peerIdentity"` }
Configuration ...
func (*Configuration) AddIceServer ¶
func (config *Configuration) AddIceServer(params ...string) error
AddIceServer ...
type Constraints ¶
type Constraints struct { Video interface{} `js:"video"` // bool or *VideoConstraints Audio interface{} `js:"audio"` // bool or *AudioConstraints }
Constraints ...
type DataChannel ¶
type DataChannel struct {
// contains filtered or unexported fields
}
DataChannel ...
type IceCandidate ¶
type IceCandidate struct { Candidate string `json:"candidate",js:"candidate"` SdpMid string `json:"sdpMid",js:"sdpMid"` SdpMLineIndex int `json:"sdpMLineIndex",js:"sdpMLineIndex"` }
IceCandidate ...
func NewIceCandidate ¶
func NewIceCandidate(candidate, sdpmid string, sdpMLineIndex int) *IceCandidate
NewIceCandidate ...
type IceServer ¶
type IceServer struct { Urls []string `js:"urls"` Username string `js:"username"` Credential string `js:"credential"` CredentialType string `js:"credentialType"` }
IceServer ...
type MediaStream ¶
type MediaStream struct{}
MediaStream ...
func GetUserMedia ¶
func GetUserMedia(constraints *Constraints) (stream *MediaStream, err error)
GetUserMedia ...
type PeerConnection ¶
type PeerConnection struct {
// contains filtered or unexported fields
}
PeerConnection ...
func NewPeerConnection ¶
func NewPeerConnection(config *Configuration) (*PeerConnection, error)
NewPeerConnection ...
func (*PeerConnection) AddIceCandidate ¶
func (pc *PeerConnection) AddIceCandidate(ic *IceCandidate) error
AddIceCandidate ...
func (*PeerConnection) AddStream ¶
func (pc *PeerConnection) AddStream(stream *MediaStream) (err error)
AddStream ...
func (*PeerConnection) ConnectionState ¶
func (pc *PeerConnection) ConnectionState() string
ConnectionState ...
func (*PeerConnection) CreateAnswer ¶
func (pc *PeerConnection) CreateAnswer() (*SessionDescription, error)
CreateAnswer ...
func (*PeerConnection) CreateDataChannel ¶
func (pc *PeerConnection) CreateDataChannel(label string) (*DataChannel, error)
CreateDataChannel ...
func (*PeerConnection) CreateOffer ¶
func (pc *PeerConnection) CreateOffer() (*SessionDescription, error)
CreateOffer ...
func (*PeerConnection) IceGatheringState ¶
func (pc *PeerConnection) IceGatheringState() string
IceGatheringState ...
func (*PeerConnection) LocalDescription ¶
func (pc *PeerConnection) LocalDescription() (sdp *SessionDescription)
LocalDescription ...
func (*PeerConnection) OnAddStream ¶
func (pc *PeerConnection) OnAddStream(cb func(*MediaStream))
OnAddStream ...
func (*PeerConnection) OnConnectionStateChange ¶
func (pc *PeerConnection) OnConnectionStateChange(cb func(PeerConnectionState string))
OnConnectionStateChange ...
func (*PeerConnection) OnDataChannel ¶
func (pc *PeerConnection) OnDataChannel(cb func(*DataChannel))
OnDataChannel ...
func (*PeerConnection) OnIceCandidate ¶
func (pc *PeerConnection) OnIceCandidate(cb func(*IceCandidate))
OnIceCandidate ...
func (*PeerConnection) OnIceCandidateError ¶
func (pc *PeerConnection) OnIceCandidateError(cb func())
OnIceCandidateError ...
func (*PeerConnection) OnIceConnectionStateChange ¶
func (pc *PeerConnection) OnIceConnectionStateChange(cb func(IceConnectionState string))
OnIceConnectionStateChange ...
func (*PeerConnection) OnIceGatheringStateChange ¶
func (pc *PeerConnection) OnIceGatheringStateChange(cb func(IceGatheringState string))
OnIceGatheringStateChange ...
func (*PeerConnection) OnNegotiationNeeded ¶
func (pc *PeerConnection) OnNegotiationNeeded(cb func())
OnNegotiationNeeded ...
func (*PeerConnection) OnRemoveStream ¶
func (pc *PeerConnection) OnRemoveStream(cb func(*MediaStream))
OnRemoveStream ...
func (*PeerConnection) OnSignalingStateChange ¶
func (pc *PeerConnection) OnSignalingStateChange(cb func(SignalingState string))
OnSignalingStateChange ...
func (*PeerConnection) RemoteDescription ¶
func (pc *PeerConnection) RemoteDescription() (sdp *SessionDescription)
RemoteDescription ...
func (*PeerConnection) SetLocalDescription ¶
func (pc *PeerConnection) SetLocalDescription(sdp *SessionDescription) error
SetLocalDescription ...
func (*PeerConnection) SetRemoteDescription ¶
func (pc *PeerConnection) SetRemoteDescription(sdp *SessionDescription) error
SetRemoteDescription ...
func (*PeerConnection) SignalingState ¶
func (pc *PeerConnection) SignalingState() string
SignalingState ...
type SessionDescription ¶
type SessionDescription struct { Type string `json:"type",js:"type"` Sdp string `json:"sdp",js:"sdp"` }
SessionDescription ...
func NewSessionDescription ¶
func NewSessionDescription(tp, sdp string) *SessionDescription
NewSessionDescription ...
type VideoConstraints ¶
type VideoConstraints struct {
Mandatory VideoMandatory `js:"mandatory"`
}
VideoConstraints ...
type VideoMandatory ¶
type VideoMandatory struct { MaxWidth int `js:"maxWidth"` MinWidth int `js:"minWidth"` MaxHeight int `js:"maxHeight"` MinHeight int `js:"minHeight"` MaxFrameRate float64 `js:"maxFrameRate"` MinFrameRate float64 `js:"minFrameRate"` AspectRate float64 `js:"aspectRate"` MaxAspectRate float64 `js:"maxAspectRate"` MinAspectRate float64 `js:"minAspectRate"` }
VideoMandatory ...