Jitsi Meet

repository·master·Indexed 10 days ago

https://github.com/jitsi/jitsi-meet

An open-source video conferencing platform providing HD audio/video, content sharing, and E2EE. It can be deployed via Docker/Debian, used as a web service, or consumed via JaaS (Jitsi as a Service). The project includes a React Native SDK, translation tools using i18next, and Redux state persistence via PersistenceRegistry.

Tokens
20.4K
Snippets
56
Records
75
Agent score
98%

What's inside Jitsi Meet

  1. How to store data in Prosody modules

    master

    When developing or extending Prosody modules for Jitsi, follow these data storage patterns to ensure stability and prevent memory leaks:

    1. Storage Location: Store data within the room._data object or directly on the room object.
    2. Data Types: Data must be simple types, such as strings or a table of strings.
    3. Avoid Complex Objects: Do not attach complex objects like room, sessions, or occupants to the data, as these cannot be serialized.
    4. Lifecycle Safety: Attaching data to the room object ensures that data is automatically wiped when the room is destroyed and makes module reloading safe.
  2. Serialization limitations in the persistence layer

    master

    The persistence layer uses JSON.stringify() for serialization. Consequently, you cannot persist complex JavaScript objects that are not JSON-compatible.

    Unsupported types include:

    • Map
    • Set
    • Function

    Ensure that any state you intend to persist via PersistenceRegistry consists only of JSON-serializable data.

  3. Configure Visitor and Moderator JWT tokens

    master

    The Waiting Queue service distinguishes between Visitors and Moderators based on the claims within their JWT context.

    Visitor Token Requirements

    To allow a user to connect to the /visitor websocket and wait for the 'ready to join' message, the token must contain:

    {
      "context": {
        "user": {
          "role": "visitor"
        }
      }
    }

    Moderator Token Requirements

    To allow a moderator to connect to the /moderator websocket and receive visitor count updates via the /secured/conference/state/topic.{conference} topic, the token must contain:

    {
      "context": {
        "user": {
          "moderator": true
        }
      }
    }
  4. Authenticate with the Waiting Queue using STOMP

    master

    To connect to the Waiting Queue service, you must provide a JWT token in the Authorization header of the STOMP CONNECT message. The token must be a valid JAAS token for the specific conference.

    When subscribing to topics, ensure the Authorization header is also included in the subscription request.

    headers = {
        Authorization: 'Bearer ' + token
    };
    
    stompClient.connectHeaders = headers;
    
    stompClient.onConnect = (frame) => {
        setConnected(true);
        console.log('Connected: ' + frame);
    
        stompClient.subscribe('/secured/conference/visitor/topic.' + conference, (message) => {
            showMessage(message.body);
        }, headers);
    };
  5. Install fastlane

    master

    To use fastlane for automation in this project, ensure you have the latest version of the Xcode command line tools installed first. You can then install fastlane using either RubyGems or Homebrew.

    xcode-select --install
    
    # Using RubyGems
    [sudo] gem install fastlane -NV
    
    # OR using Homebrew
    brew install fastlane
  6. Switch your deployment to JaaS

    master

    To migrate your Jitsi Meet deployment to JaaS (Jitsi as a Service), follow these steps:

    1. Generate API Keys: Log in to the JaaS Developer console and use the Add API key button, then select Generate API key pair.
    2. Secure the Private Key: Download the generated private key immediately. You must transfer this file to your server.
    3. Identify Key ID: Copy the key id from the JaaS console.
    4. Run Migration Script: Execute the move-to-jaas.sh helper script on your server, providing the path to your private key file and the key ID.

    Note on E2EE: By default, end-to-end encryption (E2EE) is enabled. This feature only works on Chromium-based browsers (e.g., Chrome, Edge). If a participant joins via a mobile device or a non-Chromium browser, E2EE will be disabled for that session.

    sudo /usr/share/jitsi-meet/scripts/move-to-jaas.sh /my/path/test-key.pk <key_id>
  7. Using Jitsi Meet via Web or Mobile

    master

    Jitsi Meet is a browser-based video conferencing platform. You can use it immediately without installation by visiting meet.jit.si. To start a meeting, you may need a Google, Facebook, or GitHub account.

    For mobile users, Jitsi Meet is available via mobile web browsers or through dedicated native applications:

    Early access to new features can be obtained through the open beta programs for Android and iOS (via TestFlight).

  8. Adding new translatable text in development

    master

    When adding new functionality that requires translation, follow these steps:

    1. Define the source: Add the new key and its English value to the main.json file. This serves as the base for all other translations.
    2. Use the key: Use the newly created key to retrieve the translated text for the user's current language in the UI.

    HTML Integration

    You can add translatable text to HTML elements using the data-i18n attribute. Elements with this attribute will be automatically translated when the language is changed.

    <span data-i18n="dialog.OK">OK</span>

    JavaScript Integration

    If you need to generate translatable HTML via JavaScript, use APP.translation.generateTranslationHTML(key, options). The options parameter will be rendered into a data-i18n-options attribute on the resulting element.

    APP.translation.generateTranslationHTML("dialog.OK") // returns <span data-i18n="dialog.OK">OK</span>

    To retrieve the raw translated string for a key without HTML tags, use APP.translation.translateString(key).

    APP.translation.translateString("dialog.OK") // returns the value for the key of the current language file, e.g., "OK"

    Dynamic Content

    If you dynamically inject HTML elements into the DOM, they will not be translated automatically upon insertion. You must manually call APP.translation.translateElement(jquery_selector) to trigger the translation for those new elements.

  9. How to translate Jitsi Meet

    master

    Jitsi Meet uses the i18next library for translations, with each language stored in a separate JSON file. To translate Jitsi Meet, you must manually edit these language files.

    To simplify the process, you can use the update-translation.js script to identify missing keys. Running this script against a specific language file will update it with all missing keys set to empty strings, allowing you to simply fill in the translations.

    cd lang
    node update-translation.js main-es.json
  10. Configure iOS for Jitsi Meet SDK

    master

    To support camera, microphone, and background audio, perform the following steps on iOS:

    1. Info.plist: Add Privacy - Camera Usage Description and Privacy - Microphone Usage Description.
    2. Signing & Capabilities: Enable the following Background modes:
      • Audio
      • Voice over IP
      • Background fetch
    3. Install Pods: Run pod install from the ios directory.
    cd ios && pod install && cd ..