• 서비스
  • 가격
  • 리소스
  • 기술지원
이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.
Feedback

LiveListStore

Introduction

LiveListStore provides a complete set of live room management APIs, including starting live, joining live, leaving live, ending live and other functions. Through this class, you can manage the lifecycle of live rooms. The host calls startLive/endLive to start and dismiss a live room, while the audience calls joinLive/leaveLive to join and leave a live room.
Important:
Use the LiveListStore.shared singleton object to get the LiveListStore instance.
Note:
Live state updates are delivered through the liveState publisher. Subscribe to it to receive real-time updates of live data.

Features

Live List: Get and manage live room list.
Start Live: Host starts broadcasting. If the live room ID is new, a new live room will be created; if the live room ID already exists on the server, the host will join and start broadcasting.
Live Joining: Join existing live rooms.
Live Management: Update live info, end live and other operations.
Event Listening: Listen for live ended, kicked out and other events.

Subscribable Data

LiveListState fields are described below:
Property
Type
Description
liveList
StateFlow<List<LiveInfo>>
Live list.
liveListCursor
StateFlow<String>
Live list cursor.
currentLive
StateFlow<LiveInfo>
Current live info.

API List

Function
Description
Singleton object.
Live list event callbacks.
Live list event callbacks.
Get live list.
Get live info.
Start live (Host only).
Join live (Audience only).
Leave live (Audience only).
End live (Host only).
Update live info.
Query metadata.
Update metadata.

Getting Instance

LiveListStore.shared

Singleton object.

Observing State and Events

addLiveListListener

Add live list event listener.
abstract fun addLiveListListener(listener: LiveListListener)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
listener
Required
Listener.

removeLiveListListener

Remove live list event listener.
abstract fun removeLiveListListener(listener: LiveListListener)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
listener
Required
Listener.

Live List

fetchLiveList

Get live list.
abstract fun fetchLiveList(
cursor: String?,
count: Int,
completion: CompletionHandler?
)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
cursor
String?
Required
Cursor.
count
Int
Required
Count.
completion
CompletionHandler?
Required
Completion callback.

fetchLiveInfo

Get live info.
abstract fun fetchLiveInfo(
liveID: String,
completion: LiveInfoCompletionHandler?
)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveID
String
Required
Live room ID.
completion
Required
Completion callback.

Live Operations

startLive

Start live (Host only).
abstract fun startLive(
liveInfo: LiveInfo,
completion: LiveInfoCompletionHandler?
)
Host starts broadcasting. If the live room ID is new, a new live room will be created; if the live room ID already exists on the server, the host will join and start broadcasting.
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveInfo
Required
Live info.
completion
Required
Completion callback.

joinLive

Join live (Audience only).
abstract fun joinLive(
liveID: String?,
completion: LiveInfoCompletionHandler?
)
Called by the audience to join an existing live room.
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveID
String?
Required
Live ID.
completion
Required
Completion callback.

leaveLive

Leave live (Audience only).
abstract fun leaveLive(completion: CompletionHandler?)
Called by the audience to leave the current live room. If the host only needs to leave the room without dismissing it, this API can also be called.
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
completion
CompletionHandler?
Required
Completion callback.

endLive

End live (Host only).
abstract fun endLive(completion: StopLiveCompletionHandler?)
Called by the host to end the current live and dismiss the room.
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
completion
Required
Completion callback.

updateLiveInfo

Update live info.
abstract fun updateLiveInfo(
liveInfo: LiveInfo,
modifyFlagList: List<LiveInfo.ModifyFlag>,
completion: CompletionHandler?
)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveInfo
Required
Live info.
modifyFlag
List<LiveInfo.ModifyFlag>
Required
Modify flag.
completion
CompletionHandler?
Required
Completion callback.

Metadata Operations

queryMetaData

Query metadata.
abstract fun queryMetaData(
keys: List<String>,
completion: MetaDataCompletionHandler?
)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
keys
List<String>
Required
Key list.
completion
Required
Completion callback.

updateLiveMetaData

Update live metadata.
abstract fun updateLiveMetaData(
metaData: HashMap<String, String>,
completion: CompletionHandler?
)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
metaData
HashMap<String, String>
Required
Metadata.
completion
CompletionHandler?
Required
Completion callback.

Data Structures

TakeSeatMode

Take seat mode.
Enum Value
Description
FREE
Free to take seat.
APPLY
Apply to take seat.

SeatLayoutTemplate

Seat layout template for simplifying seat configuration when creating a live room.
Enum Value
Description
VideoDynamicGrid9Seats
Portrait dynamic 9-grid layout for video live streaming.
VideoDynamicFloat7Seats
Portrait dynamic 1v6 floating layout for video live streaming.
VideoLeftFocus9Seats
Portrait left focus 9-grid layout for video live streaming.
VideoUniformGrid9Seats
Portrait uniform 9-grid layout for video live streaming.
VideoFixedGrid9Seats
Portrait static 9-grid layout for video live streaming.
VideoFixedFloat7Seats
Portrait static 1v6 floating layout for video live streaming.
VideoLandscape4Seats
Landscape 4-seat layout for video live streaming.
Karaoke
Audio KTV layout for karaoke scenes with configurable seat count.
AudioSalon
Audio salon layout for voice chat scenes with configurable seat count.

LiveEndedReason

Live ended reason.
Enum Value
Description
ENDED_BY_HOST
Ended by host.
ENDED_BY_SERVER
Ended by server.

LiveKickedOutReason

Kicked out of live room reason.
Enum Value
Description
BY_ADMIN
Kicked out by admin.
BY_LOGGED_ON_OTHER_DEVICE
Logged on other device.
BY_SERVER
Kicked out by server.
FOR_NETWORK_DISCONNECTED
Network disconnected.
FOR_JOIN_ROOM_STATUS_INVALID_DURING_OFFLINE
Join room status invalid during offline.
FOR_COUNT_OF_JOINED_ROOMS_EXCEED_LIMIT
Count of joined rooms exceed limit.

LiveInfo

Live information.
Property
Type
Description
liveID
String
Live ID.
liveName
String
Live name.
notice
String
Live notice.
isMessageDisable
Boolean
Whether message is disabled.
isPublicVisible
Boolean
Whether publicly visible.
isSeatEnabled
Boolean
Whether seat is enabled.
keepOwnerOnSeat
Boolean
Whether to keep owner on seat.
maxSeatCount
Int
Maximum seat count.
seatMode
Take seat mode.
seatTemplate
Seat layout template for simplifying seat configuration.
seatLayoutTemplateID
Int
Seat layout template ID.
coverURL
String
Cover URL.
backgroundURL
String
Background URL.
categoryList
List<Int>
Category list.
activityStatus
Int
Activity status.
liveOwner
LiveUserInfo
Live owner info.
createTime
Long
Create time.
totalViewerCount
Int
Total viewer count.
isGiftEnabled
Boolean
Whether gift is enabled.
metaData
Map<String, String>
Metadata.

LiveListState

Live list state.
Property
Type
Description
liveList
StateFlow<List<LiveInfo>>
Live list.
liveListCursor
StateFlow<String>
Live list cursor.
currentLive
StateFlow<LiveInfo>
Current live info.

LiveListListener

Live list events.
Methods
onLiveEnded: Live ended event.
open fun onLiveEnded(liveID: String, reason: LiveEndedReason, message: String) {}
Parameter
Type
Description
liveID
String
Live ID.
reason
Ended reason.
message
String
Message.
onKickedOutOfLive: Kicked out of live room event.
open fun onKickedOutOfLive(liveID: String, reason: LiveKickedOutReason, message: String) {}
Parameter
Type
Description
liveID
String
Live ID.
reason
Kicked out reason.
message
String
Message.

LiveInfoCompletionHandler

Live info completion callback interface.
Methods
onSuccess: Success callback.
fun onSuccess(liveInfo: LiveInfo)
Parameter
Type
Description
liveInfo
Live info.
onFailure: Failure callback.
fun onFailure(code: Int, desc: String)
Parameter
Type
Description
code
Int
Error code.
desc
String
Error description.

StopLiveCompletionHandler

Stop live completion callback interface.
Methods
onSuccess: Success callback.
fun onSuccess(statisticsData: TUILiveListManager.LiveStatisticsData)
Parameter
Type
Description
statisticsData
TUILiveListManager.LiveStatisticsData
Live statistics data.
onFailure: Failure callback.
fun onFailure(code: Int, desc: String)
Parameter
Type
Description
code
Int
Error code.
desc
String
Error description.

MetaDataCompletionHandler

Metadata completion callback interface.
Methods
onSuccess: Success callback.
fun onSuccess(metaData: HashMap<String, String>)
Parameter
Type
Description
metaData
HashMap<String, String>
Metadata.
onFailure: Failure callback.
fun onFailure(code: Int, desc: String)
Parameter
Type
Description
code
Int
Error code.
desc
String
Error description.