From ccc9179e83e2eb04211403d953c44bc5bd3f813a Mon Sep 17 00:00:00 2001 From: Linh Date: Fri, 25 Apr 2025 17:44:21 +0700 Subject: [PATCH 1/2] fix: error message overlaps video player when re connect --- src/components/VideoPlayer/BaseVideoPlayer.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index 251c74d4cbcc3..c6e91829eb3f2 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -494,6 +494,9 @@ function BaseVideoPlayer({ videoPlayerRef.current?.setStatusAsync?.({rate: currentPlaybackSpeed}); }} onLoad={() => { + if (hasError) { + setHasError(false); + } if (!isCurrentlyURLSet || isUploading) { return; } @@ -502,6 +505,9 @@ function BaseVideoPlayer({ onPlaybackStatusUpdate={handlePlaybackStatusUpdate} onFullscreenUpdate={handleFullscreenUpdate} onError={() => { + if (isOffline) { + return; + } setHasError(true); }} testID={CONST.VIDEO_PLAYER_TEST_ID} From 0830ef212856bcadd68bd0de2825799ff335ae8f Mon Sep 17 00:00:00 2001 From: Linh Date: Thu, 8 May 2025 06:33:48 +0700 Subject: [PATCH 2/2] fix: add explanatory comment for clarity --- src/components/VideoPlayer/BaseVideoPlayer.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index 719bcf7488e38..2875817156225 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -505,6 +505,8 @@ function BaseVideoPlayer({ onPlaybackStatusUpdate={handlePlaybackStatusUpdate} onFullscreenUpdate={handleFullscreenUpdate} onError={() => { + // No need to set hasError while offline, since the offline indicator is already shown. + // Once the user reconnects, if the video is unsupported, the error will be triggered again. if (isOffline) { return; }