Browse Source

feat(ts) migrate JitsiTrackErrors to typescript enum

tags/v0.0.2
Gary Hunt 2 years ago
parent
commit
3c392bea6f
No account linked to committer's email address
3 changed files with 87 additions and 75 deletions
  1. 1
    0
      .gitattributes
  2. 0
    75
      JitsiTrackErrors.js
  3. 86
    0
      JitsiTrackErrors.ts

+ 1
- 0
.gitattributes View File

@@ -1,3 +1,4 @@
1 1
 lib-jitsi-meet.min.js -text -diff
2 2
 lib-jitsi-meet.js -text -diff
3 3
 lib-jitsi-meet.js.map -text -diff
4
+text eol=lf

+ 0
- 75
JitsiTrackErrors.js View File

@@ -1,75 +0,0 @@
1
-/**
2
- * The errors for the JitsiTrack objects.
3
- */
4
-
5
-/**
6
- * An error which indicates that some of requested constraints in
7
- * getUserMedia call were not satisfied.
8
- */
9
-export const CONSTRAINT_FAILED = 'gum.constraint_failed';
10
-
11
-/**
12
- * A generic error which indicates an error occurred while selecting
13
- * a DesktopCapturerSource from the electron app.
14
- */
15
-export const ELECTRON_DESKTOP_PICKER_ERROR
16
-    = 'gum.electron_desktop_picker_error';
17
-
18
-/**
19
- * An error which indicates a custom desktop picker could not be detected
20
- * for the electron app.
21
- */
22
-export const ELECTRON_DESKTOP_PICKER_NOT_FOUND
23
-    = 'gum.electron_desktop_picker_not_found';
24
-
25
-/**
26
- * Generic getUserMedia error.
27
- */
28
-export const GENERAL = 'gum.general';
29
-
30
-/**
31
- * An error which indicates that requested device was not found.
32
- */
33
-export const NOT_FOUND = 'gum.not_found';
34
-
35
-/**
36
- * An error which indicates that user denied permission to share requested
37
- * device.
38
- */
39
-export const PERMISSION_DENIED = 'gum.permission_denied';
40
-
41
-/**
42
- * Generic error for screensharing failure.
43
- */
44
-export const SCREENSHARING_GENERIC_ERROR
45
-    = 'gum.screensharing_generic_error';
46
-
47
-/**
48
- * An error which indicates that user canceled screen sharing window
49
- * selection dialog.
50
- */
51
-export const SCREENSHARING_USER_CANCELED
52
-    = 'gum.screensharing_user_canceled';
53
-
54
-
55
-/**
56
- * Indicates that the timeout passed to the obtainAudioAndVideoPermissions has expired without GUM resolving.
57
- */
58
-export const TIMEOUT = 'gum.timeout';
59
-
60
-/**
61
- * An error which indicates that track has been already disposed and cannot
62
- * be longer used.
63
- */
64
-export const TRACK_IS_DISPOSED = 'track.track_is_disposed';
65
-
66
-/**
67
- * An error which indicates that track has no MediaStream associated.
68
- */
69
-export const TRACK_NO_STREAM_FOUND = 'track.no_stream_found';
70
-
71
-/**
72
- * An error which indicates that requested video resolution is not supported
73
- * by a webcam.
74
- */
75
-export const UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution';

+ 86
- 0
JitsiTrackErrors.ts View File

@@ -0,0 +1,86 @@
1
+/**
2
+ * The errors for the JitsiTrack objects.
3
+ */
4
+
5
+ export enum JitsiTrackErrors {
6
+    /**
7
+     * An error which indicates that some of requested constraints in
8
+     * getUserMedia call were not satisfied.
9
+     */
10
+    CONSTRAINT_FAILED = 'gum.constraint_failed',
11
+
12
+    /**
13
+     * A generic error which indicates an error occurred while selecting
14
+     * a DesktopCapturerSource from the electron app.
15
+     */
16
+    ELECTRON_DESKTOP_PICKER_ERROR = 'gum.electron_desktop_picker_error',
17
+
18
+    /**
19
+     * An error which indicates a custom desktop picker could not be detected
20
+     * for the electron app.
21
+     */
22
+    ELECTRON_DESKTOP_PICKER_NOT_FOUND = 'gum.electron_desktop_picker_not_found',
23
+
24
+    /**
25
+     * Generic getUserMedia error.
26
+     */
27
+    GENERAL = 'gum.general',
28
+
29
+    /**
30
+     * An error which indicates that requested device was not found.
31
+     */
32
+    NOT_FOUND = 'gum.not_found',
33
+
34
+    /**
35
+     * An error which indicates that user denied permission to share requested
36
+     * device.
37
+     */
38
+    PERMISSION_DENIED = 'gum.permission_denied',
39
+
40
+    /**
41
+     * Generic error for screensharing failure.
42
+     */
43
+    SCREENSHARING_GENERIC_ERROR = 'gum.screensharing_generic_error',
44
+
45
+    /**
46
+     * An error which indicates that user canceled screen sharing window
47
+     * selection dialog.
48
+     */
49
+    SCREENSHARING_USER_CANCELED = 'gum.screensharing_user_canceled',
50
+
51
+    /**
52
+     * Indicates that the timeout passed to the obtainAudioAndVideoPermissions has expired without GUM resolving.
53
+     */
54
+    TIMEOUT = 'gum.timeout',
55
+
56
+    /**
57
+     * An error which indicates that track has been already disposed and cannot
58
+     * be longer used.
59
+     */
60
+    TRACK_IS_DISPOSED = 'track.track_is_disposed',
61
+
62
+    /**
63
+     * An error which indicates that track has no MediaStream associated.
64
+     */
65
+    TRACK_NO_STREAM_FOUND = 'track.no_stream_found',
66
+
67
+    /**
68
+     * An error which indicates that requested video resolution is not supported
69
+     * by a webcam.
70
+     */
71
+    UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution'
72
+}
73
+
74
+// exported for backward compatibility
75
+ export const CONSTRAINT_FAILED = JitsiTrackErrors.CONSTRAINT_FAILED;
76
+ export const ELECTRON_DESKTOP_PICKER_ERROR = JitsiTrackErrors.ELECTRON_DESKTOP_PICKER_ERROR;
77
+ export const ELECTRON_DESKTOP_PICKER_NOT_FOUND = JitsiTrackErrors.ELECTRON_DESKTOP_PICKER_NOT_FOUND;
78
+ export const GENERAL = JitsiTrackErrors.GENERAL;
79
+ export const NOT_FOUND = JitsiTrackErrors.NOT_FOUND;
80
+ export const PERMISSION_DENIED = JitsiTrackErrors.PERMISSION_DENIED;
81
+ export const SCREENSHARING_GENERIC_ERROR = JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR;
82
+ export const SCREENSHARING_USER_CANCELED = JitsiTrackErrors.SCREENSHARING_USER_CANCELED;
83
+ export const TIMEOUT = JitsiTrackErrors.TIMEOUT;
84
+ export const TRACK_IS_DISPOSED = JitsiTrackErrors.TRACK_IS_DISPOSED;
85
+ export const TRACK_NO_STREAM_FOUND = JitsiTrackErrors.TRACK_NO_STREAM_FOUND;
86
+ export const UNSUPPORTED_RESOLUTION = JitsiTrackErrors.UNSUPPORTED_RESOLUTION;

Loading…
Cancel
Save