Changeset 73b41eb in Klonkt for src/views/pages


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@…>

File:
1 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  }
Note: See TracChangeset for help on using the changeset viewer.