Installation
Getting started with react-native-video-player
is quick and easy. Follow these steps to integrate the library into your React Native project.
Step 1: Install the Libraryβ
Select your package manager below to see the appropriate installation command:
- NPM
- YARN
npm install react-native-video-player@beta react-native-video
yarn add react-native-video-player@beta react-native-video
Step 2: Install iOS Dependenciesβ
If you're targeting iOS, navigate to the ios
directory and run pod install
to install the necessary CocoaPods:
cd ios
pod install
Example Usageβ
Hereβs a simple example of how to use react-native-video-player
in your app:
import React from 'react';
import {View} from 'react-native';
import VideoPlayer from 'react-native-video-player';
const App = () => (
<View style={{ flex: 1 }}>
<VideoPlayer
source={{ uri: 'https://example.com/video.mp4' }}
thumbnail={{ uri: 'https://example.com/thumbnail.jpg' }}
autoplay
/>
</View>
);
export default App;
You're now ready to use react-native-video-player
in your project. Happy coding! π