ApiRTC iOS SDK Documentation Beta

Class Stream

open class Stream: Observable<StreamEvent>
Stream Stream Observable<StreamEvent> Observable<StreamEvent> Stream->Observable<StreamEvent>

Conforms To

Observable<StreamEvent>

Properties

id

var id: String!

type

var type: StreamType = .unknown

direction

var direction: StreamDirection

Stream pub/sub direction

capture​Session

var captureSession: AVCaptureSession?

Capture session if applicable

device

var device: AVCaptureDevice?

Capture device if applicable

format

var format: AVCaptureDevice.Format?

Capture format if applicable

media​Stream

var mediaStream: MediaStream?

MediaStream if applicable

Methods

create​Camera​Stream(position:​format:​)

open class func createCameraStream(position: AVCaptureDevice.Position, format: AVCaptureDevice.Format? = nil) throws -> Stream

Creates a camera stream with given settings

create​Audio​Stream()

open class func createAudioStream() -> Stream

Creates audio stream

create​External​Camera​Stream()

open class func createExternalCameraStream() -> Stream

mute​Audio()

open func muteAudio()

Mutes audio. If this stream is published to another contact, the stream will also be muted on the contact's side. If this stream is subscribed from another contact, muting the stream will have no impact on the contact's side

unmute​Audio()

open func unmuteAudio()

Unmutes audio. If this stream is published to another contact, the stream will also be unmuted on the contact's side. If this stream is subscribed from another contact, unmuting the stream will have no impact on the contact's side, moreover, it will not unmute the stream if it has been muted by the contact

mute​Video()

open func muteVideo()

Mutes video. If this stream is published to another contact, the stream will also be muted on the contact's side. If this stream is subscribed from another contact, muting the stream will have no impact on the contact's side

unmute​Video()

open func unmuteVideo()

Unmutes video. If this stream is published to another contact, the stream will also be unmuted on the contact's side. If this stream is subscribed from another contact, muting the stream will have no impact on the contact's side, moreover, it will not unmute the stream if it has been muted by the contact

is​Audio​Muted()

open func isAudioMuted() -> Bool

Returns whether the audio track in muted

is​Video​Muted()

open func isVideoMuted() -> Bool

Returns whether the video track in muted

has​Audio()

open func hasAudio() -> Bool

Checks if stream has at least one audio track

has​Video()

open func hasVideo() -> Bool

Checks if stream has at least one video track

supported​Formats(_:​)

open class func supportedFormats(_ device: AVCaptureDevice) -> [AVCaptureDevice.Format]

Returns supported formats by WebRTC for the given device

add​Renderer(_:​)

open func addRenderer(_ renderer: RTCVideoRenderer)

Adds renderer to the current VideoTrack if applicable

get​Owner()

open func getOwner() -> Contact

Returns stream's owner

get​Conversations()

open func getConversations() -> [Conversation]?

Returns conversations the stream is published in

on​Event(_:​_:​)

open override func onEvent(_ observer: AnyObject, _ callback: @escaping ((StreamEvent) -> Void))