Agora VideoUIKit for Flutter
Instantly integrate Agora video calling or video streaming into your Flutter application.
NOTE: The Flutter VideoUIKit( >version 1.1.0) uses the latest version of the Agora 4.x SDK. To know more about the changes and the new features in the 4.x SDK, kindly take a look at the docs.
Getting started
Roadmap
Add UsernamesxMore Event CallbacksxAdd RTM SDKxScreen Sharing (Currently in Beta)xLayout for One to One Video CallLayout for Voice CallsRe-orderable list view (Floating Layout)Cloud recordingPromoting an audience member to a broadcaster role.xMuting/Unmuting a remote memberxFlutter Web Support as a pre-releaseFlutter Desktop Support as a pre-release
Requirements
- An Agora developer account
- An Android or iOS Device
- A Flutter Project
Installation
In your Flutter application, add the agora_uikit as a dependency inside your pubspec.yaml file.
In your Android level build.gradle add this at the end of the repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Device Permission
Agora Video SDK requires camera and microphone permission to start video call.
Android
Open the AndroidManifest.xml file and add the required device permissions to the file.
<manifest>
...
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- The Agora SDK requires Bluetooth permissions in case users are using Bluetooth devices.-->
<uses-permission android:name="android.permission.BLUETOOTH" />
...
</manifest>
iOS
Open info.plist and add:
Privacy - Microphone Usage Description, and add a note in the Value column.Privacy - Camera Usage Description, and add a note in the Value column.
Your application can still run the voice call when it is switched to the background if the background mode is enabled. Select the app target in Xcode, click the Capabilities tab, enable Background Modes, and check Audio, AirPlay, and Picture in Picture.
Usage
// Instantiate the client
final AgoraClient client = AgoraClient(
agoraConnectionData: AgoraConnectionData(
appId: "<--Add Your App Id Here-->",
channelName: "test",
),
);
// Initialize the Agora Engine
@override
void initState() {
super.initState();
initAgora();
}
void initAgora() async {
await client.initialize();
}
// Build your layout
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Stack(
children: [
AgoraVideoViewer(client: client),
AgoraVideoButtons(client: client),
],
),
),
),
);
}
VideoUIKits
The plan is to grow this library and have similar offerings across all supported platforms. There are already similar libraries for Android, iOS, React Native, and Web React, so be sure to check them out.
Libraries
- agora_uikit
- controllers/rtc_event_handlers
- controllers/rtc_token_handler
- controllers/rtm_channel_event_handler
- controllers/rtm_client_event_handler
- controllers/rtm_controller
- controllers/rtm_controller_helper
- controllers/rtm_mute_request
- controllers/rtm_token_handler
- controllers/session_controller
- models/agora_channel_data
- models/agora_connection_data
- models/agora_rtc_event_handlers
- models/agora_rtm_channel_event_handler
- models/agora_rtm_client_event_handler
- models/agora_rtm_mute_request
- models/agora_settings
- models/agora_user
- models/rtm_message