Skip to main content

Video Types

This document outlines the types related to the video player.

VideoSource

The VideoSource interface defines the source of the video to be played. Extends the source prop from react-native-video to include all the properties available in source prop of react-native-video.

PropertyTypeRequiredDefaultDescription
uristringYesThe URI of the video.
typestringNoThe type of the video.
headersRecord<string, string>NoThe headers to be sent with the request for the video.
note

The uri is the only required property. The type and headers are optional and can be used to provide more information about the video source.

VideoState

The VideoState interface represents the current state of the video player.

PropertyTypeRequiredDefaultDescription
isPlayingbooleanYesfalseWhether the video is currently playing.
currentTimenumberYes0The current playback time of the video.
durationnumberYes0The total duration of the video.
bufferingbooleanYesfalseWhether the video is currently buffering.
mutedbooleanYesfalseWhether the video is currently muted.
volumenumberYes1The current volume of the video.
playbackRatenumberYes1The current playback rate of the video.
fullscreenbooleanYesfalseWhether the video is currently in fullscreen.
errorstringYesnullThe current error, if any.

VideoPlayerConfig

The VideoPlayerConfig interface allows you to configure the behavior of the video player.

PropertyTypeRequiredDefaultDescription
autoHideControlsbooleanNotrueIf true, the controls will automatically hide after a certain delay.
autoPlaybooleanNotrueIf true, the video will start playing automatically.
autoHideDelaynumberNo5000The delay in milliseconds before the controls are hidden.
enableDoubleTapGesturesbooleanNotrueIf true, the user can double-tap to seek forward or backward.
enableFullscreenbooleanNotrueIf true, the user can enter and exit fullscreen mode.
enableVolumeControlbooleanNotrueIf true, the user can control the volume of the video.
enablePanGesturesbooleanNotrueIf true, the user can use pan gestures to control volume and brightness.
enableScreenRotationbooleanNotrueIf true, the screen will rotate automatically when the device is rotated.
playbackRatesnumber[]No[0.5, 1, 1.25, 1.5, 2]An array of playback rates to be displayed in the settings menu.
onEnterFullscreen() => voidNoundefinedA callback function that is called when the player enters fullscreen mode.
onExitFullscreen() => voidNoundefinedA callback function that is called when the player exits fullscreen mode.
onHideControls() => voidNoundefinedA callback function that is called when the controls are hidden.
onShowControls() => voidNoundefinedA callback function that is called when the controls are shown.