BarrageStore

abstract class BarrageStore

Barrage related interfaces, managing barrage sending, barrage state synchronization, and barrage event listening in live rooms/voice chat rooms.

Overview

BarrageStore Barrage management class for handling barrage related business logic in live rooms/voice chat rooms. BarrageStore provides a complete set of barrage management APIs, including sending text barrages, sending custom barrages, and adding local tip messages. Through this class, you can implement barrage interaction functionality in live rooms.

Main Features

  • Text Barrage: Supports sending plain text barrage messages

  • Custom Barrage: Supports sending custom format barrages (such as barrages with special effects)

  • Local Tips: Supports adding tip messages visible only locally

Important: Use the BarrageStore.create factory method to create a BarrageStore instance, which requires a valid live room ID. Barrage state updates are delivered through the barrageState publisher. Subscribe to it to receive real-time updates of barrage data in the room.

Barrage Type Description

TypeEnum ValueDescription
BarrageType.TEXT0Text type barrage, contains plain text content
BarrageType.CUSTOM1Custom type barrage, supports business custom data format

Topics

Creating Instance

Observing State

Sending Barrage

Local Messages

See Also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Barrage state subscription of the current room, including barrage message list and other information. By subscribing to this state, you can get real-time updates of barrage data in the room.

Functions

Link copied to clipboard
abstract fun appendLocalTip(message: Barrage)

Add local tip message (add tip or operation feedback message locally, visible only to the current client).

Link copied to clipboard
abstract fun sendCustomMessage(businessID: String?, data: String?, completion: CompletionHandler?)

Send custom type barrage.

Link copied to clipboard
abstract fun sendTextMessage(text: String?, extensionInfo: Map<String, String>?, completion: CompletionHandler?)

Send text type barrage.