8.0.0-beta • Published 3 years ago

@nswitfy/jitsi-meet v8.0.0-beta

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

:warning: This plugin is on development and is use mainly for Witfy projects, will be improved as needed

Nativescript Jitsi Meet

A plugin which uses jitsi open source video conference SDK for both platforms, Android and IOS;

PR are really welcome if you want to add or work on the checklist below

:wink:

Installation

Nativescript 7+

tns plugin add @nswitfy/jitsi-meet

Nativescript 6+

tns plugin add nativescript-jitsi-meet

I'm working on

  • Add call listeners to Android such as conferenceTerminated and etc.
  • Android is not accepting custom jitsi server yet, only IOS.
  • Add core demo version
  • Test and add Vue demo version

  • In the future I'd like to have more control of jitsi features such as hide invitation button, start call with password and etc. But so far I haven't found if Jisti already have this available on their framework and sdk.

Prerequisites / Requirements

The only requisites I found necessary so far is that your application may use *android:minSdkVersion 23*;

Android

-

IOS

In your info.plist file add the follow lines:

...

    <key>NSCameraUsageDescription</key>
    <string>Can we use your camera?</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Can we use your photo library, please? :)</string>
    <key>NSCalendarsUsageDescription</key>
    <string>Give access to your calendar to improve your conference experience</string>
    <key>UIBackgroundModes</key>
    <array>
      <string>audio</string>
      <string>voip</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <string>NO</string>

...

Angular Usage

import { NativescriptJitsiMeetConferenceOptions, NativescriptJitsiMeet } from 'nativescript-jitsi-meet';

...

public startMeet() {
    const jitsiOptions: NativescriptJitsiMeetConferenceOptions = {
            roomName: 'test',  // the only mandatory field
            audioMuted: false,
            videoMuted: false,
            audioOnly: false,
            featureFlags: {
                closeCaptionsEnabled: false,
                calendarEnabled: false,
                callIntegration: false,
                chatEnabled: false,
                inviteEnabled: false,
                iosRecordingEnabled: false,
                pipEnabled: false,
                welcomePageEnabled: true
            }
    };

    const jitsiCaller: NativescriptJitsiMeet = new NativescriptJitsiMeet();

    jitsiCaller.on('conferenceWillJoin', (url: string, error: string) => {
        console.log(`conferenceWillJoin`);
    });

    jitsiCaller.on('conferenceJoined', (url: string, error: string) => {
        console.log(`conferenceJoined`);
    });

    jitsiCaller.on('conferenceTerminated', (url: string, error: string) => {
        console.log(`conferenceTerminated`);
    });

    // this function will start your meeting;
    jitsiCaller.startMeeting(this.jitsiOptions);
}

...

API

NativescriptJitsiMeet

By default the server https://meet.jit.si/ is the default server used by this plugin but you have your own jitsi server you can pass the path on the constructor of NativescriptJitsiMeet.

startMeeting

This function will receive as parameter your options and will start the meet;

addEventListener

You can use this function to add your listener to the events listed below. The parameters are the listener name and your callback function. Take a look on the usage above.

on

Same as addEventListener, just smaller :)

Jitsi configuration

NativescriptJitsiMeetConferenceOptions

PropertyDefaultDescription
roomNamestring, only mandatory propertyyour room name, keep in mind that if you use this plugin if jitsi default server your room will be always public at the start
audioMutedfalsestart the meet with the audio muted
videoMutedfalsestart the meet with the video muted
audioOnlyfalsestart the meet with audio only
featureFlagsobjectsome jitsi meet configuration flags

feature flags object properties

Feature flags propertyDefaultDescription
closeCaptionsEnabledfalseactive close caption
calendarEnabledfalse??active calendar
callIntegrationfalse??start meet call with call integration
chatEnabledfalsestart meet with chat enable
iosRecordingEnabledfalseenable ios recording video
pipEnabledfalseenable pip features
welcomePageEnabledfalseenables the jitsi server welcome page, which is not being in use right now because everytime the user close the call we close the view, so this will not be shown by now

Events

Only IOS for now

conferenceWillJoin

First event fired before actualy join the meet;

conferenceJoined

Event fired when user actualy join the meet;

conferenceTerminated

Event fired when call is terminated;

License

Apache License Version 2.0, January 2004