Documentation ¶
Index ¶
- Constants
- type MediaController
- func (mediaCtrl *MediaController) AddRtpTrack(trackName string, kind string, rtpSrcUrl string, ...) (*RtpMediaSource, error)
- func (mediaCtrl *MediaController) GetCallConnectionOptions() *peerjs.ConnectionOptions
- func (mediaCtrl *MediaController) GetTrack(trackName string) MediaSource
- func (mediaCtrl *MediaController) RemoveTrack(trackName string, closeTrack bool) (error, MediaSource)
- type MediaSource
- type RtpMediaSource
- func (rtpSrc *RtpMediaSource) AddConsumer(peerId string)
- func (rtpSrc *RtpMediaSource) Close()
- func (rtpSrc *RtpMediaSource) GetConsumerPeerIds() []string
- func (rtpSrc *RtpMediaSource) GetTrack() *webrtc.TrackLocalStaticRTP
- func (rtpSrc *RtpMediaSource) RemoveConsumer(peerId string)
- func (rtpSrc *RtpMediaSource) StartMediaStream()
Constants ¶
View Source
const (
H264FrameDuration = time.Millisecond * 33
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MediaController ¶
type MediaController struct { // map of media streams being sent to this relay from the backend or frontend clients (key is the track name) MediaSources map[string]MediaSource DevicesWrapper *mediaDevicesWrapper MediaEngine webrtc.MediaEngine }
func NewMediaController ¶
func NewMediaController() *MediaController
func (*MediaController) AddRtpTrack ¶
func (mediaCtrl *MediaController) AddRtpTrack(trackName string, kind string, rtpSrcUrl string, codecParams webrtc.RTPCodecParameters) (*RtpMediaSource, error)
AddRtpTrack: add a new rtp track to the media controller and start listening for incoming rtp packets
func (*MediaController) GetCallConnectionOptions ¶
func (mediaCtrl *MediaController) GetCallConnectionOptions() *peerjs.ConnectionOptions
func (*MediaController) GetTrack ¶
func (mediaCtrl *MediaController) GetTrack(trackName string) MediaSource
func (*MediaController) RemoveTrack ¶
func (mediaCtrl *MediaController) RemoveTrack(trackName string, closeTrack bool) (error, MediaSource)
close the media source and remove it from the map
type MediaSource ¶
type RtpMediaSource ¶
type RtpMediaSource struct { MediaSource // contains filtered or unexported fields }
func NewRtpMediaSource ¶
func (*RtpMediaSource) AddConsumer ¶
func (rtpSrc *RtpMediaSource) AddConsumer(peerId string)
func (*RtpMediaSource) Close ¶
func (rtpSrc *RtpMediaSource) Close()
func (*RtpMediaSource) GetConsumerPeerIds ¶
func (rtpSrc *RtpMediaSource) GetConsumerPeerIds() []string
func (*RtpMediaSource) GetTrack ¶
func (rtpSrc *RtpMediaSource) GetTrack() *webrtc.TrackLocalStaticRTP
func (*RtpMediaSource) RemoveConsumer ¶
func (rtpSrc *RtpMediaSource) RemoveConsumer(peerId string)
func (*RtpMediaSource) StartMediaStream ¶
func (rtpSrc *RtpMediaSource) StartMediaStream()
StartMediaStream (blocking) starts pulling packets from the rtp media stream and sending them to the webrtc track
Click to show internal directories.
Click to hide internal directories.