The EnxRoom.addSpotlightUsers() method allows the Moderator to spotlight a user which pushes the user’s Stream to the top of Active Talker List irrespective of the user’s activity level. Spotlighting publishes the chosen user’s Stream in the Room even if they are not talking. The Moderator can spotlight as many users as max_active_talkers defined in the Room Configuration.

On joining a Room, the user is notified via onRoomConnected event with Room Meta Information, which contains the list of spotlightUsers.

Further active talkers list JSON received with onActiveTalkersUpdated callback has “spotlight” key with boolean value. Spotlighted users have spotlight: true in the list.

The EnxRoom.removeSpotlightUsers() method is used to remove the spotlight from user(s) Streams.

Class: EnxRoom

Methods:

  • public void addSpotlightUsers(List clientIds) 
  • public void removeSpotlightUsers(List clientIds) 

Parameters:

  • clientIds – Array of Client IDs of users whose streams are spotlighted or removed from the spotlight.

Callbacks:

  • onAckAddSpotlightUsers – Acknowledgment to the Moderator when spotlight request is received with the following JSON { "result": 0, clients: [] }:
    • result: 0 for success.
    • clients: Array of Client IDs being added.
  • onAckRemoveSpotlightUsers – Acknowledgment to the Moderator when spotlight removal request is received with the following JSON { "result": 0, clients: [] }:
    • result: 0 for success.
    • clients: Array of Client IDs being added.
  • onUpdateSpotlightUsers– Notification to everyone in the Room when the spotlighted user list update is received with the following JSON { "moderator_id": String, clients: [] }:
    • moderator_id: Moderator’s Id who updates the spotlight user list.
    • clients: Array of Client IDs of users who are spotlighted.
List clientIds = new ArrayList<>(); 
clientIds.add("clientId1");
clientIds.add("clientId2");
 
enxRoom.addSpotlightUsers(clientIds);	// To spotlight
enxRoom.removeSpotlightUsers(clientIds);// To remove from spotlight

// Moderator who spotlights users is acknowledged 
public void onAckAddSpotlightUsers (JSONObject jsonObject){ 
	// JSON { "result": 0,  clients: [] }
}

// Moderator who removes users from Spotlight is acknowledged 
public void onAckRemoveSpotlightUsers (JSONObject jsonObject){ 
	// JSON { "result": 0,  clients: [] }
}

// Everyone is notified with updated Spotlight list
public void onUpdateSpotlightUsers(JSONObject jsonObject){ 
	// JSON { "moderator_id": "String",  clients: [] }
}