API
ZegoUIKitPrebuiltLiveAudioRoomFragment
AudioRoom Widget.
You can add this Fragment into any Activity of your project to integrate the functionality of a call.
- function prototype:
/// 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)
addButtonToBottomMenuBar
add your custom buttons to bottom menubar.It will show when user role equals to
role
public void addButtonToBottomMenuBar(List<View> viewList, ZegoLiveAudioRoomRole role)
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.
public void setBackgroundView(View view)
turnMicrophoneOn
open the microphone of specific user,if the target is not your userID,then the target will receive a onTurnOnYourMicrophoneRequest callback.
public void turnMicrophoneOn(String userID, boolean isOn)
removeSpeakerFromSeat
remove user from speaker
public void removeSpeakerFromSeat(String userID)
applyToTakeSeat
request take seat to be a speaker.First avaliable seat will be used.
public void applyToTakeSeat(ZegoUIKitPluginCallback callback)
cancelSeatTakingRequest
cancel take seat request.
public void cancelSeatTakingRequest()
takeSeat
try to take seat in position
index
public void takeSeat(int index)
leaveSeat
leave seat.If your are not speaker,nothing will happen.
public void leaveSeat()
acceptSeatTakingRequest
accept room user's take seat request.
public void acceptSeatTakingRequest(String audienceUserID)
rejectSeatTakingRequest
reject room user's take seat request.
public void rejectSeatTakingRequest(String audienceUserID)
inviteAudienceToTakeSeat
invite room user to take seat.
public void inviteAudienceToTakeSeat(String audienceUserID)
acceptHostTakeSeatInvitation
accept the take seat invitation from others.
public void acceptHostTakeSeatInvitation()
openSeats
make all seats avaiable.Room users can take empty seat directly.
public void openSeats()
closeSeats
make all seats locked.Room users should request to take empty seat.
public void closeSeats()