2.2.8

Panel Controls

Last updated


This page covers the eight controls available in option.panelItem, the order they render in, and the showThumb drag-thumb option.

Controls at a Glance


The default is ["play", "progress", "time", "volumeMini", "rate", "full"].
ValueControlBehavior
playPlay/pause buttonToggles playback; the icon follows playing/pause events
progressProgress barPauses and updates the time while dragging, seeks 500 ms after dragging stops, then resumes 500 ms later
timeCurrent time / duratione.g. 0:12/0:30; not rendered in minimal
timeMiniCurrent timee.g. 0:12; not rendered in minimal
volumeMute button + always-visible volume sliderThe button toggles mute; dragging to 0 counts as muted, and unmuting from 0 restores 50
volumeMiniCollapsible volume buttonClick to expand the slider; it collapses 1 s after the pointer leaves; the button itself does not mute
rateSpeed buttonCycles 1 → 1.25 → 1.5 → 2 → 0.5 → 1
fullFullscreen buttonSee Mobile Fullscreen; not rendered for audio sources

The time format follows the total duration: 0:ss under a minute, mm:ss under an hour, hh:mm:ss otherwise.

Order and Duplicates


Controls are appended in array order, so the array order is the on-screen order. Listing a value twice renders two controls, but only the last one gets event bindings, so avoid duplicates.

showThumb


option.showThumb is written to the container's data-thumb; when false, the stylesheet hides the drag thumbs on the progress and volume sliders and keeps only the filled bar.

Example


  1. <div style="max-width: 480px; aspect-ratio: 16 / 9"><div id="player"></div></div>
  2. <script>
  3. const player = new FPlyr({
  4. id: "player",
  5. video: "https://cdn.pixabay.com/video/2023/11/28/191159-889246512_tiny.mp4",
  6. option: {
  7. panelItem: ["play", "progress", "timeMini", "volume", "rate", "full"],
  8. showThumb: false,
  9. },
  10. });
  11. console.log("buttonPlay:", player.panel.buttonPlay != null);
  12. console.log("inputVolume:", player.panel.inputVolume != null);
  13. console.log("inputVolumeMini:", player.panel.inputVolumeMini != null);
  14. console.log("data-thumb:", player.body.dataset.thumb);
  15. </script>
Live preview · @pardnchiu/flexplyr@2.2.9

Version Differences


Since 2.1.0, time shows the full format (0:00/0:30), and the old short format was renamed timeMini.

中文