fideo-js docs

Configure

Data attributes

Everything on this page configures a player without a line of JavaScript, which makes it the natural fit for CMS output and templates. Attributes are read once, when the player mounts.

Configured bymarkup only
The markup abovehtml
<video
  data-fideo
  data-fideo-src="/media/clip.mp4"
  data-fideo-poster="/media/poster.jpg"
  data-fideo-muted="true"
  data-fideo-loop="true"
  data-fideo-volume="0.4"
  data-fideo-playback-rates="1, 1.5, 2"
  data-fideo-show-settings="false"
  data-fideo-accent="#7ab8ff"
></video>

How values are parsed

KindAcceptedNotes
Boolean "" · true · 1 · yes · on
false · 0 · no · off
Case-insensitive. A bare attribute counts as true, which is why data-fideo-muted alone works. Anything unrecognised falls back to the default.
Number 0.4 · 30 · 1e3 Anything Number() accepts. Non-finite values fall back to the default.
Number list "1, 1.5, 2" Comma separated. Values that are not finite and positive are dropped; an empty result falls back.
Ratio "16:9" · "16/9" · "1.777" Both parts must be positive numbers, otherwise the default applies.
An invalid value never throws. Fideo falls back to the JavaScript option, then to the built-in default, so a bad CMS field degrades instead of breaking the page.

Core

AttributeOptionDefault
data-fideoMarks the element for initFideo() and auto-init
data-fideo-providerproviderauto
data-fideo-classclassName''

Playback

AttributeOptionDefault
data-fideo-autoplayautoplayfalse
data-fideo-mutedmutedfalse
data-fideo-looploopfalse
data-fideo-playsinlineplaysInlinedata-fideo-plays-inline also workstrue
data-fideo-volumevolume1
data-fideo-playback-ratesplaybackRates0.5, 1, 1.25, 1.5, 2
data-fideo-preloadpreloadmetadata

Loading

AttributeOptionDefault
data-fideo-lazylazytrue for iframes
data-fideo-lazy-root-marginlazyRootMargin800px 0px
data-fideo-lazy-src is written by Fideo while an embed waits to load. It holds the URL taken off src and is removed once the player upgrades — do not set it yourself.

Sources and posters

AttributeApplies to
data-fideo-srcDesktop source, and the fallback for every width
data-fideo-src-desktopDesktop source — wins over data-fideo-src
data-fideo-src-tabletTablet source
data-fideo-src-mobileMobile source
data-fideo-posterDesktop poster, and the fallback for every width
data-fideo-poster-desktopDesktop poster — wins over data-fideo-poster
data-fideo-poster-tabletTablet poster
data-fideo-poster-mobileMobile poster
data-fideo-breakpoint-mobileMobile breakpoint in pixels — default 767
data-fideo-breakpoint-tabletTablet breakpoint in pixels — default 1024

Layout and behaviour

AttributeOptionDefault
data-fideo-backgroundbackgroundfalse
data-fideo-background-aspect-ratiobackgroundAspectRatio16:9
data-fideo-viewportviewportplay · pause · play-pause · nonefalse
data-fideo-viewport-thresholdviewportThreshold0.35
data-fideo-controlscontrolstrue
data-fideo-viewport also accepts a plain boolean. true means play-pause; false or none switches it off.

Showing and hiding controls

AttributeHides
data-fideo-show-playPlay/pause button
data-fideo-show-timelineSeek bar
data-fideo-show-current-timeElapsed time
data-fideo-show-durationTotal duration
data-fideo-show-timeBoth time labels at once — a shorthand the two above override
data-fideo-show-volumeMute button and volume slider
data-fideo-show-settingsPlayback-rate menu
data-fideo-show-fullscreenFullscreen button

All default to true; set one to "false" to remove that control.

Theming

These six write a custom property straight onto the wrapper. Anything beyond them belongs in CSS or cssVars.

AttributeCustom property
data-fideo-accent--fideo-accent
data-fideo-control-bg--fideo-control-bg
data-fideo-control-color--fideo-control-color
data-fideo-track--fideo-track
data-fideo-track-fill--fideo-track-fill
data-fideo-radius--fideo-radius

Attributes Fideo writes

AttributeMeaning
data-fideo-readySet to "true" on the media element once mounted. Removed on destroy().
data-fideo-lazy-srcHolds a deferred embed URL until the player loads.