diff --git a/extension/content.js b/extension/content.js index 0ca68e0..957a14b 100644 --- a/extension/content.js +++ b/extension/content.js @@ -488,6 +488,24 @@ return false; })(); + // Build multi-video summary for debug reports + const allVideos = []; + const allVideoEls = document.querySelectorAll('video'); + for (let i = 0; i < allVideoEls.length; i++) { + const v = allVideoEls[i]; + allVideos.push({ + index: i, + width: v.videoWidth || v.offsetWidth || 0, + height: v.videoHeight || v.offsetHeight || 0, + muted: v.muted, + paused: v.paused, + duration: (v.duration && isFinite(v.duration)) ? Math.round(v.duration) : 0, + readyState: v.readyState, + src: (v.currentSrc || v.src || '').substring(0, 80), + selected: v === video + }); + } + if (video) { const dataAttributes = {}; if (video.attributes) { @@ -542,7 +560,8 @@ metadata, videoCount, inShadowDom, - platform + platform, + allVideos }); } else { sendResponse({ @@ -550,6 +569,7 @@ videoCount, inShadowDom, platform, + allVideos, url: window.location.href, pageTitle: document.title, metadata: (navigator.mediaSession && navigator.mediaSession.metadata) ? { diff --git a/extension/popup.js b/extension/popup.js index 4b1e28f..7e4e885 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -1462,6 +1462,24 @@ elements.copyLogs.addEventListener('click', () => { if (vs.platform) lines.push(`- **Platform:** ${safe(vs.platform, '?')}`); lines.push(`- **Video Count:** ${safe(vs.videoCount, 0)} | **Shadow DOM:** ${vs.inShadowDom ? 'YES' : 'NO'}`); lines.push(''); + + // Multi-video overview + const videos = Array.isArray(vs.allVideos) ? vs.allVideos : []; + if (videos.length > 1) { + lines.push('### All Videos on Page'); + lines.push(''); + lines.push('| # | Resolution | Muted | Paused | Ready | Duration | Selected |'); + lines.push('|---|------------|-------|--------|-------|----------|----------|'); + const rl = ['HAVE_NOTHING', 'HAVE_METADATA', 'HAVE_CURRENT_DATA', 'HAVE_FUTURE_DATA', 'HAVE_ENOUGH_DATA']; + for (const v of videos) { + if (!v) continue; + const sel = v.selected ? ' **\u2190 TARGET**' : ''; + const dim = `${safe(v.width, '?')}x${safe(v.height, '?')}`; + const rs = (v.readyState != null && v.readyState >= 0 && v.readyState <= 4) ? rl[v.readyState] : '?'; + lines.push(`| ${safe(v.index, '?')} | ${dim} | ${safe(v.muted, '?')} | ${safe(v.paused, '?')} | ${rs} | ${safe(v.duration, 0)}s |${sel} |`); + } + lines.push(''); + } } // ── Connection ──