tencent cloud

Feedback

SeatGridView

Last updated: 2024-12-03 17:48:28

    API Introduction

    SeatGridView is a basic control we developed for the Voice Chat Room UIKit. This core control provides rich APIs such as opening/closing the voice chat room, managing seat positions within the live room like applying to join the mic, inviting to speak, moving seat positions, and kicking someone off the mic.

    API Overview

    API
    Description
    Create a SeatGridView object, supporting code creation and XML loading .
    Enable local microphone
    Disable local microphone
    Pause publishing local audio stream
    Resume publishing local audio stream
    Anchor creates live room and starts streaming
    Anchor stops streaming and destroys live room
    Audience joins an anchor's live room
    Audience leaves an anchor's live room
    Update Room Mic Mode
    Anchor Responds to Microphone Application/Audience Responds to Microphone Invitation
    Anchor Cancels Microphone Invitation/Audience Cancels Microphone Application
    takeSeat
    Connect Mic
    Disconnect Mic
    leaveSeat
    Disconnect Mic
    Anchor Invites User to Connect Mic
    Anchor Kicks User off Mic
    lockSeat
    Anchor Locks Mic Position (including position lock, audio status lock, and video status lock)
    Anchor Sets Layout Mode for Mic List
    Set the adapter for the seat view
    Set event callbacks
    Remove event callbacks

    API Details

    SeatGridView

    Create a SeatGridView object instance. Supports code creation and XML loading.
    public SeatGridView(Context context)
    Parameter:
    Parameter
    Type
    Meaning
    context
    Context
    Android context object
    Return Value:SeatGridView

    startMicrophone

    Enable the local mic.
    void startMicrophone(ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    stopMicrophone

    Disable the local mic.
    void stopMicrophone()
    Return Value:void

    muteMicrophone

    Pause publishing local audio stream.
    void muteMicrophone()
    Return Value:void

    unMuteLocalAudio

    Resume publishing local audio stream.
    void unMuteLocalAudio(ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    startVoiceRoom

    Anchor creates live room and starts streaming.
    void startVoiceRoom(RoomInfo roomInfo, GetRoomInfoCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    roomInfo
    RoomInfo
    Information for creating a live streaming room
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    stopVoiceRoom

    Anchor stops streaming and destroys live room.
    void stopVoiceRoom(ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    joinVoiceRoom

    Audience joins an anchor's live room.
    void joinVoiceRoom(String roomId, GetRoomInfoCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    roomId
    String
    Live Streaming Room ID
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    leaveVoiceRoom

    Audience leaves an anchor's live room.
    void leaveVoiceRoom(ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    updateRoomSeatMode

    Update Room Mic Mode.
    void updateRoomSeatMode(SeatMode seatMode, ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    seatMode
    SeatMode
    FREE_TO_TAKE: Free seat mode, audience can join the seat freely without application;
    APPLY_TO_TAKE: Apply to join the seat mode, audience needs the anchor's consent to join the seat.
    callback
    ActionCallback
    Callback of the operation.
    Return Value:void

    responseRemoteRequest

    Anchor Responds to Microphone Application/Audience Responds to Microphone Invitation.
    void responseRemoteRequest(String userId, boolean agree, ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    userId
    String
    Responding user's user ID, if the current role is an audience member, the ID can be left blank
    agree
    boolean
    Whether to accept the request, true: accept the request, false: reject the request
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    cancelRequest

    Anchor Cancels Microphone Invitation/Audience Cancels Microphone Application
    void cancelRequest(String userId, ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    userId
    String
    Cancelled user's ID, if the current role is an audience member, the ID can be left blank
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    takeSeat

    Request to Speak (In speaking mode, application is required)
    void takeSeat(int index, int timeout, VoiceRoomDefine.RequestCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    index
    int
    Mic position number for connecting
    timeout
    int
    Timeout period, unit: seconds. If set to 0, the SDK will not perform a timeout check or trigger a timeout callback
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    moveToSeat

    Move Mic (only users who are already on the mic can call this function)
    void moveToSeat(int index, ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    index
    int
    Mic position number to move to
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    leaveSeat

    Proactively disconnect mic
    void leaveSeat(ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    takeUserOnSeatByAdmin

    Anchor Invites User to Connect Mic
    void takeUserOnSeatByAdmin(int index, String userId, int timeout, VoiceRoomDefine.RequestCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    index
    int
    Invited Mic position number
    userId
    String
    Invited user ID
    timeout
    int
    Timeout period, unit: seconds. If set to 0, the SDK will not perform a timeout check or trigger a timeout callback
    callback
    VoiceRoomDefine.RequestCallback
    Callback of the operation
    Return Value:void

    kickUserOffSeatByAdmin

    Anchor Kicks User off Mic
    void kickUserOffSeatByAdmin(String userId, ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    userId
    String
    User ID kicked off the Mic
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    lockSeat

    Microphone Mute, Anchor locks Mic Position (including position lock, audio status lock, and video status lock)
    void lockSeat(int seatIndex, TUIRoomDefine.SeatLockParams params, ActionCallback callback)
    Parameter:
    Parameter
    Type
    Meaning
    seatIndex
    int
    Mic position number to be locked
    params
    TUIRoomDefine.SeatLockParams
    Microphone Mute Parameters. See details: TUIRoomDefine.SeatLockParams
    callback
    ActionCallback
    Callback of the operation
    Return Value:void

    setLayoutMode

    Set the layout mode for the mic list.
    void setLayoutMode(LayoutMode layoutModel, SeatViewLayoutConfig layoutConfig)
    Parameter:
    Parameter
    Type
    Meaning
    layoutModel
    Mic list layout modes, support element layout, grid layout, vertical layout, custom layout.
    layoutConfig
    Layout configuration information, effective only in custom layout mode
    Return Value:void

    setSeatViewAdapter

    Set the adapter for the mic view.
    void setSeatViewAdapter(VoiceRoomDefine.SeatViewAdapter adapter)
    Parameter:
    Parameter
    Type
    Meaning
    adapter
    Seat view adapter
    Return Value:void

    addObserver

    Set event callbacks.
    void addObserver(SeatGridViewObserver observer)
    Parameter:
    Parameter
    Type
    Meaning
    observer
    Callback object of core component
    Return Value:void

    removeObserver

    Remove event callbacks.
    void removeObserver(SeatGridViewObserver observer)
    Parameter:
    Parameter
    Type
    Meaning
    observer
    Callback object of core component
    Return Value:void
    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