The EnxRtc.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 EnxRtc.removeSpotlightUsers() method is used to remove the spotlight from user(s) Streams.

Class: EnxRtc

Methods:

  • static Future<void> addSpotlightUsers(List<dynamic> clientIds)
  • static Future<void> removeSpotlightUsers(List<dynamic> 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.
EnxRtc.addSpotlightUsers(clientIds) // To spotlight
EnxRtc.removeSpotlightUsers(clintIds) // To remove from spotlight

EnxRtc.onAckAddSpotlightUsers=(Map<dynamic,dynamic> map){

// Moderator who spotlights users is acknowledged

};
EnxRtc.onAckRemoveSpotlightUsers=(Map<dynamic,dynamic> map){

// Moderator who removes users from Spotlight is acknowledged

};
EnxRtc.onUpdateSpotlightUsers=(Map<dynamic,dynamic> map){

// Everyone is notified with updated Spotlight list

};