Quellcode durchsuchen

docs(api.md): Comply with our coding style.

j8
Hristo Terezov vor 6 Jahren
Ursprung
Commit
f12317dc59
1 geänderte Dateien mit 125 neuen und 116 gelöschten Zeilen
  1. 125
    116
      doc/api.md

+ 125
- 116
doc/api.md Datei anzeigen

7
 To embed Jitsi Meet in your application you need to add the Jitsi Meet API library:
7
 To embed Jitsi Meet in your application you need to add the Jitsi Meet API library:
8
 
8
 
9
 ```javascript
9
 ```javascript
10
-<script src="https://meet.jit.si/external_api.js"></script>
10
+<script src='https://meet.jit.si/external_api.js'></script>
11
 ```
11
 ```
12
 ## API
12
 ## API
13
 
13
 
16
 The next step for embedding Jitsi Meet is to create the Jitsi Meet API object.
16
 The next step for embedding Jitsi Meet is to create the Jitsi Meet API object.
17
 Its constructor gets a number of options:
17
 Its constructor gets a number of options:
18
 
18
 
19
-* **domain**: domain used to build the conference URL, "meet.jit.si" for
19
+* **domain**: domain used to build the conference URL, 'meet.jit.si' for
20
   example.
20
   example.
21
 * **options**: object with properties - the optional arguments:
21
 * **options**: object with properties - the optional arguments:
22
     * **roomName**: (optional) name of the room to join.
22
     * **roomName**: (optional) name of the room to join.
34
 Example:
34
 Example:
35
 
35
 
36
 ```javascript
36
 ```javascript
37
-var domain = "meet.jit.si";
38
-var options = {
39
-    roomName: "JitsiMeetAPIExample",
37
+const domain = 'meet.jit.si';
38
+const options = {
39
+    roomName: 'JitsiMeetAPIExample',
40
     width: 700,
40
     width: 700,
41
     height: 700,
41
     height: 700,
42
     parentNode: document.querySelector('#meet')
42
     parentNode: document.querySelector('#meet')
43
-}
44
-var api = new JitsiMeetExternalAPI(domain, options);
43
+};
44
+const api = new JitsiMeetExternalAPI(domain, options);
45
 ```
45
 ```
46
 
46
 
47
 You can set the initial media devices for the call:
47
 You can set the initial media devices for the call:
48
 
48
 
49
 ```javascript
49
 ```javascript
50
-var domain = "meet.jit.si";
51
-var options = {
50
+const domain = 'meet.jit.si';
51
+const options = {
52
     ...
52
     ...
53
     devices: {
53
     devices: {
54
-        'audioInput': '<deviceLabel>',
55
-        'audioOutput': '<deviceLabel>',
56
-        'videoInput': '<deviceLabel>'
57
-    }
58
-}
59
-var api = new JitsiMeetExternalAPI(domain, options);
54
+        audioInput: '<deviceLabel>',
55
+        audioOutput: '<deviceLabel>',
56
+        videoInput: '<deviceLabel>'
57
+    },
58
+    ...
59
+};
60
+const api = new JitsiMeetExternalAPI(domain, options);
60
 ```
61
 ```
61
 
62
 
62
 You can overwrite options set in [config.js] and [interface_config.js].
63
 You can overwrite options set in [config.js] and [interface_config.js].
63
 For example, to enable the filmstrip-only interface mode, you can use:
64
 For example, to enable the filmstrip-only interface mode, you can use:
64
 
65
 
65
 ```javascript
66
 ```javascript
66
-var options = {
67
-    interfaceConfigOverwrite: {filmStripOnly: true}
67
+const options = {
68
+    ...
69
+    interfaceConfigOverwrite: { filmStripOnly: true },
70
+    ...
68
 };
71
 };
69
-var api = new JitsiMeetExternalAPI(domain, options);
72
+const api = new JitsiMeetExternalAPI(domain, options);
70
 ```
73
 ```
71
 
74
 
72
 You can also pass a jwt token to Jitsi Meet:
75
 You can also pass a jwt token to Jitsi Meet:
73
 
76
 
74
  ```javascript
77
  ```javascript
75
-var options = {
76
-    jwt: "<jwt_token>",
77
-    noSsl: false
78
+const options = {
79
+    ...
80
+    jwt: '<jwt_token>',
81
+    noSsl: false,
82
+    ...
78
 };
83
 };
79
-var api = new JitsiMeetExternalAPI(domain, options);
84
+const api = new JitsiMeetExternalAPI(domain, options);
80
  ```
85
  ```
81
 
86
 
82
 ### Controlling the embedded Jitsi Meet Conference
87
 ### Controlling the embedded Jitsi Meet Conference
85
 * **getAvailableDevices** - Retrieve a list of available devices.
90
 * **getAvailableDevices** - Retrieve a list of available devices.
86
 
91
 
87
 ```javascript
92
 ```javascript
88
-api.getAvailableDevices().then(function(devices) {
93
+api.getAvailableDevices().then(devices => {
89
     // devices = {
94
     // devices = {
90
-    //     'audioInput': [{
91
-    //         deviceId: "ID"
92
-    //         groupId: "grpID"
93
-    //         kind: "audioinput"
94
-    //         label: "Label"
95
+    //     audioInput: [{
96
+    //         deviceId: 'ID'
97
+    //         groupId: 'grpID'
98
+    //         kind: 'audioinput'
99
+    //         label: 'label'
95
     //     },....],
100
     //     },....],
96
-    //     'audioOutput': [{
97
-    //         deviceId: "ID"
98
-    //         groupId: "grpID"
99
-    //         kind: "audioOutput"
100
-    //         label: "Label"
101
+    //     audioOutput: [{
102
+    //         deviceId: 'ID'
103
+    //         groupId: 'grpID'
104
+    //         kind: 'audioOutput'
105
+    //         label: 'label'
101
     //     },....],
106
     //     },....],
102
-    //     'videoInput': [{
103
-    //         deviceId: "ID"
104
-    //         groupId: "grpID"
105
-    //         kind: "videoInput"
106
-    //         label: "Label"
107
+    //     videoInput: [{
108
+    //         deviceId: 'ID'
109
+    //         groupId: 'grpID'
110
+    //         kind: 'videoInput'
111
+    //         label: 'label'
107
     //     },....]
112
     //     },....]
108
     // }
113
     // }
109
     ...
114
     ...
112
 * **getCurrentDevices** - Retrieve a list with the devices that are currently selected.
117
 * **getCurrentDevices** - Retrieve a list with the devices that are currently selected.
113
 
118
 
114
 ```javascript
119
 ```javascript
115
-api.getCurrentDevices().then(function(devices) {
120
+api.getCurrentDevices().then(devices => {
116
     // devices = {
121
     // devices = {
117
-    //     'audioInput': {
118
-    //         deviceId: "ID"
119
-    //         groupId: "grpID"
120
-    //         kind: "videoInput"
121
-    //         label: "Label"
122
+    //     audioInput: {
123
+    //         deviceId: 'ID'
124
+    //         groupId: 'grpID'
125
+    //         kind: 'videoInput'
126
+    //         label: 'label'
122
     //     },
127
     //     },
123
-    //     'audioOutput': {
124
-    //         deviceId: "ID"
125
-    //         groupId: "grpID"
126
-    //         kind: "videoInput"
127
-    //         label: "Label"
128
+    //     audioOutput: {
129
+    //         deviceId: 'ID'
130
+    //         groupId: 'grpID'
131
+    //         kind: 'videoInput'
132
+    //         label: 'label'
128
     //     },
133
     //     },
129
-    //     'videoInput': {
130
-    //         deviceId: "ID"
131
-    //         groupId: "grpID"
132
-    //         kind: "videoInput"
133
-    //         label: "Label"
134
+    //     videoInput: {
135
+    //         deviceId: 'ID'
136
+    //         groupId: 'grpID'
137
+    //         kind: 'videoInput'
138
+    //         label: 'label'
134
     //     }
139
     //     }
135
     // }
140
     // }
136
     ...
141
     ...
140
 
145
 
141
 ```javascript
146
 ```javascript
142
 // The accepted deviceType values are - 'output', 'input' or undefined.
147
 // The accepted deviceType values are - 'output', 'input' or undefined.
143
-api.isDeviceChangeAvailable(deviceType).then(function(isDeviceChangeAvailable) {
148
+api.isDeviceChangeAvailable(deviceType).then(isDeviceChangeAvailable => {
144
     ...
149
     ...
145
 });
150
 });
146
 ```
151
 ```
147
 * **isDeviceListAvailable** - Resolves with true if the device list is available and with false if not.
152
 * **isDeviceListAvailable** - Resolves with true if the device list is available and with false if not.
148
 
153
 
149
 ```javascript
154
 ```javascript
150
-api.isDeviceListAvailable().then(function(isDeviceListAvailable) {
155
+api.isDeviceListAvailable().then(isDeviceListAvailable => {
151
     ...
156
     ...
152
 });
157
 });
153
 ```
158
 ```
154
 * **isMultipleAudioInputSupported** - Resolves with true if multiple audio input is supported and with false if not.
159
 * **isMultipleAudioInputSupported** - Resolves with true if multiple audio input is supported and with false if not.
155
 
160
 
156
 ```javascript
161
 ```javascript
157
-api.isMultipleAudioInputSupported().then(function(isMultipleAudioInputSupported) {
162
+api.isMultipleAudioInputSupported().then(isMultipleAudioInputSupported => {
158
     ...
163
     ...
159
 });
164
 });
160
 ```
165
 ```
177
 You can control the embedded Jitsi Meet conference using the `JitsiMeetExternalAPI` object by using `executeCommand`:
182
 You can control the embedded Jitsi Meet conference using the `JitsiMeetExternalAPI` object by using `executeCommand`:
178
 
183
 
179
 ```javascript
184
 ```javascript
180
-api.executeCommand(command, ...arguments)
185
+api.executeCommand(command, ...arguments);
181
 ```
186
 ```
182
 
187
 
183
 The `command` parameter is String object with the name of the command. The following commands are currently supported:
188
 The `command` parameter is String object with the name of the command. The following commands are currently supported:
194
 
199
 
195
 * **toggleAudio** - Mutes / unmutes the audio for the local participant. No arguments are required.
200
 * **toggleAudio** - Mutes / unmutes the audio for the local participant. No arguments are required.
196
 ```javascript
201
 ```javascript
197
-api.executeCommand('toggleAudio')
202
+api.executeCommand('toggleAudio');
198
 ```
203
 ```
199
 
204
 
200
 * **toggleVideo** - Mutes / unmutes the video for the local participant. No arguments are required.
205
 * **toggleVideo** - Mutes / unmutes the video for the local participant. No arguments are required.
201
 ```javascript
206
 ```javascript
202
-api.executeCommand('toggleVideo')
207
+api.executeCommand('toggleVideo');
203
 ```
208
 ```
204
 
209
 
205
 * **toggleFilmStrip** - Hides / shows the filmstrip. No arguments are required.
210
 * **toggleFilmStrip** - Hides / shows the filmstrip. No arguments are required.
206
 ```javascript
211
 ```javascript
207
-api.executeCommand('toggleFilmStrip')
212
+api.executeCommand('toggleFilmStrip');
208
 ```
213
 ```
209
 
214
 
210
 * **toggleChat** - Hides / shows the chat. No arguments are required.
215
 * **toggleChat** - Hides / shows the chat. No arguments are required.
211
 ```javascript
216
 ```javascript
212
-api.executeCommand('toggleChat')
217
+api.executeCommand('toggleChat');
213
 ```
218
 ```
214
 
219
 
215
 * **toggleShareScreen** - Starts / stops screen sharing. No arguments are required.
220
 * **toggleShareScreen** - Starts / stops screen sharing. No arguments are required.
216
 ```javascript
221
 ```javascript
217
-api.executeCommand('toggleShareScreen')
222
+api.executeCommand('toggleShareScreen');
218
 ```
223
 ```
219
 
224
 
220
 * **hangup** - Hangups the call. No arguments are required.
225
 * **hangup** - Hangups the call. No arguments are required.
221
 ```javascript
226
 ```javascript
222
-api.executeCommand('hangup')
227
+api.executeCommand('hangup');
223
 ```
228
 ```
224
 
229
 
225
 * **email** - Changes the local email address. This command requires one argument - the new email address to be set.
230
 * **email** - Changes the local email address. This command requires one argument - the new email address to be set.
226
 ```javascript
231
 ```javascript
227
-api.executeCommand('email', 'example@example.com')
232
+api.executeCommand('email', 'example@example.com');
228
 ```
233
 ```
229
 
234
 
230
 * **avatarUrl** - Changes the local avatar URL. This command requires one argument - the new avatar URL to be set.
235
 * **avatarUrl** - Changes the local avatar URL. This command requires one argument - the new avatar URL to be set.
231
 ```javascript
236
 ```javascript
232
-api.executeCommand('avatarUrl', 'https://avatars0.githubusercontent.com/u/3671647')
237
+api.executeCommand('avatarUrl', 'https://avatars0.githubusercontent.com/u/3671647');
233
 ```
238
 ```
234
 
239
 
235
 You can also execute multiple commands using the `executeCommands` method:
240
 You can also execute multiple commands using the `executeCommands` method:
236
 ```javascript
241
 ```javascript
237
-api.executeCommands(commands)
242
+api.executeCommands(commands);
238
 ```
243
 ```
239
 The `commands` parameter is an object with the names of the commands as keys and the arguments for the commands as values:
244
 The `commands` parameter is an object with the names of the commands as keys and the arguments for the commands as values:
240
 ```javascript
245
 ```javascript
241
-api.executeCommands({displayName: ['nickname'], toggleAudio: []});
246
+api.executeCommands({
247
+    displayName: [ 'nickname' ],
248
+    toggleAudio: []
249
+});
242
 ```
250
 ```
243
 
251
 
244
 You can add event listeners to the embedded Jitsi Meet using the `addEventListener` method.
252
 You can add event listeners to the embedded Jitsi Meet using the `addEventListener` method.
245
 **NOTE: This method still exists but it is deprecated. JitsiMeetExternalAPI class extends [EventEmitter]. Use [EventEmitter] methods (`addListener` or `on`).**
253
 **NOTE: This method still exists but it is deprecated. JitsiMeetExternalAPI class extends [EventEmitter]. Use [EventEmitter] methods (`addListener` or `on`).**
246
 ```javascript
254
 ```javascript
247
-api.addEventListener(event, listener)
255
+api.addEventListener(event, listener);
248
 ```
256
 ```
249
 
257
 
250
 The `event` parameter is a String object with the name of the event.
258
 The `event` parameter is a String object with the name of the event.
255
 changes. The listener will receive an object with the following structure:
263
 changes. The listener will receive an object with the following structure:
256
 ```javascript
264
 ```javascript
257
 {
265
 {
258
-"id": id, // the id of the participant that changed his avatar.
259
-"avatarURL": avatarURL // the new avatar URL.
266
+    id: string, // the id of the participant that changed his avatar.
267
+    avatarURL: string // the new avatar URL.
260
 }
268
 }
261
 ```
269
 ```
262
 
270
 
263
 * **audioAvailabilityChanged** - event notifications about audio availability status changes. The listener will receive an object with the following structure:
271
 * **audioAvailabilityChanged** - event notifications about audio availability status changes. The listener will receive an object with the following structure:
264
 ```javascript
272
 ```javascript
265
 {
273
 {
266
-"available": available // new available status - boolean
274
+    available: boolean // new available status - boolean
267
 }
275
 }
268
 ```
276
 ```
269
 
277
 
270
 * **audioMuteStatusChanged** - event notifications about audio mute status changes. The listener will receive an object with the following structure:
278
 * **audioMuteStatusChanged** - event notifications about audio mute status changes. The listener will receive an object with the following structure:
271
 ```javascript
279
 ```javascript
272
 {
280
 {
273
-"muted": muted // new muted status - boolean
281
+    muted: boolean // new muted status - boolean
274
 }
282
 }
275
 ```
283
 ```
276
 
284
 
277
 * **screenSharingStatusChanged** - receives event notifications about turning on/off the local user screen sharing. The listener will receive object with the following structure:
285
 * **screenSharingStatusChanged** - receives event notifications about turning on/off the local user screen sharing. The listener will receive object with the following structure:
278
 ```javascript
286
 ```javascript
279
 {
287
 {
280
-"on": on, //whether screen sharing is on
281
-"details": {
288
+    on: boolean, //whether screen sharing is on
289
+    details: {
282
 
290
 
283
-    // From where the screen sharing is capturing, if known. Values which are
284
-    // passed include "window", "screen", "proxy", "device". The value undefined
285
-    // will be passed if the source type is unknown or screen share is off.
286
-    sourceType: sourceType
287
-}
291
+        // From where the screen sharing is capturing, if known. Values which are
292
+        // passed include 'window', 'screen', 'proxy', 'device'. The value undefined
293
+        // will be passed if the source type is unknown or screen share is off.
294
+        sourceType: string|undefined
295
+    }
288
 }
296
 }
289
 ```
297
 ```
290
 
298
 
292
 messages. The listener will receive an object with the following structure:
300
 messages. The listener will receive an object with the following structure:
293
 ```javascript
301
 ```javascript
294
 {
302
 {
295
-"from": from, // The id of the user that sent the message
296
-"nick": nick, // the nickname of the user that sent the message
297
-"message": txt // the text of the message
303
+    from: string, // The id of the user that sent the message
304
+    nick: string, // the nickname of the user that sent the message
305
+    message: string // the text of the message
298
 }
306
 }
299
 ```
307
 ```
300
 
308
 
302
 messages. The listener will receive an object with the following structure:
310
 messages. The listener will receive an object with the following structure:
303
 ```javascript
311
 ```javascript
304
 {
312
 {
305
-"message": txt // the text of the message
313
+    message: string // the text of the message
306
 }
314
 }
307
 ```
315
 ```
308
 
316
 
310
 changes. The listener will receive an object with the following structure:
318
 changes. The listener will receive an object with the following structure:
311
 ```javascript
319
 ```javascript
312
 {
320
 {
313
-"id": id, // the id of the participant that changed his display name
314
-"displayname": displayName // the new display name
321
+    id: string, // the id of the participant that changed his display name
322
+    displayname: string // the new display name
315
 }
323
 }
316
 ```
324
 ```
317
 
325
 
318
 * **deviceListChanged** - event notifications about device list changes. The listener will receive an object with the following structure:
326
 * **deviceListChanged** - event notifications about device list changes. The listener will receive an object with the following structure:
319
 ```javascript
327
 ```javascript
320
 {
328
 {
321
-"devices": devices // the new list of available devices.
329
+    devices: Object // the new list of available devices.
322
 }
330
 }
323
 ```
331
 ```
324
 NOTE: The devices object has the same format as the getAvailableDevices result format.
332
 NOTE: The devices object has the same format as the getAvailableDevices result format.
327
 changes. The listener will receive an object with the following structure:
335
 changes. The listener will receive an object with the following structure:
328
 ```javascript
336
 ```javascript
329
 {
337
 {
330
-"id": id, // the id of the participant that changed his email
331
-"email": email // the new email
338
+    id: string, // the id of the participant that changed his email
339
+    email: string // the new email
332
 }
340
 }
333
 ```
341
 ```
334
 * **filmstripDisplayChanged** - event notifications about the visibility of the filmstrip being updated.
342
 * **filmstripDisplayChanged** - event notifications about the visibility of the filmstrip being updated.
335
 ```javascript
343
 ```javascript
336
 {
344
 {
337
-"visible": visible, // Whether or not the filmstrip is displayed or hidden.
345
+    visible: boolean // Whether or not the filmstrip is displayed or hidden.
338
 }
346
 }
339
 ```
347
 ```
340
 
348
 
341
 * **participantJoined** - event notifications about new participants who join the room. The listener will receive an object with the following structure:
349
 * **participantJoined** - event notifications about new participants who join the room. The listener will receive an object with the following structure:
342
 ```javascript
350
 ```javascript
343
 {
351
 {
344
-"id": id, // the id of the participant
345
-"displayName": displayName // the display name of the participant
352
+    id: string, // the id of the participant
353
+    displayName: string // the display name of the participant
346
 }
354
 }
347
 ```
355
 ```
348
 
356
 
349
 * **participantLeft** - event notifications about participants that leave the room. The listener will receive an object with the following structure:
357
 * **participantLeft** - event notifications about participants that leave the room. The listener will receive an object with the following structure:
350
 ```javascript
358
 ```javascript
351
 {
359
 {
352
-"id": id // the id of the participant
360
+    id: string // the id of the participant
353
 }
361
 }
354
 ```
362
 ```
355
 
363
 
356
 * **videoConferenceJoined** - event notifications fired when the local user has joined the video conference. The listener will receive an object with the following structure:
364
 * **videoConferenceJoined** - event notifications fired when the local user has joined the video conference. The listener will receive an object with the following structure:
357
 ```javascript
365
 ```javascript
358
 {
366
 {
359
-"roomName": room, // the room name of the conference
360
-"id": id, // the id of the local participant
361
-"displayName": displayName, // the display name of the local participant
362
-"avatarURL": avatarURL // the avatar URL of the local participant
367
+    roomName: string, // the room name of the conference
368
+    id: string, // the id of the local participant
369
+    displayName: string, // the display name of the local participant
370
+    avatarURL: string // the avatar URL of the local participant
363
 }
371
 }
364
 ```
372
 ```
365
 
373
 
366
 * **videoConferenceLeft** - event notifications fired when the local user has left the video conference. The listener will receive an object with the following structure:
374
 * **videoConferenceLeft** - event notifications fired when the local user has left the video conference. The listener will receive an object with the following structure:
367
 ```javascript
375
 ```javascript
368
 {
376
 {
369
-"roomName": room // the room name of the conference
377
+    roomName: string // the room name of the conference
370
 }
378
 }
371
 ```
379
 ```
372
 
380
 
373
 * **videoAvailabilityChanged** - event notifications about video availability status changes. The listener will receive an object with the following structure:
381
 * **videoAvailabilityChanged** - event notifications about video availability status changes. The listener will receive an object with the following structure:
374
 ```javascript
382
 ```javascript
375
 {
383
 {
376
-"available": available // new available status - boolean
384
+    available: boolean // new available status - boolean
377
 }
385
 }
378
 ```
386
 ```
379
 
387
 
380
 * **videoMuteStatusChanged** - event notifications about video mute status changes. The listener will receive an object with the following structure:
388
 * **videoMuteStatusChanged** - event notifications about video mute status changes. The listener will receive an object with the following structure:
381
 ```javascript
389
 ```javascript
382
 {
390
 {
383
-"muted": muted // new muted status - boolean
391
+    muted: boolean // new muted status - boolean
384
 }
392
 }
385
 ```
393
 ```
386
 
394
 
390
 The listener will receive an object with the following structure:
398
 The listener will receive an object with the following structure:
391
 ```javascript
399
 ```javascript
392
 {
400
 {
393
-"subject": subject // the new subject
401
+    subject: string // the new subject
394
 }
402
 }
395
 ```
403
 ```
396
 
404
 
412
 
420
 
413
 api.addEventListeners({
421
 api.addEventListeners({
414
     incomingMessage: incomingMessageListener,
422
     incomingMessage: incomingMessageListener,
415
-    outgoingMessage: outgoingMessageListener})
423
+    outgoingMessage: outgoingMessageListener
424
+});
416
 ```
425
 ```
417
 
426
 
418
 If you want to remove a listener you can use `removeEventListener` method with argument the name of the event.
427
 If you want to remove a listener you can use `removeEventListener` method with argument the name of the event.
419
 **NOTE: This method still exists but it is deprecated. JitsiMeetExternalAPI class extends [EventEmitter]. Use [EventEmitter] methods( `removeListener`).**
428
 **NOTE: This method still exists but it is deprecated. JitsiMeetExternalAPI class extends [EventEmitter]. Use [EventEmitter] methods( `removeListener`).**
420
 ```javascript
429
 ```javascript
421
-api.removeEventListener("incomingMessage");
430
+api.removeEventListener('incomingMessage');
422
 ```
431
 ```
423
 
432
 
424
 If you want to remove more than one event you can use `removeEventListeners` method with an Array with the names of the events as an argument.
433
 If you want to remove more than one event you can use `removeEventListeners` method with an Array with the names of the events as an argument.
425
 **NOTE: This method still exists but it is deprecated. JitsiMeetExternalAPI class extends [EventEmitter]. Use [EventEmitter] methods.**
434
 **NOTE: This method still exists but it is deprecated. JitsiMeetExternalAPI class extends [EventEmitter]. Use [EventEmitter] methods.**
426
 ```javascript
435
 ```javascript
427
-api.removeEventListeners(["incomingMessage", "outgoingMessageListener"]);
436
+api.removeEventListeners([ 'incomingMessage', 'outgoingMessageListener' ]);
428
 ```
437
 ```
429
 
438
 
430
 You can get the number of participants in the conference with the following API function:
439
 You can get the number of participants in the conference with the following API function:
431
 ```javascript
440
 ```javascript
432
-var numberOfParticipants = api.getNumberOfParticipants();
441
+const numberOfParticipants = api.getNumberOfParticipants();
433
 ```
442
 ```
434
 
443
 
435
 You can get the avatar URL of a participant in the conference with the following API function:
444
 You can get the avatar URL of a participant in the conference with the following API function:
436
 ```javascript
445
 ```javascript
437
-var avatarURL = api.getAvatarURL(participantId);
446
+const avatarURL = api.getAvatarURL(participantId);
438
 ```
447
 ```
439
 
448
 
440
 You can get the display name of a participant in the conference with the following API function:
449
 You can get the display name of a participant in the conference with the following API function:
441
 ```javascript
450
 ```javascript
442
-var displayName = api.getDisplayName(participantId);
451
+const displayName = api.getDisplayName(participantId);
443
 ```
452
 ```
444
 
453
 
445
 You can get the email of a participant in the conference with the following API function:
454
 You can get the email of a participant in the conference with the following API function:
446
 ```javascript
455
 ```javascript
447
-var email = api.getEmail(participantId);
456
+const email = api.getEmail(participantId);
448
 ```
457
 ```
449
 
458
 
450
 You can get the iframe HTML element where Jitsi Meet is loaded with the following API function:
459
 You can get the iframe HTML element where Jitsi Meet is loaded with the following API function:
451
 ```javascript
460
 ```javascript
452
-var iframe = api.getIFrame();
461
+const iframe = api.getIFrame();
453
 ```
462
 ```
454
 
463
 
455
 You can check whether the audio is muted with the following API function:
464
 You can check whether the audio is muted with the following API function:
456
 ```javascript
465
 ```javascript
457
-api.isAudioMuted().then(function(muted) {
466
+api.isAudioMuted().then(muted => {
458
     ...
467
     ...
459
 });
468
 });
460
 ```
469
 ```
461
 
470
 
462
 You can check whether the video is muted with the following API function:
471
 You can check whether the video is muted with the following API function:
463
 ```javascript
472
 ```javascript
464
-api.isVideoMuted().then(function(muted) {
473
+api.isVideoMuted().then(muted => {
465
     ...
474
     ...
466
 });
475
 });
467
 ```
476
 ```
468
 
477
 
469
 You can check whether the audio is available with the following API function:
478
 You can check whether the audio is available with the following API function:
470
 ```javascript
479
 ```javascript
471
-api.isAudioAvailable().then(function(available) {
480
+api.isAudioAvailable().then(available => {
472
     ...
481
     ...
473
 });
482
 });
474
 ```
483
 ```
475
 
484
 
476
 You can check whether the video is available with the following API function:
485
 You can check whether the video is available with the following API function:
477
 ```javascript
486
 ```javascript
478
-api.isVideoAvailable().then(function(available) {
487
+api.isVideoAvailable().then(available => {
479
     ...
488
     ...
480
 });
489
 });
481
 ```
490
 ```
482
 
491
 
483
 You can invite new participants to the call with the following API function:
492
 You can invite new participants to the call with the following API function:
484
 ```javascript
493
 ```javascript
485
-api.invite([{...}, {...}, {...}]).then(function() {
494
+api.invite([ {...}, {...}, {...} ]).then(() => {
486
     // success
495
     // success
487
-}).catch(function() {
496
+}).catch(() => {
488
     // failure
497
     // failure
489
 });
498
 });
490
 ```
499
 ```
492
 
501
 
493
 You can remove the embedded Jitsi Meet Conference with the following API function:
502
 You can remove the embedded Jitsi Meet Conference with the following API function:
494
 ```javascript
503
 ```javascript
495
-api.dispose()
504
+api.dispose();
496
 ```
505
 ```
497
 
506
 
498
 NOTE: It's a good practice to remove the conference before the page is unloaded.
507
 NOTE: It's a good practice to remove the conference before the page is unloaded.

Laden…
Abbrechen
Speichern