Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
change order of addTrack/removeTrack
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo committed Jul 1, 2014
1 parent fb8ab67 commit f893005
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mediastream-gain.bundle.js
Expand Up @@ -16,8 +16,8 @@ function GainController(stream) {
this.outputStream = this.destination.stream;
this.microphone.connect(this.gainFilter);
this.gainFilter.connect(this.destination);
stream.removeTrack(stream.getAudioTracks()[0]);
stream.addTrack(this.outputStream.getAudioTracks()[0]);
stream.removeTrack(stream.getAudioTracks()[0]);
}
this.stream = stream;
}
Expand Down Expand Up @@ -65,7 +65,7 @@ var PC = window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var IceCandidate = window.mozRTCIceCandidate || window.RTCIceCandidate;
var SessionDescription = window.mozRTCSessionDescription || window.RTCSessionDescription;
var MediaStream = window.webkitMediaStream || window.MediaStream;
var screenSharing = window.navigator.userAgent.match('Chrome') && parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1], 10) >= 26;
var screenSharing = window.location.protocol === 'https:' && window.navigator.userAgent.match('Chrome') && parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1], 10) >= 26;
var AudioContext = window.webkitAudioContext || window.AudioContext;


Expand Down
2 changes: 1 addition & 1 deletion mediastream-gain.js
Expand Up @@ -15,8 +15,8 @@ function GainController(stream) {
this.outputStream = this.destination.stream;
this.microphone.connect(this.gainFilter);
this.gainFilter.connect(this.destination);
stream.removeTrack(stream.getAudioTracks()[0]);
stream.addTrack(this.outputStream.getAudioTracks()[0]);
stream.removeTrack(stream.getAudioTracks()[0]);
}
this.stream = stream;
}
Expand Down

0 comments on commit f893005

Please sign in to comment.