<commit_before>Jitsi Meet API
============

You can use Jitsi Meet API to create Jitsi Meet video conferences with custom GUI.

Installation
==========

To embed Jitsi Meet API in your application you need to add Jitsi Meet API library

```javascript
<script src="https://meet.jit.si/libs/lib-jitsi-meet.min.js"></script>
```

Now you can access Jitsi Meet API trough the ```JitsiMeetJS``` global object.

Components
=========

Jitsi Meet API has the following components:

* JitsiMeetJS

* JitsiConnection

* JitsiConference

* JitsiTrack

* JitsiTrackError

Usage
======
JitsiMeetJS
----------
You can access the following methods and objects trough ```JitsiMeetJS``` object.


*  ```JitsiMeetJS.init(options)``` - this method initialized Jitsi Meet API.
The ```options``` parameter is JS object with the following properties:
    - `useIPv6` - boolean property
    - `desktopSharingChromeExtId` - The ID of the jidesha extension for Chrome. Example: 'mbocklcggfhnbahlnepmldehdhpjfcjp'
    - `desktopSharingChromeDisabled` - Boolean. Whether desktop sharing should be disabled on Chrome. Example: false.
    - `desktopSharingChromeSources` - Array of strings with the media sources to use when using screen sharing with the Chrome extension. Example: ['screen', 'window']
    - `desktopSharingChromeMinExtVersion` - Required version of Chrome extension. Example: '0.1'
    - `desktopSharingFirefoxDisabled` - Boolean. Whether desktop sharing should be disabled on Firefox. Example: false.
    - `disableAudioLevels` - boolean property. Enables/disables audio levels.
    - `disableSimulcast` - boolean property. Enables/disables simulcast.
    - `enableWindowOnErrorHandler` - boolean property (default false). Enables/disables attaching global onerror handler (window.onerror).
    - `disableThirdPartyRequests` - if true - callstats will be disabled and the callstats API won't be included.
    - `enableAnalyticsLogging` - boolean property (default false). Enables/disables analytics logging.
    - `callStatsCustomScriptUrl` - (optional) custom url to access callstats client script
    - `callStatsConfIDNamespace` - (optional) a namespace to prepend the callstats conference ID with. Defaults to the window.location.hostname
    - `disableRtx` - (optional) boolean property (default to false).  Enables/disable the use of RTX.
    - `disableH264` - (optional) boolean property (default to false).  If enabled, strips the H.264 codec from the local SDP.
    - `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.

* ```JitsiMeetJS.JitsiConnection``` - the ```JitsiConnection``` constructor. You can use that to create new server connection.

* ```JitsiMeetJS.setLogLevel``` - changes the log level for the library. For example to have only error messages you should do:
```
JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
```

* ```JitsiMeetJS.createLocalTracks(options, firePermissionPromptIsShownEvent)``` - Creates the media tracks and returns them trough ```Promise``` object. If rejected, passes ```JitsiTrackError``` instance to catch block.
    - options - JS object with configuration options for the local media tracks. You can change the following properties there:
        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.
        2. resolution - the prefered resolution for the local video.
        3. constraints - the prefered encoding properties for the created track (replaces 'resolution' in newer releases of browsers)
        4. cameraDeviceId - the deviceID for the video device that is going to be used
        5. micDeviceId - the deviceID for the audio device that is going to be used
        6. minFps - the minimum frame rate for the video stream (passed to GUM)
        7. maxFps - the maximum frame rate for the video stream (passed to GUM)
        8. facingMode - facing mode for a camera (possible values - 'user', 'environment')
    - firePermissionPromptIsShownEvent - optional boolean parameter. If set to ```true```, ```JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN``` will be fired when browser shows gUM permission prompt.

* ```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.
    - ```localAudioDeviceId``` - The target local audio device.
    - ```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.
    - ```vadProcessor``` - VAD Processors that does the actual compute on a PCM sample.The processor needs to implement the following functions:
        - getSampleLength() - Returns the sample size accepted by calculateAudioFrameVAD.
        - getRequiredPCMFrequency() - Returns the PCM frequency at which the processor operates .i.e. (16KHz, 44.1 KHz etc.)
        - calculateAudioFrameVAD(pcmSample) - Process a 32 float pcm sample of getSampleLength size.
* ```JitsiMeetJS.enumerateDevices(callback)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.enumerateDevices(callback)``` instead.
* ```JitsiMeetJS.isDeviceChangeAvailable(deviceType)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.isDeviceChangeAvailable(deviceType)``` instead.
* ```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.
* ```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:
    - deviceId - string containing the device ID of the audio track found as active.
    - deviceLabel - string containing the label of the audio device.
* ```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)).

* ```JitsiMeetJS.mediaDevices``` - JS object that contains methods for interaction with media devices. Following methods are available:
    - ```isDeviceListAvailable()``` - returns true if retrieving the device list is supported and false - otherwise
    - ```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.
    - ```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:
        - label - the name of the device
        - kind - "audioinput", "videoinput" or "audiooutput"
        - deviceId - the id of the device
        - 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
    - ```setAudioOutputDevice(deviceId)``` - sets current audio output device. ```deviceId``` - id of 'audiooutput' device from ```JitsiMeetJS.enumerateDevices()```, '' is for default device.
    - ```getAudioOutputDevice()``` - returns currently used audio output device id, '' stands for default device.
    - ```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.
    - ```addEventListener(event, handler)``` - attaches an event handler.
    - ```removeEventListener(event, handler)``` - removes an event handler.

* ```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.
    We have two event types - connection and conference. You can access the events with the following code ```JitsiMeetJS.events.<event_type>.<event_name>```.
    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```.
    We support the following events:
    1. conference
        - TRACK_ADDED - stream received. (parameters - JitsiTrack)
        - TRACK_REMOVED - stream removed. (parameters - JitsiTrack)
        - TRACK_MUTE_CHANGED - JitsiTrack was muted or unmuted. (parameters - JitsiTrack)
        - TRACK_AUDIO_LEVEL_CHANGED - audio level of JitsiTrack has changed. (parameters - participantId(string), audioLevel(number))
        - DOMINANT_SPEAKER_CHANGED - the dominant speaker is changed. (parameters - id(string))
        - USER_JOINED - new user joined a conference. (parameters - id(string), user(JitsiParticipant))
        - USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))
        - MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string), ts(number))
        - DISPLAY_NAME_CHANGED - user has changed his display name. (parameters - id(string), displayName(string))
        - SUBJECT_CHANGED - notifies that subject of the conference has changed (parameters - subject(string))
        - LAST_N_ENDPOINTS_CHANGED - last n set was changed (parameters - leavingEndpointIds(array) ids of users leaving lastN, enteringEndpointIds(array) ids of users entering lastN)
        - CONFERENCE_JOINED - notifies the local user that he joined the conference successfully. (no parameters)
        - CONFERENCE_LEFT - notifies the local user that he left the conference successfully. (no parameters)
        - DTMF_SUPPORT_CHANGED - notifies if at least one user supports DTMF. (parameters - supports(boolean))
        - USER_ROLE_CHANGED - notifies that role of some user changed. (parameters - id(string), role(string))
        - USER_STATUS_CHANGED - notifies that status of some user changed. (parameters - id(string), status(string))
        - CONFERENCE_FAILED - notifies that user failed to join the conference. (parameters - errorCode(JitsiMeetJS.errors.conference))
        - CONFERENCE_ERROR - notifies that error occurred. (parameters - errorCode(JitsiMeetJS.errors.conference))
        - KICKED - notifies that user has been kicked from the conference.
        - 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))
        - STARTED_MUTED - notifies that the local user has started muted
        - CONNECTION_STATS - __DEPRECATED__. Use ```JitsiMeetJS.connectionQuality.LOCAL_STATS_UPDATED``` instead.
        - 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
        - AUTH_STATUS_CHANGED - notifies that authentication is enabled or disabled, or local user authenticated (logged in). (parameters - isAuthEnabled(boolean), authIdentity(string))
        - ENDPOINT_MESSAGE_RECEIVED - notifies that a new message
        from another participant is received on a data channel.
        - TALK_WHILE_MUTED - notifies that a local user is talking while having the microphone muted.
        - NO_AUDIO_INPUT - notifies that the current selected input device has no signal.
        - AUDIO_INPUT_STATE_CHANGE - notifies that the current conference audio input switched between audio input states i.e. with or without audio input.
        - NOISY_MIC - notifies that the current microphone used by the conference is noisy.

    2. connection
        - CONNECTION_FAILED - indicates that the server connection failed.
        - CONNECTION_ESTABLISHED - indicates that we have successfully established server connection.
        - CONNECTION_DISCONNECTED - indicates that we are disconnected.
        - WRONG_STATE - indicates that the user has performed action that can't be executed because the connection is in wrong state.

    3. detection
        - VAD_SCORE_PUBLISHED - event generated by a TackVADEmitter when it computed a VAD score for an audio PCM sample.

    3. tracks
        - LOCAL_TRACK_STOPPED - indicates that a local track was stopped. This
        event can be fired when ```dispose()``` method is called or for other reasons.
        - TRACK_AUDIO_OUTPUT_CHANGED - indicates that audio output device for track was changed (parameters - deviceId (string) - new audio output device ID).

    4. mediaDevices
        - DEVICE_LIST_CHANGED - indicates that list of currently connected devices has changed (parameters - devices(MediaDeviceInfo[])).
        - 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').

    5. connectionQuality
        - LOCAL_STATS_UPDATED - New local connection statistics are received. (parameters - stats(object))
        - REMOTE_STATS_UPDATED - New remote connection statistics are received. (parameters - id(string), stats(object))

* ```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
    We have three error types - connection, conference and track. You can access the events with the following code ```JitsiMeetJS.errors.<error_type>.<error_name>```.
    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```.
    We support the following errors:
    1. conference
        - CONNECTION_ERROR - the connection with the conference is lost.
        - SETUP_FAILED - conference setup failed
        - AUTHENTICATION_REQUIRED - user must be authenticated to create this conference
        - PASSWORD_REQUIRED - that error can be passed when the connection to the conference failed. You should try to join the conference with password.
        - PASSWORD_NOT_SUPPORTED - indicates that conference cannot be locked
        - VIDEOBRIDGE_NOT_AVAILABLE - video bridge issues.<commit_msg>doc: fix track event namespace<commit_after>Jitsi Meet API
============

You can use Jitsi Meet API to create Jitsi Meet video conferences with custom GUI.

Installation
==========

To embed Jitsi Meet API in your application you need to add Jitsi Meet API library

```javascript
<script src="https://meet.jit.si/libs/lib-jitsi-meet.min.js"></script>
```

Now you can access Jitsi Meet API trough the ```JitsiMeetJS``` global object.

Components
=========

Jitsi Meet API has the following components:

* JitsiMeetJS

* JitsiConnection

* JitsiConference

* JitsiTrack

* JitsiTrackError

Usage
======
JitsiMeetJS
----------
You can access the following methods and objects trough ```JitsiMeetJS``` object.


*  ```JitsiMeetJS.init(options)``` - this method initialized Jitsi Meet API.
The ```options``` parameter is JS object with the following properties:
    - `useIPv6` - boolean property
    - `desktopSharingChromeExtId` - The ID of the jidesha extension for Chrome. Example: 'mbocklcggfhnbahlnepmldehdhpjfcjp'
    - `desktopSharingChromeDisabled` - Boolean. Whether desktop sharing should be disabled on Chrome. Example: false.
    - `desktopSharingChromeSources` - Array of strings with the media sources to use when using screen sharing with the Chrome extension. Example: ['screen', 'window']
    - `desktopSharingChromeMinExtVersion` - Required version of Chrome extension. Example: '0.1'
    - `desktopSharingFirefoxDisabled` - Boolean. Whether desktop sharing should be disabled on Firefox. Example: false.
    - `disableAudioLevels` - boolean property. Enables/disables audio levels.
    - `disableSimulcast` - boolean property. Enables/disables simulcast.
    - `enableWindowOnErrorHandler` - boolean property (default false). Enables/disables attaching global onerror handler (window.onerror).
    - `disableThirdPartyRequests` - if true - callstats will be disabled and the callstats API won't be included.
    - `enableAnalyticsLogging` - boolean property (default false). Enables/disables analytics logging.
    - `callStatsCustomScriptUrl` - (optional) custom url to access callstats client script
    - `callStatsConfIDNamespace` - (optional) a namespace to prepend the callstats conference ID with. Defaults to the window.location.hostname
    - `disableRtx` - (optional) boolean property (default to false).  Enables/disable the use of RTX.
    - `disableH264` - (optional) boolean property (default to false).  If enabled, strips the H.264 codec from the local SDP.
    - `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.

* ```JitsiMeetJS.JitsiConnection``` - the ```JitsiConnection``` constructor. You can use that to create new server connection.

* ```JitsiMeetJS.setLogLevel``` - changes the log level for the library. For example to have only error messages you should do:
```
JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
```

* ```JitsiMeetJS.createLocalTracks(options, firePermissionPromptIsShownEvent)``` - Creates the media tracks and returns them trough ```Promise``` object. If rejected, passes ```JitsiTrackError``` instance to catch block.
    - options - JS object with configuration options for the local media tracks. You can change the following properties there:
        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.
        2. resolution - the prefered resolution for the local video.
        3. constraints - the prefered encoding properties for the created track (replaces 'resolution' in newer releases of browsers)
        4. cameraDeviceId - the deviceID for the video device that is going to be used
        5. micDeviceId - the deviceID for the audio device that is going to be used
        6. minFps - the minimum frame rate for the video stream (passed to GUM)
        7. maxFps - the maximum frame rate for the video stream (passed to GUM)
        8. facingMode - facing mode for a camera (possible values - 'user', 'environment')
    - firePermissionPromptIsShownEvent - optional boolean parameter. If set to ```true```, ```JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN``` will be fired when browser shows gUM permission prompt.

* ```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.
    - ```localAudioDeviceId``` - The target local audio device.
    - ```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.
    - ```vadProcessor``` - VAD Processors that does the actual compute on a PCM sample.The processor needs to implement the following functions:
        - getSampleLength() - Returns the sample size accepted by calculateAudioFrameVAD.
        - getRequiredPCMFrequency() - Returns the PCM frequency at which the processor operates .i.e. (16KHz, 44.1 KHz etc.)
        - calculateAudioFrameVAD(pcmSample) - Process a 32 float pcm sample of getSampleLength size.
* ```JitsiMeetJS.enumerateDevices(callback)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.enumerateDevices(callback)``` instead.
* ```JitsiMeetJS.isDeviceChangeAvailable(deviceType)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.isDeviceChangeAvailable(deviceType)``` instead.
* ```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.
* ```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:
    - deviceId - string containing the device ID of the audio track found as active.
    - deviceLabel - string containing the label of the audio device.
* ```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)).

* ```JitsiMeetJS.mediaDevices``` - JS object that contains methods for interaction with media devices. Following methods are available:
    - ```isDeviceListAvailable()``` - returns true if retrieving the device list is supported and false - otherwise
    - ```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.
    - ```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:
        - label - the name of the device
        - kind - "audioinput", "videoinput" or "audiooutput"
        - deviceId - the id of the device
        - 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
    - ```setAudioOutputDevice(deviceId)``` - sets current audio output device. ```deviceId``` - id of 'audiooutput' device from ```JitsiMeetJS.enumerateDevices()```, '' is for default device.
    - ```getAudioOutputDevice()``` - returns currently used audio output device id, '' stands for default device.
    - ```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.
    - ```addEventListener(event, handler)``` - attaches an event handler.
    - ```removeEventListener(event, handler)``` - removes an event handler.

* ```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.
    We have two event types - connection and conference. You can access the events with the following code ```JitsiMeetJS.events.<event_type>.<event_name>```.
    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```.
    We support the following events:
    1. conference
        - TRACK_ADDED - stream received. (parameters - JitsiTrack)
        - TRACK_REMOVED - stream removed. (parameters - JitsiTrack)
        - TRACK_MUTE_CHANGED - JitsiTrack was muted or unmuted. (parameters - JitsiTrack)
        - TRACK_AUDIO_LEVEL_CHANGED - audio level of JitsiTrack has changed. (parameters - participantId(string), audioLevel(number))
        - DOMINANT_SPEAKER_CHANGED - the dominant speaker is changed. (parameters - id(string))
        - USER_JOINED - new user joined a conference. (parameters - id(string), user(JitsiParticipant))
        - USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))
        - MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string), ts(number))
        - DISPLAY_NAME_CHANGED - user has changed his display name. (parameters - id(string), displayName(string))
        - SUBJECT_CHANGED - notifies that subject of the conference has changed (parameters - subject(string))
        - LAST_N_ENDPOINTS_CHANGED - last n set was changed (parameters - leavingEndpointIds(array) ids of users leaving lastN, enteringEndpointIds(array) ids of users entering lastN)
        - CONFERENCE_JOINED - notifies the local user that he joined the conference successfully. (no parameters)
        - CONFERENCE_LEFT - notifies the local user that he left the conference successfully. (no parameters)
        - DTMF_SUPPORT_CHANGED - notifies if at least one user supports DTMF. (parameters - supports(boolean))
        - USER_ROLE_CHANGED - notifies that role of some user changed. (parameters - id(string), role(string))
        - USER_STATUS_CHANGED - notifies that status of some user changed. (parameters - id(string), status(string))
        - CONFERENCE_FAILED - notifies that user failed to join the conference. (parameters - errorCode(JitsiMeetJS.errors.conference))
        - CONFERENCE_ERROR - notifies that error occurred. (parameters - errorCode(JitsiMeetJS.errors.conference))
        - KICKED - notifies that user has been kicked from the conference.
        - 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))
        - STARTED_MUTED - notifies that the local user has started muted
        - CONNECTION_STATS - __DEPRECATED__. Use ```JitsiMeetJS.connectionQuality.LOCAL_STATS_UPDATED``` instead.
        - 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
        - AUTH_STATUS_CHANGED - notifies that authentication is enabled or disabled, or local user authenticated (logged in). (parameters - isAuthEnabled(boolean), authIdentity(string))
        - ENDPOINT_MESSAGE_RECEIVED - notifies that a new message
        from another participant is received on a data channel.
        - TALK_WHILE_MUTED - notifies that a local user is talking while having the microphone muted.
        - NO_AUDIO_INPUT - notifies that the current selected input device has no signal.
        - AUDIO_INPUT_STATE_CHANGE - notifies that the current conference audio input switched between audio input states i.e. with or without audio input.
        - NOISY_MIC - notifies that the current microphone used by the conference is noisy.

    2. connection
        - CONNECTION_FAILED - indicates that the server connection failed.
        - CONNECTION_ESTABLISHED - indicates that we have successfully established server connection.
        - CONNECTION_DISCONNECTED - indicates that we are disconnected.
        - WRONG_STATE - indicates that the user has performed action that can't be executed because the connection is in wrong state.

    3. detection
        - VAD_SCORE_PUBLISHED - event generated by a TackVADEmitter when it computed a VAD score for an audio PCM sample.

    3. track
        - LOCAL_TRACK_STOPPED - indicates that a local track was stopped. This
        event can be fired when ```dispose()``` method is called or for other reasons.
        - TRACK_AUDIO_OUTPUT_CHANGED - indicates that audio output device for track was changed (parameters - deviceId (string) - new audio output device ID).

    4. mediaDevices
        - DEVICE_LIST_CHANGED - indicates that list of currently connected devices has changed (parameters - devices(MediaDeviceInfo[])).
        - 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').

    5. connectionQuality
        - LOCAL_STATS_UPDATED - New local connection statistics are received. (parameters - stats(object))
        - REMOTE_STATS_UPDATED - New remote connection statistics are received. (parameters - id(string), stats(object))

* ```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
    We have three error types - connection, conference and track. You can access the events with the following code ```JitsiMeetJS.errors.<error_type>.<error_name>```.
    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```.
    We support the following errors:
    1. conference
        - CONNECTION_ERROR - the connection with the conference is lost.
        - SETUP_FAILED - conference setup failed
        - AUTHENTICATION_REQUIRED - user must be authenticated to create this conference
        - PASSWORD_REQUIRED - that error can be passed when the connection to the conference failed. You should try to join the conference with password.
        - PASSWORD_NOT_SUPPORTED - indicates that conference cannot be locked
        - VIDEOBRIDGE_NOT_AVAILABLE - video bridge issues.
{'fraction_non_alphanumeric': 0.0792800585534633, 'fraction_numerical': 0.004591123827267283, 'mean_word_length': 3.8631289435366445, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4059574', 'n_tokens_mistral': 8093, 'n_tokens_neox': 7790, 'n_words': 3345}