VideoSurface
VideoSurface is a thin wrapper around react-native-video.
It integrates the video element with the toolkit's context and hooks, so playback, buffering, and layout updates are automatically synchronized with the global player state.
Usage
import { VideoSurface } from 'react-native-video-toolkit';
export function CustomSurfaceExample() {
  return (
    <VideoSurface
      source={{ uri: 'https://example.com/video.mp4' }}
      resizeMode="cover"
      onEnd={() => console.log('Playback finished')}
    />
  );
}
Props
All props from react-native-video are supported.
| Prop | Type | Required | Default | Description | 
|---|---|---|---|---|
source | VideoSource | Yes | – | Video source (uri, local file, or require). | 
style | StyleProp<ViewStyle> | No | – | Additional style applied to the <Video> surface. | 
...rest | ReactVideoProps | No | – | Any other props from react-native-video are passed through. | 
Events
These events are already handled internally and connected to the global store:
onLoad→ sets duration, clears buffering, deduplicates tracks, and selects the first available track by default.onProgress→ updates current timeonBuffer→ updates buffering stateonError→ dispatches an error message into stateonEnd→ stops playback, seeks to0, and shows controlsonLayout→ updates player layout in state
You can override these if needed, but by default they keep your UI in sync.
Layout & Fullscreen
- Automatically adapts when 
fullscreenis toggled in the global store. - Uses a 
16:9aspect ratio by default in normal mode. - In fullscreen, expands to 
Dimensions.get('window'). 
warning
- Typically, you don't use 
VideoSurfacedirectly — it's already included insideVideoPlayer. - Import it only if you want to replace or deeply customize the rendering of the video element (e.g., special resize modes, advanced performance tuning).