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
event with Room Meta Information, which contains the list of room-connected
spotlightUsers
.
Further active talkers list JSON received with active-talkers-updated
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.
Methods:
EnxRoom.addSpotlightUsers(clientIds[], callback)
EnxRoom.removeSpotlightUsers(clientIds[], callback)
Parameters:
clientIds
– Array of Client IDs of users whose streams are spotlighted or removed from the spotlight.Callback
– Returns response information of the requests in the JSON format:{ result : 0, clients: [] }
result:
0 if success. Some other appropriate error-code if error encountered.clientIds
: Array of each Client IDs passed to put into Spotlight or removed from Spotlight.
Event Notifications:
spotlight-users
– Notification to everyone in the Room when the spotlighted user list update is received with the following JSON{ "moderator_id": String, users: [] }
moderator_id
: Moderator’s Id who updates the spotlight user list.users
: Array of Client IDs of users who are spotlighted.
// To add Spotlight users room.addSpotlightUsers(clientIDs, function(resp) { // resp json { "result": Number, "clients": [] } }) // To remove users from Spotlight room.removeSpotlightUsers(clientIDs, function(resp) { // resp json { "result": Number, "clientIds": [] } }) // Everyone is notified with updated Spotlight user list room.addEventListener('spotlight-users', function(event) { // event json { "moderator_id": String, "users": [] } });