fideo-js docs

Interface

Theming

The control bar lives in a shadow root, so ordinary selectors cannot reach inside it. That is deliberate — nothing on your page can accidentally break the player. There are three supported ways in: custom properties, ::part(), and your own icons.

Live

Applieddefault
What the buttons setjs
const sunset = {
  '--fideo-accent': '#ff9d5c',
  '--fideo-track-fill': '#ffd0a8',
  '--fideo-buffer-color': 'rgba(255, 208, 168, 0.45)',
  '--fideo-radius': '14px',
};

mountFideo(el, { cssVars: sunset });

Custom properties

Every variable is declared on the .fideo wrapper and inherits through the shadow boundary, which is why setting one in ordinary CSS reaches the controls.

Colour
PropertyDefaultAffects
--fideo-accent#46d9a7Hover and focus colour, active playback rate, focus ring
--fideo-bgtransparentWrapper background behind the media
--fideo-control-bgtransparentControl bar background
--fideo-control-color#ffffffIcons and slider thumbs
--fideo-muted-colorrgba(255,255,255,.92)Time labels
--fideo-trackrgba(255,255,255,.46)Unplayed part of the timeline
--fideo-track-fillrgba(255,255,255,.9)Played part of the timeline
--fideo-buffer-colorrgba(255,255,255,.68)Buffered band between played and unplayed
Size and shape
PropertyDefaultAffects
--fideo-radius8pxWrapper corners
--fideo-track-size5pxTimeline and volume slider thickness
--fideo-thumb-size13pxSlider handle diameter
--fideo-button-size26pxButton hit area
--fideo-button-radius4pxButton corners
--fideo-icon-size17pxIcon dimensions
--fideo-gap10pxSpacing between controls

Four places to set them

Globally, in your stylesheetcss
.fideo {
  --fideo-accent: #ff9d5c;
  --fideo-radius: 14px;
}
Per player, with a classcss
.fideo.brand-dark { --fideo-control-color: #0b0e13; }
Per player, in markup — six shorthands existhtml
<video data-fideo data-fideo-accent="#ff6f61" data-fideo-radius="0"></video>
Per player, in JavaScript — any propertyjs
mountFideo(el, {
  cssVars: { '--fideo-accent': '#ff6f61', '--fideo-gap': '16px' },
});
The markup shorthands only cover six propertiesaccent, control-bg, control-color, track, track-fill and radius. Everything else goes through CSS or cssVars.

::part()

When a variable is not enough, each control is exposed as a shadow part on the .fideo__controls host, which you can target from ordinary CSS.

Pill buttons, taller timeline::part()
The CSS applied abovecss
.fideo__controls::part(play-button),
.fideo__controls::part(fullscreen-button) {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
}

.fideo__controls::part(timeline) { height: 22px; }

.fideo__controls::part(settings-menu) {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.3);
}
PartElement
play-buttonPlay / pause toggle
mute-buttonMute / unmute toggle
volume-sliderVolume range input
timelineSeek bar range input
current-timeElapsed time text
durationDuration text
time-separatorThe slash between them
settings-buttonPlayback-rate toggle
settings-menuRate menu container
speed-buttonAn individual rate option
fullscreen-buttonFullscreen toggle
::part() cannot select descendants. You can style the part itself, but not elements inside it — ::part(play-button) svg will not match. Size icons with --fideo-icon-size instead.

Styling the wrapper

Everything outside the shadow root is plain CSS. The wrapper carries state classes you can hook into.

ClassPresent when
.fideoAlways — the generated wrapper
.fideo--html5 · --youtube · --vimeo · --wistiaPer provider
.fideo--backgroundBackground mode
.fideo--no-controlsControls disabled
.is-readyMounted
.is-playing · .is-pausedPlayback state
.is-user-activeRecent pointer or keyboard activity
.has-poster · .is-poster-visibleA poster exists / is currently shown
.is-fullscreenThis player owns fullscreen
.fideo__mediaOn the video, iframe or wistia-player element
.fideo__posterOn the poster overlay image
Add your own classhtml
<video data-fideo data-fideo-class="rounded-hero"></video>

Replacing the icons

Pass inline SVG strings. Anything you leave out keeps its default.

Custom play, pause and fullscreen iconsicons option
Triangle and bars instead of the defaultsjs
mountFideo(el, {
  icons: {
    play: '<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>',
    pause: '<svg viewBox="0 0 24 24"><path d="M7 5h4v14H7zM13 5h4v14h-4z"/></svg>',
  },
});
KeyUsed for
playPlay button, paused state
pausePlay button, playing state
volumeVolume above 50%
volumeLowVolume at or below 50%
mutedMuted, or volume at zero
settingsPlayback-rate menu
fullscreenEnter fullscreen
fullscreenExitLeave fullscreen
Icon strings are inserted as HTML. Treat them as code you control and never build them from user input.