Class
Room
public class Room
Room the user joined. Contains the local and remote participant with their media streams. Also exposes functions such as muting or toggling video. Raises events when participants join/leave or media streams change.
Properties
Methods
localParticipant()
public func localParticipant() -> LocalParticipant?
Local participant
Returns
Local participant
remoteParticipants()
public func remoteParticipants() -> [RemoteParticipant]?
Remote participants
Returns
Array of remote participants
cameraFacingMode()
public func cameraFacingMode() -> String
Camera facing mode. Change mode via switchCamera()
Returns
String describing mode
toggleMute()
public func toggleMute() -> Bool
Mute/unmute preferred audio input device.
Returns
True if muted
toggleAudio()
public func toggleAudio() -> Bool
Toggle sending local audio. This API will add or remove an audio MediaStreamTrack to the local MediaStream. This is different from toggleMute which simply enables/disables the existing audio track.
Returns
true if muted
toggleVideo(hdVideo:)
public func toggleVideo(hdVideo: Bool?) -> Bool
Toggle sending local video.
Parameters
Name | Type | Description |
---|---|---|
hdVideo | Bool? |
Whether or not HD video should be used. If not set the default options for the session is used. |
Returns
true if sending video
toggleHdVideo()
public func toggleHdVideo() -> Bool
Toggle between SD and HD if user is sending video.
Returns
true if sending HD video
scaleDownVideo(enable:connectionId:width:)
public func scaleDownVideo(enable: Bool, connectionId: String?, width: Int?)
- Enables/disables scaling down video resolution for a given connection or all connections.
- @param {boolean} enable - True to enable scaling down video resolution.
- @param {string} [connectionId] - The connection ID. If not set then request applies to all connections.
- @param {number} [width] - The scaled down width. If not set default of 640px is used.
isVideoScaledDown(connectionId:)
public func isVideoScaledDown(connectionId: String?) -> Bool
- Checks if video resolution is being scaled down for the given connection or all connections.
- @param {string} [connectionId] - The connection ID. If not set then checks default setting for new connections.
- @returns {boolean} True if video resolution is being scaled down.
toggleSpeaker()
public func toggleSpeaker() -> Bool
replaceVideoStream(stream:)
public func replaceVideoStream(stream: Any?)
Replace the sending video stream.
Parameters
Name | Type | Description |
---|---|---|
stream | Any? |
The new media stream |
hasAudio()
public func hasAudio() -> Bool
Check if user is sending / receiving audio
Returns
True if user is sending video
hasVideo()
public func hasVideo() -> Bool
Check if user is sending video
Returns
True if user is sending video
hasHdVideo()
public func hasHdVideo() -> Bool
Check if user is sending HD video
Returns
True if user is sending HD video