![]() |
In Flutter there are many prebuild Audio_Room_kit For Example – Agora, ZegoClooud LiveKit etc., but In this article, we are going to use ZegoCloud Live Audio Room Kit, use this SDK to add real-time video, audio and data features to your Flutter app. Connecting to a self- or cloud-hosted ZegoCloud server lets you quickly build applications like interactive live streaming or video calls with just a few lines of code. A sample video is given below to get an idea about what we are going to do in this article. Prerequisites:
Step By Step ImplementationStep 1: Add ZegoUIKitPrebuiltLiveAudioRoom as dependenciesRun the following code in your project’s root directory: flutter pub add zego_uikit_prebuilt_live_audio_room
Step 2: Make Some Changes in the Android File1. modify the compileSdkVersion Open the project_name/android/app/build.gradle file, and modify the compileSdkVersion to 33. ![]() Refer 27 [ CompileSdkVersion 33 ] 2. And in the Same file, edit the minSdkVersion and add multiDexEnabled minSdkVersion 21 ![]() refer 48 and 52 3. Add app permission Open the file your_project/app/src/main/AndroidManifest.xml, and add the following: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
To prevent obfuscation of the SDK public class names, do the following: In your project’s your_project > android > app folder, create a proguard-rules.pro file with the following content as shown below: -keep class **.zego.** { *; } ![]() refer 1 and 2 Add the following config code to the release part of the your_project/android/app/build.gradle file. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
![]() Refer 61 Step 3: Import the SDK [Create new File in Lib]Now in your Dart code, import the Live Audio Room Kit SDK. import 'package:zego_uikit_prebuilt_live_audio_room/zego_uikit_prebuilt_live_audio_room.dart';
Using the Live Audio Room Kit:
For below Constant.appId use your appId and Constant.appSign use your appSign import 'package:flutter/material.dart'; Step 4: Run & TestNow you can simply click the Run or Debug button to run and test your App on the device. Output: |
Reffered: https://www.geeksforgeeks.org
Dart |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |