fideo-js docs

Configure

Options reference

The same options object is accepted by every entry point. Nearly all of them have a data-fideo-* equivalent listed on Data attributes.

Try them

Each toggle destroys the player and mounts it again with the option changed, since options are fixed at mount.

Mounted with

Playback

OptionTypeDefaultWhat it does
autoplaybooleanfalse Starts playback once the player is mounted. Subject to browser autoplay policy — pair it with muted.
mutedbooleanfalse Starts muted. Forced on when background is set.
loopbooleanfalse Repeats on end. For YouTube this also adds the playlist parameter the API requires.
playsInlinebooleantrue Keeps playback inline on iOS rather than going fullscreen.
volumenumber1 Initial volume, 01. Clamped.
playbackRatesnumber[][0.5, 1, 1.25, 1.5, 2] Rates offered in the settings menu.
preload'none' | 'metadata' | 'auto''metadata' Maps to the <video> preload attribute. HTML5 only.

Loading

OptionTypeDefaultWhat it does
lazybooleantrue for iframes Defers the provider SDK and the embed until the player nears the viewport. false for <video>.
lazyRootMarginstring'800px 0px' The IntersectionObserver margin that decides how early loading starts.
provider'auto' | 'html5' | 'youtube' | 'vimeo' | 'wistia''auto' Skips URL inference. See detection.
disabledProvidersFideoProviderName[][] Guarantees those SDKs are never loaded. Mounting a disabled provider throws.
selectorstring'[data-fideo]' What initFideo() queries. Ignored by the single-player entry points.

Sources and posters

OptionTypeDefaultWhat it does
sourcesstring | { desktop?, tablet?, mobile? }{} A string is treated as { desktop }. Swapped on resize. See Responsive media.
postersstring | { desktop?, tablet?, mobile? }{} Rendered as an overlay image that hides on play.
breakpoints{ mobile?, tablet? }{ mobile: 767, tablet: 1024 } Widths in pixels that decide which source and poster apply.

Layout and behaviour

OptionTypeDefaultWhat it does
backgroundbooleanfalse Cover-fills the container and forces autoplay, muted, loop and playsInline. Also turns controls off unless you ask for them.
backgroundAspectRationumber | string16 / 9 Source aspect ratio used for cover maths. Accepts 1.777, '16:9' or '16/9'.
viewportfalse | 'play' | 'pause' | 'play-pause'false Plays and/or pauses as the player scrolls in and out of view. Background players default to 'play-pause'.
viewportThresholdnumber0.35 How much of the player must be visible to count as in view.
controlsbooleantrue, or false in background mode Renders the control bar. When off, no click-to-toggle target is created either.
controlVisibilityPartial<FideoControlVisibility>all true Per-control switches — see below.

controlVisibility

Every key defaults to true. Hiding a control removes it from the DOM rather than hiding it with CSS.

A minimal barjs
initFideo({
  controlVisibility: {
    play: true,
    timeline: true,
    currentTime: false,
    duration: false,
    volume: true,
    settings: false,
    fullscreen: true,
  },
});

Appearance

OptionTypeDefaultWhat it does
cssVarsRecord<string, string>{} Custom properties set inline on the wrapper. See Theming.
classNamestring'' Extra class added to the generated .fideo wrapper.
iconsFideoIcons{} Inline SVG strings replacing any of the built-in icons.
injectStylesbooleantrue Adds the wrapper stylesheet to <head> on first mount. Set false if you link dist/fideo.css yourself.

Reading what was resolved

player.options holds the fully-resolved configuration — defaults applied, attributes merged, every optional field filled in. It is the quickest way to check why a player is behaving the way it is.

Debugging a playerjs
const player = mountFideo(el);
console.log(player.options);
// { provider: 'html5', autoplay: false, muted: false, volume: 1,
//   breakpoints: { mobile: 767, tablet: 1024 }, … }