Changeset e091add in Klonkt
- Timestamp:
- 06/30/2026 10:32:20 PM (2 months ago)
- Branches:
- main
- Children:
- 5f3f9ec
- Parents:
- f3663e5
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
rf3663e5 re091add 666 666 const u = m[1]; if (seen.has(u)) continue; seen.add(u); 667 667 let p; try { p = AudioEmbedService.detectProvider(u); } catch { p = null; } 668 if (!p) continue; 668 if (!p) { 669 // PeerTube is decentralised (any instance), so it's not in detectProvider — match its watch URL 670 // (/w/<id> or /videos/watch/<id>) and embed the player. Host is validated (safe chars only), so 671 // it's safe to inline into the iframe src; a non-PeerTube /w/ URL just yields an empty iframe. 672 const pt = u.match(/^https?:\/\/([\w.-]+(?::\d+)?)\/(?:w|videos\/watch)\/([\w-]{6,})/i); 673 if (pt) return `<iframe class="tl-embed-frame" src="https://${pt[1]}/videos/embed/${pt[2]}" title="PeerTube" loading="lazy" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`; 674 continue; 675 } 669 676 if (p.provider === 'youtube') return `<iframe class="tl-embed-frame" src="https://www.youtube-nocookie.com/embed/${p.id}" title="YouTube" loading="lazy" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`; 670 677 if (p.provider === 'spotify') return `<iframe class="tl-embed-frame tl-embed-spotify" src="https://open.spotify.com/embed/${p.type}/${p.id}" title="Spotify" loading="lazy" frameborder="0" allow="encrypted-media"></iframe>`;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)