eyevinn-video-analytics-sdk
v1.0.0
Published
Eyevinn - Video analytics tracking for React Native applications
Maintainers
Readme
Eyevinn Video Analytics SDK
A lightweight React Native SDK for tracking video analytics events. It integrates with your React Native app and works alongside libraries like react-native-video to help you capture and send video playback data to your analytics backend.
Installation
Use either npm or yarn to install the package:
npm install eyevinn-video-analytics-sdk # or yarn add eyevinn-video-analytics-sdkUsage
- Import the SDK in your component:
import VideoAnalyticsTracker from 'eyevinn-video-analytics-sdk';- Initialize the Tracker with your configuration:
const tracker = new VideoAnalyticsTracker({
// your configuration options, e.g. videoId, user info, etc.
});- Integrate with your video component by tracking events like play, pause, and completion:
// Example: Tracking a video play event
const handlePlay = () => {
tracker.trackEvent('play', { videoId: '12345' });
};
// In your render method/component
<VideoPlayer
source={{uri: 'https://example.com/video.mp4'}}
onPlay={handlePlay}
// other props
/>- Build the SDK (if needed):
npm run buildThat's it! With these steps, you can quickly set up and use the Eyevinn Video Analytics SDK to monitor video events in your React Native app.
