Browse Source

rn: disable H.264 on iOS 10 devices

It crashes like hell. See:
https://bugs.chromium.org/p/webrtc/issues/detail?id=11002
master
Saúl Ibarra Corretgé 6 years ago
parent
commit
afccf6f06d
2 changed files with 22 additions and 3 deletions
  1. 12
    2
      react/features/base/config/reducer.js
  2. 10
    1
      react/features/base/react/Platform.web.js

+ 12
- 2
react/features/base/config/reducer.js View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 import _ from 'lodash';
4 4
 
5
+import Platform from '../react/Platform';
5 6
 import { equals, ReducerRegistry, set } from '../redux';
6 7
 
7 8
 import { CONFIG_WILL_LOAD, LOAD_CONFIG_ERROR, SET_CONFIG } from './actionTypes';
@@ -20,6 +21,15 @@ import { _cleanupConfig } from './functions';
20 21
 const INITIAL_NON_RN_STATE = {
21 22
 };
22 23
 
24
+/**
25
+ * When we should enable H.264 on mobile. iOS 10 crashes so we disable it there.
26
+ * See: https://bugs.chromium.org/p/webrtc/issues/detail?id=11002
27
+ * Note that this is only used for P2P calls.
28
+ *
29
+ * @type {boolean}
30
+ */
31
+const RN_ENABLE_H264 = navigator.product === 'ReactNative' && !(Platform.OS === 'ios' && Platform.Version === 10);
32
+
23 33
 /**
24 34
  * The initial state of the feature base/config when executing in a React Native
25 35
  * environment. The mandatory configuration to be passed to JitsiMeetJS#init().
@@ -41,8 +51,8 @@ const INITIAL_RN_STATE = {
41 51
     disableAudioLevels: true,
42 52
 
43 53
     p2p: {
44
-        disableH264: false,
45
-        preferH264: true
54
+        disableH264: !RN_ENABLE_H264,
55
+        preferH264: RN_ENABLE_H264
46 56
     }
47 57
 };
48 58
 

+ 10
- 1
react/features/base/react/Platform.web.js View File

@@ -22,5 +22,14 @@ export default {
22 22
      *
23 23
      * @type {string}
24 24
      */
25
-    OS
25
+    OS,
26
+
27
+    /**
28
+     * The operating system version on which the application is executing.
29
+     * This is intentionally set to undefined so we can tell mobile and mobile web
30
+     * appart easier.
31
+     *
32
+     * @type {number|undefined}
33
+     */
34
+    Version: undefined
26 35
 };

Loading…
Cancel
Save