this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: use direct iframe for YouTube embeds

Replace oEmbed iframe-in-iframe approach with a direct
responsive iframe wrapper for YouTube videos. This avoids
sizing issues caused by oEmbed's fixed dimensions and
enables proper autoplay on click.

+16
+16
internal/templates/views/index.html
··· 510 510 return; 511 511 } 512 512 513 + // YouTube embeds: use direct iframe with responsive wrapper 514 + // to avoid iframe-in-iframe sizing issues from oEmbed fixed dimensions 515 + var ytSrcMatch = embedHtml.match(/src="(https:\/\/www\.youtube\.com\/embed\/[^"]+)"/); 516 + if (ytSrcMatch) { 517 + var ytSrc = ytSrcMatch[1]; 518 + // Add autoplay param if not present 519 + if (ytSrc.indexOf('autoplay') === -1) { 520 + ytSrc += (ytSrc.indexOf('?') !== -1 ? '&' : '?') + 'autoplay=1'; 521 + } 522 + container.innerHTML = '<div class="youtube-embed-wrapper"><iframe width="100%" height="100%" src="' + ytSrc + '" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen" allowfullscreen></iframe></div>'; 523 + container.onclick = null; 524 + container.classList.remove('is-video'); 525 + container.style.cursor = 'default'; 526 + return; 527 + } 528 + 513 529 // Security: Use sandboxed iframe to isolate external embed content 514 530 // This prevents embedded content from accessing the parent page 515 531 var iframe = document.createElement('iframe');