Live Audio Room Kit
  • iOS
  • Android : Java
  • Flutter
  • React Native
  • Overview
  • Quick start
  • Customize prebuilt features
    • Overview
    • Set avatar for users
    • Customize the seats
    • Customize the seat-taking logic
    • Customize the background
    • Customize user attributes
    • Set a leave confirmation dialog
    • Modify user interface text
    • Customize the bottom menu bar buttons
    • Customize the text message UI
  • Advanced features
    • Send virtual gifts
    • Use Tokens for authentication
  • API Reference
    • API
    • Event
  • Migration guide
    • Migrating to ZEGOCLOUD Maven
  • Documentation
  • Live Audio Room Kit
  • Customize prebuilt features
  • Set avatar for users

Set avatar for users

Last updated:2023-06-04 16:49

Live Audio Room Kit (ZegoUIKitPrebuiltLiveAudioRoom) supports you to customize the user avatar and share it with in-room participants. All you need to do is pass the image URL (PNG, JGP, JGEP, BMP, GIF, and WEBP are supported).

The URL must be within 64 bytes. If exceeds, the default background is displayed.

Here is the reference code:

Java Kotlin
ZegoUIKitPrebuiltLiveAudioRoomConfig config;
if (isHost) {
   config = ZegoUIKitPrebuiltLiveAudioRoomConfig.host();
} else {
   config = ZegoUIKitPrebuiltLiveAudioRoomConfig.audience();
}
config.userAvatarUrl = YOUR IMAGE URL;
ZegoUIKitPrebuiltLiveAudioRoomFragment fragment = ZegoUIKitPrebuiltLiveAudioRoomFragment.newInstance(appID,appSign, userID, userName, roomID, config);
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment).commitNow();
val config: ZegoUIKitPrebuiltLiveAudioRoomConfig = if (isHost) {
     ZegoUIKitPrebuiltLiveAudioRoomConfig.host()
} else {
     ZegoUIKitPrebuiltLiveAudioRoomConfig.audience()
}
config.userAvatarUrl = YOUR IMAGE URL

val fragment = ZegoUIKitPrebuiltLiveAudioRoomFragment.newInstance(appID, appSign, userID, userName, roomID, config)
supportFragmentManager.beginTransaction()
            .replace(R.id.fragment_container, fragment)
            .commitNow()
Page Directory