Przeglądaj źródła

[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 lat temu
rodzic
commit
ae8c5287e4

+ 2
- 30
react/features/base/media/components/native/Video.js Wyświetl plik

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
-import { View } from 'react-native';
3
 import { RTCView } from 'react-native-webrtc';
2
 import { RTCView } from 'react-native-webrtc';
4
 
3
 
5
-import { Platform } from '../../../react';
6
-
7
 import { styles } from './styles';
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
  * The React Native component which is similar to Web's video element and wraps
7
  * The React Native component which is similar to Web's video element and wraps
20
  * around react-native-webrtc's RTCView.
8
  * around react-native-webrtc's RTCView.
91
             const style = styles.video;
79
             const style = styles.video;
92
             const objectFit = (style && style.objectFit) || 'cover';
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
             // eslint-disable-next-line no-extra-parens
82
             // eslint-disable-next-line no-extra-parens
103
-            const video = (
83
+            return (
104
                 <RTCView
84
                 <RTCView
105
-                    mirror = { mirrorWorkaround ? false : mirror }
85
+                    mirror = { this.props.mirror }
106
                     objectFit = { objectFit }
86
                     objectFit = { objectFit }
107
                     streamURL = { streamURL }
87
                     streamURL = { streamURL }
108
                     style = { style }
88
                     style = { style }
109
                     zOrder = { this.props.zOrder } />
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
         // RTCView has peculiarities which may or may not be platform specific.
93
         // RTCView has peculiarities which may or may not be platform specific.

+ 0
- 9
react/features/base/media/components/native/styles.js Wyświetl plik

7
     flex: 1
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
  * Native-specific styles for media components.
11
  * Native-specific styles for media components.
20
  */
12
  */
21
 export const styles = StyleSheet.create({
13
 export const styles = StyleSheet.create({
22
-    mirroredVideo,
23
     video
14
     video
24
 });
15
 });

Ładowanie…
Anuluj
Zapisz