• 製品
  • 価格
  • リソース
  • サポート
このページは現在英語版のみで提供されており、日本語版も近日中に提供される予定です。ご利用いただきありがとうございます。
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
ValueListenable<List<LiveInfo>>
Live list.
liveListCursor
ValueListenable<String>
Live list cursor.
currentLive
ValueListenable<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.
void addLiveListListener(LiveListListener listener);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
listener
Required
Listener.

removeLiveListListener

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

Live List

fetchLiveList

Get live list.
Future<CompletionHandler> fetchLiveList({
required String cursor,
required int count,
});
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
cursor
String
Required
Cursor.
count
int
Required
Count.

fetchLiveInfo

Get live info.
Future<LiveInfoCompletionHandler> fetchLiveInfo(String liveID);
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).
Future<LiveInfoCompletionHandler> startLive(LiveInfo liveInfo);
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.

joinLive

Join live (Audience only).
Future<LiveInfoCompletionHandler> joinLive(String liveID);
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.

leaveLive

Leave live (Audience only).
Future<CompletionHandler> leaveLive();
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.

endLive

End live (Host only).
Future<StopLiveCompletionHandler> endLive();
Called by the host to end the current live and dismiss the room.
Version
Supported since version 3.5.

updateLiveInfo

Update live info.
Future<CompletionHandler> updateLiveInfo({
required LiveInfo liveInfo,
required List<ModifyFlag> modifyFlagList,
});
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveInfo
Required
Live info.
modifyFlag
List<ModifyFlag>
Required
Modify flag.

Metadata Operations

queryMetaData

Query metadata.
Future<MetaDataCompletionHandler> queryMetaData(List<String> keys);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
keys
List<String>
Required
Key list.

updateLiveMetaData

Update live metadata.
Future<CompletionHandler> updateLiveMetaData(Map<String, String> metaData);
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
metaData
Map<String, String>
Required
Metadata.

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
endedByHost
Ended by host.
endedByServer
Ended by server.

LiveKickedOutReason

Kicked out of live room reason.
Enum Value
Description
byAdmin
Kicked out by admin.
byLoggedOnOtherDevice
Logged on other device.
byServer
Kicked out by server.
forNetworkDisconnected
Network disconnected.
forJoinRoomStatusInvalidDuringOffline
Join room status invalid during offline.
forCountOfJoinedRoomsExceedLimit
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
bool
Whether message is disabled.
isPublicVisible
bool
Whether publicly visible.
isSeatEnabled
bool
Whether seat is enabled.
keepOwnerOnSeat
bool
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
int
Create time.
totalViewerCount
int
Total viewer count.
isGiftEnabled
bool
Whether gift is enabled.
metaData
Map<String, String>
Metadata.

LiveListState

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

LiveListListener

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

LiveInfoCompletionHandler

Live info completion handler for Dart.
Completion handler for live info operations in Dart, containing the result live info.
Properties
Property
Type
Description
liveInfo
Live info returned on success.

StopLiveCompletionHandler

Stop live completion handler for Dart.
Completion handler for stop live operations in Dart, containing the live statistics data.
Properties
Property
Type
Description
statisticsData
TUILiveStatisticsData
Live statistics data returned on success.

MetaDataCompletionHandler

Metadata completion handler for Dart.
Completion handler for metadata operations in Dart, containing the metadata result.
Properties
Property
Type
Description
metaData
Map<String, String>
Metadata returned on success.