From d34415bc15644555b2b973c8f4d11f2059c7c467 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Mon, 24 Feb 2025 14:30:02 +0300 Subject: [PATCH 01/24] added video slash svg --- assets/images/video-slash.svg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 assets/images/video-slash.svg diff --git a/assets/images/video-slash.svg b/assets/images/video-slash.svg new file mode 100644 index 00000000000..3afb2b778b2 --- /dev/null +++ b/assets/images/video-slash.svg @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file From cc1484d5ee3d5b169a8b2163c7f6ff5f1596088a Mon Sep 17 00:00:00 2001 From: HezekielT Date: Mon, 24 Feb 2025 14:31:24 +0300 Subject: [PATCH 02/24] style change in AttachmentOfflineIndicator --- src/components/AttachmentOfflineIndicator.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/AttachmentOfflineIndicator.tsx b/src/components/AttachmentOfflineIndicator.tsx index 4ff1940ba00..a58ac361c88 100644 --- a/src/components/AttachmentOfflineIndicator.tsx +++ b/src/components/AttachmentOfflineIndicator.tsx @@ -12,9 +12,13 @@ import Text from './Text'; type AttachmentOfflineIndicatorProps = { /** Whether the offline indicator is displayed for the attachment preview. */ isPreview?: boolean; + + + /** Whether the offline indicator should always have a background color set. */ + shouldAlwaysHaveBackground?: boolean; }; -function AttachmentOfflineIndicator({isPreview = false}: AttachmentOfflineIndicatorProps) { +function AttachmentOfflineIndicator({isPreview = false, shouldAlwaysHaveBackground = false}: AttachmentOfflineIndicatorProps) { const theme = useTheme(); const styles = useThemeStyles(); const {isOffline} = useNetwork(); @@ -35,7 +39,17 @@ function AttachmentOfflineIndicator({isPreview = false}: AttachmentOfflineIndica } return ( - + Date: Mon, 24 Feb 2025 14:32:04 +0300 Subject: [PATCH 03/24] include video slash in Expensicons --- src/components/Icon/Expensicons.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Icon/Expensicons.ts b/src/components/Icon/Expensicons.ts index 712b03bf459..db5c81a0cfc 100644 --- a/src/components/Icon/Expensicons.ts +++ b/src/components/Icon/Expensicons.ts @@ -205,6 +205,7 @@ import UserEye from '@assets/images/user-eye.svg'; import UserPlus from '@assets/images/user-plus.svg'; import User from '@assets/images/user.svg'; import Users from '@assets/images/users.svg'; +import VideoSlash from '@assets/images/video-slash.svg'; import VolumeHigh from '@assets/images/volume-high.svg'; import VolumeLow from '@assets/images/volume-low.svg'; import Wallet from '@assets/images/wallet.svg'; @@ -383,6 +384,7 @@ export { User, UserCheck, Users, + VideoSlash, VolumeHigh, VolumeLow, Wallet, From e9dbcd9fef29da5e4d4bc69a9b3b7a654508cc89 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Mon, 24 Feb 2025 14:32:39 +0300 Subject: [PATCH 04/24] create a new component VideoErrorIndicator --- .../VideoPlayer/VideoErrorIndicator.tsx | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/components/VideoPlayer/VideoErrorIndicator.tsx diff --git a/src/components/VideoPlayer/VideoErrorIndicator.tsx b/src/components/VideoPlayer/VideoErrorIndicator.tsx new file mode 100644 index 00000000000..bbac21551ed --- /dev/null +++ b/src/components/VideoPlayer/VideoErrorIndicator.tsx @@ -0,0 +1,28 @@ +import React from "react"; +import {View} from "react-native"; +import Icon from "@components/Icon"; +import * as Expensicons from "@components/Icon/Expensicons"; +import useTheme from "@hooks/useTheme"; +import useThemeStyles from "@hooks/useThemeStyles"; +import variables from "@styles/variables"; + +function VideoErrorIndicator() { + const theme = useTheme(); + const styles = useThemeStyles(); + + return ( + + + + ); + +} + +VideoErrorIndicator.displayName = 'VideoErrorIndicator'; + +export default VideoErrorIndicator; \ No newline at end of file From 33b4f6a3700a52b7b5fbecb664da86bc75e0e308 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Mon, 24 Feb 2025 14:33:11 +0300 Subject: [PATCH 05/24] update in PlaybackContext --- src/components/VideoPlayerContexts/PlaybackContext.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VideoPlayerContexts/PlaybackContext.tsx b/src/components/VideoPlayerContexts/PlaybackContext.tsx index c66ca951f05..6ab325bec36 100644 --- a/src/components/VideoPlayerContexts/PlaybackContext.tsx +++ b/src/components/VideoPlayerContexts/PlaybackContext.tsx @@ -42,7 +42,7 @@ function PlaybackContextProvider({children}: ChildrenProps) { if ('durationMillis' in status && status.durationMillis === status.positionMillis) { newStatus.positionMillis = 0; } - playVideoPromiseRef.current = currentVideoPlayerRef.current?.setStatusAsync(newStatus); + playVideoPromiseRef.current = currentVideoPlayerRef.current?.setStatusAsync(newStatus).catch(); }); }, [currentVideoPlayerRef]); From 3369bba6167cf6367648ddc3dc8ed1aac4885ed4 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Mon, 24 Feb 2025 15:25:20 +0300 Subject: [PATCH 06/24] handle errors generated by unsupported video inside BaseVideoPlayer --- .../VideoPlayer/BaseVideoPlayer.tsx | 70 +++++++++++-------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index dd3eab3d633..f924c6663dc 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -27,6 +27,7 @@ import type {VideoPlayerProps, VideoWithOnFullScreenUpdate} from './types'; import useHandleNativeVideoControls from './useHandleNativeVideoControls'; import * as VideoUtils from './utils'; import VideoPlayerControls from './VideoPlayerControls'; +import VideoErrorIndicator from './VideoErrorIndicator'; function BaseVideoPlayer({ url, @@ -75,6 +76,7 @@ function BaseVideoPlayer({ const [isLoading, setIsLoading] = useState(true); const [isEnded, setIsEnded] = useState(false); const [isBuffering, setIsBuffering] = useState(true); + const [hasError, setHasError] = useState(false); // we add "#t=0.001" at the end of the URL to skip first milisecond of the video and always be able to show proper video preview when video is paused at the beginning const [sourceURL] = useState(() => VideoUtils.addSkipTimeTagToURL(url.includes('blob:') || url.includes('file:///') ? url : addEncryptedAuthTokenToURL(url), 0.001)); const [isPopoverVisible, setIsPopoverVisible] = useState(false); @@ -464,37 +466,49 @@ function BaseVideoPlayer({ videoPlayerElementParentRef.current = el; }} > - )} - {((isLoading && !isOffline) || (isBuffering && !isPlaying)) && } - {isLoading && (isOffline || !isBuffering) && } + {((isLoading && !isOffline && !hasError) || (isBuffering && !isPlaying && !hasError)) && } + {isLoading && (isOffline || !isBuffering) && ( + + )} {controlStatusState !== CONST.VIDEO_PLAYER.CONTROLS_STATUS.HIDE && !isLoading && (isPopoverVisible || isHovered || canUseTouchScreen || isEnded) && ( Date: Mon, 24 Feb 2025 18:07:30 +0300 Subject: [PATCH 07/24] created a patch for expo-av that handles unsupported video for ios --- patches/expo-av+15.0.1.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/expo-av+15.0.1.patch diff --git a/patches/expo-av+15.0.1.patch b/patches/expo-av+15.0.1.patch new file mode 100644 index 00000000000..b5e27e027e3 --- /dev/null +++ b/patches/expo-av+15.0.1.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/expo-av/ios/EXAV/EXAVPlayerData.m b/node_modules/expo-av/ios/EXAV/EXAVPlayerData.m +index 99dc808..01e4bb9 100644 +--- a/node_modules/expo-av/ios/EXAV/EXAVPlayerData.m ++++ b/node_modules/expo-av/ios/EXAV/EXAVPlayerData.m +@@ -158,8 +158,16 @@ NSString *const EXAVPlayerDataObserverMetadataKeyPath = @"timedMetadata"; + // unless we preload, the asset will not necessarily load the duration by the time we try to play it. + // http://stackoverflow.com/questions/20581567/avplayer-and-avfoundationerrordomain-code-11819 + EX_WEAKIFY(self); +- [avAsset loadValuesAsynchronouslyForKeys:@[ @"duration" ] completionHandler:^{ ++ [avAsset loadValuesAsynchronouslyForKeys:@[ @"isPlayable", @"duration" ] completionHandler:^{ + EX_ENSURE_STRONGIFY(self); ++ NSError *error = nil; ++ AVKeyValueStatus status = [avAsset statusOfValueForKey:@"isPlayable" error:&error]; ++ ++ if (status == AVKeyValueStatusLoaded && !avAsset.isPlayable) { ++ NSString *errorMessage = @"Load encountered an error: [AVAsset isPlayable:] returned false. The asset does not contains a playable content or is not supported by the device."; ++ [self _finishLoadWithError:errorMessage]; ++ return; ++ } + + // We prepare three items for AVQueuePlayer, so when the first finishes playing, + // second can start playing and the third can start preparing to play. From 3fb9c571c6bbc3821e3d5057d9d6dc3c22b0d244 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Mon, 24 Feb 2025 23:23:32 +0300 Subject: [PATCH 08/24] run prettier --- src/components/AttachmentOfflineIndicator.tsx | 1 - .../VideoPlayer/BaseVideoPlayer.tsx | 10 +++-- .../VideoPlayer/VideoErrorIndicator.tsx | 41 +++++++++---------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/components/AttachmentOfflineIndicator.tsx b/src/components/AttachmentOfflineIndicator.tsx index a58ac361c88..08cd5730507 100644 --- a/src/components/AttachmentOfflineIndicator.tsx +++ b/src/components/AttachmentOfflineIndicator.tsx @@ -13,7 +13,6 @@ type AttachmentOfflineIndicatorProps = { /** Whether the offline indicator is displayed for the attachment preview. */ isPreview?: boolean; - /** Whether the offline indicator should always have a background color set. */ shouldAlwaysHaveBackground?: boolean; }; diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index f924c6663dc..786c444b4de 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -26,8 +26,8 @@ import shouldReplayVideo from './shouldReplayVideo'; import type {VideoPlayerProps, VideoWithOnFullScreenUpdate} from './types'; import useHandleNativeVideoControls from './useHandleNativeVideoControls'; import * as VideoUtils from './utils'; -import VideoPlayerControls from './VideoPlayerControls'; import VideoErrorIndicator from './VideoErrorIndicator'; +import VideoPlayerControls from './VideoPlayerControls'; function BaseVideoPlayer({ url, @@ -492,7 +492,9 @@ function BaseVideoPlayer({ }} onPlaybackStatusUpdate={handlePlaybackStatusUpdate} onFullscreenUpdate={handleFullscreenUpdate} - onError={() => {setHasError(true)}} + onError={() => { + setHasError(true); + }} /> {!hasError && ((isLoading && !isOffline) || (isBuffering && !isPlaying)) && ( @@ -502,7 +504,9 @@ function BaseVideoPlayer({ )} - {((isLoading && !isOffline && !hasError) || (isBuffering && !isPlaying && !hasError)) && } + {((isLoading && !isOffline && !hasError) || (isBuffering && !isPlaying && !hasError)) && ( + + )} {isLoading && (isOffline || !isBuffering) && ( - - - ); + const theme = useTheme(); + const styles = useThemeStyles(); + return ( + + + + ); } VideoErrorIndicator.displayName = 'VideoErrorIndicator'; -export default VideoErrorIndicator; \ No newline at end of file +export default VideoErrorIndicator; From 95a183cbcb6201dacbb665b13f763702b08a5d42 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Mon, 24 Feb 2025 23:42:03 +0300 Subject: [PATCH 09/24] remove incorrect asset --- assets/images/video-slash.svg | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 assets/images/video-slash.svg diff --git a/assets/images/video-slash.svg b/assets/images/video-slash.svg deleted file mode 100644 index 3afb2b778b2..00000000000 --- a/assets/images/video-slash.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - \ No newline at end of file From 038cde0dbcf3e924ddb1b464f8ea765360f486c2 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Tue, 25 Feb 2025 01:17:38 +0300 Subject: [PATCH 10/24] added video-slash to assets/images --- assets/images/video-slash.svg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 assets/images/video-slash.svg diff --git a/assets/images/video-slash.svg b/assets/images/video-slash.svg new file mode 100644 index 00000000000..3afb2b778b2 --- /dev/null +++ b/assets/images/video-slash.svg @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file From 7618a3bba9e4d67a56cb91a5f12fc2de998db41f Mon Sep 17 00:00:00 2001 From: HezekielT Date: Tue, 25 Feb 2025 16:30:50 +0300 Subject: [PATCH 11/24] run prettier --- src/components/VideoPlayerContexts/PlaybackContext.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/VideoPlayerContexts/PlaybackContext.tsx b/src/components/VideoPlayerContexts/PlaybackContext.tsx index f90027315ad..9eb670176aa 100644 --- a/src/components/VideoPlayerContexts/PlaybackContext.tsx +++ b/src/components/VideoPlayerContexts/PlaybackContext.tsx @@ -42,7 +42,9 @@ function PlaybackContextProvider({children}: ChildrenProps) { if ('durationMillis' in status && status.durationMillis === status.positionMillis) { newStatus.positionMillis = 0; } - playVideoPromiseRef.current = currentVideoPlayerRef.current?.setStatusAsync(newStatus).catch(); + playVideoPromiseRef.current = currentVideoPlayerRef.current?.setStatusAsync(newStatus).catch((error) => { + return error; + }); }); }, [currentVideoPlayerRef]); From 425d48999c1d83282e93bc97184b3073a60ba94d Mon Sep 17 00:00:00 2001 From: HezekielT Date: Tue, 25 Feb 2025 17:15:23 +0300 Subject: [PATCH 12/24] fix eslint error --- src/components/VideoPlayerContexts/PlaybackContext.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VideoPlayerContexts/PlaybackContext.tsx b/src/components/VideoPlayerContexts/PlaybackContext.tsx index 9eb670176aa..527ba66b9aa 100644 --- a/src/components/VideoPlayerContexts/PlaybackContext.tsx +++ b/src/components/VideoPlayerContexts/PlaybackContext.tsx @@ -42,7 +42,7 @@ function PlaybackContextProvider({children}: ChildrenProps) { if ('durationMillis' in status && status.durationMillis === status.positionMillis) { newStatus.positionMillis = 0; } - playVideoPromiseRef.current = currentVideoPlayerRef.current?.setStatusAsync(newStatus).catch((error) => { + playVideoPromiseRef.current = currentVideoPlayerRef.current?.setStatusAsync(newStatus).catch((error: AVPlaybackStatus) => { return error; }); }); From ec82aac59d43f975bb25266671621e41223e48be Mon Sep 17 00:00:00 2001 From: HezekielT Date: Thu, 27 Feb 2025 19:46:56 +0300 Subject: [PATCH 13/24] remove unnecessary style changes --- src/components/AttachmentOfflineIndicator.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/AttachmentOfflineIndicator.tsx b/src/components/AttachmentOfflineIndicator.tsx index 08cd5730507..1647921ec8c 100644 --- a/src/components/AttachmentOfflineIndicator.tsx +++ b/src/components/AttachmentOfflineIndicator.tsx @@ -12,12 +12,9 @@ import Text from './Text'; type AttachmentOfflineIndicatorProps = { /** Whether the offline indicator is displayed for the attachment preview. */ isPreview?: boolean; - - /** Whether the offline indicator should always have a background color set. */ - shouldAlwaysHaveBackground?: boolean; }; -function AttachmentOfflineIndicator({isPreview = false, shouldAlwaysHaveBackground = false}: AttachmentOfflineIndicatorProps) { +function AttachmentOfflineIndicator({isPreview = false}: AttachmentOfflineIndicatorProps) { const theme = useTheme(); const styles = useThemeStyles(); const {isOffline} = useNetwork(); @@ -46,7 +43,7 @@ function AttachmentOfflineIndicator({isPreview = false, shouldAlwaysHaveBackgrou styles.pAbsolute, styles.h100, styles.w100, - (isPreview || shouldAlwaysHaveBackground) && styles.hoveredComponentBG, + isPreview && styles.hoveredComponentBG, ]} > Date: Sat, 1 Mar 2025 10:43:10 +0300 Subject: [PATCH 14/24] Add an error occurred message to en.ts and es.ts --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/languages/en.ts b/src/languages/en.ts index 86ace0b6a5d..ce133c9aa42 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -417,6 +417,7 @@ const translations = { youAppearToBeOffline: 'You appear to be offline.', thisFeatureRequiresInternet: 'This feature requires an active internet connection.', attachementWillBeAvailableOnceBackOnline: 'Attachment will become available once back online.', + errorOccuredWhileTryingToPlayVideo: 'An error occurred while trying to play this video.', areYouSure: 'Are you sure?', verify: 'Verify', yesContinue: 'Yes, continue', diff --git a/src/languages/es.ts b/src/languages/es.ts index 77cfc7e302f..8d370f47486 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -410,6 +410,7 @@ const translations = { youAppearToBeOffline: 'Parece que estás desconectado.', thisFeatureRequiresInternet: 'Esta función requiere una conexión a Internet activa.', attachementWillBeAvailableOnceBackOnline: 'El archivo adjunto estará disponible cuando vuelvas a estar en línea.', + errorOccuredWhileTryingToPlayVideo: 'Se produjo un error al intentar reproducir este video.', areYouSure: '¿Estás seguro?', verify: 'Verifique', yesContinue: 'Sí, continuar', From af9ba7e3f63a8ef66fb99d2e5a480365934638e8 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Sat, 1 Mar 2025 10:44:19 +0300 Subject: [PATCH 15/24] added videoErrorText style --- src/styles/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/styles/index.ts b/src/styles/index.ts index b0fdc243a9e..e400932f4ca 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -2697,6 +2697,18 @@ const styles = (theme: ThemeColors) => textAlign: 'center', }, + videoErrorText: { + ...headlineFont, + color: theme.heading, + fontSize: variables.fontSizeXLarge, + lineHeight: variables.lineHeightXXLarge, + marginTop: 20, + marginBottom: 8, + paddingLeft: 20, + paddingRight: 20, + textAlign: 'center', + }, + blockingViewContainer: { paddingBottom: variables.contentHeaderHeight, maxWidth: 400, From d596b8377a73d619054c8ff022d4afe8e9c4cf49 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Sun, 2 Mar 2025 13:12:37 +0300 Subject: [PATCH 16/24] show text and icon color based on the value of isPreview passed to VideoErrorIndicator --- .../VideoPlayer/VideoErrorIndicator.tsx | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/components/VideoPlayer/VideoErrorIndicator.tsx b/src/components/VideoPlayer/VideoErrorIndicator.tsx index 9c7b344ec87..247da1f3328 100644 --- a/src/components/VideoPlayer/VideoErrorIndicator.tsx +++ b/src/components/VideoPlayer/VideoErrorIndicator.tsx @@ -5,19 +5,32 @@ import * as Expensicons from '@components/Icon/Expensicons'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; +import Text from '@components/Text'; +import useLocalize from '@hooks/useLocalize'; -function VideoErrorIndicator() { +type VideoErrorIndicatorProps = { + /** Whether it is a preview or not */ + isPreview?: boolean; +} + +function VideoErrorIndicator({isPreview=false}: VideoErrorIndicatorProps) { const theme = useTheme(); const styles = useThemeStyles(); + const {translate} = useLocalize(); return ( - + + {!isPreview && ( + + {translate('common.errorOccuredWhileTryingToPlayVideo')} + + )} ); } From d591aebd56af675a4dd3e71e91d151eda692b0e0 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Sun, 2 Mar 2025 13:45:54 +0300 Subject: [PATCH 17/24] passed isPreview to VideoErrorIndicator --- src/components/VideoPlayer/BaseVideoPlayer.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index 786c444b4de..7b34ac9401d 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -499,7 +499,7 @@ function BaseVideoPlayer({ {!hasError && ((isLoading && !isOffline) || (isBuffering && !isPlaying)) && ( )} - {hasError && } + {hasError && !isOffline && } )} @@ -510,7 +510,6 @@ function BaseVideoPlayer({ {isLoading && (isOffline || !isBuffering) && ( )} {controlStatusState !== CONST.VIDEO_PLAYER.CONTROLS_STATUS.HIDE && !isLoading && (isPopoverVisible || isHovered || canUseTouchScreen || isEnded) && ( From daf4a432d1cfbd7396d3244767ef94fa45e40761 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Sun, 2 Mar 2025 13:58:58 +0300 Subject: [PATCH 18/24] run prettier --- src/components/AttachmentOfflineIndicator.tsx | 12 +----------- src/components/VideoPlayer/BaseVideoPlayer.tsx | 8 ++------ src/components/VideoPlayer/VideoErrorIndicator.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/components/AttachmentOfflineIndicator.tsx b/src/components/AttachmentOfflineIndicator.tsx index 1647921ec8c..4ff1940ba00 100644 --- a/src/components/AttachmentOfflineIndicator.tsx +++ b/src/components/AttachmentOfflineIndicator.tsx @@ -35,17 +35,7 @@ function AttachmentOfflineIndicator({isPreview = false}: AttachmentOfflineIndica } return ( - + )} - {hasError && !isOffline && } + {hasError && !isOffline && } )} @@ -507,11 +507,7 @@ function BaseVideoPlayer({ {((isLoading && !isOffline && !hasError) || (isBuffering && !isPlaying && !hasError)) && ( )} - {isLoading && (isOffline || !isBuffering) && ( - - )} + {isLoading && (isOffline || !isBuffering) && } {controlStatusState !== CONST.VIDEO_PLAYER.CONTROLS_STATUS.HIDE && !isLoading && (isPopoverVisible || isHovered || canUseTouchScreen || isEnded) && ( Date: Tue, 4 Mar 2025 11:57:56 +0300 Subject: [PATCH 19/24] added isBuffering check to VideoErrorIndicator --- src/components/VideoPlayer/BaseVideoPlayer.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index 19b0a003c25..5089172cc5b 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -496,14 +496,11 @@ function BaseVideoPlayer({ setHasError(true); }} /> - {!hasError && ((isLoading && !isOffline) || (isBuffering && !isPlaying)) && ( - - )} - {hasError && !isOffline && } )} + {hasError && !isBuffering && !isOffline && } {((isLoading && !isOffline && !hasError) || (isBuffering && !isPlaying && !hasError)) && ( )} From de2d31debbcd92b2b6db066dd7a7de7c8f67e237 Mon Sep 17 00:00:00 2001 From: HezekielT Date: Thu, 6 Mar 2025 11:56:06 +0300 Subject: [PATCH 20/24] remove unnecessary view wrapper --- .../VideoPlayer/BaseVideoPlayer.tsx | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index 5089172cc5b..f7e98490375 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -466,37 +466,35 @@ function BaseVideoPlayer({ videoPlayerElementParentRef.current = el; }} > - - +