Skip to main content

jitsi_meet_flutter_sdk 13.3.4 copy "jitsi_meet_flutter_sdk: ^13.3.4" to clipboard
jitsi_meet_flutter_sdk: ^13.3.4 copied to clipboard

A flutter plugin that serves as a Jitsi Meet flutter SDK which provides the same user experience as the Jitsi Meet app.

Jitsi Meet Flutter SDK #

License pub package

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.

Supported platforms #

Platform Supported Notes
Android ✅ Minimum API level is 26
iOS ✅ Minimum supported version is 15.1
Web ❌

Requires Flutter 3.38.0 or higher.

Sample application using the Flutter #

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.

Installation #

Add dependency #

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: ^13.3.4

Install #

Install the packages from the terminal:

$ flutter pub get

Import files #

Import the following files into your dart code:

import 'package:jitsi_meet_flutter_sdk/jitsi_meet_flutter_sdk.dart';

Usage #

Join meeting

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);

Configuration #

iOS #

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 keep the meeting running in the background, enable the audio and voip background modes in the same Info.plist file.

<key>UIBackgroundModes</key>
<array>
    <string>audio</string>
    <string>voip</string>
</array>

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.

Android #

Go to android/app/build.gradle and make sure that compileSdkVersion is set to at least 35 and minSdkVersion is set to at least 26.

android {
    ...
    compileSdkVersion 35
    defaultConfig {
        ...
        minSdkVersion 26
    }
}

The native SDK requires Android Gradle Plugin 8.6.0 or higher. Go to android/settings.gradle and set the version of the com.android.application plugin:

plugins {
    ...
    id "com.android.application" version "8.6.0" apply false
}

The application:label field from the Jitsi Meet Android SDK will conflict with the label of your application. 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>

Using ProGuard

If you are using ProGuard (common on Release builds) make sure you add these rules to your rules file.

Using the API #

JitsiMeet #

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.

  1. JitsiMeet()

    The constructor for the class.

  2. join(JitsiMeetConferenceOptions options, [JitsiMeetEventListener? listener])

    Joins a meeting with the given options and optionally a listener is given

    • options : meeting options
    • listener : event listener for events triggered by the native sdks
  3. hangUp()

    The localParticipant leaves the current meeting.

  4. setAudioMuted(bool muted)

    Sets the state of the localParticipant audio muted according to the muted parameter.

  5. setVideoMuted(bool muted)

    Sets the state of the localParticipant video muted according to the muted parameter.

  6. sendEndpointTextMessage({String? to, required String message})

    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.

    To get the participantId, listen for the participantJoined event and store its participantId parameter.

  7. toggleScreenShare(bool enabled)

    Sets the state of the localParticipant screen sharing according to the enabled parameter.

  8. openChat([String? to])

    Opens the chat dialog. If to contains a valid participantId, the private chat with that particular participant will be opened.

  9. sendChatMessage({String? to, required String message})

    Sends a chat message 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.

    To get the participantId, listen for the participantJoined event and store its participantId parameter.

  10. closeChat()

    Closes the chat dialog.

  11. retrieveParticipantsInfo()

    Sends an event that will trigger the participantsInfoRetrieved event which will contain participants information.

  12. enterPiP()

    Enters Picture-in-Picture mode.

JitsiMeetConferenceOptions #

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: {
        FeatureFlags.unsafeRoomWarningEnabled: false,
      },
      userInfo: JitsiMeetUserInfo(
          displayName: "Flutter user",
          email: "user@example.com"
      ),
    );
  • serverURL : the server where the conference takes place. If not set, the native SDK default is used (https://meet.jit.si).
  • room : the room name. This is the only required option.
  • token : a JWT token used for authentication.
  • configOverrides : all the values that can be added can be found here.
  • featureFlags : use the constants from the FeatureFlags class, or any value from here. For video resolution values, use FeatureFlagVideoResolutions.
  • userInfo : information about the local user. It is used in absence of a token.

Keep FeatureFlags.welcomePageEnabled set to false (the default). If it is enabled, hanging up shows the Jitsi welcome page instead of closing the meeting screen, and readyToClose is not called.

  • JitsiMeetUserInfo({String displayName, String email, String avatar})

    The constructor for the JitsiMeetUserInfo. P.S. the avatar should be an url.

JitsiMeetEventListener #

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

  1. conferenceJoined(String url)

    Called when a conference was joined.

    • url : the conference URL
  2. conferenceTerminated(String url, Object? error)

    Called when the active conference ends, be it because of user choice or because of a failure.

    • url : the conference URL
    • error : missing if the conference finished gracefully, otherwise contains the error message
  3. conferenceWillJoin(String url)

    Called before a conference is joined.

    • url: the conference URL
  4. participantJoined(String? email, String? name, String? role, String? participantId)

    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.
  5. participantLeft(String? participantId)

    Called when a participant has left the conference.

    • participantId : the id of the participant that left.
  6. audioMutedChanged(bool muted)

    Called when the local participant's audio is muted or unmuted.

    • muted : a boolean indicating whether the audio is muted or not.
  7. videoMutedChanged(bool muted)

    Called when the local participant's video is muted or unmuted.

    • muted : a boolean indicating whether the video is muted or not.
  8. endpointTextMessageReceived(String senderId, String message)

    Called when an endpoint text message is received.

    • senderId : the participantId of the sender
    • message : the content.
  9. screenShareToggled(String participantId, bool sharing)

    Called when a participant starts or stops sharing their screen.

    • participantId : the id of the participant
    • sharing : the state of screen share
  10. chatMessageReceived(String senderId, String message, bool isPrivate, String? timestamp)

    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.
  11. chatToggled(bool isOpen)

    Called when the chat dialog is opened or closed.

    • isOpen : true if the chat dialog is open, false otherwise.
  12. participantsInfoRetrieved(String participantsInfo)

    Called when retrieveParticipantsInfo action is called

    • participantsInfo : a list of participants information as a string.
  13. readyToClose()

    Called when the SDK is ready to be closed. No meeting is happening at this point.

  14. customButtonPressed(String buttonId)

    Called when a custom button is pressed. Custom buttons are added with the customToolbarButtons config override.

    • buttonId : the id of the button that was pressed.

Example of listener:

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, timestamp) {
        debugPrint(
          "chatMessageReceived: senderId: $senderId, message: $message, "
              "isPrivate: $isPrivate, timestamp: $timestamp",
        );
      },

      readyToClose: () {
        debugPrint("readyToClose");
      },
    );

References #

While building this project inspiration from https://github.com/saibotma/jitsi_meet_wrapper was taken.

111
likes
150
points
6.12k
downloads

Documentation

API reference

Publisher

verified publisherjitsi.org

Weekly Downloads

A flutter plugin that serves as a Jitsi Meet flutter SDK which provides the same user experience as the Jitsi Meet app.

Homepage
Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on jitsi_meet_flutter_sdk

Packages that implement jitsi_meet_flutter_sdk