zego_uikit_prebuilt_live_streaming 1.0.1 zego_uikit_prebuilt_live_streaming: ^1.0.1 copied to clipboard
PrebuiltLiveStreaming is a full-featured live streaming kit that provides ready-made video streaming, live text chat, face beautification, and supports unlimited viewers.
Quick start #
Integrate the SDK #
Add ZegoUIKitPrebuiltLiveStreaming as dependencies #
Run the following code in your project root directory:
flutter pub get zego_uikit_prebuilt_live_streaming
This will add a line like this to your project's pubspec.yaml
file (and Flutter will automatic run an implicit flutter pub get
):
dependencies:
zego_uikit_prebuilt_live_streaming: ^1.0.0 # Add this line
Import the SDK #
Now in your Dart code, import the prebuilt Video Call Kit SDK.
import 'package:zego_uikit_prebuilt_live_streaming/zego_uikit_prebuilt_live_streaming';
Integrate the live streaming #
You can get the AppID and AppSign from ZEGOCLOUD's Console.
Users who use the same liveID can in the same live streaming. (ZegoUIKitPrebuiltLiveStreaming supports 1 host Live for now)
you can customize UI by config properties
@override
Widget build(BuildContext context) {
return SafeArea(
child: ZegoUIKitPrebuiltLiveStreaming(
appID: /*Your App ID*/,
appSign: /*Your App Sign*/,
userID: user_id, // userID should only contain numbers, English characters and '_'
userName: 'user_name',
liveID: 'live_id',
config: isHost
? ZegoUIKitPrebuiltLiveStreamingConfig.host()
: ZegoUIKitPrebuiltLiveStreamingConfig.audience(),
),
);
}
Now, you can start a live stream, other people who enter the same 'live name' can watch your live stream.
How to run #
1. Config your project #
Android
-
If your project was created with a version of flutter that is not the latest stable, you may need to manually modify compileSdkVersion in
your_project/android/app/build.gradle
to 33 -
Need to add app permissions, Open the file
your_project/app/src/main/AndroidManifest.xml
, add the following code:<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
iOS
Need add app permissions, open ·your_project/ios/Runner/Info.plist·, add the following code inside the "dict" tag:
<key>NSCameraUsageDescription</key>
<string>We require camera access to connect to a live</string>
<key>NSMicrophoneUsageDescription</key>
<string>We require microphone access to connect to a live</string>
2. Build & Run #
Now you can simply click the "Run" or "Debug" button to build and run your App on your device.