Skip to content
  • Android
  • iOS
  • Web

Video Player

Play a clip with the engine’s media component.

Engine API VideoPlayernayan-ui/video

Live examples

Serve a video file from your app and pass its URL to VideoPlayer.

Example.tsx

Preparing preview…

Attributes

VideoPlayer attributes
NameTypeDefaultDetails
sourceVideoSourceRequired
controlsbooleanOptionalShow the platform's playback controls. Defaults to true.
autoPlaybooleanOptionalStart a new source automatically when the platform allows it. Defaults to false.
loopbooleanOptional
mutedbooleanOptional
volumenumberOptionalVolume from 0 to 1 where supported. Defaults to 1.
contentFitVideoContentFitOptional
styleCSSPropertiesOptional
refRef<VideoPlayerHandle>OptionalAllows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).
onStatusChange((status: VideoStatus) => void)Optional
onProgress((progress: VideoProgress) => void)Optional
onError((error: Error) => void)Optional
React Native API

React Native attributes

VideoPlayer react native attributes
NameTypeDefaultDetails
sourcenumber | VideoSourceRequiredA URI or a React Native bundled asset returned by require().
controlsbooleanOptionalShow the platform's playback controls. Defaults to true.
autoPlaybooleanOptionalStart a new source automatically when the platform allows it. Defaults to false.
loopbooleanOptional
mutedbooleanOptional
volumenumberOptionalVolume from 0 to 1 where supported. Defaults to 1.
contentFitVideoContentFitOptional
styleStyleProp<ViewStyle>Optional
refRef<VideoPlayerHandle>OptionalAllows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).
onStatusChange((status: VideoStatus) => void)Optional
onProgress((progress: VideoProgress) => void)Optional
onError((error: Error) => void)Optional
Video Player module

Tags