Changeset 2873b30 in Klonkt


Ignore:
Timestamp:
06/20/2026 02:54:09 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
557a76f
Parents:
16b0c00
Message:

fix(embed): Spotify directly as bare iframe (instant, no API wait)

The Spotify iFrame API bundle often fails to initialise in practice (CDN
gating), and their player cannot be skinned anyway. Therefore with Spotify
show the bare iframe immediately instead of waiting for the API → instant
rather than seconds of "sluggishness". CSP whitelist + 4s timeout (previous
commit) remain as a fallback for those who do get the API. buster
embed-player.js?v=6.

Co-Authored-By: Claude <noreply@…>

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/assets/js/embed-player.js

    r16b0c00 r2873b30  
    290290      if (mounted) { if (adapter) adapter.play(); return; }
    291291      mounted = true;
     292      // Spotify: hun speler is toch niet te skinnen (besturing-only) én de
     293      // iFrame-API-bundle initialiseert in de praktijk vaak niet (CDN-gating/503)
     294      // → niet op de API wachten, meteen het kale Spotify-iframe tonen. Instant.
     295      if (provider === 'spotify') { renderFallback(); return; }
    292296      el.classList.add('pcms-embed-busy');
    293297      try {
  • src/views/shell.ejs

    r16b0c00 r2873b30  
    303303<!-- Eigen custom media-embeds (YouTube/SoundCloud/Spotify) via de echte
    304304     player-API's + gedeelde mutual-exclusion registry met de site-speler. -->
    305 <script src="/assets/js/embed-player.js?v=5" defer></script>
     305<script src="/assets/js/embed-player.js?v=6" defer></script>
    306306<% if (site && site.enable_audio_player && audioTracks && audioTracks.length > 0) { %>
    307307  <script>window.PCMS_SITE_TRACKS = <%- JSON.stringify(audioTracks) %>;</script>
Note: See TracChangeset for help on using the changeset viewer.