瀏覽代碼

Document changes related to JitsiTrackError class and JitsiTrackErrors enum

dev1
tsareg 9 年之前
父節點
當前提交
c36130330b
共有 1 個文件被更改,包括 25 次插入2 次删除
  1. 25
    2
      doc/API.md

+ 25
- 2
doc/API.md 查看文件

27
 
27
 
28
 * JitsiTrack
28
 * JitsiTrack
29
 
29
 
30
+* JitsiTrackError
31
+
30
 Usage
32
 Usage
31
 ======
33
 ======
32
 JitsiMeetJS
34
 JitsiMeetJS
56
 JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
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
     - options - JS object with configuration options for the local media tracks. You can change the following properties there:
62
     - options - JS object with configuration options for the local media tracks. You can change the following properties there:
61
         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.
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
         2. resolution - the prefered resolution for the local video.
64
         2. resolution - the prefered resolution for the local video.
132
 
134
 
133
 
135
 
134
 * ```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
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
     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```.
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
     We support the following errors:
139
     We support the following errors:
138
     1. conference
140
     1. conference
154
         - PASSWORD_REQUIRED - passed when the connection to the server failed. You should try to authenticate with password.
156
         - PASSWORD_REQUIRED - passed when the connection to the server failed. You should try to authenticate with password.
155
         - CONNECTION_ERROR - indicates connection failures.
157
         - CONNECTION_ERROR - indicates connection failures.
156
         - OTHER_ERROR - all other errors
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
 * ```JitsiMeetJS.logLevels``` - object with the log levels:
172
 * ```JitsiMeetJS.logLevels``` - object with the log levels:
158
     1. TRACE
173
     1. TRACE
159
     2. DEBUG
174
     2. DEBUG
359
 
374
 
360
 12. isEnded() - returns true if track is ended
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
 Getting Started
386
 Getting Started
364
 ==============
387
 ==============

Loading…
取消
儲存