浏览代码

(prejoin): fix mobile

j8
Vlad Piersec 4 年前
父节点
当前提交
0aa54d8650
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 5
    1
      react/features/base/devices/functions.js
  2. 1
    1
      react/features/device-selection/middleware.js

+ 5
- 1
react/features/base/devices/functions.js 查看文件

@@ -234,7 +234,7 @@ export function getVideoDeviceIds(state: Object) {
234 234
 }
235 235
 
236 236
 /**
237
- * Returns true if there are devices of a specific type.
237
+ * Returns true if there are devices of a specific type or on native platform.
238 238
  *
239 239
  * @param {Object} state - The state of the application.
240 240
  * @param {string} type - The type of device: VideoOutput | audioOutput | audioInput.
@@ -242,6 +242,10 @@ export function getVideoDeviceIds(state: Object) {
242 242
  * @returns {boolean}
243 243
  */
244 244
 export function hasAvailableDevices(state: Object, type: string) {
245
+    if (state['features/base/devices'] === undefined) {
246
+        return true;
247
+    }
248
+
245 249
     return state['features/base/devices'].availableDevices[type].length > 0;
246 250
 }
247 251
 

+ 1
- 1
react/features/device-selection/middleware.js 查看文件

@@ -18,7 +18,7 @@ MiddlewareRegistry.register(store => next => action => {
18 18
     if (action.type === UPDATE_DEVICE_LIST) {
19 19
         const state = store.getState();
20 20
         const { popupDialogData } = state['features/device-selection'];
21
-        const { availableDevices } = state['features/base/devices'];
21
+        const { availableDevices } = state['features/base/devices'] || {};
22 22
 
23 23
         if (popupDialogData) {
24 24
             popupDialogData.transport.sendEvent({

正在加载...
取消
保存