Browse Source

Document changes related to JitsiTrackError class and JitsiTrackErrors enum

dev1
tsareg 9 years ago
parent
commit
c36130330b
1 changed files with 25 additions and 2 deletions
  1. 25
    2
      doc/API.md

+ 25
- 2
doc/API.md View File

@@ -27,6 +27,8 @@ Jitsi Meet API has the following components:
27 27
 
28 28
 * JitsiTrack
29 29
 
30
+* JitsiTrackError
31
+
30 32
 Usage
31 33
 ======
32 34
 JitsiMeetJS
@@ -56,7 +58,7 @@ The ```options``` parameter is JS object with the following properties:
56 58
 JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
57 59
 ```
58 60
 
59
-* ```JitsiMeetJS.createLocalTracks(options)``` - Creates the media tracks and returns them trough ```Promise``` object.
61
+* ```JitsiMeetJS.createLocalTracks(options)``` - Creates the media tracks and returns them trough ```Promise``` object. If rejected, passes ```JitsiTrackError``` instance to catch block.
60 62
     - options - JS object with configuration options for the local media tracks. You can change the following properties there:
61 63
         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.
62 64
         2. resolution - the prefered resolution for the local video.
@@ -132,7 +134,7 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
132 134
 
133 135
 
134 136
 * ```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
135
-    We have two error types - connection and conference. You can access the events with the following code ```JitsiMeetJS.errors.<error_type>.<error_name>```.
137
+    We have three error types - connection, conference and track. You can access the events with the following code ```JitsiMeetJS.errors.<error_type>.<error_name>```.
136 138
     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```.
137 139
     We support the following errors:
138 140
     1. conference
@@ -154,6 +156,19 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
154 156
         - PASSWORD_REQUIRED - passed when the connection to the server failed. You should try to authenticate with password.
155 157
         - CONNECTION_ERROR - indicates connection failures.
156 158
         - OTHER_ERROR - all other errors
159
+    3. track
160
+        - GENERAL - generic getUserMedia-related error.
161
+        - UNSUPPORTED_RESOLUTION - getUserMedia-related error, indicates that requested video resolution is not supported by camera.
162
+        - PERMISSION_DENIED - getUserMedia-related error, indicates that user denied permission to share requested device.
163
+        - NOT_FOUND - getUserMedia-related error, indicates that requested device was not found.
164
+        - CONSTRAINT_FAILED - getUserMedia-related error, indicates that some of requested constraints in getUserMedia call were not satisfied.
165
+        - TRACK_IS_DISPOSED - an error which indicates that track has been already disposed and cannot be longer used.
166
+        - TRACK_MUTE_UNMUTE_IN_PROGRESS - an error which indicates that track is currently in progress of muting or unmuting itself.
167
+        - CHROME_EXTENSION_GENERIC_ERROR - generic error for jidesha extension for Chrome.
168
+        - CHROME_EXTENSION_USER_CANCELED - an error which indicates that user canceled screen sharing window selection dialog in jidesha extension for Chrome.
169
+        - CHROME_EXTENSION_INSTALLATION_ERROR - an error which indicates that the jidesha extension for Chrome is failed to install.
170
+        - FIREFOX_EXTENSION_NEEDED - An error which indicates that the jidesha extension for Firefox is needed to proceed with screen sharing, and that it is not installed.
171
+        
157 172
 * ```JitsiMeetJS.logLevels``` - object with the log levels:
158 173
     1. TRACE
159 174
     2. DEBUG
@@ -359,6 +374,14 @@ We have the following methods for controling the tracks:
359 374
 
360 375
 12. isEnded() - returns true if track is ended
361 376
 
377
+JitsiTrackError
378
+======
379
+The object represents error that happened to a JitsiTrack. Is inherited from JavaScript base ```Error``` object, 
380
+so ```"name"```, ```"message"``` and ```"stack"``` properties are available. For GUM-related errors,
381
+exposes additional ```"gum"``` property, which is an object with following properties:
382
+ - error - original GUM error
383
+ - constraints - GUM constraints object used for the call
384
+ - devices - array of devices requested in GUM call (possible values - "audio", "video", "screen", "desktop")
362 385
 
363 386
 Getting Started
364 387
 ==============

Loading…
Cancel
Save