Skip to content

Commit 7da8108

Browse files
authored
Merge pull request #60893 from linhvovan29546/fix/ios-error-message-overlap-video-when-re-connect
fix: error message overlaps video player when re connect
2 parents 3b159c3 + b8685aa commit 7da8108

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/VideoPlayer/BaseVideoPlayer.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,9 @@ function BaseVideoPlayer({
494494
videoPlayerRef.current?.setStatusAsync?.({rate: currentPlaybackSpeed});
495495
}}
496496
onLoad={() => {
497+
if (hasError) {
498+
setHasError(false);
499+
}
497500
if (!isCurrentlyURLSet || isUploading) {
498501
return;
499502
}
@@ -502,6 +505,11 @@ function BaseVideoPlayer({
502505
onPlaybackStatusUpdate={handlePlaybackStatusUpdate}
503506
onFullscreenUpdate={handleFullscreenUpdate}
504507
onError={() => {
508+
// No need to set hasError while offline, since the offline indicator is already shown.
509+
// Once the user reconnects, if the video is unsupported, the error will be triggered again.
510+
if (isOffline) {
511+
return;
512+
}
505513
setHasError(true);
506514
}}
507515
testID={CONST.VIDEO_PLAYER_TEST_ID}

0 commit comments

Comments
 (0)