2.2.8

Runtime Dependencies

Last updated


This page lists the external assets FlexPlyr injects into <head> on load and what they mean for versioning, CSP, and SSR.

Injected Assets


As soon as the script runs, it inserts the following preconnect, preload, and loading tags into <head> (src/js/*.js), regardless of how many players you create or which sources they use:
AssetURLPurpose
Panel styleshttps://cdn.jsdelivr.net/npm/@pardnchiu/flexplyr@latest/dist/FlexPlyr.cssContainer, panel, and theme styles
Icon fonthttps://fonts.googleapis.com/css2?family=Material+Symbols+Outlined...Panel button icons (play_arrow, volume_up, and other font ligatures)
YouTube SDKhttps://www.youtube.com/iframe_api (async)YT.Player
Vimeo SDKhttps://player.vimeo.com/api/player.js (async)Vimeo.Player

  1. <script>
  2. const urls = [...document.head.querySelectorAll('link[rel="stylesheet"], script[src]')]
  3. .map((e) => e.href || e.src)
  4. .filter((u) => !u.includes("/dist/FlexPlyr.js"));
  5. urls.forEach((u) => console.log(u));
  6. </script>
Live preview · @pardnchiu/flexplyr@2.2.9

Implications


AreaDetails
Style versionStyles always come from @latest, so even with the script pinned to @2.2.9, styles change when a new version ships
HTML5-only pagesThe YouTube and Vimeo SDKs still download
CSPscript-src must allow cdn.jsdelivr.net (when loading from the CDN), www.youtube.com, and player.vimeo.com; style-src must allow cdn.jsdelivr.net and fonts.googleapis.com; font-src must allow fonts.gstatic.com; frame-src must allow www.youtube.com and player.vimeo.com
SSRThe module touches document.head and navigator.userAgent on load, so importing it in Node.js fails; load it dynamically on the client only
SDK timingThe SDKs load async, so YouTube/Vimeo players must wait for them; see Media Sources


中文