瀏覽代碼

[RN] Remove workaround for video mirroring on iOS

It's now natively supported:
https://github.com/oney/react-native-webrtc/pull/244
j8
Saúl Ibarra Corretgé 8 年之前
父節點
當前提交
ae8c5287e4

+ 2
- 30
react/features/base/media/components/native/Video.js 查看文件

@@ -1,20 +1,8 @@
1 1
 import React, { Component } from 'react';
2
-import { View } from 'react-native';
3 2
 import { RTCView } from 'react-native-webrtc';
4 3
 
5
-import { Platform } from '../../../react';
6
-
7 4
 import { styles } from './styles';
8 5
 
9
-/**
10
- * Indicates whether RTCView (is to be considered that it) natively supports
11
- * i.e. implements mirroring the video it renders. If false, a workaround will
12
- * be used in an attempt to support mirroring in Video. If RTCView does not
13
- * implement mirroring on a specific platform but the workaround causes issues,
14
- * set to true for that platform to disable the workaround.
15
- */
16
-const RTCVIEW_SUPPORTS_MIRROR = Platform.OS === 'android';
17
-
18 6
 /**
19 7
  * The React Native component which is similar to Web's video element and wraps
20 8
  * around react-native-webrtc's RTCView.
@@ -91,31 +79,15 @@ export class Video extends Component {
91 79
             const style = styles.video;
92 80
             const objectFit = (style && style.objectFit) || 'cover';
93 81
 
94
-            const { mirror } = this.props;
95
-
96
-            // XXX RTCView may not support support mirroring, even when
97
-            // providing a transform style property (e.g. iOS) . As a
98
-            // workaround, wrap the RTCView inside another View and apply the
99
-            // transform style property to that View instead.
100
-            const mirrorWorkaround = mirror && !RTCVIEW_SUPPORTS_MIRROR;
101
-
102 82
             // eslint-disable-next-line no-extra-parens
103
-            const video = (
83
+            return (
104 84
                 <RTCView
105
-                    mirror = { mirrorWorkaround ? false : mirror }
85
+                    mirror = { this.props.mirror }
106 86
                     objectFit = { objectFit }
107 87
                     streamURL = { streamURL }
108 88
                     style = { style }
109 89
                     zOrder = { this.props.zOrder } />
110 90
             );
111
-
112
-            if (mirrorWorkaround) {
113
-                return (
114
-                    <View style = { styles.mirroredVideo }>{ video }</View>
115
-                );
116
-            }
117
-
118
-            return video;
119 91
         }
120 92
 
121 93
         // RTCView has peculiarities which may or may not be platform specific.

+ 0
- 9
react/features/base/media/components/native/styles.js 查看文件

@@ -7,18 +7,9 @@ const video = {
7 7
     flex: 1
8 8
 };
9 9
 
10
-/**
11
- * Transform local videos to behave like a mirror.
12
- */
13
-const mirroredVideo = {
14
-    ...video,
15
-    transform: [ { scaleX: -1 } ]
16
-};
17
-
18 10
 /**
19 11
  * Native-specific styles for media components.
20 12
  */
21 13
 export const styles = StyleSheet.create({
22
-    mirroredVideo,
23 14
     video
24 15
 });

Loading…
取消
儲存