Skip to content

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

Notify for detecting suspend.

damenchof77976b742a1
diff --git a/conference.js b/conference.js
index b55c26d5ad..8f04e17d78 100644
--- a/conference.js
+++ b/conference.js
@@ -1998,6 +1998,8 @@ export default {
this.localAudio.dispose();
this.localAudio = null;
}
+
+ APP.API.notifySuspendDetected();
});
APP.UI.addListener(UIEvents.AUDIO_MUTED, muted => {
diff --git a/doc/api.md b/doc/api.md
index a5551f68d6..d3cec00a6b 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -437,6 +437,8 @@ The listener will receive an object with the following structure:
}
```
+* **suspendDetected** - event notifications about detecting suspend event in host computer.
+
You can also add multiple event listeners by using `addEventListeners`.
This method requires one argument of type Object. The object argument must
have the names of the events as keys and the listeners of the events as values.
diff --git a/modules/API/API.js b/modules/API/API.js
index f851d5167e..917646d095 100644
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -509,6 +509,15 @@ class API {
this._sendEvent({ name: 'video-ready-to-close' });
}
+ /**
+ * Notify external application (if API is enabled) that a suspend event in host computer.
+ *
+ * @returns {void}
+ */
+ notifySuspendDetected() {
+ this._sendEvent({ name: 'suspend-detected' });
+ }
+
/**
* Notify external application (if API is enabled) for audio muted status
* changed.
diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js
index 0651c2b180..8d746cc2f4 100644
--- a/modules/API/external/external_api.js
+++ b/modules/API/external/external_api.js
@@ -73,6 +73,7 @@ const events = {
'video-mute-status-changed': 'videoMuteStatusChanged',
'screen-sharing-status-changed': 'screenSharingStatusChanged',
'subject-change': 'subjectChange',
+ 'suspend-detected': 'suspendDetected',
'tile-view-changed': 'tileViewChanged'
};
@@ -537,6 +538,7 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
* {{
* on: on //whether screen sharing is on
* }}
+ * {@code suspendDetected} - receives event notifications about detecting suspend event in host computer.
* {@code readyToClose} - all hangup operations are completed and Jitsi Meet
* is ready to be disposed.
* @returns {void}