Просмотр исходного кода

Add missing options to docs and improve naming (#1354)

* fix(docs): refactor and fix formatting
* fix(docs): add missing options
* fix(docs): change confusing link naming in README

Closes #1272
dev1
Paul Tiedtke 5 лет назад
Родитель
Сommit
dfa10c92f2
Аккаунт пользователя с таким Email не найден
2 измененных файлов: 339 добавлений и 292 удалений
  1. 2
    1
      README.md
  2. 337
    291
      doc/API.md

+ 2
- 1
README.md Просмотреть файл

@@ -4,7 +4,8 @@ You can use Jitsi Meet API to create Jitsi Meet video conferences with a custom
4 4
 
5 5
 ## Installation
6 6
 
7
-[Checkout the examples.](doc/API.md#installation)
7
+- [Installation guide](doc/API.md#installation)
8
+- [Checkout the example](doc/example)
8 9
 
9 10
 ## Building the sources
10 11
 

+ 337
- 291
doc/API.md Просмотреть файл

@@ -8,11 +8,11 @@ Installation
8 8
 
9 9
 To embed Jitsi Meet API in your application you need to add Jitsi Meet API library
10 10
 
11
-```javascript
11
+```html
12 12
 <script src="https://meet.jit.si/libs/lib-jitsi-meet.min.js"></script>
13 13
 ```
14 14
 
15
-Now you can access Jitsi Meet API trough the ```JitsiMeetJS``` global object.
15
+Now you can access Jitsi Meet API trough the `JitsiMeetJS` global object.
16 16
 
17 17
 Components
18 18
 =========
@@ -33,11 +33,11 @@ Usage
33 33
 ======
34 34
 JitsiMeetJS
35 35
 ----------
36
-You can access the following methods and objects trough ```JitsiMeetJS``` object.
36
+You can access the following methods and objects trough `JitsiMeetJS` object.
37 37
 
38 38
 
39
-*  ```JitsiMeetJS.init(options)``` - this method initialized Jitsi Meet API.
40
-The ```options``` parameter is JS object with the following properties:
39
+*  `JitsiMeetJS.init(options)` - this method initialized Jitsi Meet API.
40
+The `options` parameter is JS object with the following properties:
41 41
     - `useIPv6` - boolean property
42 42
     - `disableAudioLevels` - boolean property. Enables/disables audio levels.
43 43
     - `disableSimulcast` - boolean property. Enables/disables simulcast.
@@ -47,267 +47,314 @@ The ```options``` parameter is JS object with the following properties:
47 47
     - `externalStorage` - Object that implements the Storage interface. If specified this object will be used for storing data instead of `localStorage`.
48 48
     - `callStatsCustomScriptUrl` - (optional) custom url to access callstats client script
49 49
     - `disableRtx` - (optional) boolean property (default to false).  Enables/disable the use of RTX.
50
-    - `disableH264` - (optional) boolean property (default to false).  If enabled, strips the H.264 codec from the local SDP.
51
-    - `preferH264` - (optional) boolean property (default to false).  Enables/disable preferring the first instance of an h264 codec in an offer by moving it to the front of the codec list.
50
+    - `disabledCodec` - the mime type of the code that should not be negotiated on the peerconnection.
51
+    - `preferredCodec` the mime type of the codec that needs to be made the preferred codec for the connection.
52
+    - `disableH264` - __DEPRECATED__. Use `disabledCodec` instead.
53
+    - `preferH264` - __DEPRECATED__. Use `preferredCodec` instead.
52 54
 
53
-* ```JitsiMeetJS.JitsiConnection``` - the ```JitsiConnection``` constructor. You can use that to create new server connection.
55
+* `JitsiMeetJS.JitsiConnection` - the `JitsiConnection` constructor. You can use that to create new server connection.
54 56
 
55
-* ```JitsiMeetJS.setLogLevel``` - changes the log level for the library. For example to have only error messages you should do:
56
-```
57
+* `JitsiMeetJS.setLogLevel` - changes the log level for the library. For example to have only error messages you should do:
58
+```javascript
57 59
 JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
58 60
 ```
59 61
 
60
-* ```JitsiMeetJS.createLocalTracks(options, firePermissionPromptIsShownEvent)``` - Creates the media tracks and returns them trough ```Promise``` object. If rejected, passes ```JitsiTrackError``` instance to catch block.
61
-    - options - JS object with configuration options for the local media tracks. You can change the following properties there:
62
-        1. devices - array with the devices - "desktop", "video" and "audio" that will be passed to GUM. If that property is not set GUM will try to get all available devices.
63
-        2. resolution - the prefered resolution for the local video.
64
-        3. constraints - the prefered encoding properties for the created track (replaces 'resolution' in newer releases of browsers)
65
-        4. cameraDeviceId - the deviceID for the video device that is going to be used
66
-        5. micDeviceId - the deviceID for the audio device that is going to be used
67
-        6. minFps - the minimum frame rate for the video stream (passed to GUM)
68
-        7. maxFps - the maximum frame rate for the video stream (passed to GUM)
69
-        8. facingMode - facing mode for a camera (possible values - 'user', 'environment')
70
-    - firePermissionPromptIsShownEvent - optional boolean parameter. If set to ```true```, ```JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN``` will be fired when browser shows gUM permission prompt.
71
-
72
-* ```JitsiMeetJS.createTrackVADEmitter(localAudioDeviceId, sampleRate, vadProcessor)``` - Creates a TrackVADEmitter service that connects an audio track to a VAD (voice activity detection) processor in order to obtain VAD scores for individual PCM audio samples.
73
-    - ```localAudioDeviceId``` - The target local audio device.
74
-    - ```sampleRate``` - Sample rate at which the emitter will operate. Possible values  256, 512, 1024, 4096, 8192, 16384. Passing other values will default to closes neighbor, i.e. Providing a value of 4096 means that the emitter will process bundles of 4096 PCM samples at a time, higher values mean longer calls, lowers values mean more calls but shorter.
75
-    - ```vadProcessor``` - VAD Processors that does the actual compute on a PCM sample.The processor needs to implement the following functions:
76
-        - getSampleLength() - Returns the sample size accepted by calculateAudioFrameVAD.
77
-        - getRequiredPCMFrequency() - Returns the PCM frequency at which the processor operates .i.e. (16KHz, 44.1 KHz etc.)
78
-        - calculateAudioFrameVAD(pcmSample) - Process a 32 float pcm sample of getSampleLength size.
79
-* ```JitsiMeetJS.enumerateDevices(callback)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.enumerateDevices(callback)``` instead.
80
-* ```JitsiMeetJS.isDeviceChangeAvailable(deviceType)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.isDeviceChangeAvailable(deviceType)``` instead.
81
-* ```JitsiMeetJS.isDesktopSharingEnabled()``` - returns true if desktop sharing is supported and false otherwise. NOTE: that method can be used after ```JitsiMeetJS.init(options)``` is completed otherwise the result will be always null.
82
-* ```JitsiMeetJS.getActiveAudioDevice()``` - goes through all audio devices on the system and returns information about one that is active, i.e. has audio signal. Returns a Promise resolving to an Object with the following structure:
83
-    - deviceId - string containing the device ID of the audio track found as active.
84
-    - deviceLabel - string containing the label of the audio device.
85
-* ```JitsiMeetJS.getGlobalOnErrorHandler()``` - returns function that can be used to be attached to window.onerror and if options.enableWindowOnErrorHandler is enabled returns the function used by the lib. (function(message, source, lineno, colno, error)).
86
-
87
-* ```JitsiMeetJS.mediaDevices``` - JS object that contains methods for interaction with media devices. Following methods are available:
88
-    - ```isDeviceListAvailable()``` - returns true if retrieving the device list is supported and false - otherwise
89
-    - ```isDeviceChangeAvailable(deviceType)``` - returns true if changing the input (camera / microphone) or output (audio) device is supported and false if not. ```deviceType``` is a type of device to change. Undefined or 'input' stands for input devices, 'output' - for audio output devices.
90
-    - ```enumerateDevices(callback)``` - returns list of the available devices as a parameter to the callback function. Every device is a MediaDeviceInfo object with the following properties:
91
-        - label - the name of the device
92
-        - kind - "audioinput", "videoinput" or "audiooutput"
93
-        - deviceId - the id of the device
94
-        - groupId - group identifier, two devices have the same group identifier if they belong to the same physical device; for example a monitor with both a built-in camera and microphone
95
-    - ```setAudioOutputDevice(deviceId)``` - sets current audio output device. ```deviceId``` - id of 'audiooutput' device from ```JitsiMeetJS.enumerateDevices()```, '' is for default device.
96
-    - ```getAudioOutputDevice()``` - returns currently used audio output device id, '' stands for default device.
97
-    - ```isDevicePermissionGranted(type)``` - returns a Promise which resolves to true if user granted permission to media devices. ```type``` - 'audio', 'video' or ```undefined```. In case of ```undefined``` will check if both audio and video permissions were granted.
98
-    - ```addEventListener(event, handler)``` - attaches an event handler.
99
-    - ```removeEventListener(event, handler)``` - removes an event handler.
100
-
101
-* ```JitsiMeetJS.events``` - JS object that contains all events used by the API. You will need that JS object when you try to subscribe for connection or conference events.
102
-    We have two event types - connection and conference. You can access the events with the following code ```JitsiMeetJS.events.<event_type>.<event_name>```.
103
-    For example if you want to use the conference event that is fired when somebody leave conference you can use the following code - ```JitsiMeetJS.events.conference.USER_LEFT```.
62
+* `JitsiMeetJS.createLocalTracks(options, firePermissionPromptIsShownEvent)` - Creates the media tracks and returns them trough `Promise` object. If rejected, passes `JitsiTrackError` instance to catch block.
63
+    - `options` - JS object with configuration options for the local media tracks. You can change the following properties there:
64
+        1. `devices` - array with the devices - "desktop", "video" and "audio" that will be passed to GUM. If that property is not set GUM will try to get all available devices.
65
+        2. `resolution` - the prefered resolution for the local video.
66
+        3. `constraints` - the prefered encoding properties for the created track (replaces 'resolution' in newer releases of browsers)
67
+        4. `cameraDeviceId` - the deviceID for the video device that is going to be used
68
+        5. `micDeviceId` - the deviceID for the audio device that is going to be used
69
+        6. `minFps` - the minimum frame rate for the video stream (passed to GUM)
70
+        7. `maxFps` - the maximum frame rate for the video stream (passed to GUM)
71
+        8. `desktopSharingFrameRate`
72
+           - `min` - Minimum fps
73
+           - `max` - Maximum fps
74
+        9. `desktopSharingSourceDevice` - The device id or label for a video input source that should be used for screensharing.
75
+        10. `facingMode` - facing mode for a camera (possible values - 'user', 'environment')
76
+    - firePermissionPromptIsShownEvent - optional boolean parameter. If set to `true`, `JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN` will be fired when browser shows gUM permission prompt.
77
+
78
+* `JitsiMeetJS.createTrackVADEmitter(localAudioDeviceId, sampleRate, vadProcessor)` - Creates a TrackVADEmitter service that connects an audio track to a VAD (voice activity detection) processor in order to obtain VAD scores for individual PCM audio samples.
79
+    - `localAudioDeviceId` - The target local audio device.
80
+    - `sampleRate` - Sample rate at which the emitter will operate. Possible values  256, 512, 1024, 4096, 8192, 16384. Passing other values will default to closes neighbor, i.e. Providing a value of 4096 means that the emitter will process bundles of 4096 PCM samples at a time, higher values mean longer calls, lowers values mean more calls but shorter.
81
+    - `vadProcessor` - VAD Processors that does the actual compute on a PCM sample.The processor needs to implement the following functions:
82
+        - `getSampleLength()` - Returns the sample size accepted by calculateAudioFrameVAD.
83
+        - `getRequiredPCMFrequency()` - Returns the PCM frequency at which the processor operates .i.e. (16KHz, 44.1 KHz etc.)
84
+        - `calculateAudioFrameVAD(pcmSample)` - Process a 32 float pcm sample of getSampleLength size.
85
+* `JitsiMeetJS.enumerateDevices(callback)` - __DEPRECATED__. Use `JitsiMeetJS.mediaDevices.enumerateDevices(callback)` instead.
86
+* `JitsiMeetJS.isDeviceChangeAvailable(deviceType)` - __DEPRECATED__. Use `JitsiMeetJS.mediaDevices.isDeviceChangeAvailable(deviceType)` instead.
87
+* `JitsiMeetJS.isDesktopSharingEnabled()` - returns true if desktop sharing is supported and false otherwise. NOTE: that method can be used after `JitsiMeetJS.init(options)` is completed otherwise the result will be always null.
88
+* `JitsiMeetJS.getActiveAudioDevice()` - goes through all audio devices on the system and returns information about one that is active, i.e. has audio signal. Returns a Promise resolving to an Object with the following structure:
89
+    - `deviceId` - string containing the device ID of the audio track found as active.
90
+    - `deviceLabel` - string containing the label of the audio device.
91
+* `JitsiMeetJS.getGlobalOnErrorHandler()` - returns function that can be used to be attached to window.onerror and if options.enableWindowOnErrorHandler is enabled returns the function used by the lib. (function(message, source, lineno, colno, error)).
92
+
93
+* `JitsiMeetJS.mediaDevices` - JS object that contains methods for interaction with media devices. Following methods are available:
94
+    - `isDeviceListAvailable()` - returns true if retrieving the device list is supported and false - otherwise
95
+    - `isDeviceChangeAvailable(deviceType)` - returns true if changing the input (camera / microphone) or output (audio) device is supported and false if not. `deviceType` is a type of device to change. Undefined or 'input' stands for input devices, 'output' - for audio output devices.
96
+    - `enumerateDevices(callback)` - returns list of the available devices as a parameter to the callback function. Every device is a MediaDeviceInfo object with the following properties:
97
+        - `label` - the name of the device
98
+        - `kind` - "audioinput", "videoinput" or "audiooutput"
99
+        - `deviceId` - the id of the device
100
+        - `groupId` - group identifier, two devices have the same group identifier if they belong to the same physical device; for example a monitor with both a built-in camera and microphone
101
+    - `setAudioOutputDevice(deviceId)` - sets current audio output device. `deviceId` - id of 'audiooutput' device from `JitsiMeetJS.enumerateDevices()`, '' is for default device.
102
+    - `getAudioOutputDevice()` - returns currently used audio output device id, '' stands for default device.
103
+    - `isDevicePermissionGranted(type)` - returns a Promise which resolves to true if user granted permission to media devices. `type` - 'audio', 'video' or `undefined`. In case of `undefined` will check if both audio and video permissions were granted.
104
+    - `addEventListener(event, handler)` - attaches an event handler.
105
+    - `removeEventListener(event, handler)` - removes an event handler.
106
+
107
+* `JitsiMeetJS.events` - JS object that contains all events used by the API. You will need that JS object when you try to subscribe for connection or conference events.
108
+    We have two event types - connection and conference. You can access the events with the following code `JitsiMeetJS.events.<event_type>.<event_name>`.
109
+    For example if you want to use the conference event that is fired when somebody leave conference you can use the following code - `JitsiMeetJS.events.conference.USER_LEFT`.
104 110
     We support the following events:
105
-    1. conference
106
-        - TRACK_ADDED - stream received. (parameters - JitsiTrack)
107
-        - TRACK_REMOVED - stream removed. (parameters - JitsiTrack)
108
-        - TRACK_MUTE_CHANGED - JitsiTrack was muted or unmuted. (parameters - JitsiTrack)
109
-        - TRACK_AUDIO_LEVEL_CHANGED - audio level of JitsiTrack has changed. (parameters - participantId(string), audioLevel(number))
110
-        - DOMINANT_SPEAKER_CHANGED - the dominant speaker is changed. (parameters - id(string))
111
-        - USER_JOINED - new user joined a conference. (parameters - id(string), user(JitsiParticipant))
112
-        - USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))
113
-        - MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string), ts(number))
114
-        - DISPLAY_NAME_CHANGED - user has changed his display name. (parameters - id(string), displayName(string))
115
-        - SUBJECT_CHANGED - notifies that subject of the conference has changed (parameters - subject(string))
116
-        - LAST_N_ENDPOINTS_CHANGED - last n set was changed (parameters - leavingEndpointIds(array) ids of users leaving lastN, enteringEndpointIds(array) ids of users entering lastN)
117
-        - CONFERENCE_JOINED - notifies the local user that he joined the conference successfully. (no parameters)
118
-        - CONFERENCE_LEFT - notifies the local user that he left the conference successfully. (no parameters)
119
-        - DTMF_SUPPORT_CHANGED - notifies if at least one user supports DTMF. (parameters - supports(boolean))
120
-        - USER_ROLE_CHANGED - notifies that role of some user changed. (parameters - id(string), role(string))
121
-        - USER_STATUS_CHANGED - notifies that status of some user changed. (parameters - id(string), status(string))
122
-        - CONFERENCE_FAILED - notifies that user failed to join the conference. (parameters - errorCode(JitsiMeetJS.errors.conference))
123
-        - CONFERENCE_ERROR - notifies that error occurred. (parameters - errorCode(JitsiMeetJS.errors.conference))
124
-        - KICKED - notifies that user has been kicked from the conference.
125
-        - START_MUTED_POLICY_CHANGED - notifies that all new participants will join with muted audio/video stream (parameters - JS object with 2 properties - audio(boolean), video(boolean))
126
-        - STARTED_MUTED - notifies that the local user has started muted
127
-        - CONNECTION_STATS - __DEPRECATED__. Use ```JitsiMeetJS.connectionQuality.LOCAL_STATS_UPDATED``` instead.
128
-        - BEFORE_STATISTICS_DISPOSED - fired just before the statistics module is disposed and it's the last chance to submit some logs to the statistics service, before it gets disconnected
129
-        - AUTH_STATUS_CHANGED - notifies that authentication is enabled or disabled, or local user authenticated (logged in). (parameters - isAuthEnabled(boolean), authIdentity(string))
130
-        - ENDPOINT_MESSAGE_RECEIVED - notifies that a new message
111
+    1. `conference`
112
+        - `TRACK_ADDED` - stream received. (parameters - JitsiTrack)
113
+        - `TRACK_REMOVED` - stream removed. (parameters - JitsiTrack)
114
+        - `TRACK_MUTE_CHANGED` - JitsiTrack was muted or unmuted. (parameters - JitsiTrack)
115
+        - `TRACK_AUDIO_LEVEL_CHANGED` - audio level of JitsiTrack has changed. (parameters - participantId(string), audioLevel(number))
116
+        - `DOMINANT_SPEAKER_CHANGED` - the dominant speaker is changed. (parameters - id(string))
117
+        - `USER_JOINED` - new user joined a conference. (parameters - id(string), user(JitsiParticipant))
118
+        - `USER_LEFT` - a participant left conference. (parameters - id(string), user(JitsiParticipant))
119
+        - `MESSAGE_RECEIVED` - new text message received. (parameters - id(string), text(string), ts(number))
120
+        - `DISPLAY_NAME_CHANGED` - user has changed his display name. (parameters - id(string), displayName(string))
121
+        - `SUBJECT_CHANGED` - notifies that subject of the conference has changed (parameters - subject(string))
122
+        - `LAST_N_ENDPOINTS_CHANGED` - last n set was changed (parameters - leavingEndpointIds(array) ids of users leaving lastN, enteringEndpointIds(array) ids of users entering lastN)
123
+        - `CONFERENCE_JOINED` - notifies the local user that he joined the conference successfully. (no parameters)
124
+        - `CONFERENCE_LEFT` - notifies the local user that he left the conference successfully. (no parameters)
125
+        - `DTMF_SUPPORT_CHANGED` - notifies if at least one user supports DTMF. (parameters - supports(boolean))
126
+        - `USER_ROLE_CHANGED` - notifies that role of some user changed. (parameters - id(string), role(string))
127
+        - `USER_STATUS_CHANGED` - notifies that status of some user changed. (parameters - id(string), status(string))
128
+        - `CONFERENCE_FAILED` - notifies that user failed to join the conference. (parameters - errorCode(JitsiMeetJS.errors.conference))
129
+        - `CONFERENCE_ERROR` - notifies that error occurred. (parameters - errorCode(JitsiMeetJS.errors.conference))
130
+        - `KICKED` - notifies that user has been kicked from the conference.
131
+        - `START_MUTED_POLICY_CHANGED` - notifies that all new participants will join with muted audio/video stream (parameters - JS object with 2 properties - audio(boolean), video(boolean))
132
+        - `STARTED_MUTED` - notifies that the local user has started muted
133
+        - `CONNECTION_STATS` - __DEPRECATED__. Use `JitsiMeetJS.connectionQuality.LOCAL_STATS_UPDATED` instead.
134
+        - `BEFORE_STATISTICS_DISPOSED` - fired just before the statistics module is disposed and it's the last chance to submit some logs to the statistics service, before it gets disconnected
135
+        - `AUTH_STATUS_CHANGED` - notifies that authentication is enabled or disabled, or local user authenticated (logged in). (parameters - isAuthEnabled(boolean), authIdentity(string))
136
+        - `ENDPOINT_MESSAGE_RECEIVED` - notifies that a new message
131 137
         from another participant is received on a data channel.
132
-        - TALK_WHILE_MUTED - notifies that a local user is talking while having the microphone muted.
133
-        - NO_AUDIO_INPUT - notifies that the current selected input device has no signal.
134
-        - AUDIO_INPUT_STATE_CHANGE - notifies that the current conference audio input switched between audio input states i.e. with or without audio input.
135
-        - NOISY_MIC - notifies that the current microphone used by the conference is noisy.
136
-
137
-    2. connection
138
-        - CONNECTION_FAILED - indicates that the server connection failed.
139
-        - CONNECTION_ESTABLISHED - indicates that we have successfully established server connection.
140
-        - CONNECTION_DISCONNECTED - indicates that we are disconnected.
141
-        - WRONG_STATE - indicates that the user has performed action that can't be executed because the connection is in wrong state.
142
-
143
-    3. detection
144
-        - VAD_SCORE_PUBLISHED - event generated by a TackVADEmitter when it computed a VAD score for an audio PCM sample.
145
-
146
-    3. track
147
-        - LOCAL_TRACK_STOPPED - indicates that a local track was stopped. This
148
-        event can be fired when ```dispose()``` method is called or for other reasons.
149
-        - TRACK_AUDIO_OUTPUT_CHANGED - indicates that audio output device for track was changed (parameters - deviceId (string) - new audio output device ID).
150
-
151
-    4. mediaDevices
152
-        - DEVICE_LIST_CHANGED - indicates that list of currently connected devices has changed (parameters - devices(MediaDeviceInfo[])).
153
-        - PERMISSION_PROMPT_IS_SHOWN - Indicates that the environment is currently showing permission prompt to access camera and/or microphone (parameters - environmentType ('chrome'|'opera'|'firefox'|'safari'|'nwjs'|'react-native'|'android').
154
-
155
-    5. connectionQuality
156
-        - LOCAL_STATS_UPDATED - New local connection statistics are received. (parameters - stats(object))
157
-        - REMOTE_STATS_UPDATED - New remote connection statistics are received. (parameters - id(string), stats(object))
158
-
159
-* ```JitsiMeetJS.errors``` - JS object that contains all errors used by the API. You can use that object to check the reported errors from the API
160
-    We have three error types - connection, conference and track. You can access the events with the following code ```JitsiMeetJS.errors.<error_type>.<error_name>```.
161
-    For example if you want to use the conference event that is fired when somebody leave conference you can use the following code - ```JitsiMeetJS.errors.conference.PASSWORD_REQUIRED```.
138
+        - `TALK_WHILE_MUTED` - notifies that a local user is talking while having the microphone muted.
139
+        - `NO_AUDIO_INPUT` - notifies that the current selected input device has no signal.
140
+        - `AUDIO_INPUT_STATE_CHANGE` - notifies that the current conference audio input switched between audio input states i.e. with or without audio input.
141
+        - `NOISY_MIC` - notifies that the current microphone used by the conference is noisy.
142
+
143
+    2. `connection`
144
+        - `CONNECTION_FAILED` - indicates that the server connection failed.
145
+        - `CONNECTION_ESTABLISHED` - indicates that we have successfully established server connection.
146
+        - `CONNECTION_DISCONNECTED` - indicates that we are disconnected.
147
+        - `WRONG_STATE` - indicates that the user has performed action that can't be executed because the connection is in wrong state.
148
+
149
+    3. `detection`
150
+        - `VAD_SCORE_PUBLISHED` - event generated by a TackVADEmitter when it computed a VAD score for an audio PCM sample.
151
+
152
+    4. `track`
153
+        - `LOCAL_TRACK_STOPPED` - indicates that a local track was stopped. This
154
+        event can be fired when `dispose()` method is called or for other reasons.
155
+        - `TRACK_AUDIO_OUTPUT_CHANGED` - indicates that audio output device for track was changed (parameters - deviceId (string) - new audio output device ID).
156
+
157
+    5. `mediaDevices`
158
+        - `DEVICE_LIST_CHANGED` - indicates that list of currently connected devices has changed (parameters - devices(MediaDeviceInfo[])).
159
+        - `PERMISSION_PROMPT_IS_SHOWN` - Indicates that the environment is currently showing permission prompt to access camera and/or microphone (parameters - environmentType ('chrome'|'opera'|'firefox'|'safari'|'nwjs'|'react-native'|'android').
160
+
161
+    6. `connectionQuality`
162
+        - `LOCAL_STATS_UPDATED` - New local connection statistics are received. (parameters - stats(object))
163
+        - `REMOTE_STATS_UPDATED` - New remote connection statistics are received. (parameters - id(string), stats(object))
164
+
165
+* `JitsiMeetJS.errors` - JS object that contains all errors used by the API. You can use that object to check the reported errors from the API
166
+    We have three error types - connection, conference and track. You can access the events with the following code `JitsiMeetJS.errors.<error_type>.<error_name>`.
167
+    For example if you want to use the conference event that is fired when somebody leave conference you can use the following code - `JitsiMeetJS.errors.conference.PASSWORD_REQUIRED`.
162 168
     We support the following errors:
163
-    1. conference
164
-        - CONNECTION_ERROR - the connection with the conference is lost.
165
-        - SETUP_FAILED - conference setup failed
166
-        - AUTHENTICATION_REQUIRED - user must be authenticated to create this conference
167
-        - PASSWORD_REQUIRED - that error can be passed when the connection to the conference failed. You should try to join the conference with password.
168
-        - PASSWORD_NOT_SUPPORTED - indicates that conference cannot be locked
169
-        - VIDEOBRIDGE_NOT_AVAILABLE - video bridge issues.
170
-        - RESERVATION_ERROR - error in reservation system
171
-        - GRACEFUL_SHUTDOWN - graceful shutdown
172
-        - JINGLE_FATAL_ERROR - error in jingle (the orriginal error is attached as parameter.)
173
-        - CONFERENCE_DESTROYED - conference has been destroyed
174
-        - CHAT_ERROR - chat error happened
175
-        - FOCUS_DISCONNECTED - focus error happened
176
-        - FOCUS_DISCONNECTED - focus left the conference
177
-        - CONFERENCE_MAX_USERS - The maximum users limit has been reached
178
-    2. connection
179
-        - CONNECTION_DROPPED_ERROR - indicates that the connection was dropped with an error which was most likely caused by some networking issues.
180
-        - PASSWORD_REQUIRED - passed when the connection to the server failed. You should try to authenticate with password.
181
-        - SERVER_ERROR - indicates too many 5XX errors were received from the server.
182
-        - OTHER_ERROR - all other errors
183
-    3. track
184
-        - GENERAL - generic getUserMedia-related error.
185
-        - UNSUPPORTED_RESOLUTION - getUserMedia-related error, indicates that requested video resolution is not supported by camera.
186
-        - PERMISSION_DENIED - getUserMedia-related error, indicates that user denied permission to share requested device.
187
-        - NOT_FOUND - getUserMedia-related error, indicates that requested device was not found.
188
-        - CONSTRAINT_FAILED - getUserMedia-related error, indicates that some of requested constraints in getUserMedia call were not satisfied.
189
-        - TRACK_IS_DISPOSED - an error which indicates that track has been already disposed and cannot be longer used.
190
-        - TRACK_NO_STREAM_FOUND - an error which indicates that track has no MediaStream associated.
191
-        - SCREENSHARING_GENERIC_ERROR - generic error for screensharing.
192
-        - SCREENSHARING_USER_CANCELED - an error which indicates that user canceled screen sharing window selection dialog.
193
-
194
-* ```JitsiMeetJS.errorTypes``` - constructors for Error instances that can be produced by library. Are useful for checks like ```error instanceof JitsiMeetJS.errorTypes.JitsiTrackError```. Following Errors are available:
195
-    1. ```JitsiTrackError``` - Error that happened to a JitsiTrack.
196
-
197
-* ```JitsiMeetJS.logLevels``` - object with the log levels:
198
-    1. TRACE
199
-    2. DEBUG
200
-    3. INFO
201
-    4. LOG
202
-    5. WARN
203
-    6. ERROR
169
+    1. `conference`
170
+        - `CONNECTION_ERROR` - the connection with the conference is lost.
171
+        - `SETUP_FAILED` - conference setup failed
172
+        - `AUTHENTICATION_REQUIRED` - user must be authenticated to create this conference
173
+        - `PASSWORD_REQUIRED` - that error can be passed when the connection to the conference failed. You should try to join the conference with password.
174
+        - `PASSWORD_NOT_SUPPORTED` - indicates that conference cannot be locked
175
+        - `VIDEOBRIDGE_NOT_AVAILABLE` - video bridge issues.
176
+        - `RESERVATION_ERROR` - error in reservation system
177
+        - `GRACEFUL_SHUTDOWN` - graceful shutdown
178
+        - `JINGLE_FATAL_ERROR` - error in jingle (the orriginal error is attached as parameter.)
179
+        - `CONFERENCE_DESTROYED` - conference has been destroyed
180
+        - `CHAT_ERROR` - chat error happened
181
+        - `FOCUS_DISCONNECTED` - focus error happened
182
+        - `FOCUS_DISCONNECTED` - focus left the conference
183
+        - `CONFERENCE_MAX_USERS` - The maximum users limit has been reached
184
+    2. `connection`
185
+        - `CONNECTION_DROPPED_ERROR` - indicates that the connection was dropped with an error which was most likely caused by some networking issues.
186
+        - `PASSWORD_REQUIRED` - passed when the connection to the server failed. You should try to authenticate with password.
187
+        - `SERVER_ERROR` - indicates too many 5XX errors were received from the server.
188
+        - `OTHER_ERROR` - all other errors
189
+    3. `track`
190
+        - `GENERAL` - generic getUserMedia-related error.
191
+        - `UNSUPPORTED_RESOLUTION` - getUserMedia-related error, indicates that requested video resolution is not supported by camera.
192
+        - `PERMISSION_DENIED` - getUserMedia-related error, indicates that user denied permission to share requested device.
193
+        - `NOT_FOUND` - getUserMedia-related error, indicates that requested device was not found.
194
+        - `CONSTRAINT_FAILED` - getUserMedia-related error, indicates that some of requested constraints in getUserMedia call were not satisfied.
195
+        - `TRACK_IS_DISPOSED` - an error which indicates that track has been already disposed and cannot be longer used.
196
+        - `TRACK_NO_STREAM_FOUND` - an error which indicates that track has no MediaStream associated.
197
+        - `SCREENSHARING_GENERIC_ERROR` - generic error for screensharing.
198
+        - `SCREENSHARING_USER_CANCELED` - an error which indicates that user canceled screen sharing window selection dialog.
199
+
200
+* `JitsiMeetJS.errorTypes` - constructors for Error instances that can be produced by library. Are useful for checks like `error instanceof JitsiMeetJS.errorTypes.JitsiTrackError`. Following Errors are available:
201
+    1. `JitsiTrackError` - Error that happened to a JitsiTrack.
202
+
203
+* `JitsiMeetJS.logLevels` - object with the log levels:
204
+    1. `TRACE`
205
+    2. `DEBUG`
206
+    3. `INFO`
207
+    4. `LOG`
208
+    5. `WARN`
209
+    6. `ERROR`
204 210
 
205 211
 JitsiConnection
206 212
 ------------
207
-This objects represents the server connection. You can create new ```JitsiConnection``` object with the constructor ```JitsiMeetJS.JitsiConnection```. ```JitsiConnection``` has the following methods:
208
-
209
-
210
-1. ```JitsiConnection(appID, token, options)``` - constructor. Creates the conference object.
211
-
212
-    - appID - identification for the provider of Jitsi Meet video conferencing services. **NOTE: not implemented yet. You can safely pass ```null```**
213
-    - token - secret generated by the provider of Jitsi Meet video conferencing services. The token will be send to the provider from the Jitsi Meet server deployment for authorization of the current client.
214
-    - options - JS object with configuration options for the server connection. You can change the following properties there:
215
-        1. serviceUrl - XMPP service URL. For  example 'wss://server.com/xmpp-websocket' for Websocket or '//server.com/http-bind' for BOSH.
216
-        2. bosh - DEPRECATED, use serviceUrl to specify either BOSH or Websocket URL.
217
-        3. hosts - JS Object
218
-            - domain
219
-            - muc
220
-            - anonymousdomain
221
-        4. enableLipSync - (optional) boolean property which enables the lipsync feature. Currently works only in Chrome and is disabled by default.
222
-
223
-2. connect(options) - establish server connection
224
-    - options - JS Object with ```id``` and ```password``` properties.
225
-
226
-3. disconnect() - destroys the server connection
227
-
228
-4. initJitsiConference(name, options) - creates new ```JitsiConference``` object.
229
-    - name - the name of the conference
230
-    - options - JS object with configuration options for the conference. You can change the following properties there:
231
-        - openBridgeChannel - Enables/disables bridge channel. Values can be "datachannel", "websocket", true (treat it as "datachannel"), undefined (treat it as "datachannel") and false (don't open any channel). **NOTE: we recommend to set that option to true**
232
-        - recordingType - the type of recording to be used
233
-        - callStatsID - callstats credentials
234
-        - callStatsSecret - callstats credentials
235
-        - enableTalkWhileMuted - boolean property. Enables/disables talk while muted detection, by default the value is false/disabled.
236
-        - ignoreStartMuted - ignores start muted events coming from jicofo.
237
-        - startSilent - enables silent mode, will mark audio as inactive will not send/receive audio
238
-        - confID - Used for statistics to identify conference, if tenants are supported will contain tenant and the non lower case variant for the room name.
239
-        - siteID - (optional) Used for statistics to identify the site where the user is coming from, if tenants are supported it will contain a unique identifier for that tenant. If not provided, the value will be infered from confID
240
-        - statisticsId - The id to be used as stats instead of default callStatsUsername.
241
-        - statisticsDisplayName - The display name to be used for stats, used for callstats.
213
+This objects represents the server connection. You can create new `JitsiConnection` object with the constructor `JitsiMeetJS.JitsiConnection`. `JitsiConnection` has the following methods:
214
+
215
+
216
+1. `JitsiConnection(appID, token, options)` - constructor. Creates the conference object.
217
+
218
+    - `appID` - identification for the provider of Jitsi Meet video conferencing services. **NOTE: not implemented yet. You can safely pass `null`**
219
+    - `token` - secret generated by the provider of Jitsi Meet video conferencing services. The token will be send to the provider from the Jitsi Meet server deployment for authorization of the current client.
220
+    - `options` - JS object with configuration options for the server connection. You can change the following properties there:
221
+        1. `serviceUrl` - XMPP service URL. For  example 'wss://server.com/xmpp-websocket' for Websocket or '//server.com/http-bind' for BOSH.
222
+        2. `bosh` - DEPRECATED, use serviceUrl to specify either BOSH or Websocket URL.
223
+        3. `hosts` - JS Object
224
+            - `domain`
225
+            - `muc`
226
+            - `anonymousdomain`
227
+        4. `enableLipSync` - (optional) boolean property which enables the lipsync feature. Currently works only in Chrome and is disabled by default.
228
+        5. `clientNode` - The name of client node advertised in XEP-0115 'c' stanza
229
+
230
+2. `connect(options)` - establish server connection
231
+    - `options` - JS Object with `id` and `password` properties.
232
+
233
+3. `disconnect()` - destroys the server connection
234
+
235
+4. `initJitsiConference(name, options)` - creates new `JitsiConference` object.
236
+    - `name` - the name of the conference
237
+    - `options` - JS object with configuration options for the conference. You can change the following properties there:
238
+        - `openBridgeChannel` - Enables/disables bridge channel. Values can be "datachannel", "websocket", true (treat it as "datachannel"), undefined (treat it as "datachannel") and false (don't open any channel). **NOTE: we recommend to set that option to true**
239
+        - `recordingType` - the type of recording to be used
240
+        - `callStatsID` - callstats credentials
241
+        - `callStatsSecret` - callstats credentials
242
+        - `enableTalkWhileMuted` - boolean property. Enables/disables talk while muted detection, by default the value is false/disabled.
243
+        - `ignoreStartMuted` - ignores start muted events coming from jicofo.
244
+        - `startSilent` - enables silent mode, will mark audio as inactive will not send/receive audio
245
+        - `confID` - Used for statistics to identify conference, if tenants are supported will contain tenant and the non lower case variant for the room name.
246
+        - `siteID` - (optional) Used for statistics to identify the site where the user is coming from, if tenants are supported it will contain a unique identifier for that tenant. If not provided, the value will be infered from confID
247
+        - `statisticsId` - The id to be used as stats instead of default callStatsUsername.
248
+        - `statisticsDisplayName` - The display name to be used for stats, used for callstats.
249
+        - `focusUserJid` - The real JID of focus participant - can be overridden here
250
+        - `enableNoAudioDetection`
251
+        - `enableNoisyMicDetection`
252
+        - `enableRemb`
253
+        - `enableTcc`
254
+        - `useRoomAsSharedDocumentName`
255
+        - `channelLastN`
256
+        - `startBitrate`
257
+        - `stereo`
258
+        - `forceJVB121Ratio` - "Math.random() < forceJVB121Ratio" will determine whether a 2 people conference should be moved to the JVB instead of P2P. The decision is made on the responder side, after ICE succeeds on the P2P connection.
259
+        - `hiddenDomain`
260
+        - `startAudioMuted`
261
+        - `startVideoMuted`
262
+        - `enableLayerSuspension` - if set to 'true', we will cap the video send bitrate when we are told we have not been selected by any endpoints (and therefore the non-thumbnail streams are not in use).
263
+        - `deploymentInfo`
264
+            - `shard`
265
+            - `userRegion`
266
+        - `p2p` - Peer to peer related options
267
+            - `enabled` - enables or disable peer-to-peer connection, if disabled all media will be routed through the Jitsi Videobridge.
268
+            - `stunServers` - list of STUN servers e.g. `{ urls: 'stun:meet-jit-si-turnrelay.jitsi.net:443' }`
269
+            - `backToP2PDelay` - a delay given in seconds, before the conference switches back to P2P, after the 3rd participant has left the room.
270
+            - `disabledCodec` - the mime type of the code that should not be negotiated on the peerconnection.
271
+            - `preferredCodec` the mime type of the codec that needs to be made the preferred codec for the connection.
272
+            - `disableH264` - __DEPRECATED__. Use `disabledCodec` instead.
273
+            - `preferH264` - __DEPRECATED__. Use `preferredCodec` instead.
274
+        - `rttMonitor`
275
+            - `enabled`
276
+            - `initialDelay`
277
+            - `getStatsInterval`
278
+            - `analyticsInterval`
279
+            - `stunServers`
280
+        - `e2eping`
281
+            - `pingInterval`
282
+        - `abTesting` - A/B testing related options
283
+            - `enableSuspendVideoTest`
284
+        - `testing`
285
+            - `capScreenshareBitrate`
286
+            - `p2pTestMode`
287
+            - `octo`
288
+                - `probability`
242 289
 
243 290
         **NOTE: if 4 and 5 are set the library is going to send events to callstats. Otherwise the callstats integration will be disabled.**
244 291
 
245
-5. addEventListener(event, listener) - Subscribes the passed listener to the event.
246
-    - event - one of the events from ```JitsiMeetJS.events.connection``` object.
247
-    - listener - handler for the event.
292
+5. `addEventListener(event, listener)` - Subscribes the passed listener to the event.
293
+    - `event` - one of the events from `JitsiMeetJS.events.connection` object.
294
+    - `listener` - handler for the event.
248 295
 
249
-6. removeEventListener(event, listener) - Removes event listener.
250
-    - event - the event
251
-    - listener - the listener that will be removed.
296
+6. `removeEventListener(event, listener)` - Removes event listener.
297
+    - `event` - the event
298
+    - `listener` - the listener that will be removed.
252 299
 
253
-7. addFeature - Adds new feature to the list of supported features for the local participant
254
-    - feature - string, the name of the feature
255
-    - submit - boolean, default false, if true - the new list of features will be immediately submitted to the others.
300
+7. `addFeature` - Adds new feature to the list of supported features for the local participant
301
+    - `feature` - string, the name of the feature
302
+    - `submit` - boolean, default false, if true - the new list of features will be immediately submitted to the others.
256 303
 
257
-8. removeFeature - Removes a feature from the list of supported features for the local participant
258
-    - feature - string, the name of the feature
259
-    - submit - boolean, default false, if true - the new list of features will be immediately submitted to the others.
304
+8. `removeFeature` - Removes a feature from the list of supported features for the local participant
305
+    - `feature` - string, the name of the feature
306
+    - `submit` - boolean, default false, if true - the new list of features will be immediately submitted to the others.
260 307
 
261 308
 JitsiConference
262 309
 -----------
263 310
 The object represents a conference. We have the following methods to control the conference:
264 311
 
265 312
 
266
-1. join(password) - Joins the conference
313
+1. `join(password)` - Joins the conference
267 314
     - password - string of the password. This parameter is not mandatory.
268 315
 
269
-2. leave() - leaves the conference. Returns Promise.
316
+2. `leave()` - leaves the conference. Returns Promise.
270 317
 
271
-3. myUserId() - get local user ID.
318
+3. `myUserId()` - get local user ID.
272 319
 
273
-4. getLocalTracks() - Returns array with JitsiTrack objects for the local streams.
320
+4. `getLocalTracks()` - Returns array with JitsiTrack objects for the local streams.
274 321
 
275
-5. addEventListener(event, listener) - Subscribes the passed listener to the event.
276
-    - event - one of the events from ```JitsiMeetJS.events.conference``` object.
277
-    - listener - handler for the event.
322
+5. `addEventListener(event, listener)` - Subscribes the passed listener to the event.
323
+    - `event` - one of the events from `JitsiMeetJS.events.conference` object.
324
+    - `listener` - handler for the event.
278 325
 
279
-6. removeEventListener(event, listener) - Removes event listener.
280
-    - event - the event
281
-    - listener - the listener that will be removed.
326
+6. `removeEventListener(event, listener)` - Removes event listener.
327
+    - `event` - the event
328
+    - `listener` - the listener that will be removed.
282 329
 
283
-7. on(event, listener) - alias for addEventListener
330
+7. `on(event, listener)` - alias for addEventListener
284 331
 
285
-8. off(event, listener) - alias for removeEventListener
332
+8. `off(event, listener)` - alias for removeEventListener
286 333
 
287
-9. sendTextMessage(text) - sends the given string to other participants in the conference.
334
+9. `sendTextMessage(text)` - sends the given string to other participants in the conference.
288 335
 
289
-10. setDisplayName(name) - changes the display name of the local participant.
290
-    - name - the new display name
336
+10. `setDisplayName(name)` - changes the display name of the local participant.
337
+    - `name` - the new display name
291 338
 
292
-11. selectParticipant(participantId) - Elects the participant with the given id to be the selected participant in order to receive higher video quality (if simulcast is enabled).
293
-    - participantId - the identifier of the participant
339
+11. `selectParticipant(participantId)` - Elects the participant with the given id to be the selected participant in order to receive higher video quality (if simulcast is enabled).
340
+    - `participantId` - the identifier of the participant
294 341
 
295 342
 Throws NetworkError or InvalidStateError or Error if the operation fails.
296 343
 
297 344
 
298
-12. sendCommand(name, values) - sends user defined system command to the other participants
299
-    - name - the name of the command.
300
-    - values - JS object. The object has the following structure:
345
+12. `sendCommand(name, values)` - sends user defined system command to the other participants
346
+    - `name` - the name of the command.
347
+    - `values` - JS object. The object has the following structure:
301 348
 
302 349
 
303
-        ```
350
+        ```javascript
304 351
             {
305 352
 
306 353
 
307 354
                 value: the_value_of_the_command,
308 355
 
309 356
 
310
-                attributes: {},// map with keys the name of the attribute and values - the values of the attributes.
357
+                attributes: {}, // map with keys the name of the attribute and values - the values of the attributes.
311 358
 
312 359
 
313 360
                 children: [] // array with JS object with the same structure.
@@ -318,158 +365,158 @@ Throws NetworkError or InvalidStateError or Error if the operation fails.
318 365
     NOTE: When you use that method the passed object will be added in every system message that is sent to the other participants. It might be sent more than once.
319 366
 
320 367
 
321
-13. sendCommandOnce(name, values) - Sends only one time a user defined system command to the other participants
368
+13. `sendCommandOnce(name, values)` - Sends only one time a user defined system command to the other participants
322 369
 
323 370
 
324
-14. removeCommand(name) - removes a command for the list of the commands that are sent to the ther participants
325
-    - name - the name of the command
371
+14. `removeCommand(name)` - removes a command for the list of the commands that are sent to the ther participants
372
+    - `name` - the name of the command
326 373
 
327
-15. addCommandListener(command, handler) - adds listener
328
-    - command - string for the name of the command
329
-    - handler(values) - the listener that will be called when a command is received from another participant.
374
+15. `addCommandListener(command, handler)` - adds listener
375
+    - `command` - string for the name of the command
376
+    - `handler(values)` - the listener that will be called when a command is received from another participant.
330 377
 
331
-16. removeCommandListener(command) - removes the listeners for the specified command
332
-    - command - the name of the command
378
+16. `removeCommandListener(command)` - removes the listeners for the specified command
379
+    - `command` - the name of the command
333 380
 
334
-17. addTrack(track) - Adds JitsiLocalTrack object to the conference. Throws an error if adding second video stream. Returns Promise.
335
-    - track - the JitsiLocalTrack
381
+17. `addTrack(track)` - Adds `JitsiLocalTrack` object to the conference. Throws an error if adding second video stream. Returns Promise.
382
+    - `track` - the `JitsiLocalTrack`
336 383
 
337
-18. removeTrack(track) - Removes JitsiLocalTrack object to the conference. Returns Promise.
338
-    - track - the JitsiLocalTrack
384
+18. `removeTrack(track)` - Removes `JitsiLocalTrack` object to the conference. Returns Promise.
385
+    - `track` - the `JitsiLocalTrack`
339 386
 
340
-19. isDTMFSupported() - Check if at least one user supports DTMF.
387
+19. `isDTMFSupported()` - Check if at least one user supports DTMF.
341 388
 
342
-20. getRole() - returns string with the local user role ("moderator" or "none")
389
+20. `getRole()` - returns string with the local user role ("moderator" or "none")
343 390
 
344
-21. isModerator() - checks if local user has "moderator" role
391
+21. `isModerator()` - checks if local user has "moderator" role
345 392
 
346
-22. lock(password) - set password for the conference; returns Promise
347
-    - password - string password
393
+22. `lock(password)` - set password for the conference; returns Promise
394
+    - `password` - string password
348 395
 
349 396
     Note: available only for moderator
350 397
 
351
-23. unlock() - unset conference password; returns Promise
398
+23. `unlock()` - unset conference password; returns Promise
352 399
 
353 400
     Note: available only for moderator
354 401
 
355
-24. kickParticipant(id) - Kick participant from the conference
356
-    - id - string participant id
402
+24. `kickParticipant(id)` - Kick participant from the conference
403
+    - `id` - string participant id
357 404
 
358
-25. setStartMutedPolicy(policy) - make all new participants join with muted audio/video
359
-    - policy - JS object with following properties
360
-        - audio - boolean if audio stream should be muted
361
-        - video - boolean if video stream should be muted
405
+25. `setStartMutedPolicy(policy)` - make all new participants join with muted audio/video
406
+    - `policy` - JS object with following properties
407
+        - `audio` - boolean if audio stream should be muted
408
+        - `video` - boolean if video stream should be muted
362 409
 
363 410
     Note: available only for moderator
364 411
 
365
-26. getStartMutedPolicy() - returns the current policy with JS object:
366
-    - policy - JS object with following properties
367
-        - audio - boolean if audio stream should be muted
368
-        - video - boolean if video stream should be muted
412
+26. `getStartMutedPolicy()` - returns the current policy with JS object:
413
+    - `policy` - JS object with following properties
414
+        - `audio` - boolean if audio stream should be muted
415
+        - `video` - boolean if video stream should be muted
369 416
 
370
-27. isStartAudioMuted() - check if audio is muted on join
417
+27. `isStartAudioMuted()` - check if audio is muted on join
371 418
 
372
-28. isStartVideoMuted() - check if video is muted on join
419
+28. `isStartVideoMuted()` - check if video is muted on join
373 420
 
374
-29. sendFeedback(overallFeedback, detailedFeedback) - Sends the given feedback through CallStats if enabled.
375
-    - overallFeedback an integer between 1 and 5 indicating the user feedback
376
-    - detailedFeedback detailed feedback from the user. Not yet used
421
+29. `sendFeedback(overallFeedback, detailedFeedback)` - Sends the given feedback through CallStats if enabled.
422
+    - `overallFeedback` - an integer between 1 and 5 indicating the user feedback
423
+    - `detailedFeedback` - detailed feedback from the user. Not yet used
377 424
 
378
-30. setSubject(subject) - change subject of the conference
379
-    - subject - string new subject
425
+30. `setSubject(subject)` - change subject of the conference
426
+    - `subject` - string new subject
380 427
 
381 428
     Note: available only for moderator
382 429
 
383
-31. sendEndpointMessage(to, payload) - Sends message via the data channels.
384
-    - to - the id of the endpoint that should receive the message. If "" the message will be sent to all participants.
385
-    - payload - JSON object - the payload of the message.
430
+31. `sendEndpointMessage(to, payload)` - Sends message via the data channels.
431
+    - `to` - the id of the endpoint that should receive the message. If "" the message will be sent to all participants.
432
+    - `payload` - JSON object - the payload of the message.
386 433
 
387 434
 Throws NetworkError or InvalidStateError or Error if the operation fails.
388 435
 
389
-32. broadcastEndpointMessage(payload) - Sends broadcast message via the datachannels.
390
-    - payload - JSON object - the payload of the message.
436
+32. `broadcastEndpointMessage(payload)` - Sends broadcast message via the datachannels.
437
+    - `payload` - JSON object - the payload of the message.
391 438
 
392 439
 Throws NetworkError or InvalidStateError or Error if the operation fails.
393 440
 
394
-33. pinParticipant(participantId) - Elects the participant with the given id to be the pinned participant in order to always receive video for this participant (even when last n is enabled).
395
-    - participantId - the identifier of the participant
441
+33. `pinParticipant(participantId)` - Elects the participant with the given id to be the pinned participant in order to always receive video for this participant (even when last n is enabled).
442
+    - `participantId` - the identifier of the participant
396 443
 
397 444
 Throws NetworkError or InvalidStateError or Error if the operation fails.
398 445
 
399
-34. setReceiverVideoConstraint(resolution) - set the desired resolution to get from JVB (180, 360, 720, 1080, etc).
446
+34. `setReceiverVideoConstraint(resolution)` - set the desired resolution to get from JVB (180, 360, 720, 1080, etc).
400 447
     You should use that method if you are using simulcast.
401 448
 
402
-35. setSenderVideoConstraint(resolution) - set the desired resolution to send to JVB or the peer (180, 360, 720).
449
+35. `setSenderVideoConstraint(resolution)` - set the desired resolution to send to JVB or the peer (180, 360, 720).
403 450
 
404
-36. isHidden - checks if local user has joined as a "hidden" user. This is a specialized role used for integrations.
451
+36. `isHidden` - checks if local user has joined as a "hidden" user. This is a specialized role used for integrations.
405 452
 
406 453
 JitsiTrack
407 454
 ======
408 455
 The object represents single track - video or audio. They can be remote tracks ( from the other participants in the call) or local tracks (from the devices of the local participant).
409 456
 We have the following methods for controling the tracks:
410 457
 
411
-1. getType() - returns string with the type of the track( "video" for the video tracks and "audio" for the audio tracks)
458
+1. `getType()` - returns string with the type of the track( "video" for the video tracks and "audio" for the audio tracks)
412 459
 
413 460
 
414
-2. mute() - mutes the track. Returns Promise.
461
+2. `mute()` - mutes the track. Returns Promise.
415 462
 
416 463
    Note: This method is implemented only for the local tracks.
417 464
 
418
-3. unmute() - unmutes the track. Returns Promise.
465
+3. `unmute()` - unmutes the track. Returns Promise.
419 466
 
420 467
    Note: This method is implemented only for the local tracks.
421 468
 
422
-4. isMuted() - check if track is muted
469
+4. `isMuted()` - check if track is muted
423 470
 
424
-5. attach(container) - attaches the track to the given container.
471
+5. `attach(container)` - attaches the track to the given container.
425 472
 
426
-6. detach(container) - removes the track from the container.
473
+6. `detach(container)` - removes the track from the container.
427 474
 
428
-7. dispose() - disposes the track. If the track is added to a conference the track will be removed. Returns Promise.
475
+7. `dispose()` - disposes the track. If the track is added to a conference the track will be removed. Returns Promise.
429 476
 
430 477
    Note: This method is implemented only for the local tracks.
431 478
 
432
-8. getId() - returns unique string for the track.
479
+8. `getId()` - returns unique string for the track.
433 480
 
434
-9. getParticipantId() - returns id(string) of the track owner
481
+9. `getParticipantId()` - returns id(string) of the track owner
435 482
 
436 483
    Note: This method is implemented only for the remote tracks.
437 484
 
438
-10. setAudioOutput(audioOutputDeviceId) - sets new audio output device for track's DOM elements. Video tracks are ignored.
485
+10. `setAudioOutput(audioOutputDeviceId)` - sets new audio output device for track's DOM elements. Video tracks are ignored.
439 486
 
440
-11. getDeviceId() - returns device ID associated with track (for local tracks only)
487
+11. `getDeviceId()` - returns device ID associated with track (for local tracks only)
441 488
 
442
-12. isEnded() - returns true if track is ended
489
+12. `isEnded()` - returns true if track is ended
443 490
 
444
-13. setEffect(effect) - Applies the effect by swapping out the existing MediaStream on the JitsiTrack with the new
491
+13. `setEffect(effect)` - Applies the effect by swapping out the existing MediaStream on the JitsiTrack with the new
445 492
 
446 493
     MediaStream which has the desired effect. "undefined" is passed to this function for removing the effect and for
447 494
 
448
-    restoring the original MediaStream on the JitsiTrack.
495
+    restoring the original MediaStream on the `JitsiTrack`.
449 496
 
450 497
     The following methods have to be defined for the effect instance.
451 498
 
452
-    startEffect() - Starts the effect and returns a new MediaStream that is to be swapped with the existing one.
499
+    `startEffect()` - Starts the effect and returns a new MediaStream that is to be swapped with the existing one.
453 500
 
454
-    stopEffect() - Stops the effect.
501
+    `stopEffect()` - Stops the effect.
455 502
 
456
-    isEnabled() - Checks if the local track supports the effect.
503
+    `isEnabled()` - Checks if the local track supports the effect.
457 504
 
458 505
     Note: This method is implemented only for the local tracks.
459 506
 
460 507
 JitsiTrackError
461 508
 ======
462
-The object represents error that happened to a JitsiTrack. Is inherited from JavaScript base ```Error``` object,
463
-so ```"name"```, ```"message"``` and ```"stack"``` properties are available. For GUM-related errors,
464
-exposes additional ```"gum"``` property, which is an object with following properties:
465
- - error - original GUM error
466
- - constraints - GUM constraints object used for the call
467
- - devices - array of devices requested in GUM call (possible values - "audio", "video", "screen", "desktop", "audiooutput")
509
+The object represents error that happened to a JitsiTrack. Is inherited from JavaScript base `Error` object,
510
+so `"name"`, `"message"` and `"stack"` properties are available. For GUM-related errors,
511
+exposes additional `"gum"` property, which is an object with following properties:
512
+ - `error` - original GUM error
513
+ - `constraints` - GUM constraints object used for the call
514
+ - `devices` - array of devices requested in GUM call (possible values - "audio", "video", "screen", "desktop", "audiooutput")
468 515
 
469 516
 Getting Started
470 517
 ==============
471 518
 
472
-1. The first thing you must do in order to use Jitsi Meet API is to initialize ```JitsiMeetJS``` object:
519
+1. The first thing you must do in order to use Jitsi Meet API is to initialize `JitsiMeetJS` object:
473 520
 
474 521
 ```javascript
475 522
 JitsiMeetJS.init();
@@ -493,12 +540,11 @@ connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTE
493 540
 connection.connect();
494 541
 ```
495 542
 
496
-4. After you receive the ```CONNECTION_ESTABLISHED``` event you are to create the ```JitsiConference``` object and
543
+4. After you receive the `CONNECTION_ESTABLISHED` event you are to create the `JitsiConference` object and
497 544
 also you may want to attach listeners for conference events (we are going to add handlers for remote track, conference joined, etc. ):
498 545
 
499 546
 
500 547
 ```javascript
501
-
502 548
 room = connection.initJitsiConference("conference1", confOptions);
503 549
 room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
504 550
 room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, onConferenceJoined);

Загрузка…
Отмена
Сохранить