このページは現在英語版のみで提供されており、日本語版も近日中に提供される予定です。ご利用いただきありがとうございます。

BarrageInputView

Component Overview

Message Sending Component allows users to input emojis and text messages in the bullet screen and send the message to the live streaming room. Users in the live streaming room can receive the message through the Live Streaming Rendering Component and display it on the screen, thereby enhancing the fun of the live stream and making the interaction experience more enjoyable and vivid.
Android
iOS
Flutter
BarrageInputView: Message Sending Component that allows users to input emojis and text messages in the barrage and send the message to the live streaming room.
BarrageInputView: Message Sending Component, which allows users to input emojis and text messages in the barrage and send the message to the live streaming room.
BarrageSendWidget: Message Sending Component, which enables users to input emojis and text messages in the barrage and send the message to the live streaming room.
Rendering display:

Notes:
1. Support switching between system keyboard and emoji keyboard.
2. To respect emoji design copyright, large emoji element slicing is not included in the TUILiveKit project. Before official commercial launch, please replace it with other emoji packs designed or owned by yourself. The default little yellow face emoji pack copyright belongs to Tencent Cloud, and it can be licensed for a fee. If you need to obtain authorization, you can submit a ticket to contact us.




Component Integration

Android
iOS
Flutter
1. Download TUILiveKit from
2. GitHub to your local system.
3. Copy the Android/tuilivekit/component/barrage directory to your project.
4. Add configurations in your settings.gradle.kts or settings.gradle file:
settings.gradle.kts
settings.gradle
include(":barrage")
include ':barrage'
5. In the build.gradle.kts or build.gradle file of the project where you need to introduce dependencies, add dependency configurations:
build.gradle.kts
build.gradle
api(project(":barrage"))
api project(':barrage')

Import components using CocoaPods. The specific steps to import components are as follows:
1. You need to download the Barrage folder from GitHub to your local system.

2. Add pod 'TUIBarrage' dependency in the Podfile file of your project.
Swift
target 'xxxx' do
...
...
pod 'TUIBarrage', :path => '../Component/Barrage/TUIBarrage.podspec'
// The path is the relative path between your Podfile file and TUIBarrage.Podspec file.
end
If you don't have a Podfile file, first use the terminal to cd into the xxxx.xcodeproj directory, then create it with the following command:
pod init
3. In the terminal, first cd to the Podfile directory, then execute the following commands to install components.
pod install
4. Any issues you encounter during integration and use, feel free to give feedback.
1. In the dependencies node of the pubspec.yaml file in the project engineering, add a dependency on barrage.
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.19.0
# Add barrage dependency
live_uikit_barrage: ^1.0.0
1. Execute the
2. flutter pub get command.
3. Configure multilingual support. Add multilingual support for the gift component to the localizationsDelegates and supportedLocales properties of your application's MaterialApp.
MaterialApp(localizationsDelegates: const [
...BarrageLocalizations.localizationsDelegates,
], supportedLocales: const [
...BarrageLocalizations.supportedLocales,
],
// ...
);

Component Usage

Notes:
Since the barrage component requires live room information parameters, it is necessary to load the barrage component after Audience Entering the Live Room or Anchor Create Live Room.

Integration of Sending Barrage Message Component

Android
iOS
Flutter
At the position to send barrage, create BarrageInputView. Click to bring up the input interface.
BarrageInputView barrageInputView = new BarrageInputView(mContext);
barrageInputView.init(roomId);
mBarrageInputContainer.addView(barrageInputView);
At the position to send barrage, create BarrageInputView. Click to bring up the input interface.
import TUIBarrage

let barrageInputView = BarrageInputView(roomId: roomId)
// ...Add barrageInputView to your parent view here and adjust the layout.
Notes:
You can only send danmaku into the room successfully after successfully entering the room.
Construct the BarrageSendController and BarrageSendWidget objects where you need to connect to send barrage messages. Add the constructed BarrageSendWidget object to your Widget tree. Sample code:
BarrageSendController _sendController = BarrageSendController(
roomId: "liveRoomId", /// Replace with your liveRoomId
ownerId: "liveOwnerId", /// Replace liveOwnerId with your live stream host ID
selfUserId: "selfUserId", /// Replace selfUserId with your currently logged-in user ID
selfName: "selfUserName"; /// Replace selfUserName with your currently logged-in user nickname
BarrageSendWidget(controller: _sendController);