提交工单
咨询集成、功能及报价等问题
Live Audio Room Kit (ZegoUIKitPrebuiltLiveAudioRoom) supports customizing the user attributes. The user attribute (userInRoomAttributes) is in the format of key-value pairs, which are used to implement customized functions, such as setting the user level and sharing it with in-room participants.
After you customized successfully (or in-room participants complete the customization), you (or in-room participants) will receive a notification through the onUserCountOrPropertyChanged
callback, and the user attributes you customized will return in this callback.
Here is the reference code:
class LivePage extends StatelessWidget {
const LivePage({Key? key, required this.roomID, this.isHost = false})
: super(key: key);
final String roomID;
final bool isHost;
@override
Widget build(BuildContext context) {
return SafeArea(
child: ZegoUIKitPrebuiltLiveAudioRoom(
appID: YourSecret.appID,
appSign: YourSecret.appSign,
userID: userID,
userName: 'user_$userID',
roomID: roomID,
// Modify your custom configurations here.
config: isHost
? ZegoUIKitPrebuiltLiveAudioRoomConfig.host()
: ZegoUIKitPrebuiltLiveAudioRoomConfig.audience()
..userInRoomAttributes = {
'key_1': 'value_1',
},
),
);
}
}