2.2.8

Panel Themes

Last updated


This page covers the five panel themes selected by option.panelType and how they are applied.

How It Works


option.panelType is written to the container's data-type attribute, and the stylesheet applies each look through .FPlyr[data-type="..."] selectors (src/scss/panelType/). Any value not listed behaves like the default theme.
ValueLookExtra behavior
"" (default)Translucent bar floating at the bottom of the picture—
minimalCompact centered bar with rounded top cornersWidth is fixed from the item count; time/timeMini are not rendered
classicBottom gradient overlay with a rounded pill bar—
retroGrey bevelled borders with a monospace font—
simpleFlat light-grey bar with a monospace font—

Every theme hides the panel 1 second into playback and shows it again on mouse movement or pause.

Example


One player per theme (no id, so each player.body is inserted manually):
  1. <style>.box { max-width: 480px; aspect-ratio: 16 / 9; margin-bottom: 12px }</style>
  2. <script>
  3. for (const panelType of ["", "minimal", "classic", "retro", "simple"]) {
  4. const box = document.createElement("div");
  5. box.className = "box";
  6. document.body.appendChild(box);
  7. const player = new FPlyr({
  8. video: "https://cdn.pixabay.com/video/2023/11/28/191159-889246512_tiny.mp4",
  9. option: { panelType },
  10. });
  11. box.appendChild(player.body);
  12. console.log(JSON.stringify(panelType), "->", JSON.stringify(player.body.dataset.type));
  13. }
  14. </script>
Live preview · @pardnchiu/flexplyr@2.2.9

Where the Styles Come From


Theme styles live in FlexPlyr.css, which the script loads automatically from jsDelivr @latest (see Runtime Dependencies). To customize a theme, override .FPlyr[data-type="..."] > div.panel in your own stylesheet.

中文