VideoSource
Represents the source of a video, which can be either a remote URL (string) or a local asset (number fromrequire()).
Usage
Remote Video URL
Pass a string URL to load a video from a remote server:Local Video Asset
Pass the result ofrequire() to load a video bundled with your app:
Supported Formats
The specific video formats supported depend on the platform:Android
- MP4 (H.264, H.265)
- WebM
- 3GP
- MKV
- HLS (.m3u8)
- DASH (.mpd)
iOS/visionOS/tvOS
- MP4 (H.264, H.265/HEVC)
- MOV
- M4V
- HLS (.m3u8)
Examples
Basic Usage
With VideoConfig
HLS Streaming
DASH Streaming (Android)
Type Safety
When using TypeScript, theVideoSource type ensures you can only pass valid source types:
Related Types
- VideoConfig - Complete video configuration including the source URI