Skip to content

Commit 090d487

Browse files
committed
Hide Controlls and loader in full screen blur
1 parent b7e6a9b commit 090d487

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-video-provider",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"description": "Singleton-engine video library for React Native (one native player, many surfaces)",
55
"main": "./lib/module/index.js",
66
"types": "./lib/typescript/src/index.d.ts",

src/components/VideoControls.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ export interface VideoControlsProps {
3333
*/
3434
offlineMessage?: string;
3535
/**
36-
* Suppress the center loading/buffering spinner — e.g. while `isBlur` is
37-
* active on the player: a spinner over a blurred picture reads as broken
38-
* rather than intentional. Default false.
36+
* Mirrors the player's `isBlur` prop: while true, hides the loading/
37+
* buffering spinner (in every case, not just while offline — a spinner
38+
* over a blurred picture reads as broken rather than intentional) and the
39+
* mute and fullscreen buttons. Default false.
3940
*/
40-
hideLoader?: boolean;
41+
isBlur?: boolean;
4142
}
4243

4344
/**
@@ -53,7 +54,7 @@ export function VideoControls({
5354
showFullscreenButton = true,
5455
onClose,
5556
offlineMessage = 'No Internet Connection',
56-
hideLoader = false,
57+
isBlur = false,
5758
}: VideoControlsProps) {
5859
const manager = useVideoManager();
5960
const playing = usePlayback((s) => s.playing);
@@ -70,7 +71,7 @@ export function VideoControls({
7071

7172
const feedArriving = playing || buffered > 0 || position > 0;
7273
const showLoader =
73-
!hideLoader &&
74+
!isBlur &&
7475
(live ? (loading || buffering) && !feedArriving : loading || buffering);
7576
const showOffline = !online && (loading || buffering);
7677

@@ -128,7 +129,7 @@ export function VideoControls({
128129

129130
const progress = duration > 0 ? Math.min(position / duration, 1) : 0;
130131

131-
const muteButton = (
132+
const muteButton = isBlur ? null : (
132133
<Pressable
133134
style={styles.button}
134135
onPress={() => (muted ? manager.unmute() : manager.mute())}
@@ -142,7 +143,7 @@ export function VideoControls({
142143
</Pressable>
143144
);
144145

145-
const fullscreenButton = showFullscreenButton ? (
146+
const fullscreenButton = showFullscreenButton && !isBlur ? (
146147
<Pressable
147148
style={styles.button}
148149
onPress={() => manager.toggleFullscreen()}

src/components/VideoPlayer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ export const VideoPlayer = forwardRef<VideoManager, VideoPlayerProps>(
417417
{thumbnail()}
418418
</View>
419419
) : null}
420-
{controls ? <VideoControls hideLoader={isBlur} /> : null}
420+
{controls ? <VideoControls isBlur={isBlur} /> : null}
421421
</View>
422422
);
423423
}

0 commit comments

Comments
 (0)