Event
ZegoUIKitPrebuiltLiveStreamingService.PK.Event
PKListener
onPKStarted
This callback is triggered when the PK starts.
void onPKStarted();onPKEnded
This callback is triggered when the PK ends.
void onPKEnded();onIncomingPKBattleRequestReceived
This callback is triggered when the host receives a PK battle request.
void onIncomingPKBattleRequestReceived(String requestID, ZegoUIKitUser anotherHostUser,String anotherHostLiveID, String customData);onIncomingPKBattleRequestTimeout
This callback is triggered when a PK request is received, but no response is made before the request times out.
void onIncomingPKBattleRequestTimeout(String requestID, ZegoUIKitUser anotherHostUser);onOutgoingPKBattleRequestTimeout
This callback is triggered when a PK battle request is sent but no response is received before the timeout.
void onOutgoingPKBattleRequestTimeout(String requestID, ZegoUIKitUser anotherHostUser);onIncomingPKBattleRequestCanceled
This callback is triggered when the sender cancels the PK battle request after receiving it.
void onIncomingPKBattleRequestCanceled(String requestID, ZegoUIKitUser anotherHostUser, String customData);onOutgoingPKBattleRequestAccepted
This callback is triggered when the PK battle request sent by the host is accepted by another host.
void onOutgoingPKBattleRequestAccepted(String requestID, ZegoUIKitUser anotherHostUser);onOutgoingPKBattleRequestRejected
This callback is triggered when the PK battle request sent by the host is rejected by another host. The rejection reason can be any enumeration of ZegoLiveStreamingPKBattleRejectCode, including HOST_REJECT, USER_NOT_HOST, IN_PK, LIVE_NOT_STARTED, ALREADY_SEND, ALREADY_RECEIVED.
void onOutgoingPKBattleRequestRejected(int reason, ZegoUIKitUser anotherHostUser);onPKUserDisConnected
This callback is triggered when the other host disconnects from the PK battle for more than 5 seconds.
void onPKUserDisConnected(String userID, boolean disconnected);onOtherHostCameraOpen
When PK, the callback for the status of other hosts opening or closing the camera.
void onOtherHostCameraOpen(String userID, boolean open);onOtherHostMicrophoneOpen
When PK, the callback for the status of other hosts opening or closing the microphone.
void onOtherHostMicrophoneOpen(String userID, boolean open);onOtherHostMuted
When PK, the callback for receiving the mute status after muting other hosts.
void onOtherHostMuted(String userID, boolean muted);ZegoUIKitPrebuiltLiveStreamingService.Common.Event
RoleChangedListener
This callback is triggered when there is a change in the role of the current user.
public interface RoleChangedListener {
void onRoleChanged(ZegoLiveStreamingRole liveStreamingRole);
}ZegoInRoomMessageListener
This callback is used to listen for room messages. It is triggered when receiving or sending room messages.
public interface ZegoInRoomMessageListener {
// Receive messages sent by others in the room
void onInRoomMessageReceived(List<ZegoInRoomMessage> messageList);
// The state of the message sent by oneself changes
void onInRoomMessageSendingStateChanged(ZegoInRoomMessage inRoomMessage);
}ZegoBarrageMessageListener
This callback is triggered when receiving barrage messages in the room.
public interface ZegoBarrageMessageListener {
void onIMRecvBarrageMessage(String roomID, ArrayList<ZegoBarrageMessageInfo> messageList);
}ZegoUIKitPrebuiltLiveStreamingConfig
ZegoLiveStreamingEndListener
onLiveStreamingEnded
This callback is triggered when the host ends the live streaming to notify the audience.
void onLiveStreamingEnded();ZegoLeaveLiveStreamingListener
onLeaveLiveStreaming
This callback is triggered when the user clicks the exit button.
void onLeaveLiveStreaming();ZegoMeRemovedFromRoomListener
onMeRemovedFromRoom
This callback is triggered when the user is kicked out of the room by the server command or the ZegoUIKit.removeUserFromRoom() method.
void onMeRemovedFromRoom();
