LiveAudienceStore provides a complete set of audience management APIs, including fetching audience list, setting administrators, kicking users, muting, etc. Through this class, you can implement audience management functions in live rooms.LiveAudienceStore instance, which requires a valid live room ID.Property | Type | Description |
audienceList | Audience list. | |
audienceCount | ValueListenable<int> | Audience count. |
adminList | Administrator list. | |
messageBannedUserList | List of users banned from sending messages. |
Function | Description |
Create audience management instance. | |
Audience event callbacks. | |
Audience event callbacks. | |
Fetch audience list. | |
Set administrator. | |
Revoke administrator. | |
Kick user. | |
Mute/unmute user. |
void addLiveAudienceListener(LiveAudienceListener listener);
Parameter | Type | Description |
listener | Listener. |
void removeLiveAudienceListener(LiveAudienceListener listener);
Parameter | Type | Description |
listener | Listener. |
Future<CompletionHandler> fetchAudienceList();
Future<CompletionHandler> setAdministrator(String userID);
Parameter | Type | Description |
userID | String | User ID to be set as administrator. |
Future<CompletionHandler> revokeAdministrator(String userID);
Parameter | Type | Description |
userID | String | User ID to revoke administrator permission. |
Future<CompletionHandler> kickUserOutOfRoom(String userID);
Parameter | Type | Description |
userID | String | User ID to be kicked out. |
Future<CompletionHandler> disableSendMessage({required String userID,required bool isDisable,});
Parameter | Type | Description |
userID | String | Target user ID. |
isDisable | bool | true to disable message sending, false to enable. |
Enum Value | Description |
owner | Room owner. |
admin | Administrator. |
generalUser | General user. |
Property | Type | Description |
userID | String | User unique identifier ID. |
userName | String | User name. |
avatarURL | String | User avatar URL. |
Property | Type | Description |
audienceList | Audience list. | |
audienceCount | ValueListenable<int> | Audience count. |
adminList | Administrator list. | |
messageBannedUserList | List of users banned from sending messages. |
void Function(LiveUserInfo owner)? onOwnerJoined;
Parameter | Type | Description |
owner | Information of the joined owner. |
void Function(LiveUserInfo owner)? onOwnerLeft;
Parameter | Type | Description |
owner | Information of the left owner. |
void Function(LiveUserInfo admin)? onAdminJoined;
Parameter | Type | Description |
admin | Information of the joined admin. |
void Function(LiveUserInfo admin)? onAdminLeft;
Parameter | Type | Description |
admin | Information of the left admin. |
void Function(LiveUserInfo audience)? onAudienceJoined;
Parameter | Type | Description |
audience | Information of the joined audience. |
void Function(LiveUserInfo audience)? onAudienceLeft;
Parameter | Type | Description |
audience | Information of the left audience. |
void Function(LiveUserInfo audience, bool isDisable)? onAudienceMessageDisabled;LiveAudienceListener({this.onOwnerJoined, this.onOwnerLeft, this.onAdminJoined, this.onAdminLeft, this.onAudienceJoined, this.onAudienceLeft, this.onAudienceMessageDisabled});
Parameter | Type | Description |
audience | Audience information. | |
isDisable | bool | Whether message sending is disabled. |
フィードバック