Skip to content

Commit

Permalink
Fix Firefox onnnegotiation needed (lynckia#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
lodoyun authored Dec 23, 2020
1 parent 0ad7dc5 commit dddc6fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions erizo_controller/erizoClient/src/webrtc-stacks/BaseStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const BaseStack = (specInput) => {

addStream: negotiationQueue.protectFunction((stream) => {
logSDP('queue - addStream');
that.tracksToBeNegotiated += stream.getTracks().length;
that._updateTracksToBeNegotiatedFromStream(stream);
negotiationQueue.startEnqueuing('addStream');
const promise = that.peerConnectionFsm.addStream(stream);
if (promise) {
Expand All @@ -244,7 +244,7 @@ const BaseStack = (specInput) => {
}),

removeStream: negotiationQueue.protectFunction((stream) => {
that.tracksToBeNegotiated += stream.getTracks().length;
that._updateTracksToBeNegotiatedFromStream(stream);
logSDP('queue - removeStream');
negotiationQueue.startEnqueuing('removeStream');
const promise = that.peerConnectionFsm.removeStream(stream);
Expand Down Expand Up @@ -545,6 +545,11 @@ const BaseStack = (specInput) => {

// Peerconnection events
that.peerConnection.onicecandidate = onIceCandidate;

// private functions
that._updateTracksToBeNegotiatedFromStream = (stream) => {
that.tracksToBeNegotiated += stream.getTracks().length;
};
// public functions

that.setStartVideoBW = (sdpInput) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ const FirefoxStack = (specInput) => {
return Promise.all(promises);
};

// private functions
that._updateTracksToBeNegotiatedFromStream = () => {
that.tracksToBeNegotiated += 1;
};

return that;
};

Expand Down

0 comments on commit dddc6fb

Please sign in to comment.