浏览代码

Merge pull request #132 from tsareg/pass_facing_mode_through_create_local_tracks_options

Add ability to pass facingMode as option to JitsiMeetJS.createLocalTracks()
master
Любомир Маринов 9 年前
父节点
当前提交
6f05b6ee64
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 1
    0
      doc/API.md
  2. 5
    1
      modules/RTC/RTCUtils.js

+ 1
- 0
doc/API.md 查看文件

66
         4. micDeviceId - the deviceID for the audio device that is going to be used
66
         4. micDeviceId - the deviceID for the audio device that is going to be used
67
         5. minFps - the minimum frame rate for the video stream (passed to GUM)
67
         5. minFps - the minimum frame rate for the video stream (passed to GUM)
68
         6. maxFps - the maximum frame rate for the video stream (passed to GUM)
68
         6. maxFps - the maximum frame rate for the video stream (passed to GUM)
69
+        7. facingMode - facing mode for a camera (possible values - 'user', 'environment')
69
 
70
 
70
 * ```JitsiMeetJS.enumerateDevices(callback)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.enumerateDevices(callback)``` instead.
71
 * ```JitsiMeetJS.enumerateDevices(callback)``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.enumerateDevices(callback)``` instead.
71
 * ```JitsiMeetJS.isDeviceListAvailable()``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.isDeviceListAvailable()``` instead.
72
 * ```JitsiMeetJS.isDeviceListAvailable()``` - __DEPRECATED__. Use ```JitsiMeetJS.mediaDevices.isDeviceListAvailable()``` instead.

+ 5
- 1
modules/RTC/RTCUtils.js 查看文件

103
  * @param {string} options.desktopStream
103
  * @param {string} options.desktopStream
104
  * @param {string} options.cameraDeviceId
104
  * @param {string} options.cameraDeviceId
105
  * @param {string} options.micDeviceId
105
  * @param {string} options.micDeviceId
106
+ * @param {'user'|'environment'} options.facingMode
106
  * @param {bool} firefox_fake_device
107
  * @param {bool} firefox_fake_device
107
  */
108
  */
108
 function getConstraints(um, options) {
109
 function getConstraints(um, options) {
122
         } else {
123
         } else {
123
             // Prefer the front i.e. user-facing camera (to the back i.e.
124
             // Prefer the front i.e. user-facing camera (to the back i.e.
124
             // environment-facing camera, for example).
125
             // environment-facing camera, for example).
125
-            constraints.video.facingMode = 'user';
126
+            // TODO: Maybe use "exact" syntax if options.facingMode is defined,
127
+            // but this probably needs to be decided when updating other
128
+            // constraints, as we currently don't use "exact" syntax anywhere.
129
+            constraints.video.facingMode = options.facingMode || 'user';
126
         }
130
         }
127
 
131
 
128
         constraints.video.optional.push({ googLeakyBucket: true });
132
         constraints.video.optional.push({ googLeakyBucket: true });

正在加载...
取消
保存