Changeset 73b41eb in Klonkt for src/views


Ignore:
Timestamp:
06/20/2026 03:42:00 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
9e6b54f
Parents:
389aa99
Message:

feat(embed): YouTube audio-only option in posts

Per embed you now choose audio-only or video. [[embed:audio:URL]] (YouTube)
renders as an audio card with our controls (play/seek/volume + thumbnail as
cover); the YT player runs hidden off-screen and provides only the sound.
[[embed:URL]] stays video. The editor embed button asks for audio or video
when a YouTube URL is given. Server: audio:/video: prefix in the shortcode
→ data-embed-mode. busters embed-player.js?v=8, embed.css?v=5.

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

Location:
src/views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/post-edit.ejs

    r389aa99 r73b41eb  
    14631463      const url = raw.trim();
    14641464      if (!/^https?:\/\//i.test(url)) { alert('Geef een volledige URL (https://…).'); return; }
    1465       insertChip('embed', url);
     1465      // YouTube: keuze audio-only (alleen geluid) of video.
     1466      let val = url;
     1467      if (/(youtube\.com|youtu\.be)/i.test(url)) {
     1468        const audioOnly = window.confirm('YouTube — alleen audio afspelen?\n\nOK = audio-only speler (geen video)\nAnnuleren = video');
     1469        if (audioOnly) val = 'audio:' + url;
     1470      }
     1471      insertChip('embed', val);
    14661472    });
    14671473  }
  • src/views/shell.ejs

    r389aa99 r73b41eb  
    170170<link rel="stylesheet" href="/assets/css/audio.css?v=6">
    171171<!-- Eigen custom media-embeds (YouTube/SoundCloud/Spotify) in huisstijl. -->
    172 <link rel="stylesheet" href="/assets/css/embed.css?v=4">
     172<link rel="stylesheet" href="/assets/css/embed.css?v=5">
    173173
    174174<%- include('partials/shared-styles') %>
     
    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=7" defer></script>
     305<script src="/assets/js/embed-player.js?v=8" 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.