From 1e566df60ea8482946db2690e367388d5f483a97 Mon Sep 17 00:00:00 2001 From: Calin-Teodor Date: Fri, 4 Oct 2024 14:40:45 +0300 Subject: [PATCH] feat(base/media): refactoring/lint fixes --- .../media/components/native/FallbackView.tsx | 9 +- .../base/media/components/native/Video.tsx | 82 +++++++++---------- 2 files changed, 42 insertions(+), 49 deletions(-) diff --git a/react/features/base/media/components/native/FallbackView.tsx b/react/features/base/media/components/native/FallbackView.tsx index 626d3032d908..e64970a8e412 100644 --- a/react/features/base/media/components/native/FallbackView.tsx +++ b/react/features/base/media/components/native/FallbackView.tsx @@ -1,10 +1,7 @@ import { View } from 'react-native'; -const FallbackView = () => { - - return( - - ) -} +const FallbackView = () => ( + +) export default FallbackView; diff --git a/react/features/base/media/components/native/Video.tsx b/react/features/base/media/components/native/Video.tsx index f2965ce89ee8..6da58c9bcea7 100644 --- a/react/features/base/media/components/native/Video.tsx +++ b/react/features/base/media/components/native/Video.tsx @@ -8,7 +8,7 @@ import { IReduxState} from '../../../../app/types'; import { translate } from '../../../i18n/functions'; import Pressable from '../../../react/components/native/Pressable'; -import logger from '../../logger'; +// import logger from '../../logger'; import VideoTransform from './VideoTransform'; import styles from './styles'; @@ -101,7 +101,6 @@ class Video extends Component { const { _enableIosPIP, onPress, stream, zoomEnabled } = this.props; const iosPIPOptions = { - startAutomatically: true, fallbackView: (), preferredSize: { width: 400, @@ -121,52 +120,49 @@ class Video extends Component { // stopIOSPIP(this._ref?.current); } - if (stream) { - // RTCView - const style = styles.video; - const objectFit - = zoomEnabled - ? 'contain' - : 'cover'; - const rtcView - = ( - - ); - - // VideoTransform implements "pinch to zoom". As part of "pinch to - // zoom", it implements onPress, of course. - if (zoomEnabled) { - return ( - - { rtcView } - - ); - } - - // XXX Unfortunately, VideoTransform implements a custom press - // detection which has been observed to be very picky about the - // precision of the press unlike the builtin/default/standard press - // detection which is forgiving to imperceptible movements while - // pressing. It's not acceptable to be so picky, especially when - // "pinch to zoom" is not enabled. + // RTCView + const style = styles.video; + const objectFit + = zoomEnabled + ? 'contain' + : 'cover'; + const rtcView + = ( + + ); + + // VideoTransform implements "pinch to zoom". As part of "pinch to + // zoom", it implements onPress, of course. + if (zoomEnabled) { return ( - + { rtcView } - + ); } + // XXX Unfortunately, VideoTransform implements a custom press + // detection which has been observed to be very picky about the + // precision of the press unlike the builtin/default/standard press + // detection which is forgiving to imperceptible movements while + // pressing. It's not acceptable to be so picky, especially when + // "pinch to zoom" is not enabled. + return ( + + { rtcView } + + ); + // RTCView has peculiarities which may or may not be platform specific. // For example, it doesn't accept an empty streamURL. If the execution // reached here, it means that we explicitly chose to not initialize an