A sample React Native application demonstrating the integration of TPStreams video player with download management and navigation.
TPStreams SDK: react-native-tpstreams
- Node.js (v16 or higher)
- React Native development environment set up
- For iOS: Xcode and CocoaPods
- For Android: Android Studio and Android SDK
git clone https://github.com/testpress/sample-rn-player-app.git
cd SampleRNPlayerAppnpm installcd ios
pod install
cd ..No additional setup required. The dependencies will be automatically linked.
npx react-native run-androidnpx react-native run-iosOr open ios/SampleRNPlayerApp.xcworkspace in Xcode and run from there.
First, initialize the TPStreams SDK with your Organization ID in index.js:
import { TPStreams } from 'react-native-tpstreams';
// Replace 'YOUR_ORG_ID' with your actual TPStreams Organization ID
TPStreams.initialize('YOUR_ORG_ID');Example:
TPStreams.initialize('9q94nm');To use your own videos, update the video IDs and access tokens in src/screens/HomeScreen.tsx:
navigation.navigate('Video', {
videoId: 'YOUR_VIDEO_ID',
accessToken: 'YOUR_ACCESS_TOKEN',
title: 'Video Title'
});Example:
navigation.navigate('Video', {
videoId: '42h2tZ5fmNf',
accessToken: '9327e2d0-fa13-4288-902d-840f32cd0eed',
title: 'DRM Video'
});