Skip to content

UI controls ​

Import UI components from videojs-vue/ui and render them inside PlayerRoot.

ts
import { MediaContainer, PlayButton, TimeSlider } from 'videojs-vue/ui'

These are unstyled bindings to upstream custom elements. Their default slots, attributes, and event listeners are passed to the underlying elements. Declared props are synchronized as DOM properties; removing a prop restores the element's captured constructor default.

Layout and display ​

ComponentDeclared propsPurpose
MediaContainerNoneMedia and fullscreen container.
MediaControlsvisibilityControl visibility behavior.
MediaControlsContentNoneContent inside the controls layer.
MediaControlsGroupNoneGroup controls in a layout.
PosterNoneDisplay the player poster.
StatusAnnouncerNoneAnnounce player status for assistive technology.

visibility uses the upstream ControlsElement['visibility'] type. For example, visibility="always" keeps the controls visible.

Buttons ​

All buttons accept optional disabled: boolean and label: string props.

ComponentAdditional propsAction
PlayButtonNoneToggle playback.
MuteButtonNoneToggle mute.
FullscreenButtonNoneToggle fullscreen.
PiPButtonNoneToggle picture-in-picture.
CaptionsButtonNoneToggle captions.
SeekButtonseconds: numberSeek by the specified offset.

Provide visible content through the default slot. Built-in accessible labels follow player state; an explicit label overrides that label. Translate explicit labels in your application when needed.

Time ​

PropType
typeUpstream TimeElement['type']
toggleboolean
negativeSignstring
labelstring

All props are optional and retain upstream defaults when omitted.

Sliders ​

TimeSlider and VolumeSlider accept these optional props:

PropType
disabledboolean
labelstring
stepnumber
largeStepnumber
orientationUpstream TimeSliderElement['orientation']

TimeSlider additionally accepts pauseOnDrag: boolean and changeThrottle: number.

Build slider visuals with SliderTrack, SliderBuffer, SliderFill, and SliderThumb. These parts have no declared Vue props. Supply their layout and appearance with CSS.

Listeners such as @drag-start and @drag-end receive the upstream custom events unchanged.

Hotkey ​

PropType
keysstring
actionUpstream HotkeyElement['action']
valuenumber
disabledboolean
targetUpstream HotkeyElement['target']

All props are optional. Accepted action and target values follow the installed upstream types.

Styling and accessibility ​

The wrappers preserve upstream keyboard behavior, accessible labels, and state attributes. Keep visible focus styles, give custom controls understandable text, and include StatusAnnouncer when assembling a complete interface.

See the composition guide for a working layout, the Playground for a composed slider, and the Video.js UI guide for upstream state attributes and styling.

Individual entries ​

Each entry registers only its own control and upstream dependencies. Use these paths when selecting a subset; the videojs-vue/ui aggregate still registers all controls.

ComponentImport path
CaptionsButtonvideojs-vue/ui/captions-button
FullscreenButtonvideojs-vue/ui/fullscreen-button
Hotkeyvideojs-vue/ui/hotkey
MediaContainervideojs-vue/ui/container
MediaControlsvideojs-vue/ui/controls
MediaControlsContentvideojs-vue/ui/controls-content
MediaControlsGroupvideojs-vue/ui/controls-group
MuteButtonvideojs-vue/ui/mute-button
PiPButtonvideojs-vue/ui/pip-button
PlayButtonvideojs-vue/ui/play-button
Postervideojs-vue/ui/poster
SeekButtonvideojs-vue/ui/seek-button
SliderBuffervideojs-vue/ui/slider-buffer
SliderFillvideojs-vue/ui/slider-fill
SliderThumbvideojs-vue/ui/slider-thumb
SliderTrackvideojs-vue/ui/slider-track
StatusAnnouncervideojs-vue/ui/status-announcer
Timevideojs-vue/ui/time
TimeSlidervideojs-vue/ui/time-slider
VolumeSlidervideojs-vue/ui/volume-slider