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.

ClassEnxRoom

Method: –(EnxStream *)getlocalStream:(NSDictionary *)publishStreamInfo;

ParameterspublishStreamInfo – 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:

CodeDescription
5015Failed to initialize a Stream without Audio, Video, and Data track.
5016Failed to initialize the Stream due to incorrect values of JSON Keys in publishStreamInfo.
5017Unable to create Stream due to failure to access Camera and Microphone.
5018Unable to create Video Stream due to failure to access Camera. Only Audio Stream created.
5019Unable to create Stream due to failure to access Microphone.
5084Invalid Video Layer. Max allowed Video Layers: 3.
5088Invalid Frame Rate. Max allowed Frame Rate: 30.