Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Merge remote-tracking branch 'origin/race_conditions' into api_eslint

Lyubo Marinovcbc08eb96d72
diff --cc modules/API/API.js
index 555ea0c613,ab85db3d1f..436435734d
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@@ -30,46 -39,30 +30,46 @@@ const jitsiMeetExternalApiI
let postis;
/**
- * Current status (enabled/disabled) of API.
+ * Object that will execute sendMessage.
*/
-let enabled = false;
+const target = window.opener || window.parent;
+/**
+ * Initializes supported commands.
+ *
+ * @returns {void}
+ */
function initCommands() {
commands = {
- "display-name":
+ 'display-name':
APP.conference.changeLocalDisplayName.bind(APP.conference),
- 'toggle-audio': APP.conference.toggleAudioMuted.bind(APP.conference),
- 'toggle-video': APP.conference.toggleVideoMuted.bind(APP.conference),
- "toggle-audio": () => APP.conference.toggleAudioMuted(true),
- "toggle-video": () => APP.conference.toggleVideoMuted(true),
- "toggle-film-strip": APP.UI.toggleFilmStrip,
- "toggle-chat": APP.UI.toggleChat,
- "toggle-contact-list": APP.UI.toggleContactList,
- "toggle-share-screen":
- APP.conference.toggleScreenSharing.bind(APP.conference),
- "video-hangup": () => APP.conference.hangup(),
- "email": APP.conference.changeLocalEmail,
- "avatar-url": APP.conference.changeLocalAvatarUrl,
- "remote-control-event": event =>
- APP.remoteControl.onRemoteControlAPIEvent(event)
++ 'toggle-audio': () => APP.conference.toggleAudioMuted(true),
++ 'toggle-video': () => APP.conference.toggleVideoMuted(true),
+ 'toggle-film-strip': APP.UI.toggleFilmstrip,
+ 'toggle-chat': APP.UI.toggleChat,
+ 'toggle-contact-list': APP.UI.toggleContactList,
+ 'toggle-share-screen': toggleScreenSharing,
+ 'video-hangup': () => APP.conference.hangup(),
+ 'email': APP.conference.changeLocalEmail,
+ 'avatar-url': APP.conference.changeLocalAvatarUrl,
+ 'remote-control-event':
+ event => APP.remoteControl.onRemoteControlAPIEvent(event)
};
- Object.keys(commands).forEach(function (key) {
- postis.listen(key, args => commands[key](...args));
- });
+ Object.keys(commands).forEach(
+ key => postis.listen(key, args => commands[key](...args)));
+}
+
+/**
+ * Listens for desktop/screen sharing enabled events and toggles the screen
+ * sharing if needed.
+ *
+ * @param {boolean} enabled - Current screen sharing enabled status.
+ * @returns {void}
+ */
+function onDesktopSharingEnabledChanged(enabled = false) {
+ if (enabled && initialScreenSharingState) {
+ toggleScreenSharing();
+ }
}
/**