浏览代码

ES6 for JitsiMediaDevicesEvents

release-8443
Lyubomir Marinov 9 年前
父节点
当前提交
4f10ce43a9
共有 3 个文件被更改,包括 24 次插入27 次删除
  1. 2
    2
      JitsiMediaDevices.js
  2. 21
    24
      JitsiMediaDevicesEvents.js
  3. 1
    1
      JitsiMeetJS.js

+ 2
- 2
JitsiMediaDevices.js 查看文件

@@ -2,7 +2,7 @@ var EventEmitter = require("events");
2 2
 var RTCEvents = require('./service/RTC/RTCEvents');
3 3
 var RTC = require("./modules/RTC/RTC");
4 4
 var MediaType = require('./service/RTC/MediaType');
5
-var JitsiMediaDevicesEvents = require('./JitsiMediaDevicesEvents');
5
+import * as JitsiMediaDevicesEvents from "./JitsiMediaDevicesEvents";
6 6
 var Statistics = require("./modules/statistics/statistics");
7 7
 
8 8
 var eventEmitter = new EventEmitter();
@@ -135,4 +135,4 @@ var JitsiMediaDevices = {
135 135
     }
136 136
 };
137 137
 
138
-module.exports = JitsiMediaDevices;
138
+module.exports = JitsiMediaDevices;

+ 21
- 24
JitsiMediaDevicesEvents.js 查看文件

@@ -1,27 +1,24 @@
1 1
 /**
2
- * Enumeration with the events for the media devices.
3
- * @type {{string: string}}
2
+ * The events for the media devices.
4 3
  */
5
-var JitsiMediaDevicesEvents = {
6
-    /**
7
-     * Indicates that the list of available media devices has been changed. The
8
-     * event provides the following parameters to its listeners:
9
-     *
10
-     * @param {MediaDeviceInfo[]} devices - array of MediaDeviceInfo or
11
-     *  MediaDeviceInfo-like objects that are currently connected.
12
-     *  @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo
13
-     */
14
-    DEVICE_LIST_CHANGED: "mediaDevices.devicechange",
15
-    /**
16
-     * Indicates that the environment is currently showing permission prompt to
17
-     * access camera and/or microphone. The event provides the following
18
-     * parameters to its listeners:
19
-     *
20
-     * @param {'chrome'|'opera'|'firefox'|'iexplorer'|'safari'|'nwjs'
21
-     *      |'react-native'|'android'} environmentType - type of browser or
22
-     *      other execution environment.
23
-     */
24
-    PERMISSION_PROMPT_IS_SHOWN: "mediaDevices.permissionPromptIsShown"
25
-};
26 4
 
27
-module.exports = JitsiMediaDevicesEvents;
5
+/**
6
+ * Indicates that the list of available media devices has been changed. The
7
+ * event provides the following parameters to its listeners:
8
+ *
9
+ * @param {MediaDeviceInfo[]} devices - array of MediaDeviceInfo or
10
+ *  MediaDeviceInfo-like objects that are currently connected.
11
+ *  @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo
12
+ */
13
+export const DEVICE_LIST_CHANGED = "mediaDevices.devicechange";
14
+/**
15
+ * Indicates that the environment is currently showing permission prompt to
16
+ * access camera and/or microphone. The event provides the following
17
+ * parameters to its listeners:
18
+ *
19
+ * @param {'chrome'|'opera'|'firefox'|'iexplorer'|'safari'|'nwjs'
20
+ *  |'react-native'|'android'} environmentType - type of browser or
21
+ *  other execution environment.
22
+ */
23
+export const PERMISSION_PROMPT_IS_SHOWN
24
+    = "mediaDevices.permissionPromptIsShown";

+ 1
- 1
JitsiMeetJS.js 查看文件

@@ -4,9 +4,9 @@ var JitsiConnection = require("./JitsiConnection");
4 4
 var JitsiMediaDevices = require("./JitsiMediaDevices");
5 5
 var JitsiConferenceEvents = require("./JitsiConferenceEvents");
6 6
 var JitsiConnectionEvents = require("./JitsiConnectionEvents");
7
-var JitsiMediaDevicesEvents = require('./JitsiMediaDevicesEvents');
8 7
 var JitsiConnectionErrors = require("./JitsiConnectionErrors");
9 8
 var JitsiConferenceErrors = require("./JitsiConferenceErrors");
9
+import * as JitsiMediaDevicesEvents from "./JitsiMediaDevicesEvents";
10 10
 import JitsiTrackError from "./JitsiTrackError";
11 11
 import * as JitsiTrackErrors from "./JitsiTrackErrors";
12 12
 import * as JitsiTrackEvents from "./JitsiTrackEvents";

正在加载...
取消
保存