Removes rtp stats option and adds options for disabling/enabling stats and audio levels.

This commit is contained in:
hristoterezov 2015-02-09 14:51:25 +02:00
parent b32acf0dfb
commit d21f994eee
6 changed files with 134 additions and 146 deletions

View File

@ -20,8 +20,9 @@ var config = {
chromeExtensionId: 'diibjkoicjeejcmhdnailmkgecihlobk', // Id of desktop streamer Chrome extension chromeExtensionId: 'diibjkoicjeejcmhdnailmkgecihlobk', // Id of desktop streamer Chrome extension
desktopSharingSources: ['screen', 'window'], desktopSharingSources: ['screen', 'window'],
minChromeExtVersion: '0.1', // Required version of Chrome extension minChromeExtVersion: '0.1', // Required version of Chrome extension
enableRtpStats: true, // Enables RTP stats processing
openSctp: true, // Toggle to enable/disable SCTP channels openSctp: true, // Toggle to enable/disable SCTP channels
disableStats: false,
disableAudioLevels: false,
channelLastN: -1, // The default value of the channel attribute last-n. channelLastN: -1, // The default value of the channel attribute last-n.
adaptiveLastN: false, adaptiveLastN: false,
adaptiveSimulcast: false, adaptiveSimulcast: false,

View File

@ -10,7 +10,7 @@
<meta itemprop="description" content="Join a WebRTC video conference powered by the Jitsi Videobridge"/> <meta itemprop="description" content="Join a WebRTC video conference powered by the Jitsi Videobridge"/>
<meta itemprop="image" content="/images/jitsilogo.png"/> <meta itemprop="image" content="/images/jitsilogo.png"/>
<script src="libs/jquery-2.1.1.min.js"></script> <script src="libs/jquery-2.1.1.min.js"></script>
<script src="config.js?v=5"></script><!-- adapt to your needs, i.e. set hosts and bosh path --> <script src="config.js?v=6"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
<script src="libs/strophe/strophe.min.js?v=1"></script> <script src="libs/strophe/strophe.min.js?v=1"></script>
<script src="libs/strophe/strophe.disco.min.js?v=1"></script> <script src="libs/strophe/strophe.disco.min.js?v=1"></script>
<script src="libs/strophe/strophe.caps.jsonly.min.js?v=1"></script> <script src="libs/strophe/strophe.caps.jsonly.min.js?v=1"></script>
@ -19,7 +19,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib --> <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib --> <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script> <script src="interface_config.js?v=5"></script>
<script src="libs/app.bundle.js?v=7"></script> <script src="libs/app.bundle.js?v=8"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin --> <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=6"/> <link rel="stylesheet" href="css/font.css?v=6"/>

File diff suppressed because one or more lines are too long

View File

@ -84,7 +84,7 @@ function LocalStatsCollector(stream, interval, statisticsService, eventEmitter)
* Starts the collecting the statistics. * Starts the collecting the statistics.
*/ */
LocalStatsCollector.prototype.start = function () { LocalStatsCollector.prototype.start = function () {
if (!window.AudioContext) if (config.disableAudioLevels || !window.AudioContext)
return; return;
var context = new AudioContext(); var context = new AudioContext();

View File

@ -219,69 +219,66 @@ StatsCollector.prototype.errorCallback = function (error)
StatsCollector.prototype.start = function () StatsCollector.prototype.start = function ()
{ {
var self = this; var self = this;
this.audioLevelsIntervalId = setInterval( if(!config.disableAudioLevels) {
function () this.audioLevelsIntervalId = setInterval(
{ function () {
// Interval updates // Interval updates
self.peerconnection.getStats( self.peerconnection.getStats(
function (report) function (report) {
{ var results = null;
var results = null; if (!report || !report.result ||
if(!report || !report.result || typeof report.result != 'function') typeof report.result != 'function') {
{ results = report;
results = report; }
} else {
else results = report.result();
{ }
results = report.result(); //console.error("Got interval report", results);
} self.currentAudioLevelsReport = results;
//console.error("Got interval report", results); self.processAudioLevelReport();
self.currentAudioLevelsReport = results; self.baselineAudioLevelsReport =
self.processAudioLevelReport(); self.currentAudioLevelsReport;
self.baselineAudioLevelsReport = },
self.currentAudioLevelsReport; self.errorCallback
}, );
self.errorCallback },
); self.audioLevelsIntervalMilis
}, );
self.audioLevelsIntervalMilis }
);
this.statsIntervalId = setInterval( if(!config.disableStats) {
function () { this.statsIntervalId = setInterval(
// Interval updates function () {
self.peerconnection.getStats( // Interval updates
function (report) self.peerconnection.getStats(
{ function (report) {
var results = null; var results = null;
if(!report || !report.result || typeof report.result != 'function') if (!report || !report.result ||
{ typeof report.result != 'function') {
//firefox //firefox
results = report; results = report;
} }
else else {
{ //chrome
//chrome results = report.result();
results = report.result(); }
} //console.error("Got interval report", results);
//console.error("Got interval report", results); self.currentStatsReport = results;
self.currentStatsReport = results; try {
try self.processStatsReport();
{ }
self.processStatsReport(); catch (e) {
} console.error("Unsupported key:" + e, e);
catch (e) }
{
console.error("Unsupported key:" + e, e);
}
self.baselineStatsReport = self.currentStatsReport; self.baselineStatsReport = self.currentStatsReport;
}, },
self.errorCallback self.errorCallback
); );
}, },
self.statsIntervalMilis self.statsIntervalMilis
); );
}
if (config.logStats) { if (config.logStats) {
this.gatherStatsIntervalId = setInterval( this.gatherStatsIntervalId = setInterval(

View File

@ -33,18 +33,14 @@ function stopRemote()
} }
function startRemoteStats (peerconnection) { function startRemoteStats (peerconnection) {
if (config.enableRtpStats) if(rtpStats)
{ {
if(rtpStats) rtpStats.stop();
{ rtpStats = null;
rtpStats.stop();
rtpStats = null;
}
rtpStats = new RTPStats(peerconnection, 200, 2000, eventEmitter);
rtpStats.start();
} }
rtpStats = new RTPStats(peerconnection, 200, 2000, eventEmitter);
rtpStats.start();
} }
function onStreamCreated(stream) function onStreamCreated(stream)