Repairing callstats, fix scoping on this for screen obtainer callback,

stopping new stream in RTC
This commit is contained in:
Robert Smallwood 2015-12-15 20:00:02 -07:00 committed by Mike Girard
parent 168de5ecad
commit 831943e0bf
3 changed files with 11 additions and 4 deletions

View File

@ -159,10 +159,14 @@ var RTC = {
this.rtcUtils = null;
}
// Remove all local streams on cleanup
while (this.localStreams.length > 0) {
var stream = this.localStreams[0];
this.stopMediaStream(stream.getOriginalStream());
while (this.localAudio.length > 0) {
this.stopMediaStream(this.localAudio[0]
.getOriginalStream());
}
while (this.localVideo.length > 0) {
this.stopMediaStream(this.localVideo[0]
.getOriginalStream());
}
if (eventEmitter) {
eventEmitter.removeAllListeners();
}

View File

@ -270,6 +270,7 @@ function obtainScreenFromExtension(streamCallback, failCallback) {
'Changes will take effect after next Chrome restart.');
}
var _this = this;
chrome.webstore.install(
getWebStoreInstallUrl(),
function (arg) {
@ -281,7 +282,7 @@ function obtainScreenFromExtension(streamCallback, failCallback) {
}, 500);
},
function (arg) {
this.eventEmitter
_this.eventEmitter
.emit(DesktopSharingEventTypes.EXTENSION_INSTALLATION_ERROR);
console.log("Failed to install the extension", arg);
failCallback(arg);

View File

@ -31,6 +31,8 @@ var callStatsIntegrationEnabled = config.callStatsID && config.callStatsSecret;
var CallStats = {
init: function (jingleSession) {
callStatsIntegrationEnabled = config.callStatsID
&& config.callStatsSecret;
if(!callStatsIntegrationEnabled || callStats !== null) {
return;
}