Blur expo-video and react-native-video in React Native
On Android, most blur libraries leave a playing video perfectly sharp behind the glass. This page explains why, and how to blur expo-video and react-native-video.
Why the video stays sharp
Android players such as expo-video and react-native-video draw frames into a SurfaceView. The system compositor puts a SurfaceView in its own layer, outside your app's view tree. A blur that captures or renders the view tree never sees that layer, so the video shows through untouched.
How this library blurs it
BlurView finds SurfaceViews among its children, copies their frames with PixelCopy (downscaled 4×, every frame) and draws the copy in their place. The RenderEffect blur then applies to the video like everything else.
Install
React Native CLI
npm install @nguyenduy1412/react-native-blur
cd ios && pod install
Rebuild the app. Autolinking picks the library up; no Expo packages are needed.
Expo
npx expo install @nguyenduy1412/react-native-blur
npx expo run:ios
npx expo run:android
It contains native code, so it does not run in Expo Go. Use a development build or EAS Build.
Blur a whole video (content mode)
import BlurView from "@nguyenduy1412/react-native-blur";
import { useVideoPlayer, VideoView } from "expo-video";
export function BlurredVideo({ source, locked }) {
const player = useVideoPlayer(source, (p) => p.play());
return (
<BlurView style={{ flex: 1 }} intensity={locked ? 60 : 0}>
<VideoView player={player} style={{ flex: 1 }} />
</BlurView>
);
}
Content mode works with the default SurfaceView. Set intensity to 0 to remove the blur without unmounting the player.
Frosted button over a video (backdrop mode)
To blur only the area under a button and keep the rest of the video sharp, use backdrop mode. Since 2.1.0 this works with the default SurfaceView of expo-video and react-native-video on Android; the blur stays in sync with the video (syncVideo, default true).
<View style={{ flex: 1 }}>
<VideoView player={player} style={StyleSheet.absoluteFill} />
<BlurView mode="backdrop" intensity={85} tint="dark" style={{ borderRadius: 999, paddingVertical: 12, alignItems: "center" }}>
<Text style={{ color: "white" }}>Play</Text>
</BlurView>
</View>
With react-native-video it is the same; no TextureView needed:
<View style={{ flex: 1 }}>
<Video source={{ uri }} style={StyleSheet.absoluteFill} resizeMode="cover" repeat />
<BlurView mode="backdrop" intensity={85} tint="dark" style={{ borderRadius: 999, paddingVertical: 12, alignItems: "center" }}>
<Text style={{ color: "white" }}>Play</Text>
</BlurView>
</View>
Limits
- Backdrop mode copies a
SurfaceViewbehind it withPixelCopy, off the UI thread; aTextureViewis drawn directly. WithsyncVideoon, a 60 fps video is shown at the copy rate; usesyncVideo={false}or aTextureViewplayer to keep it at full rate. - Copies stop while the video is paused or the BlurView is off screen.
FAQ
Why doesn't expo-blur blur my video on Android?
Android video plays in a SurfaceView, which the system composites outside the app's view tree. View-based blurs never see it. This library copies SurfaceView frames with PixelCopy and blurs the copy.
Does backdrop blur over video work on Android 12 (API 31-32)?
Yes. Since 2.1.0 Android 12 / 12L has its own renderer: the blur follows the video, content mode no longer shows black, and video copies are half size and taken off the UI thread.
Do I need a TextureView for backdrop blur over video?
No. Since 2.1.0 the default SurfaceView works. A TextureView player (expo-video surfaceType="textureView", react-native-video viewType={ViewType.TEXTURE}) still works and needs no frame copy.
Does it work with react-native-video?
Yes. Wrap the Video in a BlurView for content mode. Since 2.1.0 backdrop mode over the video also works with the default SurfaceView, so no TextureView is needed.
Does it work in Expo Go?
No. The package contains native code, so it needs a development build (npx expo run:ios / npx expo run:android) or EAS Build. React Native CLI apps work after pod install and a rebuild.
Does it work without Expo?
Yes. Since 2.0 it is a plain React Native Fabric component, so a React Native CLI app only needs npm install and pod install.
Which Android versions get a real blur?
Android 12 (API 31) and later, where RenderEffect exists. Android 12 / 12L (API 31-32) gets the same blur and video blur as Android 13+ (API 33+) since 2.1.0, with its own renderer. Android 11 and earlier draw a translucent material plate without blur, so content stays readable.
Does it work with expo-video and react-native-video?
Yes, on iOS and Android. Since 2.1.0 backdrop mode blurs a playing expo-video VideoView or react-native-video <Video> behind it with the default Android SurfaceView, in sync with the video, and content mode blurs the whole player. No TextureView is needed.