feature(rtcstats): expose sendSdp as config option (#12072)
* feature(rtcstats): expose sendSdp as config option * fixed linting error
This commit is contained in:
parent
4ef5da6c82
commit
96099a06a8
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue