Skip to content
8 changes: 8 additions & 0 deletions src/components/VideoPlayer/BaseVideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ function BaseVideoPlayer({
videoPlayerRef.current?.setStatusAsync?.({rate: currentPlaybackSpeed});
}}
onLoad={() => {
if (hasError) {
setHasError(false);
}
if (!isCurrentlyURLSet || isUploading) {
return;
}
Expand All @@ -502,6 +505,11 @@ 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;
}
setHasError(true);
}}
testID={CONST.VIDEO_PLAYER_TEST_ID}
Expand Down