tencent cloud

Feedback

LiveCoreViewDefine

Last updated: 2024-12-04 17:31:02

    Type Definition

    Type
    Description
    Set callback events for core control connections.
    Layout mode during connection, supporting grid layout, floating window layout, and custom layout.
    Connection view adapter interface, which allows you to add widgets to each audio and video stream view by implementing this interface.

    ConnectionObserver

    Type
    Description
    Callback for changes in the list of connected users.
    Callback for receiving a connection request.
    Callback for receiving a request to cancel the connection.
    Callback for connection request approval.
    Callback for connection request rejection.
    Callback for connection request timeout.
    Callback for the host disconnecting the connection with this viewer.
    Callback for the viewer actively disconnecting.
    Callback for changes in the cross-room connection room list.
    Callback for receiving a cross-room connection request.
    Callback for receiving a request to cancel the cross-room connection.
    Received callback for consent to cross-room connection
    Received callback for cross-room connection rejection
    Received callback for cross-room connection timeout.
    Received callback for cross-room disconnection.
    Received callback for room termination.

    LayoutMode

    Layout mode during connection
    Type
    Description
    gridLayout
    Grid Layout.
    floatLayout
    Floating Window Layout.
    freeLayout
    Custom Layout.

    VideoViewDelegate

    Connection view delegate interface, which allows you to add widgets to each audio and video stream view by implementing this interface.
    API
    Description
    Callback when creating a connected audience view. The View created through this API will be displayed on the connected audience's view.
    Callback when updating the connected audience view.
    Callback when creating a connected host view, the View created through this API will be displayed on the connected host's view.
    Callback when updating the connected host view.

    Callback Event Details

    onConnectedUsersUpdated

    Callback for changes in the list of connected users.
    func onConnectedUsersUpdated(userList: [TUIUserInfo], joinList: [TUIUserInfo], leaveList: [TUIUserInfo])
    Parameters:
    Parameter
    Type
    Description
    userList
    List of connected users
    joinList
    Newly connected users
    leaveList
    Users who have left the connection

    onUserConnectionRequest

    Callback for receiving a connection request.
    func onUserConnectionRequest(inviterUser: TUIUserInfo)
    Parameters:
    Parameter
    Type
    Description
    inviterUser
    Information of the user applying for connection

    onUserConnectionCancelled

    Callback for receiving a request to cancel the connection.
    func onUserConnectionCancelled(inviterUser: TUIUserInfo)
    Parameters:
    Parameter
    Type
    Description
    inviterUser
    Information of the user canceling the connection

    onUserConnectionAccepted

    Callback for connection request approval.
    func onUserConnectionAccepted(userInfo: TUIUserInfo)
    Parameters:
    Parameter
    Type
    Description
    userInfo
    Information of users who agreed to the connection

    onUserConnectionRejected

    Callback for connection request rejection.
    func onUserConnectionRejected(userInfo: TUIUserInfo)
    Parameters:
    Parameter
    Type
    Description
    userInfo
    Information of users who rejected the connection

    onUserConnectionTimeout

    Callback for connection request timeout.
    func onUserConnectionTimeout(userInfo: TUIUserInfo)
    Parameters:
    Parameter
    Type
    Description
    userInfo
    Information of users whose connection request timed out

    onUserConnectionTerminated

    The callback for the anchor disconnecting the mic connect with this audience.
    func onUserConnectionTerminated()

    onUserConnectionExited

    The callback for the user disconnecting from the seat.
    func onUserConnectionExited(userInfo: TUIUserInfo)
    Parameters:
    Parameter
    Type
    Description
    userInfo
    Information of users disconnected from the seat

    onConnectedRoomsUpdated

    The callback for changes in the room list of connections.
    func onConnectedRoomsUpdated(hostUserList: [TUIConnectionUser])
    Parameters:
    Parameter
    Type
    Description
    hostUserList
    List of room owners of the connected room

    onCrossRoomConnectionRequest

    The callback for receiving a cross-room connection request.
    func onCrossRoomConnectionRequest(hostUser: TUIConnectionUser)
    Parameters:
    Parameter
    Type
    Description
    hostUser
    Information on the live streaming room owner requesting a connection

    onCrossRoomConnectionCancelled

    Callback for receiving a cancellation request for a cross-room connection.
    func onCrossRoomConnectionCancelled(hostUser: TUIConnectionUser)
    Parameters:
    Parameter
    Type
    Description
    hostUser
    Cancel the information of the live streaming room owner requesting a connection

    onCrossRoomConnectionAccepted

    Callback for receiving an approval for a cross-room connection request.
    func onCrossRoomConnectionAccepted(hostUser: TUIConnectionUser)
    Parameters:
    Parameter
    Type
    Description
    hostUser
    Information on the live streaming room owner agreeing to the connection

    onCrossRoomConnectionRejected

    Callback for receiving a rejection of a cross-room connection request.
    func onCrossRoomConnectionRejected(hostUser: TUIConnectionUser)
    Parameters:
    Parameter
    Type
    Description
    hostUser
    Information on the live streaming room owner rejecting the connection

    onCrossRoomConnectionTimeout

    Callback for a timeout in receiving a room connection request.
    func onCrossRoomConnectionTimeout(inviter: TUIConnectionUser, invitee: TUIConnectionUser)
    Parameters:
    Parameter
    Type
    Description
    inviter
    Information on the live streaming room owner requesting a connection
    invitee
    Information on the live streaming room owner being invited to connect

    onCrossRoomConnectionExited

    Callback for changes in the connected users list.
    func onCrossRoomConnectionExited(hostUser: TUIConnectionUser)
    Parameters:
    Parameter
    Type
    Description
    hostUser
    Information of the live streaming room exiting the connection

    onRoomDismissed

    Callback of live streaming room termination.
    func onRoomDismissed(roomId: String)
    Parameters:
    Parameter
    Type
    Description
    roomId
    String
    Room ID

    createCoGuestView

    Create a pendant view for audience connection, which will be added to the user's video stream.
    func createCoGuestView(userInfo: TUIUserInfo) -> UIView?
    Parameters:
    Parameter
    Type
    Description
    userInfo
    User information of users connected to the microphone
    Return value: UIView?

    updateCoGuestView

    Callback for updating the pendant view. In general, you don't need to concern yourself with this callback. You can update your set pendant view based on the state of your pendant data unless your pendant depends on changes in userInfo.
    func updateCoGuestView(userInfo: TUIUserInfo, coGuestView: UIView)
    Parameters:
    Parameter
    Type
    Description
    userInfo
    User information of users connected to the microphone
    coGuestView
    UIView
    The pendant view you created using the createCoGuestView API

    createCoHostView

    Create a pendant view for the host's connection, which will be added to the connected host's video stream.
    func createCoHostView(connectionUser: TUIConnectionUser) -> UIView?
    Parameters:
    Parameter
    Type
    Description
    connectionUser
    User information of the connected host
    Return value: UIView?

    updateCoHostView

    Callback for updating the pendant view. In general, you don't need to concern yourself with this callback. You can update your set pendant view based on the state of your pendant data unless your pendant depends on changes in connectionUser.
    func updateCoHostView(connectionUser: TUIConnectionUser, coHostView: UIView)
    Parameters:
    Parameter
    Type
    Description
    connectionUser
    Information of the connected host
    coHostView
    UIView
    The pendant view you created using the createCoHostView API
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support