API Reference
Complete API documentation for React Native Video Toolkit components, hooks, providers, and utilities
API Reference
Welcome to the complete API documentation for React Native Video Toolkit. This library provides a comprehensive set of components, hooks, providers, and utilities for building powerful video players in React Native applications.
All components are built with TypeScript and support the new React Native architecture (Fabric + TurboModules).
Overview
Components
Ready-to-use video player components including controls, displays, and UI elements
Hooks
React hooks for managing video state, gestures, and player functionality
Providers
Context providers for video state, theming, settings, and portals
Types
TypeScript type definitions for all library interfaces and props
Utils
Utility functions for common video player operations and helpers
Gesture Handler
Advanced gesture handling system for interactive video controls
Layouts
Pre-built layout configurations for common video player designs
Quick Start
The main entry point for the library is the VideoPlayer component:
import { VideoPlayer } from 'react-native-video-toolkit';
function MyVideoPlayer() {
return (
<VideoPlayer source={{ uri: 'https://example.com/video.mp4' }} style={{ width: '100%', height: 200 }}>
<VideoPlayer.Controls />
</VideoPlayer>
);
}Architecture
The library is organized into several key areas:
- Core Components: Essential video functionality (
VideoSurface,VideoPlayer) - Control Components: Interactive controls (
PlayButton,ProgressBar,VolumeControl) - Display Components: Visual elements (
TimeDisplay,Title,LoadingSpinner) - Layout Components: Structural containers and positioning
- Provider System: State management and theming
- Hook System: Reusable logic and state management
- Gesture System: Touch and gesture handling
This library requires React Native 0.76+ and works best with the new architecture enabled.