ComponentsControls

VolumeControl

A customizable slider that allows users to adjust video volume interactively, integrated with the video player's state and theme.

Usage


Props

PropTypeRequiredDefaultDescription
orientation'horizontal' | 'vertical'No'horizontal'Orientation of the slider (horizontal or vertical).
widthnumberNo100Width of the slider (applies when orientation="horizontal").
heightnumberNo4Height of the slider track.
thumbWidthnumberNo12Width of the draggable thumb.
trackColorstringNoTheme sliderTrackInactiveColor of the inactive track section.
progressColorstringNoTheme sliderTrackActiveColor of the active track section.
styleStyleProp<ViewStyle>No–Optional styles for the container.
onVolumeChange(volume: number) => voidNo–Callback fired when the volume changes.

Examples

Default VolumeControl

import { VolumeControl } from 'react-native-video-toolkit';

<VolumeControl />;

Vertical Slider

import { VolumeControl } from 'react-native-video-toolkit';

<VolumeControl orientation="vertical" height={120} width={6} />;

Custom Size & Style

import { VolumeControl } from 'react-native-video-toolkit';

<VolumeControl width={150} height={6} thumbWidth={16} style={{ marginVertical: 10 }} />;

  • Volume values range from 0 (muted) to 1 (max).
  • The control calls setVolume(newVolume) automatically.
  • Use the onVolumeChange callback to respond to volume changes.
  • renderBubble is disabled by default (no value tooltip) to keep the UI minimal.

On this page