Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[L33T-3002] Update #25

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e3d66f7
chore(deps): bump sdp-interop to get another fix for ICE restart
nils-ohlmeier Sep 16, 2021
609e3d5
fix: Reads shard name and from disco-info if available.
damencho Sep 17, 2021
491664c
fix(codec-selection): Impose VP9 bitrates only when VP9 is the negoti…
jallamsetty1 Sep 17, 2021
69604b9
fix(Jingle) Reverse the order of ssrcs signaled for Firefox.
jallamsetty1 Sep 20, 2021
3b8baa9
fix(JitsiConference) Check for room before calling isFocus method on …
jallamsetty1 Sep 20, 2021
2e1ca64
fix(e2ee) restore initial key when RATCHET_WINDOW_SIZE reached
tmoldovan8x8 Sep 21, 2021
86f6c25
fix(e2ee) replace nullish coalescing with or
saghul Sep 21, 2021
b5c465f
fix(chore corrected typo in log message
nils-ohlmeier Sep 24, 2021
0646bc3
feat(av-moderation) Remove from moderation whitelist functionality (#…
robertpin Sep 28, 2021
3e5b942
fix(logging) Log only the imp events on remote tracks.
jallamsetty1 Sep 13, 2021
7ba2ebc
ref(RTC) rename iceConfig to pcConfig.
jallamsetty1 Sep 14, 2021
cc24224
ref(Jingle) Log formatted source information.
jallamsetty1 Sep 22, 2021
d3aca06
ref(Jingle) Alpha sort and prefix the local functions with '_'
jallamsetty1 Sep 22, 2021
ae70962
fix(Jingle) Log the extracted info from Jingle IQ.
jallamsetty1 Sep 24, 2021
8f1649b
ref: sendMuteStatus is not async
paweldomas Sep 28, 2021
2e0d106
fix(JitsiConference):2 instances for the same room
hristoterezov Sep 28, 2021
c15dda1
fix(browser-support) fix detecting iOS browsers correctly
saghul Sep 30, 2021
88ccab4
fix(Jingle): stop reverting the SSRCs from Firefox
nils-ohlmeier Sep 30, 2021
7a56f7b
fix(xmpp): disable RTX for Firefox < 93, because it results in random…
nils-ohlmeier Sep 30, 2021
56857eb
fix(loggging) fix exceptions on mobile
saghul Oct 1, 2021
afc1c34
fix(JitsiConference) make sure isE2EEEnabled() returns a boolean
saghul Oct 1, 2021
b5288c2
fix: Avoids sending empty nick in presence.
damencho Oct 1, 2021
3bdf8a6
feat: generates source names (#1725)
paweldomas Oct 4, 2021
fbebebd
fix: logger calling wrong function typo
DanielMcAssey Oct 5, 2021
1e640cd
fix(iOS15) fix not being able to unmute if "everyone starts muted" is…
saghul Oct 6, 2021
cee62a6
fix(IceFailedHandling) force client reload when ICE fails locally.
jallamsetty1 Oct 6, 2021
febd908
feat(identity): add region identity parsing
horymury Oct 7, 2021
f005d57
feat(flow) drop Flow integration
saghul Aug 12, 2021
f515909
fix(deps) update js-utils
saghul Aug 12, 2021
bf0d5b5
feat(build) migrate to webpack 5
saghul Aug 12, 2021
17aa19e
fix(connectionstatus) Increase the rtc mute timeout for p2p.
jallamsetty1 Oct 8, 2021
afc006e
feat(e2ee) add ExternallyManagedKeyHandler
tmoldovan8x8 Oct 11, 2021
a5cc232
feat(build) update build toolchain to Node 14 / npm 7
saghul Oct 11, 2021
2248531
feat(CodecSelection) Disable VP9 on Safari. (#1752)
jallamsetty1 Oct 13, 2021
d27a510
ref(TPC) Configure encodings in one go. (#1739)
jallamsetty1 Oct 15, 2021
a68af90
fix(TPC) Remove video track from pc on mute for Firefox.
jallamsetty1 Oct 15, 2021
75d3106
feat: Adds to JitsiConferenceEvents CONFERENCE_JOIN_IN_PROGRESS. (#1754)
damencho Oct 15, 2021
012c387
ref(JingleSessionPC) Do not renegotiate on every local source change.
jallamsetty1 Oct 19, 2021
7275ee1
fix(layer-suspension) Do not ignore maxHeight=0 sender constraint.
jallamsetty1 Oct 20, 2021
42c6752
fix(SS): missing.
hristoterezov Oct 20, 2021
764c85a
Merge remote-tracking branch 'fork/master' into L33T-3002-update
Oct 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ lib-jitsi-meet.*
# Third-party source code which we (1) do not want to modify or (2) try to
# modify as little as possible.
doc/example/libs/*
flow-typed/*

# ESLint will by default ignore its own configuration file. However, there does
# not seem to be a reason why we will want to risk being inconsistent with our
Expand Down
32 changes: 0 additions & 32 deletions .flowconfig

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '14.x'
- run: npm i -g npm@7
- run: npm install
- run: npm run lint
- run: npm run test
106 changes: 80 additions & 26 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ export default function JitsiConference(options) {
logger.error(errmsg);
throw new Error(errmsg);
}
this.connection = options.connection;
this.xmpp = this.connection?.xmpp;

if (this.xmpp.isRoomCreated(options.name, options.customDomain)) {
const errmsg = 'A coference with the same name has already been created!';

delete this.connection;
delete this.xmpp;
logger.error(errmsg);
throw new Error(errmsg);
}
this.eventEmitter = new EventEmitter();
this.options = options;
this.eventManager = new JitsiConferenceEventManager(this);
Expand Down Expand Up @@ -258,7 +269,7 @@ export default function JitsiConference(options) {
* End-to-End Encryption. Make it available if supported.
*/
if (this.isE2EESupported()) {
logger.info('End-to-End Encryprtion is supported');
logger.info('End-to-End Encryption is supported');

this._e2eEncryption = new E2EEncryption(this);
}
Expand Down Expand Up @@ -310,15 +321,7 @@ JitsiConference.resourceCreator = function(jid, isAuthenticatedUser) {
* @param options.connection {JitsiConnection} overrides this.connection
*/
JitsiConference.prototype._init = function(options = {}) {
// Override connection and xmpp properties (Useful if the connection
// reloaded)
if (options.connection) {
this.connection = options.connection;
this.xmpp = this.connection.xmpp;

// Setup XMPP events only if we have new connection object.
this.eventManager.setupXMPPListeners();
}
this.eventManager.setupXMPPListeners();

const { config } = this.options;

Expand Down Expand Up @@ -394,10 +397,9 @@ JitsiConference.prototype._init = function(options = {}) {
this.rtc,
this,
{
// Both these options are not public API, leaving it here only
// as an entry point through config for tuning up purposes.
// Default values should be adjusted as soon as optimal values
// are discovered.
// These options are not public API, leaving it here only as an entry point through config for tuning
// up purposes. Default values should be adjusted as soon as optimal values are discovered.
p2pRtcMuteTimeout: config._p2pConnStatusRtcMuteTimeout,
rtcMuteTimeout: config._peerConnStatusRtcMuteTimeout,
outOfLastNTimeout: config._peerConnStatusOutOfLastNTimeout
});
Expand Down Expand Up @@ -946,7 +948,14 @@ JitsiConference.prototype.removeCommand = function(name) {
*/
JitsiConference.prototype.setDisplayName = function(name) {
if (this.room) {
this.room.addOrReplaceInPresence('nick', {
const nickKey = 'nick';

// if there is no display name already set, avoid setting an empty one
if (!name && !this.room.getFromPresence(nickKey)) {
return;
}

this.room.addOrReplaceInPresence(nickKey, {
attributes: { xmlns: 'http://jabber.org/protocol/nick' },
value: name
}) && this.room.sendPresence();
Expand Down Expand Up @@ -1094,11 +1103,23 @@ JitsiConference.prototype._fireMuteChangeEvent = function(track) {
* @returns {Array<JitsiLocalTrack>} - list of local tracks that are unmuted.
*/
JitsiConference.prototype._getInitialLocalTracks = function() {
// Always add the audio track on mobile Safari because of a known issue where audio playout doesn't happen
// if the user joins audio and video muted.
// Always add the audio track on certain platforms:
// * Safari / WebKit: because of a known issue where audio playout doesn't happen
// if the user joins audio and video muted.
// * React Native: after iOS 15, if a user joins muted they won't be able to unmute.
return this.getLocalTracks()
.filter(track => (track.getType() === MediaType.AUDIO && (!this.isStartAudioMuted() || browser.isIosBrowser()))
|| (track.getType() === MediaType.VIDEO && !this.isStartVideoMuted()));
.filter(track => {
const trackType = track.getType();

if (trackType === MediaType.AUDIO
&& (!this.isStartAudioMuted() || browser.isWebKitBased() || browser.isReactNative())) {
return true;
} else if (trackType === MediaType.VIDEO && !this.isStartVideoMuted()) {
return true;
}

return false;
});
};

/**
Expand Down Expand Up @@ -2033,7 +2054,7 @@ JitsiConference.prototype.onIncomingCall = function(
if (jingleSession.isP2P) {
this._onIncomingCallP2P(jingleSession, jingleOffer);
} else {
if (!this.room.isFocus(jingleSession.remoteJid)) {
if (!this.isFocus(jingleSession.remoteJid)) {
const description = 'Rejecting session-initiate from non-focus.';

this._rejectIncomingCall(
Expand Down Expand Up @@ -2638,14 +2659,13 @@ JitsiConference.prototype.sendApplicationLog = function(message) {
};

/**
* Checks if the user identified by given <tt>mucJid</tt> is the conference
* focus.
* Checks if the user identified by given <tt>mucJid</tt> is the conference focus.
* @param mucJid the full MUC address of the user to be checked.
* @returns {boolean|null} <tt>true</tt> if MUC user is the conference focus,
* <tt>false</tt> when is not. <tt>null</tt> if we're not in the MUC anymore and
* are unable to figure out the status or if given <tt>mucJid</tt> is invalid.
*/
JitsiConference.prototype._isFocus = function(mucJid) {
JitsiConference.prototype.isFocus = function(mucJid) {
return this.room ? this.room.isFocus(mucJid) : null;
};

Expand Down Expand Up @@ -2767,7 +2787,6 @@ JitsiConference.prototype.isConnectionInterrupted = function() {
*/
JitsiConference.prototype._onConferenceRestarted = function(session) {
if (!session.isP2P && this.options.config.enableForcedReload) {
this.restartInProgress = true;
this.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.CONFERENCE_RESTARTED);
}
};
Expand Down Expand Up @@ -3705,7 +3724,7 @@ JitsiConference.prototype._restartMediaSessions = function() {
* @returns {boolean}
*/
JitsiConference.prototype.isE2EEEnabled = function() {
return this._e2eEncryption && this._e2eEncryption.isEnabled();
return Boolean(this._e2eEncryption && this._e2eEncryption.isEnabled());
};

/**
Expand Down Expand Up @@ -3734,6 +3753,17 @@ JitsiConference.prototype.toggleE2EE = function(enabled) {
this._e2eEncryption.setEnabled(enabled);
};

/**
* Sets the key and index for End-to-End encryption.
*
* @param {CryptoKey} [keyInfo.encryptionKey] - encryption key.
* @param {Number} [keyInfo.index] - the index of the encryption key.
* @returns {void}
*/
JitsiConference.prototype.setMediaEncryptionKey = function(keyInfo) {
this._e2eEncryption.setEncryptionKey(keyInfo);
};

/**
* Returns <tt>true</tt> if lobby support is enabled in the backend.
*
Expand Down Expand Up @@ -3873,7 +3903,31 @@ JitsiConference.prototype.avModerationApprove = function(mediaType, id) {

this.room.getAVModeration().approve(mediaType, participant.getJid());
} else {
logger.warn(`AV moderation skipped , ${this.room ? '' : 'not in a room, '}${
logger.warn(`AV moderation approve skipped , ${this.room ? '' : 'not in a room, '}${
this.isModerator() ? '' : 'participant is not a moderator, '}${
this.room && this.isModerator() ? 'wrong media type passed' : ''}`);
}
};

/**
* Reject participant access to certain media, blocks unmuting audio or video.
*
* @param {MediaType} mediaType "audio" or "video"
* @param id the id of the participant.
*/
JitsiConference.prototype.avModerationReject = function(mediaType, id) {
if (this.room && this.isModerator()
&& (mediaType === MediaType.AUDIO || mediaType === MediaType.VIDEO)) {

const participant = this.getParticipantById(id);

if (!participant) {
return;
}

this.room.getAVModeration().reject(mediaType, participant.getJid());
} else {
logger.warn(`AV moderation reject skipped , ${this.room ? '' : 'not in a room, '}${
this.isModerator() ? '' : 'participant is not a moderator, '}${
this.room && this.isModerator() ? 'wrong media type passed' : ''}`);
}
Expand Down
18 changes: 18 additions & 0 deletions JitsiConferenceEventManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
this.chatRoomForwarder.forward(XMPPEvents.MUC_JOINED,
JitsiConferenceEvents.CONFERENCE_JOINED);

this.chatRoomForwarder.forward(XMPPEvents.MUC_JOIN_IN_PROGRESS,
JitsiConferenceEvents.CONFERENCE_JOIN_IN_PROGRESS);

this.chatRoomForwarder.forward(XMPPEvents.MEETING_ID_SET,
JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET);

Expand Down Expand Up @@ -722,8 +725,23 @@ JitsiConferenceEventManager.prototype.setupXMPPListeners = function() {
});
}
});
this._addConferenceXMPPListener(XMPPEvents.AV_MODERATION_PARTICIPANT_REJECTED,
(mediaType, jid) => {
const participant = conference.getParticipantById(Strophe.getResourceFromJid(jid));

if (participant) {
conference.eventEmitter.emit(JitsiConferenceEvents.AV_MODERATION_PARTICIPANT_REJECTED, {
participant,
mediaType
});
}
});
this._addConferenceXMPPListener(XMPPEvents.AV_MODERATION_APPROVED,
value => conference.eventEmitter.emit(JitsiConferenceEvents.AV_MODERATION_APPROVED, { mediaType: value }));
this._addConferenceXMPPListener(XMPPEvents.AV_MODERATION_REJECTED,
value => {
conference.eventEmitter.emit(JitsiConferenceEvents.AV_MODERATION_REJECTED, { mediaType: value });
});
};

/**
Expand Down
22 changes: 22 additions & 0 deletions JitsiConferenceEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export const CONFERENCE_ERROR = 'conference.error';
*/
export const CONFERENCE_FAILED = 'conference.failed';

/**
* Indicates that conference is in progress of joining.
*/
export const CONFERENCE_JOIN_IN_PROGRESS = 'conference.join_in_progress';

/**
* Indicates that conference has been joined. The event does NOT provide any
* parameters to its listeners.
Expand Down Expand Up @@ -385,6 +390,14 @@ export const LOBBY_USER_LEFT = 'conference.lobby.userLeft';
*/
export const AV_MODERATION_APPROVED = 'conference.av_moderation.approved';

/**
* The local participant was blocked to be able to unmute.
* @param {options} event - {
* {MediaType} mediaType
* }.
*/
export const AV_MODERATION_REJECTED = 'conference.av_moderation.rejected';

/**
* AV Moderation was enabled/disabled. The actor is the participant that is currently in the meeting,
* or undefined if that participant has left the meeting.
Expand All @@ -405,3 +418,12 @@ export const AV_MODERATION_CHANGED = 'conference.av_moderation.changed';
* }.
*/
export const AV_MODERATION_PARTICIPANT_APPROVED = 'conference.av_moderation.participant.approved';

/**
* AV Moderation, report for user being blocked to unmute.
* @param {options} event - {
* {JitsiParticipant} participant,
* {MediaType} mediaType
* }.
*/
export const AV_MODERATION_PARTICIPANT_REJECTED = 'conference.av_moderation.participant.rejected';
6 changes: 6 additions & 0 deletions JitsiMeetJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ParticipantConnectionStatus }
import getActiveAudioDevice from './modules/detection/ActiveDeviceDetector';
import * as DetectionEvents from './modules/detection/DetectionEvents';
import TrackVADEmitter from './modules/detection/TrackVADEmitter';
import FeatureFlags from './modules/flags/FeatureFlags';
import ProxyConnectionService
from './modules/proxyconnection/ProxyConnectionService';
import recordingConstants from './modules/recording/recordingConstants';
Expand Down Expand Up @@ -146,6 +147,11 @@ export default _mergeNamespaceAndModule({
Settings.init(options.externalStorage);
Statistics.init(options);

// Configure the feature flags.
FeatureFlags.init({
sourceNameSignaling: options.sourceNameSignaling
});

// Initialize global window.connectionTimes
// FIXME do not use 'window'
if (!window.connectionTimes) {
Expand Down
6 changes: 0 additions & 6 deletions flow-typed/npm/flow-bin_v0.x.x.js

This file was deleted.

4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function(config) {

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [ 'jasmine' ],
frameworks: [ 'jasmine', 'webpack' ],

// list of files / patterns to load in the browser
files: [
Expand Down Expand Up @@ -60,6 +60,6 @@ module.exports = function(config) {
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

webpack: require('./webpack-shared-config')
webpack: require('./webpack-shared-config')(false /* minimize */, false /* analyzeBundle */)
});
};
8 changes: 2 additions & 6 deletions modules/RTC/CodecSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ export class CodecSelection {
logger.debug(`Codec preferences for the conference are JVB: ${this.jvbPreferredCodec},
P2P: ${this.p2pPreferredCodec}`);

// Do not prefer VP9 on Firefox because of the following bug.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1633876
if (browser.isFirefox() && this.jvbPreferredCodec === CodecMimeType.VP9) {
if (this.jvbPreferredCodec === CodecMimeType.VP9 && !browser.supportsVP9()) {
this.jvbPreferredCodec = CodecMimeType.VP8;
}

Expand Down Expand Up @@ -136,11 +134,9 @@ export class CodecSelection {
const peerMediaInfo = session.signalingLayer.getPeerMediaInfo(remote, MediaType.VIDEO);
const peerCodec = peerMediaInfo?.codecType;

// We do not want Firefox to switch to VP9 because of the following bug.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1492500.
if (peerCodec
&& peerCodec !== currentCodec
&& !(browser.isFirefox() && peerCodec === CodecMimeType.VP9)) {
&& (peerCodec !== CodecMimeType.VP9 || browser.supportsVP9())) {
selectedCodec = peerCodec;
}
}
Expand Down
Loading