The Enx.pinUsers() method allows the Moderator to pin a user(s) to the Active Talker List irrespective of the user’s activity level. A pinned user’s Stream is always published in the Room even if they are not talking. The inactive pinned users are placed in the Active Talker List after the actively talking users in a descending order based on the activity level with the most active talker on top. The total number of pinned users in a Room is restricted to (max_active_talkers – 1) based on the Room configuration.

On joining a Room, the user is notified via onRoomConnected event with Room Meta Information, which contains the list of pinned users as "pinnedUsers": [ /*client-ids*/ ].

The Enx.unpinUsers() method is used to unpin the user(s).

Class: Enx

Methods:

  • Enx.pinUsers(clientIds)
  • Enx.unpinUsers(clientIds)

Parameters:

  • clientIds – Array of Client IDs of users whose streams need to be pinned or unpinned.

Callbacks:

  • ackPinUsers – Acknowledgment to the Moderator when the users are pinned.
  • ackUnpinUsers – Acknowledgment to the Moderator when the users are unpinned.
  • pinnedUsers – Notification to everyone in the Room with an updated list of pinned users.
ackPinUsers:event=>{
   // Moderator is acknowledged for pinning user

              }

ackUnpinUsers:event=>{
     // Moderator is acknowledged for unpinning user

              }

pinnedUsers:event=>{
   // Everyone is notified wtih updated pinned lis 
              }

Error Codes & Exceptions:

CodeDescription
5003Unauthorized Access. When a user with participant role invokes pinUser() or unpinUser().
5126Invalid client IDs passed.