Changeset 6be57b4 in Klonkt for src/server.js


Ignore:
Timestamp:
06/19/2026 04:13:46 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
b9dc94c
Parents:
1794fac
Message:

Embeddable player (premium feature #7)

Standalone /embed page (no shell) with a compact audio player for the site
tracks, intended for an <iframe> on external sites. The page runs on the klonkt
origin, so audio requests from the iframe remain same-origin -> the
/audio/stream gate lets them through, even on an external site. Helmet's
X-Frame-Options + frame-ancestors are overridden per route (frame-ancestors *)
so external embedding is allowed.

  • routes/embed.js (premium-gated): GET /embed.
  • views/pages/embed-player.ejs: standalone HTML, inline css/js, play/pause, track click, auto-next, progress bar; themable on site.accent.
  • admin-audio: embedUrl + "Embeddable player" section with copyable iframe code + preview link (premium).

node --check passed.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/server.js

    r1794fac r6be57b4  
    5757import downloadRoutes from './routes/download.js';
    5858import linkbioRoutes from './routes/linkbio.js';
     59import embedRoutes from './routes/embed.js';
    5960
    6061if (!process.env.SESSION_SECRET) {
     
    275276app.use('/', downloadRoutes); // /downloads + /download/:id download-voor-email (premium)
    276277app.use('/', linkbioRoutes); // /links link-in-bio + klikstats (premium)
     278app.use('/', embedRoutes); // /embed inbedbare audiospeler (premium)
    277279app.use('/', postsRoutes);
    278280
Note: See TracChangeset for help on using the changeset viewer.