feature(rtcstats): expose sendSdp as config option (#12072)

* feature(rtcstats): expose sendSdp as config option

* fixed linting error
This commit is contained in:
Nils Ohlmeier 2022-08-26 11:03:08 -07:00 committed by GitHub
parent 4ef5da6c82
commit 96099a06a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -969,6 +969,10 @@ var config = {
// will only send data related to RTCPeerConnection events.
// rtcstatsPollInterval: 10000,
// This determines if rtcstats sends the SDP to the rtcstats server or replaces
// all SDPs with an emtpy string instead.
// rtcstatsSendSdp: false,
// Array of script URLs to load as lib-jitsi-meet "analytics handlers".
// scriptURLs: [
// "libs/analytics-ga.min.js", // google-analytics

View File

@ -41,11 +41,12 @@ class RTCStats {
* @param {string} options.useLegacy - Switch to legacy chrome webrtc statistics. Parameter will only have
* an effect on chrome based applications.
* @param {number} options.pollInterval - The getstats poll interval in ms.
* @param {boolean} options.sendSdp - Determines if the client sends SDP to the rtcstats server.
* @returns {void}
*/
init(options) {
const { endpoint, useLegacy, pollInterval } = options;
const { endpoint, useLegacy, pollInterval, sendSdp } = options;
const traceOptions = {
endpoint,
@ -56,7 +57,8 @@ class RTCStats {
const rtcstatsOptions = {
connectionFilter,
pollInterval,
useLegacy
useLegacy,
sendSdp
};
this.trace = traceInit(traceOptions);

View File

@ -44,6 +44,7 @@ MiddlewareRegistry.register(store => next => action => {
// Default poll interval is 10000ms and standard stats will be used, if not provided in the config.
const pollInterval = analytics.rtcstatsPollInterval || 10000;
const useLegacy = analytics.rtcstatsUseLegacy || false;
const sendSdp = analytics.rtcstatsSendSdp || false;
// Initialize but don't connect to the rtcstats server wss, as it will start sending data for all
@ -51,7 +52,8 @@ MiddlewareRegistry.register(store => next => action => {
RTCStats.init({
endpoint: analytics.rtcstatsEndpoint,
useLegacy,
pollInterval
pollInterval,
sendSdp
});
} catch (error) {
logger.error('Failed to initialize RTCStats: ', error);