The react-native-video package is a versatile video playback library for React Native applications. It allows developers to embed and control video playback within their mobile apps, supporting a wide range of video formats and providing various customization options.
What are react-native-video's main functionalities?
Basic Video Playback
This feature allows you to play a video from a given URI. The video is embedded within a React Native component and can be styled using standard React Native styles.
The react-native-video-controls package provides a customizable set of video controls for the react-native-video component. It extends the functionality of react-native-video by adding a set of default controls that can be easily customized.
The react-native-youtube package allows you to embed YouTube videos in your React Native application. It provides a simple interface for playing YouTube videos and supports various YouTube player features, such as autoplay, fullscreen, and video quality settings.
The react-native-vlc-media-player package is a React Native wrapper for the VLC media player. It supports a wide range of video formats and provides advanced playback features, such as network streaming, subtitles, and hardware acceleration.
You can find several examples demonstrating the usage of react-native-video here.
These include a basic usage and DRM example (with a free DRM stream).
Usage
// Load the moduleimportVideo, {VideoRef} from'react-native-video';
// Within your render function, assuming you have a file called// "background.mp4" in your project. You can include multiple videos// on a single screen if you like.constVideoPlayer = () => {
const videoRef = useRef<VideoRef>(null);
const background = require('./background.mp4');
return (
<Video
// CanbeaURLoralocalfile.source={background}
// Storereferenceref={videoRef}
// CallbackwhenremotevideoisbufferingonBuffer={onBuffer}
// CallbackwhenvideocannotbeloadedonError={onError}style={styles.backgroundVideo}
/>
)
}
// Later on in your styles..var styles = StyleSheet.create({
backgroundVideo: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
},
});
📱 react-native-video is provided as it is. For enterprise support or other business inquiries, please contact us 🤝. We can help you with the integration, customization and maintenance. We are providing both free and commercial support for this project. let's build something awesome together! 🚀
FAQs
A <Video /> element for react-native
We found that react-native-video demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 15 Feb 2025
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.
TC39 met in Seattle and advanced 9 JavaScript proposals, including three to Stage 4, introducing new features and enhancements for a future ECMAScript release.