BarrageStore class abstract
Barrage related interfaces, managing barrage sending, barrage state synchronization, and barrage event listening in live rooms/voice chat rooms.
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.
Key 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 create factory method to create a
BarrageStoreinstance, which requires a valid live room ID.
Note: 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
| Type | Enum Value | Description |
|---|---|---|
| BarrageType.text | 0 | Text type barrage |
| BarrageType.custom | 1 | Custom type barrage |
Topics
Creating Instance
- create : Create barrage management instance
Observing State
- barrageState : Barrage state data
Sending Barrage
- sendTextMessage : Send text barrage
- sendCustomMessage : Send custom barrage
Local Messages
- appendLocalTip : Add local tip message
See Also
Constructors
Properties
- barrageState → BarrageState
-
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.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
appendLocalTip(
Barrage message) → void - Add local tip message (add tip or operation feedback message locally, visible only to the current client).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendCustomMessage(
{required String businessID, required String data}) → Future< CompletionHandler> - Send custom type barrage.
-
sendTextMessage(
{required String text, Map< String, String> ? extensionInfo}) → Future<CompletionHandler> - Send text type barrage.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
String liveID) → BarrageStore - Barrage management core class for handling barrage related business logic in live rooms/voice chat rooms.