-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ts) TypeScript enum for JitsiMediaDevicesEvents
- Loading branch information
1 parent
9123f34
commit 581ee80
Showing
3 changed files
with
73 additions
and
60 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* The events for the media devices. | ||
*/ | ||
|
||
export enum JitsiMediaDevicesEvents { | ||
/** | ||
* Indicates that the list of available media devices has been changed. The | ||
* event provides the following parameters to its listeners: | ||
* | ||
* @param {MediaDeviceInfo[]} devices - array of MediaDeviceInfo or | ||
* MediaDeviceInfo-like objects that are currently connected. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo | ||
*/ | ||
DEVICE_LIST_CHANGED = 'mediaDevices.devicechange', | ||
|
||
/** | ||
* Event emitted when the user granted/blocked a permission for the camera / mic. | ||
* Used to keep track of the granted permissions on browsers which don't | ||
* support the Permissions API. | ||
*/ | ||
PERMISSIONS_CHANGED = 'rtc.permissions_changed', | ||
|
||
/** | ||
* Indicates that the environment is currently showing permission prompt to | ||
* access camera and/or microphone. The event provides the following | ||
* parameters to its listeners: | ||
* | ||
* @param {'chrome'|'opera'|'firefox'|'safari'|'nwjs' | ||
* |'react-native'|'android'} environmentType - type of browser or | ||
* other execution environment. | ||
*/ | ||
PERMISSION_PROMPT_IS_SHOWN = 'mediaDevices.permissionPromptIsShown', | ||
|
||
SLOW_GET_USER_MEDIA = 'mediaDevices.slowGetUserMedia' | ||
}; | ||
|
||
// exported for backward compatibility | ||
export const DEVICE_LIST_CHANGED = JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED; | ||
export const PERMISSIONS_CHANGED = JitsiMediaDevicesEvents.PERMISSIONS_CHANGED; | ||
export const PERMISSION_PROMPT_IS_SHOWN = JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN; | ||
export const SLOW_GET_USER_MEDIA = JitsiMediaDevicesEvents.SLOW_GET_USER_MEDIA; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
/** | ||
* The events for the media devices. | ||
*/ | ||
/** | ||
* Indicates that the list of available media devices has been changed. The | ||
* event provides the following parameters to its listeners: | ||
* | ||
* @param {MediaDeviceInfo[]} devices - array of MediaDeviceInfo or | ||
* MediaDeviceInfo-like objects that are currently connected. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo | ||
*/ | ||
export const DEVICE_LIST_CHANGED: "mediaDevices.devicechange"; | ||
/** | ||
* Event emitted when the user granted/blocked a permission for the camera / mic. | ||
* Used to keep track of the granted permissions on browsers which don't | ||
* support the Permissions API. | ||
*/ | ||
export const PERMISSIONS_CHANGED: "rtc.permissions_changed"; | ||
/** | ||
* Indicates that the environment is currently showing permission prompt to | ||
* access camera and/or microphone. The event provides the following | ||
* parameters to its listeners: | ||
* | ||
* @param {'chrome'|'opera'|'firefox'|'safari'|'nwjs' | ||
* |'react-native'|'android'} environmentType - type of browser or | ||
* other execution environment. | ||
*/ | ||
export const PERMISSION_PROMPT_IS_SHOWN: "mediaDevices.permissionPromptIsShown"; | ||
export const SLOW_GET_USER_MEDIA: "mediaDevices.slowGetUserMedia"; | ||
export declare enum JitsiMediaDevicesEvents { | ||
/** | ||
* Indicates that the list of available media devices has been changed. The | ||
* event provides the following parameters to its listeners: | ||
* | ||
* @param {MediaDeviceInfo[]} devices - array of MediaDeviceInfo or | ||
* MediaDeviceInfo-like objects that are currently connected. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo | ||
*/ | ||
DEVICE_LIST_CHANGED = "mediaDevices.devicechange", | ||
/** | ||
* Event emitted when the user granted/blocked a permission for the camera / mic. | ||
* Used to keep track of the granted permissions on browsers which don't | ||
* support the Permissions API. | ||
*/ | ||
PERMISSIONS_CHANGED = "rtc.permissions_changed", | ||
/** | ||
* Indicates that the environment is currently showing permission prompt to | ||
* access camera and/or microphone. The event provides the following | ||
* parameters to its listeners: | ||
* | ||
* @param {'chrome'|'opera'|'firefox'|'safari'|'nwjs' | ||
* |'react-native'|'android'} environmentType - type of browser or | ||
* other execution environment. | ||
*/ | ||
PERMISSION_PROMPT_IS_SHOWN = "mediaDevices.permissionPromptIsShown", | ||
SLOW_GET_USER_MEDIA = "mediaDevices.slowGetUserMedia" | ||
} | ||
export declare const DEVICE_LIST_CHANGED = JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED; | ||
export declare const PERMISSIONS_CHANGED = JitsiMediaDevicesEvents.PERMISSIONS_CHANGED; | ||
export declare const PERMISSION_PROMPT_IS_SHOWN = JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN; | ||
export declare const SLOW_GET_USER_MEDIA = JitsiMediaDevicesEvents.SLOW_GET_USER_MEDIA; |