Channel
Channel represents an established channel session and is the core entry point for publishing, subscribing, messaging, and user state.
Properties
getUsers()
Gets info for all users currently in the channel.
[String: UserInfo]
getUser(_:)
Gets a user object by uid.
User?
publishLocalTrack(_:)
Publishes a local audio or video track.
publishLocalTrack(_ track: LocalAudioTrack, options: AudioPublishOptions? = nil)publishLocalTrack(_ track: LocalVideoTrack, options: VideoPublishOptions? = nil)
- Audio tracks go through the internal mixed sending model
- If a
LocalScreenTrackcarries screen audio, its audio part is published automatically along with it
unpublishLocalTrack(_:)
Unpublishes a local audio or video track.
stopCapture() after unpublishing to release capture resources.
subscribeRemoteAudioTrack(uid:trackId:)
Subscribes to a remote audio track.
subscribeRemoteVideoTrack(uid:trackId:)
Subscribes to a remote video track.
unsubscribeRemoteTrack(_:debounceMs:)
Unsubscribes from a remote track.
getRemoteTrack(uid:trackId:)
Gets a remote track object by user and track ID.
Track?
getRemoteTrackByDesc(uid:desc:)
Gets a remote track by desc.
Track base class
All tracks inherit fromTrack and share the following core properties:
Common methods:
getInfo()
LocalMicTrack
Capture control
startCapture(options:)stopCapture()restartCapture()
User control
mute()unmute()changeDeviceId(_:)
LocalCameraTrack
Capture control
startCapture(options:)stopCapture()restartCapture()
User control
mute()unmute()changeDeviceId(_:)switchCamera()
Rendering
addRenderer(_:)removeRenderer(_:)removeAllRenderers()
LocalScreenTrack
Capture control
startCapture(options:)stopCapture()restartCapture()
User control
mute()unmute()
Screen audio
audioTracksetAudioTrack(_:)getAudioTrack()
Capture mode and state (iOS)
LocalAudioTrack
For custom audio input:mute()unmute()pushAudioBuffer(_:)
startCapture(); instead, your app keeps injecting PCM data.
LocalVideoTrack
For custom video input:addRenderer(_:)removeRenderer(_:)removeAllRenderers()pushFrame(_:rotation:timestampNs:)
RemoteAudioTrack
Playback control
startPlay()stopPlay()isPlaying
PCM data callback
add(audioRenderer:)remove(audioRenderer:)
AudioRenderer callback receives AVAudioPCMBuffer values, suitable for speech transcription, recording, or further analysis.
RemoteVideoTrack
Rendering control
addRenderer(_:)removeRenderer(_:)removeAllRenderers()
SRTCVideoView(track:) or SRTCVideoRenderer.
Receive status
isReceiveTimedOut: Bool
timedOut last reported by channel(_:didChangeReceiveStreamStatus:), and is suited for filling in the current state once when a render view initializes or when the app returns from the background to the foreground, so the UI doesn’t fall out of sync with reality by relying on events alone. For the everyday “loading” indicator, we still recommend driving it with events—see Events for details.
Rendering components
SRTCVideoView
Preferred for SwiftUI:
VideoView
For UIKit / AppKit, use bind(track:) / unbind() to manage binding.
SRTCVideoRenderer
A lower-level rendering view, bound by the track explicitly calling addRenderer(_:).