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.
// 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! 🚀
ensure aspect ratio from video is handled in a coherent way (#4219) (a8d5841)
iOS: pause video on end reached & don't remove listeners (#4218) (2c19a47)
remove warning and refactor & fix ad workflow (#4235) (7501880)
Features
add setSource API function fix ads playback (#4185) (9a3fcda)
android: add settings button to control video playback speed (#4211) (d1883a7)
exoplayerview: Migrate ExoPlayerView to kotlin (#4038) (78f4f04)
FAQs
A <Video /> element for react-native
The npm package react-native-video receives a total of 67,147 weekly downloads. As such, react-native-video popularity was classified as popular.
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 17 Oct 2024
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.
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
A malicious npm campaign is targeting Ethereum developers by impersonating Hardhat plugins and the Nomic Foundation, stealing sensitive data like private keys.