IrisRtcStream Class Reference
Inherits from | NSObject |
---|---|
Declared in | IrisRtcStream.h |
Overview
The IrisRtcStream
class manages the audio and video streams that can be created
using IRIS stream APIs. When a video or audio session is created, you can associate
the session with a stream.
The stream class APIs divided in 3 main sections: 1) Creation of streams. This can be done using initWithDelegate:error: and initWithType:quality:cameraType:delegate:error: API. Use the close api to close the streams
2) Local preview: The startPreview and stopPreview API can start and stop the preview
3) Management: To mute, unmute or to flip you can use mute, unmute, flip API
Warning: When using the stream class, it will ask user to allow to use camera while running. Please make sure apppropriate access is allowed in info.plist for the same. When the stream is started, it wont immediately access the microphone, it will use the mic only when the call is connected. Hence the pop-up for mic access will be presented to the user at a later point of time. Also when the call is connected, we change the audio session mode to VIDEO CHAT for a better experience. You can override this behaviour by choosing your own audio session in the application.
Other Methods
isVideoEnabled
Returns the flag telling whether the video stream is used by the current stream object.
@property (readonly) BOOL isVideoEnabled
Return Value
The flag value of video stream.
Discussion
Returns the flag telling whether the video stream is used by the current stream object.
Declared In
IrisRtcStream.h
Creation of the stream
– initWithDelegate:error:
This method is called to create a stream with default options. It will create stream with both audio and video. It will choose the video quality as VGA and make use of back camera.
- (id)initWithDelegate:(id<IrisRtcStreamDelegate>)delegate error:(NSError **)outError
Parameters
delegate |
The delegate object for the stream. The delegate will receive delegate messages during execution of the operation when output is generated and upon completion or failure of the operation. |
---|---|
outError |
Provides error code and basic error description when any exception occured in api call. |
Discussion
This method is called to create a stream with default options. It will create stream with both audio and video. It will choose the video quality as VGA and make use of back camera.
Declared In
IrisRtcStream.h
– initWithType:quality:cameraType:delegate:error:
This method is called to create a stream with options. It will create stream based on the options provided.
- (id)initWithType:(IrisRtcSdkStreamType)type quality:(IrisRtcSdkStreamQuality)quality cameraType:(IrisRtcCameraType)cameraType delegate:(id<IrisRtcStreamDelegate>)delegate error:(NSError **)outError
Parameters
type |
The type of the stream that will be created. You can choose to use audio or video or both for the stream creation. |
---|---|
quality |
The stream video quality you would like to use. You can choose from HD to a lower resolution such as QCIF. |
cameraType |
A choice between front and back camera of the device. |
delegate |
The delegate object for the stream. The delegate will receive delegate messages during execution of the operation when output is generated and upon completion or failure of the operation. |
outError |
Provides error code and basic error description when any exception occured in api call. |
Discussion
This method is called to create a stream with options. It will create stream based on the options provided.
Declared In
IrisRtcStream.h
– close
This method is called to close a stream. The close operation is synchronous and can take time while closing the stream. Closing the stream during a session can cause an error in video or audio sessions. Hence it is advisable to use this API once the session is closed.
- (void)close
Discussion
This method is called to close a stream. The close operation is synchronous and can take time while closing the stream. Closing the stream during a session can cause an error in video or audio sessions. Hence it is advisable to use this API once the session is closed.
Declared In
IrisRtcStream.h
Creation of the preview
– startPreview
This method is called to start a local preview for the chosen camera. When this API is called after stream creation, it will use the delegate method onLocalStream:mediaTrack: to send the track to the application. Application can create a renderer and add the same to this track.
- (void)startPreview
Discussion
This method is called to start a local preview for the chosen camera. When this API is called after stream creation, it will use the delegate method onLocalStream:mediaTrack: to send the track to the application. Application can create a renderer and add the same to this track.
Declared In
IrisRtcStream.h
– stopPreview
This method is called to stop a local preview for the chosen camera. Please remove the renderer from the track before calling this API.
- (void)stopPreview
Discussion
This method is called to stop a local preview for the chosen camera. Please remove the renderer from the track before calling this API.
Declared In
IrisRtcStream.h
Settings
– flip
This method is called to change the camera type. If the current camera type is “back”, it will be changed to front and vice versa.
- (void)flip
Discussion
This method is called to change the camera type. If the current camera type is “back”, it will be changed to front and vice versa.
Declared In
IrisRtcStream.h
– mute
This method is called to mute the audio. This API should be called only when the stream type is VIDEO or AUDIO.
- (void)mute
Discussion
This method is called to mute the audio. This API should be called only when the stream type is VIDEO or AUDIO.
Declared In
IrisRtcStream.h