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

LiveListStore

Introduction

LiveListStore provides a complete set of live room management APIs, including creating live, joining live, leaving live, ending live and other functions. Through this class, you can manage the lifecycle of live rooms.
Important:
Use the shared singleton object to get the LiveListStore instance.
Note:
Live state updates are delivered through the state publisher. Subscribe to it to receive real-time updates of live data.

Features

Live List:Get and manage live room list
Live Creation:Create new live rooms
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
Live list.
liveListCursor
String
Live list cursor.
currentLive
Current live info.

API List

Function
Description
Singleton object.
Live list event publisher.
Get live list.
Get live info.
Create live.
Join live.
Leave live.
End live.
Update live info.
Query metadata.
Update metadata.

Getting Instance

shared

Singleton object

Observing State and Events

liveListEventPublisher

Live list event publisher

Live List

fetchLiveList

Get live list
public func fetchLiveList(cursor: String,
count: Int,
completion: CompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
cursor
String
Required
Cursor.
count
Int
Required
Count.
completion
Required
Completion callback.

fetchLiveInfo

Get live info
public func fetchLiveInfo(liveID: String,
completion: LiveInfoCompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveID
String
Required
Live room ID.
completion
LiveInfoCompletionClosure?
Required
Completion callback.

Live Operations

createLive

Create live
public func createLive(_ liveInfo: LiveInfo,
completion: LiveInfoCompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveInfo
Required
Live info.
completion
LiveInfoCompletionClosure?
Required
Completion callback.

joinLive

Join live
public func joinLive(liveID: String,
completion: LiveInfoCompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveID
String
Required
Live ID.
completion
LiveInfoCompletionClosure?
Required
Completion callback.

leaveLive

Leave live
public func leaveLive(completion: CompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
completion
Required
Completion callback.

endLive

End live
public func endLive(completion: StopLiveCompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
completion
StopLiveCompletionClosure?
Required
Completion callback.

updateLiveInfo

Update live info
public func updateLiveInfo(_ liveInfo: LiveInfo,
modifyFlag: LiveInfo.ModifyFlag,
completion: CompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
liveInfo
Required
Live info.
modifyFlag
LiveInfo.ModifyFlag
Required
Modify flag.
completion
Required
Completion callback.

Metadata Operations

queryMetaData

Query metadata
public func queryMetaData(keys: [String], completion: MetaDataCompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
keys
[String]
Required
Key list.
completion
MetaDataCompletionClosure?
Required
Completion callback.

updateLiveMetaData

Update live metadata
public func updateLiveMetaData(_ metaData: [String: String],
completion: CompletionClosure?) {
fatalError("\(#function) must be overridden by subclass")
}
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
metaData
[String: String]
Required
Metadata.
completion
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.
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
Required
Description
liveID
String
Required
Unique identifier for the live room, maximum 48 bytes. It is recommended to use prefixes to distinguish different room types.
liveName
String
Optional
Live room name, maximum 100 bytes. If not set, defaults to the room ID.
notice
String
Optional
Room announcement, maximum 100 bytes.
seatTemplate
Required
Seat layout template for simplifying seat configuration.
Portrait video streaming: Supports VideoDynamicGrid9Seats (dynamic grid layout), VideoDynamicFloat7Seats (floating window layout), VideoFixedGrid9Seats (fixed grid layout), VideoFixedFloat7Seats (fixed floating layout), etc.
Landscape video streaming: Supports VideoLandscape4Seat (landscape layout).
Voice chat room streaming: Supports AudioSalon (chat room layout), Karaoke (KTV layout), etc.
keepOwnerOnSeat
Bool
Optional
Only applicable to voice chat room scenarios, default value is false, the owner will not automatically take a seat. If set to true, the owner will automatically take a seat after entering the room.
seatMode
Optional
Take seat mode, with the following options. Default is FreeToTake mode.
FreeToTake: Free to take seat, no approval from owner or admin is required.
ApplyToTake: Apply to take seat, approval from owner or admin is required.
maxSeatCount
Int
Optional
Only applicable to voice chat room scenarios, effective when SeatTemplate is set to AudioSalon or Karaoke, sets the number of seats in the room (value range is limited by the maximum count in the package).
isSeatEnabled
Bool
Optional
Deprecated. Please use seatTemplate instead. This parameter will be parsed automatically.
seatLayoutTemplateID
UInt
Optional
Deprecated. Please use seatTemplate instead. This parameter will be parsed automatically.
isMessageDisable
Bool
Optional
Default value is false, allowing viewers to send barrage messages. Admins and owners are exceptions.
Only the owner and admins can modify this setting.
isPublicVisible
Bool
Optional
Whether the room is visible in the live room list, default value is true.
Only the owner and admins can modify this setting.
Set to false if you want to preview before officially going live or create a private live room.
Set to true if you want the room to be visible in the live room list.
isGiftEnabled
Bool
Optional
Read-only, default value is true, allowing viewers to send gifts.
coverURL
String
Optional
Room cover image, can be used for display in the live room list. Maximum 200 bytes.
Only the owner and admins can modify this setting.
backgroundURL
String
Optional
Background image of the live room, maximum 200 bytes.
Only the owner and admins can modify this setting.
categoryList
[NSNumber]
Optional
Room category tags, custom field, can be used as room type identifiers such as gaming, music, etc.
Only the owner and admins can modify this setting.
A single room supports up to 3 tags.
activityStatus
Int
Optional
Activity status within the live room, custom field. For example: 0 - Game preparing; 1 - In game; 2 - Game ended.
Only the owner and admins can modify this setting.
Once set, all users entering the room will receive this value; when updated, users in the room will also receive the latest value.
liveOwner
Optional
Read-only, the owner information of the current live room, defaults to the user who created the room.
createTime
Int
Optional
Read-only, room creation timestamp in milliseconds.
totalViewerCount
Int
Optional
Read-only, total number of times users have entered the room.
metaData
[String: String]
Optional
Custom metadata key-value pairs, both keys and values must be strings.
Only the owner and admins can modify this setting.
A single room supports up to 10 keys, each key can be up to 50 bytes, each value can be up to 2KB, and the total size of all values in a single room cannot exceed 16KB.

LiveListState

Live list state
Property
Type
Description
liveList
Live list.
liveListCursor
String
Live list cursor.
currentLive
Current live info.

LiveListListener

Live list events
Methods
onLiveEnded: Live ended event.
case 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.
case onKickedOutOfLive(liveID: String, reason: LiveKickedOutReason, message: String)
Parameter
Type
Description
liveID
String
Live ID.
reason
Kicked out reason.
message
String
Message.