Barrage

data class Barrage(var liveID: String = "", var sender: LiveUserInfo = LiveUserInfo(), var sequence: Long = 0, var timestampInSecond: Long = 0, var messageType: BarrageType = BarrageType.TEXT, var textContent: String = "", var extensionInfo: Map<String, String> = emptyMap(), var businessID: String = "", var data: String = "")

Barrage data model, containing complete attribute information of a single barrage.

Constructors

Link copied to clipboard
constructor(liveID: String = "", sender: LiveUserInfo = LiveUserInfo(), sequence: Long = 0, timestampInSecond: Long = 0, messageType: BarrageType = BarrageType.TEXT, textContent: String = "", extensionInfo: Map<String, String> = emptyMap(), businessID: String = "", data: String = "")

Properties

Link copied to clipboard

Business identifier ID of custom type barrage, used to distinguish custom barrages in different business scenarios.

Link copied to clipboard

Specific data content of custom type barrage (usually a JSON format string), valid when messageType{@link BarrageType} is CUSTOM.

Link copied to clipboard

Barrage extension information, customizable fields (such as display style, priority, etc.). Valid when messageType {@link BarrageType} is TEXT.

Link copied to clipboard

The unique identifier ID of the live room/voice chat room to which the barrage belongs.

Link copied to clipboard

Barrage message type (text or custom). {@link BarrageType}

Link copied to clipboard

User information of the barrage sender (such as user ID, nickname, avatar, etc.). {@link $LiveUserInfo$}

Link copied to clipboard

Unique sequence ID of the barrage message, used for message sorting and deduplication.

Link copied to clipboard

Message content of text type barrage, i.e., the text content of the barrage.

Link copied to clipboard

Barrage sending timestamp (unit: seconds), used to display the sending time order.