瀏覽代碼

Notify for detecting suspend.

master
damencho 6 年之前
父節點
當前提交
f77976b742
共有 4 個檔案被更改,包括 15 行新增0 行删除
  1. 2
    0
      conference.js
  2. 2
    0
      doc/api.md
  3. 9
    0
      modules/API/API.js
  4. 2
    0
      modules/API/external/external_api.js

+ 2
- 0
conference.js 查看文件

@@ -1998,6 +1998,8 @@ export default {
1998 1998
                 this.localAudio.dispose();
1999 1999
                 this.localAudio = null;
2000 2000
             }
2001
+
2002
+            APP.API.notifySuspendDetected();
2001 2003
         });
2002 2004
 
2003 2005
         APP.UI.addListener(UIEvents.AUDIO_MUTED, muted => {

+ 2
- 0
doc/api.md 查看文件

@@ -437,6 +437,8 @@ The listener will receive an object with the following structure:
437 437
 }
438 438
 ```
439 439
 
440
+* **suspendDetected** - event notifications about detecting suspend event in host computer.
441
+
440 442
 You can also add multiple event listeners by using `addEventListeners`.
441 443
 This method requires one argument of type Object. The object argument must
442 444
 have the names of the events as keys and the listeners of the events as values.

+ 9
- 0
modules/API/API.js 查看文件

@@ -509,6 +509,15 @@ class API {
509 509
         this._sendEvent({ name: 'video-ready-to-close' });
510 510
     }
511 511
 
512
+    /**
513
+     * Notify external application (if API is enabled) that a suspend event in host computer.
514
+     *
515
+     * @returns {void}
516
+     */
517
+    notifySuspendDetected() {
518
+        this._sendEvent({ name: 'suspend-detected' });
519
+    }
520
+
512 521
     /**
513 522
      * Notify external application (if API is enabled) for audio muted status
514 523
      * changed.

+ 2
- 0
modules/API/external/external_api.js 查看文件

@@ -73,6 +73,7 @@ const events = {
73 73
     'video-mute-status-changed': 'videoMuteStatusChanged',
74 74
     'screen-sharing-status-changed': 'screenSharingStatusChanged',
75 75
     'subject-change': 'subjectChange',
76
+    'suspend-detected': 'suspendDetected',
76 77
     'tile-view-changed': 'tileViewChanged'
77 78
 };
78 79
 
@@ -537,6 +538,7 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
537 538
      * {{
538 539
      * on: on //whether screen sharing is on
539 540
      * }}
541
+     * {@code suspendDetected} - receives event notifications about detecting suspend event in host computer.
540 542
      * {@code readyToClose} - all hangup operations are completed and Jitsi Meet
541 543
      * is ready to be disposed.
542 544
      * @returns {void}

Loading…
取消
儲存