Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(statistics) initialize LocalStatsCollector on Statistics.init #2494

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions modules/statistics/LocalStatsCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ LocalStatsCollector.prototype.stop = function() {
this.source = null;
};

/**
* Initialize collector.
*/
LocalStatsCollector.init = function() {
LocalStatsCollector.connectAudioContext();
};

/**
* Checks if the environment has the necessary conditions to support
* collecting stats from local streams.
Expand Down Expand Up @@ -170,8 +177,3 @@ LocalStatsCollector.connectAudioContext = function() {

context.suspend();
};

/**
* Initialize the audio context on startup.
*/
LocalStatsCollector.connectAudioContext();
2 changes: 2 additions & 0 deletions modules/statistics/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Statistics.init = function(options) {

Statistics.disableThirdPartyRequests = options.disableThirdPartyRequests;

LocalStats.init();

// WatchRTC is not required to work for react native
browser.isReactNative()
? logger.warn('Cannot initialize WatchRTC in a react native environment!')
Expand Down
Loading