ComponentsControls
ProgressBar
A customizable slider component that displays the current playback position and total duration of the video, with scrubbing support and theming integration.
Usage
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
height | number | No | 4 | Height of the progress track (in px). |
thumbWidth | number | No | 12 | Width of the draggable thumb control. |
style | StyleProp<ViewStyle> | No | – | Optional styles for the container. |
onSeekStart | () => void | No | – | Callback fired when the user starts seeking. |
onSeekEnd | (time: number) => void | No | – | Callback fired when the user finishes seeking. |
onSeek | (time: number) => void | No | – | Callback fired when the seek position changes. |
Examples
Default ProgressBar
import { ProgressBar } from 'react-native-video-toolkit';
<ProgressBar />;Custom Height & Thumb
import { ProgressBar } from 'react-native-video-toolkit';
<ProgressBar height={6} thumbWidth={16} />;Styled ProgressBar
import { ProgressBar } from 'react-native-video-toolkit';
<ProgressBar style={{ marginHorizontal: 20 }} />;Integration Example
Embed inside your VideoPlayer controls:
import { VideoPlayer, ProgressBar } from 'react-native-video-toolkit';
const MyVideoPlayer = () => {
return (
<VideoPlayer source={{ uri: 'https://example.com/video.mp4' }}>
<VideoPlayer.Controls>
<ProgressBar height={6} thumbWidth={14} />
</VideoPlayer.Controls>
</VideoPlayer>
);
};- With the default slider, the bar follows playback through shared values on the UI thread and doesn't re-render while the video plays. A custom
Slidergets the position fromuseProgress()as plain numbers, and re-renders on every progress event. - When sliding starts,
showControls()is called so the UI remains visible during scrubbing. - Use
onSeekStart,onSeek, andonSeekEndcallbacks to track user interactions. - Colors adapt automatically using the player's theme (
sliderTrackActivefor progress,sliderTrackInactivefor track).