logo
On this page

Event

ZegoUIKitPrebuiltLiveStreamingVCDelegate

getForegroundView

  • function prototype:
Untitled
func getForegroundView(_ userInfo: ZegoUIKitUser?) -> ZegoBaseAudioVideoForegroundView?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
  func getForegroundView(_ userInfo: ZegoUIKitUser?) -> ZegoBaseAudioVideoForegroundView? {
    let view = ZegoBaseAudioVideoForegroundView(frame: CGRect(x: 0, y: 0, width: 100, height: 100), userID: userInfo?.userID, delegate: nil)
    //...
    return view
  }
}
1
Copied!

onLeaveLiveStreaming

  • function prototype:
Untitled
func onLeaveLiveStreaming()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
  func onLeaveLiveStreaming() {
    print("is leave live streaming")
    //....
  }
}
1
Copied!

onLiveStreamingEnded

  • function prototype:
Untitled
func onLiveStreamingEnded()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
  func onLiveStreamingEnded() {
    print("live streaming is end")
    //....
  }
}
1
Copied!

onStartLiveButtonPressed

  • function prototype:
Untitled
func onStartLiveButtonPressed()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
  func onStartLiveButtonPressed() {
    print("start live button is click")
    //....
  }
}
1
Copied!

getPKBattleTopView

  • function prototype:
Untitled
func getPKBattleTopView(_ parentView: UIView, userList: [ZegoUIKitUser]) -> UIView?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
  func getPKBattleTopView(_ parentView: UIView, userList: [ZegoUIKitUser]) -> UIView? {
    let view = UIView()
    view.backgroundColor = UIColor.red
    return view
  }
}
1
Copied!

getPKBattleForegroundView

  • function prototype:
Untitled
func getPKBattleForegroundView(_ parentView: UIView, userInfo: ZegoUIKitUser) -> UIView?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
  func getPKBattleForegroundView(_ parentView: UIView, userInfo: ZegoUIKitUser) -> UIView? {
    let view = UIView()
    let button: MutePKUserButton = MutePKUserButton()
    button.frame = CGRect(x: 30, y: 30, width: 80, height: 40)
    view.addSubview(button)
    return view
  }
}
1
Copied!

getPKBattleBottomView

  • function prototype:
Untitled
func getPKBattleBottomView(_ parentView: UIView, userList: [ZegoUIKitUser]) -> UIView?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
  func getPKBattleBottomView(_ parentView: UIView, userList: [ZegoUIKitUser]) -> UIView? {
    let view = UIView()
    view.backgroundColor = UIColor.red
    return view
  }
}
1
Copied!

onInRoomMessageClick

  • function prototype:
Untitled
func onInRoomMessageClick(_ message: ZegoInRoomMessage)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
    func onInRoomMessageClick(_ message: ZegoInRoomMessage) {
       // ...
       // ZegoInRoomMessage has these property
       // public var message: String?
       // public var messageID: Int64 = 0
       // public var sendTime: UInt64 = 0
       // public var user: ZegoUIKitUser?
    }
}
1
Copied!

onIMRecvBarrageMessage

  • function prototype:

    Untitled
    func onIMRecvBarrageMessage(_ roomID: String, messageList: [ZegoUIKitBarrageMessageInfo])
    
    1
    Copied!
  • example:

    Untitled
    extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
        func func onIMRecvBarrageMessage(_ roomID: String, messageList: [ZegoUIKitBarrageMessageInfo]) {
        // ...
        // ZegoInRoomMessage has the following properties:
        // public var message: String?
        // public var messageID: String?
        // public var sendTime: CUnsignedLongLong = 0
        // public var user: ZegoUIKitUser?
        }
    }
    
    1
    Copied!

ZegoLiveStreamingManagerDelegate

onIncomingCohostRequest

  • function prototype:
Untitled
func onIncomingCohostRequest(inviter: ZegoUIKitUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingCohostRequest(inviter: ZegoUIKitUser) {
     //...
  }
}
1
Copied!

onIncomingInviteToCohostRequest

  • function prototype:
Untitled
func onIncomingInviteToCohostRequest(inviter: ZegoUIKitUser, invitationID: String)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingInviteToCohostRequest(inviter: ZegoUIKitUser, invitationID: String) {
    //...
  }
}
1
Copied!

onIncomingRemoveCohostRequest

  • function prototype:
Untitled
func onIncomingRemoveCohostRequest(inviter: ZegoUIKitUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingRemoveCohostRequest(inviter: ZegoUIKitUser) {
    //...
  }
}
1
Copied!

onIncomingAcceptCohostRequest

  • function prototype:
Untitled
func onIncomingAcceptCohostRequest(invitee: ZegoUIKitUser, data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingAcceptCohostRequest(invitee: ZegoUIKitUser, data: String?) {
    //...
  }
}
1
Copied!

onIncomingCancelCohostRequest

  • function prototype:
Untitled
func onIncomingCancelCohostRequest(inviter: ZegoUIKitUser, data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingCancelCohostRequest(inviter: ZegoUIKitUser, data: String?) {
    //...
  }
}
1
Copied!

onIncomingCancelCohostInvite

  • function prototype:
Untitled
func onIncomingCancelCohostInvite(inviter: ZegoUIKitUser, data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingCancelCohostInvite(inviter: ZegoUIKitUser, data: String?) {
    //...
  }
}
1
Copied!

onIncomingRefuseCohostRequest

  • function prototype:
Untitled
func onIncomingRefuseCohostRequest(invitee: ZegoUIKitUser, data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingRefuseCohostRequest(invitee: ZegoUIKitUser, data: String?) {
    //...
  }
}
1
Copied!

onIncomingRefuseCohostInvite

  • function prototype:
Untitled
func onIncomingRefuseCohostInvite(invitee: ZegoUIKitUser, data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingRefuseCohostInvite(invitee: ZegoUIKitUser, data: String?) {
    //...
  }
}
1
Copied!

onIncomingCohostRequestTimeOut

  • function prototype:
Untitled
func onIncomingCohostRequestTimeOut(inviter: ZegoUIKitUser, data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingCohostRequestTimeOut(inviter: ZegoUIKitUser, data: String?) {
    //...
  }
}
1
Copied!

onIncomingCohostInviteTimeOut

  • function prototype:
Untitled
func onIncomingCohostInviteTimeOut(inviter: ZegoUIKitUser, data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingCohostInviteTimeOut(inviter: ZegoUIKitUser, data: String?) {
    //...
  }
}
1
Copied!

onIncomingCohostInviteResponseTimeOut

  • function prototype:
Untitled
func onIncomingCohostInviteResponseTimeOut(invitees: [ZegoUIKitUser], data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingCohostInviteResponseTimeOut(invitees: [ZegoUIKitUser], data: String?) {
    //...
  }
}
1
Copied!

onIncomingCohostRequestResponseTimeOut

  • function prototype:
Untitled
func onIncomingCohostInviteResponseTimeOut(invitees: [ZegoUIKitUser], data: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingCohostInviteResponseTimeOut(invitees: [ZegoUIKitUser], data: String?) {
    //...
  }
}
1
Copied!

onIncomingPKRequestReceived

  • function prototype:
Untitled
func onIncomingPKRequestReceived(requestID: String, 
                                 anotherHostUser: ZegoUIKitUser, 
                                 anotherHostLiveID: String, 
                                 customData: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingPKRequestReceived(requestID: String, 
                                   anotherHostUser: ZegoUIKitUser, 
                                   anotherHostLiveID: String, 
                                   customData: String?) {
    //...
  }
}
1
Copied!

onIncomingResumePKRequestReceived

  • function prototype:
Untitled
func onIncomingResumePKRequestReceived(requestID: String)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingResumePKRequestReceived(requestID: String) {
    //...
  }
}
1
Copied!

onIncomingPKRequestCancelled

  • function prototype:
Untitled
func onIncomingPKRequestCancelled(anotherHostLiveID: String, 
                                  anotherHostUser: ZegoUIKitUser, 
                                  customData: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingPKRequestCancelled(anotherHostLiveID: String, 
                                    anotherHostUser: ZegoUIKitUser, 
                                    customData: String?) {
    //...
  }
}
1
Copied!

onOutgoingPKRequestAccepted

  • function prototype:
Untitled
func onOutgoingPKRequestAccepted(anotherHostLiveID: String,
                                 anotherHostUser: ZegoUIKitUser, 
                                 customData: String?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onOutgoingPKRequestAccepted(anotherHostLiveID: String, 
                                   anotherHostUser: ZegoUIKitUser, 
                                   customData: String?) {
    //...
  }
}
1
Copied!

onOutgoingPKRequestRejected

  • function prototype:
Untitled
func onOutgoingPKRequestRejected(reason: Int, anotherHostUser: ZegoUIKitUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onOutgoingPKRequestRejected(reason: Int, anotherHostUser: ZegoUIKitUser) {
    //...
  }
}
1
Copied!

onIncomingPKRequestTimeout

  • function prototype:
Untitled
func onIncomingPKRequestTimeout(requestID: String, anotherHostUser: ZegoUIKitUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onIncomingPKRequestTimeout(requestID: String, anotherHostUser: ZegoUIKitUser) {
    //...
  }
}
1
Copied!

onOutgoingPKRequestTimeout

  • function prototype:
Untitled
func onOutgoingPKRequestTimeout(requestID: String, anotherHost: ZegoUIKitUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onOutgoingPKRequestTimeout(requestID: String, anotherHost: ZegoUIKitUser) {
    //...
  }
}
1
Copied!

onPKStarted

  • function prototype:
Untitled
func onPKStarted(roomID: String, userID: String)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onPKStarted(roomID: String, userID: String) {
    //...
  }
}
1
Copied!

onPKEnded

  • function prototype:
Untitled
func onPKEnded()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onPKEnded() {
    //...
  }
}
1
Copied!

onPKViewAvaliable

  • function prototype:
Untitled
func onPKViewAvaliable()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onPKViewAvaliable() {
    //...
  }
}
1
Copied!

onLocalHostCameraStatus

  • function prototype:
Untitled
func onLocalHostCameraStatus(isOn: Bool)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onLocalHostCameraStatus(isOn: Bool) {
    //...
  }
}
1
Copied!

onAnotherHostCameraStatus

  • function prototype:
Untitled
func onAnotherHostCameraStatus(isOn: Bool)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onAnotherHostCameraStatus(isOn: Bool) {
    //...
  }
}
1
Copied!

onAnotherHostIsReconnecting

  • function prototype:
Untitled
func onAnotherHostIsReconnecting()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onAnotherHostIsReconnecting() {
    //...
  }
}
1
Copied!

onAnotherHostIsConnected

  • function prototype:
Untitled
func onAnotherHostIsConnected()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onAnotherHostIsConnected() {
    //...
  }
}
1
Copied!

onHostIsReconnecting

  • function prototype:
Untitled
func onHostIsReconnecting()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onHostIsReconnecting() {
    //...
  }
}
1
Copied!

onHostIsConnected

  • function prototype:
Untitled
func onHostIsConnected()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onHostIsConnected() {
    //...
  }
}
1
Copied!

onMixerStreamTaskFail

  • function prototype:
Untitled
func onMixerStreamTaskFail(errorCode: Int)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onMixerStreamTaskFail(errorCode: Int) {
    //...
  }
}
1
Copied!

onStartPlayMixerStream

  • function prototype:
Untitled
func onStartPlayMixerStream()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onStartPlayMixerStream() {
    //...
  }
}
1
Copied!

onStopPlayMixerStream

  • function prototype:
Untitled
func onStopPlayMixerStream()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onStopPlayMixerStream() {
    //...
  }
}
1
Copied!

onOtherHostMuted

  • function prototype:
Untitled
func onOtherHostMuted(userID: String, mute: Bool)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoLiveStreamingManagerDelegate {
  func onOtherHostMuted(userID: String, mute: Bool) {
    //...
  }
}
1
Copied!

Previous

API

Next

Config