December 2026 - Media Player on Video.js
The media player is rebuilt on Video.js v10 and gains YouTube, Vimeo, HLS, DASH, Shaka and DRM support behind the same parts. Includes breaking changes.
Media Player now runs on Video.js v10 instead of Media Chrome. The parts keep their names and their shadcn look, and the component is about 62% shorter in both bases: 1,276 lines instead of 3,353 in Radix, and 1,281 instead of 3,390 in Base UI.
What moved to Video.js
- Player state.
MediaPlayeris a Video.js player.useMediaPlayeris its typed store hook: read state with a selector, such asuseMediaPlayer((state) => state.paused), and call actions on the store, such asplayer.play(). - Controls. Play, seek, volume, time, fullscreen, picture in picture and captions render Video.js's headless controls through diceui's
Buttonand slider styles. Their labels follow the state and are translated through Video.js's i18n. - Keyboard shortcuts and gestures. Shortcuts work while focus is anywhere inside the player, and every control exposes its shortcut with
aria-keyshortcuts. Tap toggles playback, double-tap on either side seeks 10 seconds, and double-tap in the center toggles fullscreen. - Announcements. A polite live region reads out keyboard actions, such as "Seeked to 5 seconds" or "Captions off".
- Menus. The settings menu's quality and captions options come from the media and hide when it has none. Quality shows the level the engine picked, such as "Auto (720p)".
- Tooltips.
MediaPlayerTooltipuses Video.js's tooltip, which reads the label and shortcut from its trigger and needs no portal container. The install step that patched shadcnTooltipandDropdownMenuis gone.
Sources
Pass any Video.js media component to MediaPlayerVideo, with asChild in Radix or render in Base UI, and install its package next to @videojs/react.
- HLS with
HlsJsVideofrom@videojs/hlsjs-video, or the browser's own HLS withNativeHlsVideo. - DASH with
DashVideo, or with Shaka Player throughShakaVideofrom@videojs/shaka-video. - DRM.
ShakaVideoandHlsJsVideotake license servers insource.drm, keyed by key system. Widevine plays in Chrome, Edge and Firefox; FairPlay needs Safari and your own certificate. - YouTube and Vimeo with
YouTubeVideoandVimeoVideo, behind the same controls.
Video.js marks these media components as unstable, so their options may change in a minor release.
HLS quality starts at 720p
MediaPlayerVideo caps automatic HLS quality at 720p by default. Without the cap, hls.js loaded a 1920×800 first segment into a 900 px player; with it, the first frame on Chrome's Fast 4G preset arrives in 1.8 s instead of 2.9 s. Pass maxAutoResolution="1080p" to raise the cap, or maxAutoResolution={null} to lift it. Viewers can still pick a higher quality from the settings menu.
Size and performance
- Bundle. The default example grows from 68.7 to 100.3 KB gzipped in Radix (+31.6 KB), and from 103.6 to 128.6 KB in Base UI (+25.0 KB). Video.js's core replaces Media Chrome's smaller store. Engines like hls.js, Shaka, YouTube and Vimeo load only where you import them.
- Playback. The player re-renders about five times a second while a video plays, and spends about the same main-thread time as before.
- Time remaining lags slightly on long videos. To keep playback cheap, the player updates time on the media's
timeupdateevents and skips updates that wouldn't change the display. On videos longer than about four minutes,MediaPlayerTime variant="remaining"can trail the elapsed time by up to a second.
Breaking changes
-
Renamed props. Boolean props that show something now use a positive
showname:Part Before After Default MediaPlayerwithoutTooltipshowTooltiptrueMediaPlayerSeekwithTimeshowTimefalseMediaPlayerSeekwithoutChaptershowChaptertrueMediaPlayerSeekwithoutTooltipshowTooltiptrue -
Removed root callbacks.
onPlay,onPause,onEnded,onTimeUpdate,onVolumeChange,onMuted,onMediaError,onPipErrorandonFullscreenChangeare gone fromMediaPlayer. Put media events onMediaPlayerVideoorMediaPlayerAudio, or read the state withuseMediaPlayer. -
Removed root composition.
MediaPlayerno longer takesasChildorrender. -
Removed parts and hooks.
MediaPlayerPortalanduseMediaPlayerStoreare gone.useMediaPlayeris now Video.js's store hook, so its state names change, such asmediaPausedtopaused. -
speedsmoved to the root. Set it onMediaPlayerinstead ofMediaPlayerPlaybackSpeedorMediaPlayerSettings. -
Seek preview props.
MediaPlayerSeekdropstooltipThumbnailSrc,tooltipTimeVariantand thetooltipCollision*props. Thumbnails come from ametadatatext track labeledthumbnails, and chapter titles from achapterstrack. -
Error UI.
MediaPlayerErroris an alert dialog with one dismiss button. Itserror,onRetryandonReloadprops and its retry and reload buttons are gone. -
Data attributes.
data-stateis replaced bydata-paused,data-muted,data-fullscreen,data-pip,data-activeanddata-visible. -
Audio shortcuts. Arrow keys seek and change volume without Shift.
-
Removed demo files. The docs site no longer ships
/assets/cloud.mp4and/assets/lofi.mp3. Point any copy of the old examples at your own media.
tooltipDelayDuration (Radix), tooltipDelay (Base UI), tooltipSideOffset, autoHide, disabled and expandable are unchanged.
Examples
The docs examples play openly licensed films with a credit under each player: Sintel, Big Buck Bunny and Elephants Dream from the Blender Foundation, through Blender's mirror, Mux's samples and test streams, YouTube and Vimeo. New examples show a custom skin and Widevine DRM through Shaka.
Migrating
Reinstall the component, then install the package for each media component you use, such as @videojs/hlsjs-video for HlsJsVideo:
pnpm dlx shadcn@latest add "@diceui/media-player"Then rename the boolean props and move media events to the media part:
<MediaPlayer
withoutTooltip
showTooltip={false}
onEnded={onEnded}
>
<MediaPlayerVideo src="/video.mp4" /> {}
<MediaPlayerVideo src="/video.mp4" onEnded={onEnded} /> {}
<MediaPlayerControls>
<MediaPlayerSeek withTime withoutChapter /> {}
<MediaPlayerSeek showTime showChapter={false} /> {}
</MediaPlayerControls>
</MediaPlayer>useMediaPlayer now reads Video.js state, whose names drop the media prefix, and it also covers what useMediaPlayerStore held:
const isPaused = useMediaPlayer((state) => state.mediaPaused);
const isPaused = useMediaPlayer((state) => state.paused);
const isVisible = useMediaPlayerStore((state) => state.controlsVisible);
const isVisible = useMediaPlayer((state) => state.controlsVisible);