feat(tracks) Clean up the track if a source addition is rejected. (#10562)

* feat(tracks) Clean up the track if a source addition is rejected.
When jicofo rejects a source-add because of sendder limits, dispose and remove the local track from the conference.

* chore(deps) update LJM to latest.
This commit is contained in:
Jaya Allamsetty 2021-12-09 08:48:55 -05:00 committed by GitHub
parent 5dbf4845fb
commit 700c7c523d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 10 deletions

View File

@ -2135,6 +2135,8 @@ export default {
}
});
room.on(JitsiConferenceEvents.TRACK_UNMUTE_REJECTED, track => APP.store.dispatch(destroyLocalTracks(track)));
room.on(JitsiConferenceEvents.SUBJECT_CHANGED,
subject => APP.store.dispatch(conferenceSubjectChanged(subject)));

12
package-lock.json generated
View File

@ -65,7 +65,7 @@
"jquery-i18next": "1.2.1",
"js-md5": "0.6.1",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#161da84ac045afd8ac8eed9168bd708dc0cbedb1",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#8aa35dae401f32a7eafe2b7dec159827c4bb2a84",
"libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
"lodash": "4.17.21",
"moment": "2.29.1",
@ -12509,8 +12509,8 @@
},
"node_modules/lib-jitsi-meet": {
"version": "0.0.0",
"resolved": "git+ssh://git@github.com/jitsi/lib-jitsi-meet.git#161da84ac045afd8ac8eed9168bd708dc0cbedb1",
"integrity": "sha512-UPQrJjATYSerDZVezRpr+v9OMI94LYwimWyrDUg2Wpr2yfrDnIM90oqn62F9CwsE3QBBBLEZoTUk9K02z2d/Yg==",
"resolved": "git+ssh://git@github.com/jitsi/lib-jitsi-meet.git#8aa35dae401f32a7eafe2b7dec159827c4bb2a84",
"integrity": "sha512-i2cP4DaCj4sdf4dFDQTO3FO+Ds6/JgiSvboHj1pBS+L74767qWVhoVjDQ0LO76g+JhVoXECR9MEkr2CGgSKA8Q==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
@ -29978,9 +29978,9 @@
}
},
"lib-jitsi-meet": {
"version": "git+ssh://git@github.com/jitsi/lib-jitsi-meet.git#161da84ac045afd8ac8eed9168bd708dc0cbedb1",
"integrity": "sha512-UPQrJjATYSerDZVezRpr+v9OMI94LYwimWyrDUg2Wpr2yfrDnIM90oqn62F9CwsE3QBBBLEZoTUk9K02z2d/Yg==",
"from": "lib-jitsi-meet@github:jitsi/lib-jitsi-meet#161da84ac045afd8ac8eed9168bd708dc0cbedb1",
"version": "git+ssh://git@github.com/jitsi/lib-jitsi-meet.git#8aa35dae401f32a7eafe2b7dec159827c4bb2a84",
"integrity": "sha512-i2cP4DaCj4sdf4dFDQTO3FO+Ds6/JgiSvboHj1pBS+L74767qWVhoVjDQ0LO76g+JhVoXECR9MEkr2CGgSKA8Q==",
"from": "lib-jitsi-meet@github:jitsi/lib-jitsi-meet#8aa35dae401f32a7eafe2b7dec159827c4bb2a84",
"requires": {
"@jitsi/js-utils": "2.0.0",
"@jitsi/logger": "2.0.0",

View File

@ -70,7 +70,7 @@
"jquery-i18next": "1.2.1",
"js-md5": "0.6.1",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#161da84ac045afd8ac8eed9168bd708dc0cbedb1",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#8aa35dae401f32a7eafe2b7dec159827c4bb2a84",
"libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
"lodash": "4.17.21",
"moment": "2.29.1",

View File

@ -27,7 +27,13 @@ import {
participantRoleChanged,
participantUpdated
} from '../participants';
import { getLocalTracks, replaceLocalTrack, trackAdded, trackRemoved } from '../tracks';
import {
destroyLocalTracks,
getLocalTracks,
replaceLocalTrack,
trackAdded,
trackRemoved
} from '../tracks';
import { getBackendSafeRoomName } from '../util';
import {
@ -181,6 +187,8 @@ function _addConferenceListeners(conference, dispatch, state) {
}
});
conference.on(JitsiConferenceEvents.TRACK_UNMUTE_REJECTED, track => dispatch(destroyLocalTracks(track)));
// Dispatches into features/base/participants follow:
conference.on(
JitsiConferenceEvents.DISPLAY_NAME_CHANGED,

View File

@ -188,12 +188,19 @@ export function createLocalTracksA(options = {}) {
}
/**
* Calls JitsiLocalTrack#dispose() on all local tracks ignoring errors when
* Calls JitsiLocalTrack#dispose() on the given track or on all local tracks (if none are passed) ignoring errors if
* track is already disposed. After that signals tracks to be removed.
*
* @param {JitsiLocalTrack|null} [track] - The local track that needs to be destroyed.
* @returns {Function}
*/
export function destroyLocalTracks() {
export function destroyLocalTracks(track = null) {
if (track) {
return dispatch => {
dispatch(_disposeAndRemoveTracks([ track ]));
};
}
return (dispatch, getState) => {
// First wait until any getUserMedia in progress is settled and then get
// rid of all local tracks.