Skip to main content

watchRTC as a feature of JaaS

To make the process of collecting stats for JaaS (Jitsi as a Service) users easier, jitsi agreed to add the watchRTC SDK code inside the jitsi source code. This is done through the use of a watchRTCEnabled flag. JaaS will now come with the feature of watchRTC straight out of the box, but in order to initiate watchRTC, you will require the appropriate watchRTC configuration to also be provided.

This involves adding:

  • configOverwrite parameters: configuration to jitsi to enable watchRTC
  • watchRTCConfigParams: for initializing the SDK and setting your watchRTC options

Why add watchRTC SDK code within jitsi source code?

Just as you use Jitsi with some configurations, we will expose some configurations of the watchRTC SDK so that customers using Jitsi will be able to use watchRTC as well.

How do I enable watchRTC to run within a jitsi iframe?

Within the jitsi configuration of your project you will find a configOverwrite property in the options. Here you must pass some new configurations that will enable watchRTC to run within jitsi.

configOverwrite parameters

To initiate watchRTC within jitsi you must pass the following parameters in the configOverwrite property.

  • Analytics:
    • rtcstatsEnabled: Must be set to false. RTC stats uses the same process that watchRTC does. So in order for watchRTC to work, you should not collect RTC stats. Please remember to keep this disabled in order for watchRTC to work.
    • watchRTCEnabled: Must be set to true. By enabling the watchRTCEnabled option you are confirming that you want to use the watchRTC feature to collect stats. This would also require configuring the watchRTCConfigParams.
    • watchRTCConfigParams: Must be set to watchRTCOptions. This will pass the configuration set in the watchRTC options (APIkey, RoomID, PeerId,etc..)
      var options = {
          width: "100%",
          height: "100%",
          parentNode: document.querySelector('#meet'),
          configOverwrite: {
              analytics: {
                  rtcstatsEnabled: false,
                  watchRTCEnabled: true,
              },
              watchRTCConfigParams: watchRTCOptions,
          },
          roomName: roomId
      };
      var api = new JitsiMeetExternalAPI(domain, options);
      

watchRTCConfigParams

In order to begin collecting RTC stats you must add the watchRTC options to the jitsi configuration file. These are required to make a secure connection to the watchRTC API and to pass any parameters you need to jitsi.

There are many configuration options that you can set depending on your needs. Your options for this can be found in the Configuration section of the watchRTC JS SDK

When added, these will look something like this:
const watchRTCOptions = {
                rtcApiKey : <key>,
                rtcRoomId : <roomId>,
                rtcPeerId : <peerId>,
                allowBrowserLogCollection : false,
                console: { override: true },
            }
Note: Important: The final two options here are important because of current limitations with watchRTC.
  1. allowBrowserLogCollection: This must be set to false. This is currently not supported by JaaS.
  2. Console: This must be set to true.

    What this says is that local options will override options that are defined by the project or within the account. Read Granular control of console log collection in the SDK if you would like to know more about this override setting.

Room and Peer IDs

These IDs are required by watchRTC to show results in the history. If they are not passed in the watchRTC configuration, or they are not available for whatever reason, we will check to see if this information is available from jitsi and we will attempt to assign the room and peer name that has been given by the user.

Was this article helpful?

0 out of 0 found this helpful