瀏覽代碼

Merge pull request #243 from jitsi/es2015

ES2015
master
hristoterezov 9 年之前
父節點
當前提交
3ace1f6b3b

+ 2
- 2
JitsiConference.js 查看文件

@@ -4,8 +4,8 @@ var logger = require("jitsi-meet-logger").getLogger(__filename);
4 4
 var RTC = require("./modules/RTC/RTC");
5 5
 var XMPPEvents = require("./service/xmpp/XMPPEvents");
6 6
 var EventEmitter = require("events");
7
-var JitsiConferenceEvents = require("./JitsiConferenceEvents");
8
-var JitsiConferenceErrors = require("./JitsiConferenceErrors");
7
+import * as JitsiConferenceErrors from "./JitsiConferenceErrors";
8
+import * as JitsiConferenceEvents from "./JitsiConferenceEvents";
9 9
 var JitsiParticipant = require("./JitsiParticipant");
10 10
 var Statistics = require("./modules/statistics/statistics");
11 11
 var JitsiDTMFManager = require('./modules/DTMF/JitsiDTMFManager');

+ 64
- 71
JitsiConferenceErrors.js 查看文件

@@ -1,73 +1,66 @@
1 1
 /**
2
- * Enumeration with the errors for the conference.
3
- * @type {{string: string}}
4
- */
5
-var JitsiConferenceErrors = {
6
-    /**
7
-     * Indicates that a password is required in order to join the conference.
8
-     */
9
-    PASSWORD_REQUIRED: "conference.passwordRequired",
10
-    /**
11
-     * Indicates that client must be authenticated to create the conference.
12
-     */
13
-    AUTHENTICATION_REQUIRED: "conference.authenticationRequired",
14
-    /**
15
-     * Indicates that password cannot be set for this conference.
16
-     */
17
-    PASSWORD_NOT_SUPPORTED: "conference.passwordNotSupported",
18
-    /**
19
-     * Indicates that a connection error occurred when trying to join a
20
-     * conference.
21
-     */
22
-    CONNECTION_ERROR: "conference.connectionError",
23
-    /**
24
-     * Indicates that the conference setup failed.
25
-     */
26
-    SETUP_FAILED: "conference.setup_failed",
27
-    /**
28
-     * Indicates that there is no available videobridge.
29
-     */
30
-    VIDEOBRIDGE_NOT_AVAILABLE: "conference.videobridgeNotAvailable",
31
-    /**
32
-     * Indicates that reservation system returned error.
33
-     */
34
-    RESERVATION_ERROR: "conference.reservationError",
35
-    /**
36
-     * Indicates that graceful shutdown happened.
37
-     */
38
-    GRACEFUL_SHUTDOWN: "conference.gracefulShutdown",
39
-    /**
40
-     * Indicates that jingle fatal error happened.
41
-     */
42
-    JINGLE_FATAL_ERROR: "conference.jingleFatalError",
43
-    /**
44
-     * Indicates that conference has been destroyed.
45
-     */
46
-    CONFERENCE_DESTROYED: "conference.destroyed",
47
-    /**
48
-     * Indicates that chat error occurred.
49
-     */
50
-    CHAT_ERROR: "conference.chatError",
51
-    /**
52
-     * Indicates that focus error happened.
53
-     */
54
-    FOCUS_DISCONNECTED: "conference.focusDisconnected",
55
-    /**
56
-     * Indicates that focus left the conference.
57
-     */
58
-    FOCUS_LEFT: "conference.focusLeft",
59
-    /**
60
-     * Indicates that max users limit has been reached.
61
-     */
62
-    CONFERENCE_MAX_USERS: "conference.max_users",
63
-    /**
64
-     * Indicates that the versions of the server side components are
65
-     * incompatible with the client side.
66
-     */
67
-    INCOMPATIBLE_SERVER_VERSIONS: "conference.incompatible_server_versions"
68
-    /**
69
-     * Many more errors TBD here.
70
-     */
71
-};
2
+ * The errors for the conference.
3
+ */
72 4
 
73
-module.exports = JitsiConferenceErrors;
5
+/**
6
+ * Indicates that client must be authenticated to create the conference.
7
+ */
8
+export const AUTHENTICATION_REQUIRED = "conference.authenticationRequired";
9
+/**
10
+ * Indicates that chat error occurred.
11
+ */
12
+export const CHAT_ERROR = "conference.chatError";
13
+/**
14
+ * Indicates that conference has been destroyed.
15
+ */
16
+export const CONFERENCE_DESTROYED = "conference.destroyed";
17
+/**
18
+ * Indicates that max users limit has been reached.
19
+ */
20
+export const CONFERENCE_MAX_USERS = "conference.max_users";
21
+/**
22
+ * Indicates that a connection error occurred when trying to join a conference.
23
+ */
24
+export const CONNECTION_ERROR = "conference.connectionError";
25
+/**
26
+ * Indicates that focus error happened.
27
+ */
28
+export const FOCUS_DISCONNECTED = "conference.focusDisconnected";
29
+/**
30
+ * Indicates that focus left the conference.
31
+ */
32
+export const FOCUS_LEFT = "conference.focusLeft";
33
+/**
34
+ * Indicates that graceful shutdown happened.
35
+ */
36
+export const GRACEFUL_SHUTDOWN = "conference.gracefulShutdown";
37
+/**
38
+ * Indicates that the versions of the server side components are incompatible
39
+ * with the client side.
40
+ */
41
+export const INCOMPATIBLE_SERVER_VERSIONS
42
+    = "conference.incompatible_server_versions";
43
+/**
44
+ * Indicates that jingle fatal error happened.
45
+ */
46
+export const JINGLE_FATAL_ERROR = "conference.jingleFatalError";
47
+/**
48
+ * Indicates that password cannot be set for this conference.
49
+ */
50
+export const PASSWORD_NOT_SUPPORTED = "conference.passwordNotSupported";
51
+/**
52
+ * Indicates that a password is required in order to join the conference.
53
+ */
54
+export const PASSWORD_REQUIRED = "conference.passwordRequired";
55
+/**
56
+ * Indicates that reservation system returned error.
57
+ */
58
+export const RESERVATION_ERROR = "conference.reservationError";
59
+/**
60
+ * Indicates that the conference setup failed.
61
+ */
62
+export const SETUP_FAILED = "conference.setup_failed";
63
+/**
64
+ * Indicates that there is no available videobridge.
65
+ */
66
+export const VIDEOBRIDGE_NOT_AVAILABLE = "conference.videobridgeNotAvailable";

+ 2
- 2
JitsiConferenceEventManager.js 查看文件

@@ -3,8 +3,8 @@ var logger = require("jitsi-meet-logger").getLogger(__filename);
3 3
 var EventEmitterForwarder = require("./modules/util/EventEmitterForwarder");
4 4
 var XMPPEvents = require("./service/xmpp/XMPPEvents");
5 5
 var RTCEvents = require("./service/RTC/RTCEvents");
6
-var JitsiConferenceEvents = require("./JitsiConferenceEvents");
7
-var JitsiConferenceErrors = require("./JitsiConferenceErrors");
6
+import * as JitsiConferenceErrors from "./JitsiConferenceErrors";
7
+import * as JitsiConferenceEvents from "./JitsiConferenceEvents";
8 8
 var AuthenticationEvents =
9 9
     require("./service/authentication/AuthenticationEvents");
10 10
 var Statistics = require("./modules/statistics/statistics");

+ 146
- 148
JitsiConferenceEvents.js 查看文件

@@ -1,150 +1,148 @@
1 1
 /**
2
- * Enumeration with the events for the conference.
3
- * @type {{string: string}}
4
- */
5
-var JitsiConferenceEvents = {
6
-    /**
7
-     * A new media track was added to the conference. The event provides the
8
-     * following parameters to its listeners:
9
-     *
10
-     * @param {JitsiTrack} track the added JitsiTrack
11
-     */
12
-    TRACK_ADDED: "conference.trackAdded",
13
-    /**
14
-     * The media track was removed from the conference. The event provides the
15
-     * following parameters to its listeners:
16
-     *
17
-     * @param {JitsiTrack} track the removed JitsiTrack
18
-     */
19
-    TRACK_REMOVED: "conference.trackRemoved",
20
-    /**
21
-     * The dominant speaker was changed.
22
-     */
23
-    DOMINANT_SPEAKER_CHANGED: "conference.dominantSpeaker",
24
-    /**
25
-     * A new user joinned the conference.
26
-     */
27
-    USER_JOINED: "conference.userJoined",
28
-    /**
29
-     * A user has left the conference.
30
-     */
31
-    USER_LEFT: "conference.userLeft",
32
-    /**
33
-     * User role changed.
34
-     */
35
-    USER_ROLE_CHANGED: "conference.roleChanged",
36
-    /**
37
-     * User status changed.
38
-     */
39
-    USER_STATUS_CHANGED: "conference.statusChanged",
40
-    /**
41
-     * New text message was received.
42
-     */
43
-    MESSAGE_RECEIVED: "conference.messageReceived",
44
-    /**
45
-     * A user has changed it display name
46
-     */
47
-    DISPLAY_NAME_CHANGED: "conference.displayNameChanged",
48
-    /**
49
-     * Indicates that subject of the conference has changed.
50
-     */
51
-    SUBJECT_CHANGED: "conference.subjectChanged",
52
-    /**
53
-     * A participant avatar has changed.
54
-     */
55
-    AVATAR_CHANGED: "conference.avatarChanged",
56
-    /**
57
-     * New local connection statistics are received.
58
-     */
59
-    CONNECTION_STATS: "conference.connectionStats",
60
-    /**
61
-     * The Last N set is changed.
62
-     */
63
-    LAST_N_ENDPOINTS_CHANGED: "conference.lastNEndpointsChanged",
64
-    /**
65
-     * You are included / excluded in somebody's last N set
66
-     */
67
-    IN_LAST_N_CHANGED: "conference.inLastNChanged",
68
-    /**
69
-     * A media track ( attached to the conference) mute status was changed.
70
-     */
71
-    TRACK_MUTE_CHANGED: "conference.trackMuteChanged",
72
-    /**
73
-     * Audio levels of a media track ( attached to the conference) was changed.
74
-     */
75
-    TRACK_AUDIO_LEVEL_CHANGED: "conference.audioLevelsChanged",
76
-    /**
77
-     * Indicates that the connection to the conference has been interrupted
78
-     * for some reason.
79
-     */
80
-    CONNECTION_INTERRUPTED: "conference.connectionInterrupted",
81
-    /**
82
-     * Indicates that the connection to the conference has been restored.
83
-     */
84
-    CONNECTION_RESTORED: "conference.connectionRestored",
85
-    /**
86
-     * Indicates that conference failed.
87
-     */
88
-    CONFERENCE_FAILED: "conference.failed",
89
-    /**
90
-     * Indicates that an error occured.
91
-     */
92
-    CONFERENCE_ERROR: "conference.error",
93
-    /**
94
-     * Indicates that conference has been joined. The event does NOT provide any
95
-     * parameters to its listeners.
96
-     */
97
-    CONFERENCE_JOINED: "conference.joined",
98
-    /**
99
-     * Indicates that conference has been left.
100
-     */
101
-    CONFERENCE_LEFT: "conference.left",
102
-    /**
103
-     * You are kicked from the conference.
104
-     */
105
-    KICKED: "conferenece.kicked",
106
-    /**
107
-     * Indicates that start muted settings changed.
108
-     */
109
-    START_MUTED_POLICY_CHANGED: "conference.start_muted_policy_changed",
110
-    /**
111
-     * Indicates that the local user has started muted.
112
-     */
113
-    STARTED_MUTED: "conference.started_muted",
114
-    /**
115
-     * Indicates that DTMF support changed.
116
-     */
117
-    DTMF_SUPPORT_CHANGED: "conference.dtmfSupportChanged",
118
-    /**
119
-     * Indicates that recording state changed.
120
-     */
121
-    RECORDER_STATE_CHANGED: "conference.recorderStateChanged",
122
-    /**
123
-     * Indicates that phone number changed.
124
-     */
125
-    PHONE_NUMBER_CHANGED: "conference.phoneNumberChanged",
126
-    /**
127
-     * Indicates that available devices changed.
128
-     */
129
-    AVAILABLE_DEVICES_CHANGED: "conference.availableDevicesChanged",
130
-    /**
131
-     * Indicates that authentication status changed.
132
-     */
133
-    AUTH_STATUS_CHANGED: "conference.auth_status_changed",
134
-    /**
135
-     * Indicates that a the value of a specific property of a specific
136
-     * participant has changed.
137
-     */
138
-    PARTICIPANT_PROPERTY_CHANGED: "conference.participant_property_changed",
139
-    /**
140
-     * Indicates that a message from another participant is received on
141
-     * data channel.
142
-     */
143
-    ENDPOINT_MESSAGE_RECEIVED: "conference.endpoint_message_received",
144
-    /**
145
-     * Indicates that the room has been locked or unlocked.
146
-     */
147
-    LOCK_STATE_CHANGED: "conference.lock_state_changed"
148
-};
2
+ * The events for the conference.
3
+ */
149 4
 
150
-module.exports = JitsiConferenceEvents;
5
+/**
6
+ * Indicates that authentication status changed.
7
+ */
8
+export const AUTH_STATUS_CHANGED = "conference.auth_status_changed";
9
+/**
10
+ * Indicates that available devices changed.
11
+ */
12
+export const AVAILABLE_DEVICES_CHANGED = "conference.availableDevicesChanged";
13
+/**
14
+ * A participant avatar has changed.
15
+ */
16
+export const AVATAR_CHANGED = "conference.avatarChanged";
17
+/**
18
+ * Indicates that an error occured.
19
+ */
20
+export const CONFERENCE_ERROR = "conference.error";
21
+/**
22
+ * Indicates that conference failed.
23
+ */
24
+export const CONFERENCE_FAILED = "conference.failed";
25
+/**
26
+ * Indicates that conference has been joined. The event does NOT provide any
27
+ * parameters to its listeners.
28
+ */
29
+export const CONFERENCE_JOINED = "conference.joined";
30
+/**
31
+ * Indicates that conference has been left.
32
+ */
33
+export const CONFERENCE_LEFT = "conference.left";
34
+/**
35
+ * Indicates that the connection to the conference has been interrupted for some
36
+ * reason.
37
+ */
38
+export const CONNECTION_INTERRUPTED = "conference.connectionInterrupted";
39
+/**
40
+ * Indicates that the connection to the conference has been restored.
41
+ */
42
+export const CONNECTION_RESTORED = "conference.connectionRestored";
43
+/**
44
+ * New local connection statistics are received.
45
+ */
46
+export const CONNECTION_STATS = "conference.connectionStats";
47
+/**
48
+ * A user has changed it display name
49
+ */
50
+export const DISPLAY_NAME_CHANGED = "conference.displayNameChanged";
51
+/**
52
+ * The dominant speaker was changed.
53
+ */
54
+export const DOMINANT_SPEAKER_CHANGED = "conference.dominantSpeaker";
55
+/**
56
+ * Indicates that DTMF support changed.
57
+ */
58
+export const DTMF_SUPPORT_CHANGED = "conference.dtmfSupportChanged";
59
+/**
60
+ * Indicates that a message from another participant is received on data
61
+ * channel.
62
+ */
63
+export const ENDPOINT_MESSAGE_RECEIVED = "conference.endpoint_message_received";
64
+/**
65
+ * You are included / excluded in somebody's last N set
66
+ */
67
+export const IN_LAST_N_CHANGED = "conference.inLastNChanged";
68
+/**
69
+ * You are kicked from the conference.
70
+ */
71
+export const KICKED = "conferenece.kicked";
72
+/**
73
+ * The Last N set is changed.
74
+ */
75
+export const LAST_N_ENDPOINTS_CHANGED = "conference.lastNEndpointsChanged";
76
+/**
77
+ * Indicates that the room has been locked or unlocked.
78
+ */
79
+export const LOCK_STATE_CHANGED = "conference.lock_state_changed";
80
+/**
81
+ * New text message was received.
82
+ */
83
+export const MESSAGE_RECEIVED = "conference.messageReceived";
84
+/**
85
+ * Indicates that a the value of a specific property of a specific participant
86
+ * has changed.
87
+ */
88
+export const PARTICIPANT_PROPERTY_CHANGED
89
+    = "conference.participant_property_changed";
90
+/**
91
+ * Indicates that phone number changed.
92
+ */
93
+export const PHONE_NUMBER_CHANGED = "conference.phoneNumberChanged";
94
+/**
95
+ * Indicates that recording state changed.
96
+ */
97
+export const RECORDER_STATE_CHANGED = "conference.recorderStateChanged";
98
+/**
99
+ * Indicates that start muted settings changed.
100
+ */
101
+export const START_MUTED_POLICY_CHANGED
102
+    = "conference.start_muted_policy_changed";
103
+/**
104
+ * Indicates that the local user has started muted.
105
+ */
106
+export const STARTED_MUTED = "conference.started_muted";
107
+/**
108
+ * Indicates that subject of the conference has changed.
109
+ */
110
+export const SUBJECT_CHANGED = "conference.subjectChanged";
111
+/**
112
+ * A new media track was added to the conference. The event provides the
113
+ * following parameters to its listeners:
114
+ *
115
+ * @param {JitsiTrack} track the added JitsiTrack
116
+ */
117
+export const TRACK_ADDED = "conference.trackAdded";
118
+/**
119
+ * Audio levels of a media track ( attached to the conference) was changed.
120
+ */
121
+export const TRACK_AUDIO_LEVEL_CHANGED = "conference.audioLevelsChanged";
122
+/**
123
+ * A media track ( attached to the conference) mute status was changed.
124
+ */
125
+export const TRACK_MUTE_CHANGED = "conference.trackMuteChanged";
126
+/**
127
+ * The media track was removed from the conference. The event provides the
128
+ * following parameters to its listeners:
129
+ *
130
+ * @param {JitsiTrack} track the removed JitsiTrack
131
+ */
132
+export const TRACK_REMOVED = "conference.trackRemoved";
133
+/**
134
+ * A new user joinned the conference.
135
+ */
136
+export const USER_JOINED = "conference.userJoined";
137
+/**
138
+ * A user has left the conference.
139
+ */
140
+export const USER_LEFT = "conference.userLeft";
141
+/**
142
+ * User role changed.
143
+ */
144
+export const USER_ROLE_CHANGED = "conference.roleChanged";
145
+/**
146
+ * User status changed.
147
+ */
148
+export const USER_STATUS_CHANGED = "conference.statusChanged";

+ 2
- 2
JitsiConnection.js 查看文件

@@ -1,7 +1,7 @@
1 1
 var JitsiConference = require("./JitsiConference");
2 2
 var XMPP = require("./modules/xmpp/xmpp");
3
-var JitsiConnectionEvents = require("./JitsiConnectionEvents");
4
-var JitsiConnectionErrors = require("./JitsiConnectionErrors");
3
+import * as JitsiConnectionErrors from "./JitsiConnectionErrors";
4
+import * as JitsiConnectionEvents from "./JitsiConnectionEvents";
5 5
 var Statistics = require("./modules/statistics/statistics");
6 6
 
7 7
 /**

+ 13
- 18
JitsiConnectionErrors.js 查看文件

@@ -1,21 +1,16 @@
1 1
 /**
2
- * Enumeration with the errors for the connection.
3
- * @type {{string: string}}
2
+ * The errors for the connection.
4 3
  */
5
-var JitsiConnectionErrors = {
6
-    /**
7
-     * Indicates that a password is required in order to join the conference.
8
-     */
9
-    PASSWORD_REQUIRED: "connection.passwordRequired",
10
-    /**
11
-     * Indicates that a connection error occurred when trying to join a
12
-     * conference.
13
-     */
14
-    CONNECTION_ERROR: "connection.connectionError",
15
-    /**
16
-     * Not specified errors.
17
-     */
18
-    OTHER_ERROR: "connection.otherError"
19
-};
20 4
 
21
-module.exports = JitsiConnectionErrors;
5
+/**
6
+ * Indicates that a connection error occurred when trying to join a conference.
7
+ */
8
+export const CONNECTION_ERROR = "connection.connectionError";
9
+/**
10
+ * Not specified errors.
11
+ */
12
+export const OTHER_ERROR = "connection.otherError";
13
+/**
14
+ * Indicates that a password is required in order to join the conference.
15
+ */
16
+export const PASSWORD_REQUIRED = "connection.passwordRequired";

+ 29
- 33
JitsiConnectionEvents.js 查看文件

@@ -1,36 +1,32 @@
1 1
 /**
2
- * Enumeration with the events for the connection.
3
- * @type {{string: string}}
2
+ * The events for the connection.
4 3
  */
5
-var JitsiConnnectionEvents = {
6
-    /**
7
-     * Indicates that the connection has been failed for some reason. The event
8
-     * proivdes the following parameters to its listeners:
9
-     *
10
-     * @param err {string} the error (message) associated with the failure
11
-     */
12
-    CONNECTION_FAILED: "connection.connectionFailed",
13
-    /**
14
-     * Indicates that the connection has been established. The event provides
15
-     * the following parameters to its listeners:
16
-     *
17
-     * @param id {string} the ID of the local endpoint/participant/peer (within
18
-     * the context of the established connection)
19
-     */
20
-    CONNECTION_ESTABLISHED: "connection.connectionEstablished",
21
-    /**
22
-     * Indicates that the connection has been disconnected. The event provides
23
-     * the following parameters to its listeners:
24
-     *
25
-     * @param msg {string} a message associated with the disconnect such as the
26
-     * last (known) error message
27
-     */
28
-    CONNECTION_DISCONNECTED: "connection.connectionDisconnected",
29
-    /**
30
-     * Indicates that the perfomed action cannot be executed because the
31
-     * connection is not in the correct state(connected, disconnected, etc.)
32
-     */
33
-    WRONG_STATE: "connection.wrongState"
34
-};
35 4
 
36
-module.exports = JitsiConnnectionEvents;
5
+/**
6
+ * Indicates that the connection has been disconnected. The event provides
7
+ * the following parameters to its listeners:
8
+ *
9
+ * @param msg {string} a message associated with the disconnect such as the
10
+ * last (known) error message
11
+ */
12
+export const CONNECTION_DISCONNECTED = "connection.connectionDisconnected";
13
+/**
14
+ * Indicates that the connection has been established. The event provides
15
+ * the following parameters to its listeners:
16
+ *
17
+ * @param id {string} the ID of the local endpoint/participant/peer (within
18
+ * the context of the established connection)
19
+ */
20
+export const CONNECTION_ESTABLISHED = "connection.connectionEstablished";
21
+/**
22
+ * Indicates that the connection has been failed for some reason. The event
23
+ * proivdes the following parameters to its listeners:
24
+ *
25
+ * @param err {string} the error (message) associated with the failure
26
+ */
27
+export const CONNECTION_FAILED = "connection.connectionFailed";
28
+/**
29
+ * Indicates that the perfomed action cannot be executed because the
30
+ * connection is not in the correct state(connected, disconnected, etc.)
31
+ */
32
+export const WRONG_STATE = "connection.wrongState";

+ 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";

+ 5
- 5
JitsiMeetJS.js 查看文件

@@ -2,11 +2,11 @@ var logger = require("jitsi-meet-logger").getLogger(__filename);
2 2
 var AuthUtil = require("./modules/util/AuthUtil");
3 3
 var JitsiConnection = require("./JitsiConnection");
4 4
 var JitsiMediaDevices = require("./JitsiMediaDevices");
5
-var JitsiConferenceEvents = require("./JitsiConferenceEvents");
6
-var JitsiConnectionEvents = require("./JitsiConnectionEvents");
7
-var JitsiMediaDevicesEvents = require('./JitsiMediaDevicesEvents');
8
-var JitsiConnectionErrors = require("./JitsiConnectionErrors");
9
-var JitsiConferenceErrors = require("./JitsiConferenceErrors");
5
+import * as JitsiConferenceErrors from "./JitsiConferenceErrors";
6
+import * as JitsiConferenceEvents from "./JitsiConferenceEvents";
7
+import * as JitsiConnectionErrors from "./JitsiConnectionErrors";
8
+import * as JitsiConnectionEvents from "./JitsiConnectionEvents";
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";

+ 1
- 1
JitsiParticipant.js 查看文件

@@ -1,5 +1,5 @@
1 1
 /* global Strophe */
2
-var JitsiConferenceEvents = require('./JitsiConferenceEvents');
2
+import * as JitsiConferenceEvents from "./JitsiConferenceEvents";
3 3
 
4 4
 /**
5 5
  * Represents a participant in (a member of) a conference.

+ 2
- 2
modules/xmpp/xmpp.js 查看文件

@@ -6,8 +6,8 @@ var Pako = require("pako");
6 6
 var RandomUtil = require("../util/RandomUtil");
7 7
 var RTCEvents = require("../../service/RTC/RTCEvents");
8 8
 var XMPPEvents = require("../../service/xmpp/XMPPEvents");
9
-var JitsiConnectionErrors = require("../../JitsiConnectionErrors");
10
-var JitsiConnectionEvents = require("../../JitsiConnectionEvents");
9
+import * as JitsiConnectionErrors from "../../JitsiConnectionErrors";
10
+import * as JitsiConnectionEvents from "../../JitsiConnectionEvents";
11 11
 var RTC = require("../RTC/RTC");
12 12
 var RTCBrowserType = require("../RTC/RTCBrowserType");
13 13
 

Loading…
取消
儲存