The EnxRoom.getLocalStream() method is used to initialize a local stream at the Client endpoint before it can be published to the Room. The initialization process comprises specifying media tracks, adding custom attributes, etc. in the form of a JSON object passed as a parameter to the method.
Class: EnxRoom
Method: –(EnxStream *)getlocalStream:(NSDictionary *)publishStreamInfo;
Parameters: publishStreamInfo – A JSON object with Local Stream Options as given below:
{
"audio": true, // Whether to add Audio to stream
"video": true, // Whether to add Video to stream
"data": true, // Whether to add Data to stream
"videoSize": { // Video Frame Size - Deprecated in iOS SDK v2.0.1+
"minWidth": number,
"minHeight": number,
"maxWidth": number,
"maxHeight": number
),
"audioMuted": true, // Audio muted on entry to room
"videoMuted": true, // Video muted on entry to room
"attributes": { // Object to carry custom data
"custom1": ""
},
"maxVideoBW": number, // Max Bandwidth - Deprecated in iOS SDK v2.0.1+
"minVideoBW": number // Min Bandwidth - Deprecated in iOS SDK v2.0.1+
}
Error Codes / Exceptions:
| Code | Description |
|---|---|
| 5015 | Failed to initialize a Stream without Audio, Video, and Data track. |
| 5016 | Failed to initialize the Stream due to incorrect values of JSON Keys in publishStreamInfo. |
| 5017 | Unable to create Stream due to failure to access Camera and Microphone. |
| 5018 | Unable to create Video Stream due to failure to access Camera. Only Audio Stream created. |
| 5019 | Unable to create Stream due to failure to access Microphone. |
| 5084 | Invalid Video Layer. Max allowed Video Layers: 3. |
| 5088 | Invalid Frame Rate. Max allowed Frame Rate: 30. |
