The Jitsi Meet Flutter SDK provides the same user experience as the Jitsi Meet app, in the form of a Flutter plugin so that you can embed and customize Jitsi Meet in your own Flutter app.
Platform | Supported | Notes |
---|---|---|
Android | âś… | Minimum API level is 24 |
iOS | âś… | Minimum supported version is 13.4 |
Web | ❌ |
If you want to see how easy integrating the Jitsi Meet Flutter SDK into a Flutter application is, take a look at the
sample applications repository.
Add the dependency from command-line
$ flutter pub add jitsi_meet_flutter_sdk
The command above will add this to the pubspec.yaml
file in your project (you can do this manually):
dependencies:
jitsi_meet_flutter_sdk: ^10.2.1
Install the packages from the terminal:
$ flutter pub get
Import the following files into your dart code:
import 'package:jitsi_meet_flutter_sdk/jitsi_meet_flutter_sdk.dart';
Firstly, create a JitsiMeet
object, then call the method join
from it with a JitsiMeetConferenceOptions
object
var jitsiMeet = JitsiMeet();
var options = JitsiMeetConferenceOptions(room: 'jitsiIsAwesome');
jitsiMeet.join(options);
Make sure in Podfile
from ios
directory you set the ios version 15.1 or higher
platform :ios, '15.1'
The plugin requests camera and microphone access, make sure to include the required entries for NSCameraUsageDescription
and NSMicrophoneUsageDescription
in your Info.plist
file from the ios/Runner
directory.
<key>NSCameraUsageDescription</key>
<string>The app needs access to your camera for meetings.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The app needs access to your microphone for meetings.</string>
To use the screen sharing feature requires Broadcast Upload Extension
. Please check the following to integrate it: https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-ios-sdk/#screen-sharing-integration.
Go to android/app/build.gradle
and make sure that the minSdkVersion
is set to at lest 24
android {
...
defaultConfig {
...
minSdkVersion 24
}
}
The application:label
field from the Jitsi Meet Android SDK will conflict with your application's one . Go to android/app/src/main/AndroidManifest.xml
and add the tools library and tools:replace="android:label"
to the application tag.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
tools:replace="android:label"
android:label="sample_app"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
...
</application>
</manifest>
The JitsiMeet
class is the entry point for the sdk. It is used to launch the meeting screen, to send and receive all the events.
-
The constructor for the class.
-
Joins a meeting with the given options and optionally a listener is given
options
: meeting optionslistener
: event listener for events triggered by the native sdks
-
The localParticipant leaves the current meeting.
-
Sets the state of the localParticipant audio muted according to the
muted
parameter. -
Sets the state of the localParticipant video muted according to the
muted
parameter. -
Sends a message via the data channel to one particular participant or to all of them. If the
to
param is empty, the message will be sent to all the participants in the conference.In order to get the participantId, the
participantsJoined
event should be listened for, which have as a parameter theparticipantId
and this should be stored somehow. -
Sets the state of the localParticipant screen sharing according to the
enabled
parameter. -
Opens the chat dialog. If
to
contains a valid participantId, the private chat with that particular participant will be opened. -
Sends a chat message via to one particular participant or to all of them. If the
to
param is empty, the message will be sent to all the participants in the conference.In order to get the participantId, the
participantsJoined
event should be listened for, which have as a parameter theparticipantId
and this should be stored somehow. -
Closes the chat dialog.
-
Sends and event that will trigger the
participantsInfoRetrieved
event which will contain participants information
This object encapsulates all the options that can be tweaked when joining a conference.
Example:
var options = JitsiMeetConferenceOptions(
serverURL: "https://meet.jit.si",
room: "jitsiIsAwesomeWithFlutter",
configOverrides: {
"startWithAudioMuted": false,
"startWithVideoMuted": false,
"subject" : "Jitsi with Flutter",
},
featureFlags: {
"unsaferoomwarning.enabled": false
},
userInfo: JitsiMeetUserInfo(
displayName: "Flutter user",
email: "user@example.com"
),
);
-
All the values that can be added to the
configOverrides
can be found here. -
All the values that can be added to the
featureFlags
can be found here. -
The constructor for the JitsiMeetUserInfo. P.S. the avatar should be an url.
This class intends to be used as a listener for events that come from the native sdks. It will receive as arguments the event handlers
-
Called when a conference was joined.
url
: the conference URL
-
Called when the active conference ends, be it because of user choice or because of a failure.
url
: the conference URLerror
: missing if the conference finished gracefully, otherwise contains the error message
-
Called before a conference is joined.
- url: the conference URL
-
Called when a participant has joined the conference.
email
: the email of the participant. It may not be set if the remote participant didn't set one.name
: the name of the participant.role
: the role of the participant.participantId
: the id of the participant.
-
Called when a participant has left the conference.
participantId
: the id of the participant that left.
-
Called when the local participant's audio is muted or unmuted.
muted
: a boolean indicating whether the audio is muted or not.
-
Called when the local participant's video is muted or unmuted.
muted
: a boolean indicating whether the video is muted or not.
-
Called when an endpoint text message is received.
senderId
: the participantId of the sendermessage
: the content.
-
Called when a participant starts or stops sharing his screen.
participantId
: the id of the participantsharing
: the state of screen share
-
Called when a chat text message is received.
senderId
: the id of the participant that sent the message.message
: the content of the message.isPrivate
: true if the message is private, false otherwise.timestamp
: the (optional) timestamp of the message.
-
Called when the chat dialog is opened or closed.
isOpen
: true if the chat dialog is open, false otherwise.
-
Called when
retrieveParticipantsInfo
action is calledparticipantsInfo
: a list of participants information as a string.
-
Called when the SDK is ready to be closed. No meeting is happening at this point.
var listener = JitsiMeetEventListener(
conferenceJoined: (url) {
debugPrint("conferenceJoined: url: $url");
},
participantJoined: (email, name, role, participantId) {
debugPrint(
"participantJoined: email: $email, name: $name, role: $role, "
"participantId: $participantId",
);
participants.add(participantId!);
},
chatMessageReceived: (senderId, message, isPrivate) {
debugPrint(
"chatMessageReceived: senderId: $senderId, message: $message, "
"isPrivate: $isPrivate",
);
},
readyToClose: () {
debugPrint("readyToClose");
},
);
While building this project inspiration from https://github.com/saibotma/jitsi_meet_wrapper was taken.