Table of Contents

To support Screen-Sharing in the Room, you need to enable Screen-Sharing during Room Creation by setting: { "screen_share": true; }) in the JSON Payload. To receive Shared Screen, you need to subscribe to the Screen-Share Stream ID# 101 and play it on the Video Player.

Start Screen Sharing

The EnxRoom.startScreenShare() method is used to create a Screen-Sharing Stream @ 6fps to publish in the Room. Screen Sharing continues even when the Application runs in the background.

Class: EnxRoom

Methods: - (void) startScreenShare – To start Share

Delegate Methods:

  • -didStartBroadCast: Broadcast extension class receives this callback method when publishing the Screen Stream
  • -didStartScreenShareACK: This is acknowledgement to the end point whern screen stream starts.
[enxRoom startScreenShare];

// Broadcast extension class receives this callback 
// method when publishing the Screen Stream

-(void)didStartBroadCast:(NSArray *)data {

}

// Acknowledgement to the end point whern screen stream starts.

-(void)room:(EnxRoom *)room didStartScreenShareACK:(NSArray *)Data {

}

[Know more…]

Stop Screen Sharing

The EnxRoom.stopScreenShare() method is used to stop the ongoing Screen-Sharing.

Class: EnxRoom

Methods: -(void) stopScreenShare – To stop Share

Delegate Methods:

  • -didStoppedBroadCast: Broadcast extension class receives this callback method when unpublishing the Screen Stream
  • -didStopScreenShareACK: This is acknowledgement to the end point whern screen stream stops.
[enxRoom stopScreenShare ];

// Broadcast extension class receives this callback 
// method when unpublishing the Screen Stream

-(void) didStoppedBroadCast:(NSArray *)data {

}

// Acknowledgement to the end point whern screen stream stops

-(void)room:(EnxRoom *)room didStopScreenShareACK:(NSArray *)Data {

}
 

[Know more…]

Exit Screen Sharing

The EnxRoom.exitScreenShare() method is used to notify the Screen Share Broadcast Extension to exit from the ongoing Session. This is required to be called as Broadcast Extension is a different target from the main target.

Class: EnxRoom

Method: -(void)exitScreenShare

Delegate Methods:

  • -didExitScreenShareACK: Acknowledgment callback at the parent end point executed the method.
  • didRequestedExitRoom: Notification received by the child client (screen share client). As the screen share client receives this callback, they initiate to stop the broadcast and disconnect from the room.
[enxRoom exitScreenShare];

// Notification received by the child client (screen share client)

-(void)didRequestedExitRoom:(NSArray *_Nullable)Data {

}

// Acknowledgment callback for the parent client

-(void)room:(EnxRoom *_Nullable)room didExitScreenShareACK:(NSArray *_Nullable)Data {

} 

Error Codes / Exceptions

CodeDescription
5137Screen Share is not running in conference

[Know more…]

Force Stop other’s Screen Sharing

Availability: iOS SDK 2.1.2+

If moderator wishes to force stop any ongoing Screen Share by other user in the Room, he can do so by using EnxRoom.stopAllSharing() method. Note, this is Moderator exclusive feature, can’t be executed from Participant’s end point.

This method also force stops any ongoing Canvas Streaming.

Class: EnxRoom

Observer: ACK CallBack

Method: -(void)stopAllSharing

Callbacks:

  • didACKStopAllSharing – Notification to everyone in the Room when Screen-Sharing stops.
[enxRoom stopAllSharing];

-(void)room:(EnxRoom *_Nullable)room didStopAllSharingACK:(NSArray *_Nullable)data {

};