logo
当前页

Event

ZegoUIKitPrebuiltLiveStreamingVCDelegate

getForegroundView

  • 函数原型:

    Untitled
    func getForegroundView(_ userInfo: ZegoUIKitUser?) -> ZegoBaseAudioVideoForegroundView?
    
    1
    Copied!
  • 示例:

    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

  • 函数原型:

    Untitled
    func onLeaveLiveStreaming()
    
    1
    Copied!
  • 示例:

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

onLiveStreamingEnded

  • 函数原型:

    Untitled
    func onLiveStreamingEnded()
    
    1
    Copied!
  • 示例:

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

onStartLiveButtonPressed

  • 函数原型:

    Untitled
    func onStartLiveButtonPressed()
    
    1
    Copied!
  • 示例:

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

getPKBattleTopView

  • 函数原型:

    Untitled
    func getPKBattleTopView(_ parentView: UIView, userList: [ZegoUIKitUser]) -> UIView?
    
    1
    Copied!
  • 示例:

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

getPKBattleForegroundView

  • 函数原型:

    Untitled
    func getPKBattleForegroundView(_ parentView: UIView, userInfo: ZegoUIKitUser) -> UIView?
    
    1
    Copied!
  • 示例:

    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

  • 函数原型:

    Untitled
    func getPKBattleBottomView(_ parentView: UIView, userList: [ZegoUIKitUser]) -> UIView?
    
    1
    Copied!
  • 示例:

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

onInRoomMessageClick

  • 函数原型:

    Untitled
    func onInRoomMessageClick(_ message: ZegoInRoomMessage)
    
    1
    Copied!
  • 示例:

    Untitled
    extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
        func onInRoomMessageClick(_ message: ZegoInRoomMessage) {
        // ...
        // ZegoInRoomMessage 具有以下属性
        // public var message: String?
        // public var messageID: Int64 = 0
        // public var sendTime: UInt64 = 0
        // public var user: ZegoUIKitUser?
        }
    }
    
    1
    Copied!

onIMRecvBarrageMessage

  • 函数原型:

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

    Untitled
    extension ViewController: ZegoUIKitPrebuiltLiveStreamingVCDelegate {
        func func onIMRecvBarrageMessage(_ roomID: String, messageList: [ZegoUIKitBarrageMessageInfo]) {
        // ...
        // ZegoInRoomMessage 具有以下属性
        // public var message: String?
        // public var messageID: String?
        // public var sendTime: CUnsignedLongLong = 0
        // public var user: ZegoUIKitUser?
        }
    }
    
    1
    Copied!

ZegoLiveStreamingManagerDelegate

onIncomingCohostRequest

  • 函数原型:

    Untitled
    func onIncomingCohostRequest(inviter: ZegoUIKitUser)
    
    1
    Copied!
  • 示例:

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

onIncomingInviteToCohostRequest

  • 函数原型:

    Untitled
    func onIncomingInviteToCohostRequest(inviter: ZegoUIKitUser, invitationID: String)
    
    1
    Copied!
  • 示例:

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

onIncomingRemoveCohostRequest

  • 函数原型:

    Untitled
    func onIncomingRemoveCohostRequest(inviter: ZegoUIKitUser)
    
    1
    Copied!
  • 示例:

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

onIncomingAcceptCohostRequest

  • 函数原型:

    Untitled
    func onIncomingAcceptCohostRequest(invitee: ZegoUIKitUser, data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingCancelCohostRequest

  • 函数原型:

    Untitled
    func onIncomingCancelCohostRequest(inviter: ZegoUIKitUser, data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingRefuseCohostRequest

  • 函数原型:

    Untitled
    func onIncomingRefuseCohostRequest(invitee: ZegoUIKitUser, data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingRefuseCohostInvite

  • 函数原型:

    Untitled
    func onIncomingRefuseCohostInvite(invitee: ZegoUIKitUser, data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingCohostRequestTimeOut

  • 函数原型:

    Untitled
    func onIncomingCohostRequestTimeOut(inviter: ZegoUIKitUser, data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingCohostInviteTimeOut

  • 函数原型:

    Untitled
    func onIncomingCohostInviteTimeOut(inviter: ZegoUIKitUser, data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingCohostInviteResponseTimeOut

  • 函数原型:

    Untitled
    func onIncomingCohostInviteResponseTimeOut(invitees: [ZegoUIKitUser], data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingCohostRequestResponseTimeOut

  • 函数原型:

    Untitled
    func onIncomingCohostInviteResponseTimeOut(invitees: [ZegoUIKitUser], data: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingPKRequestReceived

  • 函数原型:

    Untitled
    func onIncomingPKRequestReceived(requestID: String, 
                                    anotherHostUser: ZegoUIKitUser, 
                                    anotherHostLiveID: String, 
                                    customData: String?)
    
    1
    Copied!
  • 示例:

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

onIncomingResumePKRequestReceived

  • 函数原型:

    Untitled
    func onIncomingResumePKRequestReceived(requestID: String)
    
    1
    Copied!
  • 示例:

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

onIncomingPKRequestCancelled

  • 函数原型:

    Untitled
    func onIncomingPKRequestCancelled(anotherHostLiveID: String, 
                                    anotherHostUser: ZegoUIKitUser, 
                                    customData: String?)
    
    1
    Copied!
  • 示例:

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

onOutgoingPKRequestAccepted

  • 函数原型:

    Untitled
    func onOutgoingPKRequestAccepted(anotherHostLiveID: String,
                                    anotherHostUser: ZegoUIKitUser, 
                                    customData: String?)
    
    1
    Copied!
  • 示例:

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

onOutgoingPKRequestRejected

  • 函数原型:

    Untitled
    func onOutgoingPKRequestRejected(reason: Int, anotherHostUser: ZegoUIKitUser)
    
    1
    Copied!
  • 示例:

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

onIncomingPKRequestTimeout

  • 函数原型:

    Untitled
    func onIncomingPKRequestTimeout(requestID: String, anotherHostUser: ZegoUIKitUser)
    
    1
    Copied!
  • 示例:

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

onOutgoingPKRequestTimeout

  • 函数原型:

    Untitled
    func onOutgoingPKRequestTimeout(requestID: String, anotherHost: ZegoUIKitUser)
    
    1
    Copied!
  • 示例:

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

onPKStarted

  • 函数原型:

    Untitled
    func onPKStarted(roomID: String, userID: String)
    
    1
    Copied!
  • 示例:

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

onPKEnded

  • 函数原型:

    Untitled
    func onPKEnded()
    
    1
    Copied!
  • 示例:

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

onPKViewAvaliable

  • 函数原型:

    Untitled
    func onPKViewAvaliable()
    
    1
    Copied!
  • 示例:

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

onLocalHostCameraStatus

  • 函数原型:

    Untitled
    func onLocalHostCameraStatus(isOn: Bool)
    
    1
    Copied!
  • 示例:

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

onAnotherHostCameraStatus

  • 函数原型:

    Untitled
    func onAnotherHostCameraStatus(isOn: Bool)
    
    1
    Copied!
  • 示例:

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

onAnotherHostIsReconnecting

  • 函数原型:

    Untitled
    func onAnotherHostIsReconnecting()
    
    1
    Copied!
  • 示例:

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

onAnotherHostIsConnected

  • 函数原型:

    Untitled
    func onAnotherHostIsConnected()
    
    1
    Copied!
  • 示例:

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

onHostIsReconnecting

  • 函数原型:

    Untitled
    func onHostIsReconnecting()
    
    1
    Copied!
  • 示例:

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

onHostIsConnected

  • 函数原型:

    Untitled
    func onHostIsConnected()
    
    1
    Copied!
  • 示例:

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

onMixerStreamTaskFail

  • 函数原型:

    Untitled
    func onMixerStreamTaskFail(errorCode: Int)
    
    1
    Copied!
  • 示例:

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

onStartPlayMixerStream

  • 函数原型:

    Untitled
    func onStartPlayMixerStream()
    
    1
    Copied!
  • 示例:

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

onStopPlayMixerStream

  • 函数原型:

    Untitled
    func onStopPlayMixerStream()
    
    1
    Copied!
  • 示例:

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

onOtherHostMuted

  • 函数原型:

    Untitled
    func onOtherHostMuted(userID: String, mute: Bool)
    
    1
    Copied!
  • 示例:

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

Previous

API

Next

Config