Stream Class Properties - iOS
id
-
type:
String -
Represents the id for that stream. It is also the key of the stream in
participant.streams.
kind
-
type:
MediaType -
kindrepresents the type of stream:.audio: microphone audio.video: camera video.share: screen share.shareAudio: screen-share audio
Example
if stream.kind == .share {
// show the screen share in a larger view
}
participantId
-
type:
String -
The id of the participant the stream belongs to.
isPaused
-
type:
Bool -
truewhile the stream is paused for you: after you callpause(), or when the server pauses it, for example under adaptive subscription. Your own streams are never paused.
track
-
type:
RTCMediaStreamTrack -
It represents the media track of the stream. It is an
RTCVideoTrackfor camera and screen-share streams, and anRTCAudioTrackfor audio streams. These types come fromVideoSDKRTC. See Video Rendering for their properties and methods. -
To show a video stream, add an
RTCMTLVideoViewto theRTCVideoTrackwithadd(_:). Callremove(_:)when you stop showing it. -
track.kindis.audioor.video. A screen-share track is.videotoo, so use the stream'skindto tell camera and screen share apart. -
The SDK plays remote audio for you. Setting
isEnabledtofalseon a remote participant'sRTCAudioTrackasks the server to stop sending you that participant's audio, andtrueresumes it. To mute your own microphone, callmuteMic()on the room.
Example
import VideoSDKRTC
extension RoomViewController: ParticipantEventListener {
func onStreamEnabled(_ stream: RTCStream, forParticipant participant: Participant) {
if stream.kind == .video, let videoTrack = stream.track as? RTCVideoTrack {
participantVideoView.videoContentMode = .scaleAspectFill
videoTrack.add(participantVideoView)
}
}
func onStreamDisabled(_ stream: RTCStream, forParticipant participant: Participant) {
if stream.kind == .video, let videoTrack = stream.track as? RTCVideoTrack {
videoTrack.remove(participantVideoView)
}
}
}
videoTracks
-
type:
[RTCVideoTrack] -
Holds the stream's video track for a camera or screen-share stream. It is empty for an audio stream.
audioTracks
-
type:
[RTCAudioTrack] -
Holds the stream's audio track for an audio stream. It is empty for a camera or screen-share stream.
Got a Question? Ask us on discord

