logo
On this page

API


ZegoUIKitPrebuiltLiveAudioRoomFragment

AudioRoom Widget.

You can add this Fragment into any Activity of your project to integrate the functionality of a call.

  • function prototype:
Untitled
 /// You can create a project and obtain an appID from the [ZEGOCLOUD Admin >Console](https://console.zegocloud.com).
 final long appID;

 /// You can create a project and obtain an appSign from the [ZEGOCLOUD >Admin Console](https://console.zegocloud.com).
 final String appSign;

 /// The ID of the currently logged-in user.
 /// It can be any valid string.
 /// Typically, you would use the ID from your own user system, such as >Firebase.
 final String userID;

 /// The name of the currently logged-in user.
 /// It can be any valid string.
 /// Typically, you would use the name from your own user system, such as >Firebase.
 final String userName;

 /// The ID of the call.
 /// This ID is a unique identifier for the current call, so you need to >ensure its uniqueness.
 /// It can be any valid string.
 /// Users who provide the same roomID will be logged into the same room >for the call.
 final String roomID;

 /// Initialize the configuration for the liveaudioroom.
 final ZegoUIKitPrebuiltLiveAudioRoomConfig config;

 public static ZegoUIKitPrebuiltCallFragment newInstance(long appID, @NonNull String appSign, @NonNull String userID, @NonNull String userName, @NonNull String callID, @NonNull ZegoUIKitPrebuiltCallConfig config) 
1
Copied!

addButtonToBottomMenuBar

add your custom buttons to bottom menubar.It will show when user role equals to role

Untitled
 public void addButtonToBottomMenuBar(List<View> viewList, ZegoLiveAudioRoomRole role)
1
Copied!

setBackgroundView

set your custom views as background to the live audio room.You can also add room title view and show it in top of audio room by this method.

Untitled
 public void setBackgroundView(View view)
1
Copied!

turnMicrophoneOn

open the microphone of specific user,if the target is not your userID,then the target will receive a onTurnOnYourMicrophoneRequest callback.

Untitled
 public void turnMicrophoneOn(String userID, boolean isOn)
1
Copied!

removeSpeakerFromSeat

remove user from speaker

Untitled
 public void removeSpeakerFromSeat(String userID)
1
Copied!

applyToTakeSeat

request take seat to be a speaker.First avaliable seat will be used.

Untitled
 public void applyToTakeSeat(ZegoUIKitPluginCallback callback)
1
Copied!

cancelSeatTakingRequest

cancel take seat request.

Untitled
 public void cancelSeatTakingRequest()
1
Copied!

takeSeat

try to take seat in position index

Untitled
 public void takeSeat(int index)
1
Copied!

leaveSeat

leave seat.If your are not speaker,nothing will happen.

Untitled
 public void leaveSeat()
1
Copied!

acceptSeatTakingRequest

accept room user's take seat request.

Untitled
 public void acceptSeatTakingRequest(String audienceUserID)
1
Copied!

rejectSeatTakingRequest

reject room user's take seat request.

Untitled
 public void rejectSeatTakingRequest(String audienceUserID) 
1
Copied!

inviteAudienceToTakeSeat

invite room user to take seat.

Untitled
 public void inviteAudienceToTakeSeat(String audienceUserID) 
1
Copied!

acceptHostTakeSeatInvitation

accept the take seat invitation from others.

Untitled
 public void acceptHostTakeSeatInvitation() 
1
Copied!

openSeats

make all seats avaiable.Room users can take empty seat directly.

Untitled
 public void openSeats() 
1
Copied!

closeSeats

make all seats locked.Room users should request to take empty seat.

Untitled
 public void closeSeats() 
1
Copied!