Skip to main content

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.
Returns: [String: UserInfo]

getUser(_:)

Gets a user object by uid.
Returns: User?

publishLocalTrack(_:)

Publishes a local audio or video track.
Supported overloads:
  • publishLocalTrack(_ track: LocalAudioTrack, options: AudioPublishOptions? = nil)
  • publishLocalTrack(_ track: LocalVideoTrack, options: VideoPublishOptions? = nil)
Note:
  • Audio tracks go through the internal mixed sending model
  • If a LocalScreenTrack carries screen audio, its audio part is published automatically along with it

unpublishLocalTrack(_:)

Unpublishes a local audio or video track.
We recommend calling 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.
Returns: Track?

getRemoteTrackByDesc(uid:desc:)

Gets a remote track by desc.


Track base class

All tracks inherit from Track and share the following core properties: Common methods:
  • getInfo()

LocalMicTrack

Capture control

  • startCapture(options:)
  • stopCapture()
  • restartCapture()

User control

  • mute()
  • unmute()
  • changeDeviceId(_:)
Typical usage:

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

  • audioTrack
  • setAudioTrack(_:)
  • getAudioTrack()

Capture mode and state (iOS)


LocalAudioTrack

For custom audio input:
  • mute()
  • unmute()
  • pushAudioBuffer(_:)
This kind of track usually doesn’t need startCapture(); instead, your app keeps injecting PCM data.

LocalVideoTrack

For custom video input:
  • addRenderer(_:)
  • removeRenderer(_:)
  • removeAllRenderers()
  • pushFrame(_:rotation:timestampNs:)
If you have an external rendering pipeline, a canvas, a screen encoder, or an AI processing pipeline, this entry point is the better fit.

RemoteAudioTrack

Playback control

  • startPlay()
  • stopPlay()
  • isPlaying

PCM data callback

  • add(audioRenderer:)
  • remove(audioRenderer:)
The AudioRenderer callback receives AVAudioPCMBuffer values, suitable for speech transcription, recording, or further analysis.

RemoteVideoTrack

Rendering control

  • addRenderer(_:)
  • removeRenderer(_:)
  • removeAllRenderers()
Remote video is usually displayed after a successful subscription, through SRTCVideoView(track:) or SRTCVideoRenderer.

Receive status

  • isReceiveTimedOut: Bool
Whether this video has currently been judged to have timed out on receiving. The value matches the 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(_:).