Versions in this module Expand all Collapse all v0 v0.7.0 Nov 23, 2021 Changes in this version + const API_CHANNEL + const MimeTypeH264 + const MimeTypeOpus + const MimeTypeVP8 + const MimeTypeVP9 + var DefaultConfig = RTCConfig + func FileExist(path string) bool + func GetArgs(args ...string) (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 string) + func GetError(err *room.Error) error + func RandomKey(n int) string + type Call struct + Audio bool + StreamID string + Video string + type Connector struct + Metadata metadata.MD + OnClose func(Service, ServiceEvent) + OnOpen func(Service) + func NewConnector(addr string, config ...ConnectorConfig) *Connector + func (c *Connector) Close() + func (c *Connector) OnEnd(service Service, headers metadata.MD) + func (c *Connector) OnHeaders(service Service, headers metadata.MD) + func (c *Connector) RegisterService(service Service) + type ConnectorConfig struct + Cafile string + SSL bool + Token string + type JoinConfig map[string]string + func NewJoinConfig() *JoinConfig + func SetRelay(j JoinConfig) *JoinConfig + func (j JoinConfig) SetNoAutoSubscribe() *JoinConfig + func (j JoinConfig) SetNoPublish() *JoinConfig + func (j JoinConfig) SetNoSubscribe() *JoinConfig + type JoinInfo struct + Avatar string + Destination string + Direction Peer_Direction + DisplayName string + ExtraInfo []byte + Protocol Protocol + Role Role + Sid string + Uid string + Vendor string + type MediaType int32 + const MediaType_Cavans + const MediaType_MediaUnknown + const MediaType_ScreenCapture + const MediaType_Streaming + const MediaType_UserMedia + const MediaType_VoIP + type PeerInfo struct + Avatar string + Destination string + Direction Peer_Direction + DisplayName string + ExtraInfo []byte + Protocol Protocol + Role Role + Sid string + Uid string + Vendor string + type PeerState int32 + const PeerState_JOIN + const PeerState_LEAVE + const PeerState_UPDATE + type Peer_Direction int32 + const Peer_BILATERAL + const Peer_INCOMING + const Peer_OUTGOING + type Protocol int32 + const Protocol_ProtocolUnknown + const Protocol_RTMP + const Protocol_RTSP + const Protocol_SIP + const Protocol_WebRTC + type RTC struct + OnDataChannel func(*webrtc.DataChannel) + OnError func(error) + OnSpeaker func(event []string) + OnTrack func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) + OnTrackEvent func(event TrackEvent) + func NewRTC(connector *Connector, config ...RTCConfig) *RTC + func (r *RTC) Close() + func (r *RTC) Connect() + func (r *RTC) Connected() bool + func (r *RTC) CreateDataChannel(label string) (*webrtc.DataChannel, error) + func (r *RTC) GetBandWidth(cycle int) (int, int) + func (r *RTC) GetPubStats() webrtc.StatsReport + func (r *RTC) GetPubTransport() *Transport + func (r *RTC) GetSubStats() webrtc.StatsReport + func (r *RTC) GetSubTransport() *Transport + func (r *RTC) Join(sid, uid string, config ...*JoinConfig) error + func (r *RTC) Name() string + func (r *RTC) Publish(tracks ...webrtc.TrackLocal) ([]*webrtc.RTPTransceiver, error) + func (r *RTC) PublishFile(file string, video, audio bool) error + func (r *RTC) SendAnswer(sdp webrtc.SessionDescription) error + func (r *RTC) SendJoin(sid string, uid string, offer webrtc.SessionDescription, ...) error + func (r *RTC) SendOffer(sdp webrtc.SessionDescription) error + func (r *RTC) SendTrickle(candidate *webrtc.ICECandidate, target Target) + func (r *RTC) Subscribe(trackInfos []*Subscription) error + func (r *RTC) SubscribeFromEvent(event TrackEvent, audio, video bool, layer string) error + func (r *RTC) UnPublish(transceivers ...*webrtc.RTPTransceiver) error + type RTCConfig struct + WebRTC WebRTCTransportConfig + type Role int32 + const Role_Guest + const Role_Host + type Room struct + OnDisconnect func(sid, reason string) + OnError func(error) + OnJoin func(success bool, info RoomInfo, err error) + OnLeave func(success bool, err error) + OnMessage func(from string, to string, data map[string]interface{}) + OnPeerEvent func(state PeerState, Peer PeerInfo) + OnRoomInfo func(info RoomInfo) + func NewRoom(connector *Connector) *Room + func (c *Room) Close() + func (c *Room) Connect() + func (c *Room) Connected() bool + func (c *Room) Join(j JoinInfo) error + func (c *Room) Leave(sid, uid string) error + func (c *Room) Name() string + func (c *Room) SendMessage(sid, from, to string, data map[string]interface{}) error + func (r *Room) AddPeer(peer PeerInfo) error + func (r *Room) CreateRoom(info RoomInfo) error + func (r *Room) EndRoom(sid, reason string, delete bool) error + func (r *Room) GetPeers(sid string) []PeerInfo + func (r *Room) RemovePeer(sid, uid string) error + func (r *Room) UpdatePeer(peer PeerInfo) error + func (r *Room) UpdateRoom(info RoomInfo) error + type RoomInfo struct + Lock bool + Name string + Password string + Sid string + type Service interface + Close func() + Connect func() + Connected func() bool + Name func() string + type ServiceEvent struct + ErrStatus *status.Status + Name string + type Subscription struct + Layer string + Mute bool + Subscribe bool + TrackId string + type Target int32 + const Target_PUBLISHER + const Target_SUBSCRIBER + type TrackEvent struct + State TrackEvent_State + Tracks []*TrackInfo + Uid string + type TrackEvent_State int32 + const TrackEvent_ADD + const TrackEvent_REMOVE + const TrackEvent_UPDATE + type TrackInfo struct + Direction string + FrameRate uint32 + Height uint32 + Id string + Kind string + Label string + Layer string + Muted bool + StreamId string + Subscribe bool + Type MediaType + Width uint32 + type Transport struct + RecvCandidates []webrtc.ICECandidateInit + SendCandidates []*webrtc.ICECandidate + func NewTransport(role Target, rtc *RTC) *Transport + func (t *Transport) GetPeerConnection() *webrtc.PeerConnection + type WebMProducer struct + func NewWebMProducer(name string, offset int) *WebMProducer + func (t *WebMProducer) GetAudioTrack() (*webrtc.TrackLocalStaticSample, error) + func (t *WebMProducer) GetSendBandwidth(cycle int) int + func (t *WebMProducer) GetVideoTrack() (*webrtc.TrackLocalStaticSample, error) + func (t *WebMProducer) Pause(pause bool) + func (t *WebMProducer) SeekP(ts int) + func (t *WebMProducer) Start() + func (t *WebMProducer) Stop() + type WebRTCTransportConfig struct + Configuration webrtc.Configuration + Setting webrtc.SettingEngine + VideoMime string