Skip to content

Commit

Permalink
feat(ts) migrate JitsiTrackErrors to typescript enum
Browse files Browse the repository at this point in the history
  • Loading branch information
garyhuntddn authored Feb 21, 2022
1 parent 3bc1b88 commit 3c392be
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 75 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lib-jitsi-meet.min.js -text -diff
lib-jitsi-meet.js -text -diff
lib-jitsi-meet.js.map -text -diff
text eol=lf
75 changes: 0 additions & 75 deletions JitsiTrackErrors.js

This file was deleted.

86 changes: 86 additions & 0 deletions JitsiTrackErrors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* The errors for the JitsiTrack objects.
*/

export enum JitsiTrackErrors {
/**
* An error which indicates that some of requested constraints in
* getUserMedia call were not satisfied.
*/
CONSTRAINT_FAILED = 'gum.constraint_failed',

/**
* A generic error which indicates an error occurred while selecting
* a DesktopCapturerSource from the electron app.
*/
ELECTRON_DESKTOP_PICKER_ERROR = 'gum.electron_desktop_picker_error',

/**
* An error which indicates a custom desktop picker could not be detected
* for the electron app.
*/
ELECTRON_DESKTOP_PICKER_NOT_FOUND = 'gum.electron_desktop_picker_not_found',

/**
* Generic getUserMedia error.
*/
GENERAL = 'gum.general',

/**
* An error which indicates that requested device was not found.
*/
NOT_FOUND = 'gum.not_found',

/**
* An error which indicates that user denied permission to share requested
* device.
*/
PERMISSION_DENIED = 'gum.permission_denied',

/**
* Generic error for screensharing failure.
*/
SCREENSHARING_GENERIC_ERROR = 'gum.screensharing_generic_error',

/**
* An error which indicates that user canceled screen sharing window
* selection dialog.
*/
SCREENSHARING_USER_CANCELED = 'gum.screensharing_user_canceled',

/**
* Indicates that the timeout passed to the obtainAudioAndVideoPermissions has expired without GUM resolving.
*/
TIMEOUT = 'gum.timeout',

/**
* An error which indicates that track has been already disposed and cannot
* be longer used.
*/
TRACK_IS_DISPOSED = 'track.track_is_disposed',

/**
* An error which indicates that track has no MediaStream associated.
*/
TRACK_NO_STREAM_FOUND = 'track.no_stream_found',

/**
* An error which indicates that requested video resolution is not supported
* by a webcam.
*/
UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution'
}

// exported for backward compatibility
export const CONSTRAINT_FAILED = JitsiTrackErrors.CONSTRAINT_FAILED;
export const ELECTRON_DESKTOP_PICKER_ERROR = JitsiTrackErrors.ELECTRON_DESKTOP_PICKER_ERROR;
export const ELECTRON_DESKTOP_PICKER_NOT_FOUND = JitsiTrackErrors.ELECTRON_DESKTOP_PICKER_NOT_FOUND;
export const GENERAL = JitsiTrackErrors.GENERAL;
export const NOT_FOUND = JitsiTrackErrors.NOT_FOUND;
export const PERMISSION_DENIED = JitsiTrackErrors.PERMISSION_DENIED;
export const SCREENSHARING_GENERIC_ERROR = JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR;
export const SCREENSHARING_USER_CANCELED = JitsiTrackErrors.SCREENSHARING_USER_CANCELED;
export const TIMEOUT = JitsiTrackErrors.TIMEOUT;
export const TRACK_IS_DISPOSED = JitsiTrackErrors.TRACK_IS_DISPOSED;
export const TRACK_NO_STREAM_FOUND = JitsiTrackErrors.TRACK_NO_STREAM_FOUND;
export const UNSUPPORTED_RESOLUTION = JitsiTrackErrors.UNSUPPORTED_RESOLUTION;

0 comments on commit 3c392be

Please sign in to comment.