feat(player): C hotkey toggles the lyrics overlay

YT parity. "C" clicks the visible #ytpLyricsBtn when there is one (music
type), no-op otherwise so hitting C next to K / L / M on a plain video
doesn't trigger something unexpected.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
ghassanandClaude Opus 4.7 committed 2026-10-21 12:31:25 +03:00
1 parent 7ba272edf6
commit e550d8d15b
1 file changed
+10
@@ -1505,6 +1505,16 @@ document.addEventListener('keydown', e => {
e.preventDefault(); theaterBtn && theaterBtn.click(); break; e.preventDefault(); theaterBtn && theaterBtn.click(); break;
case 'i': case 'I': case 'i': case 'I':
e.preventDefault(); pipBtn && !pipBtn.classList.contains('unsupported') && pipBtn.click(); break; e.preventDefault(); pipBtn && !pipBtn.classList.contains('unsupported') && pipBtn.click(); break;
case 'c': case 'C':
// Captions / lyrics toggle — click the lyrics button when the
// page has one (music type). On a video that has no lyrics
// the key is a no-op; we don't throw up a toast because the
// viewer may just be hitting letters next to K / L / M.
{
const lyr = document.getElementById('ytpLyricsBtn');
if (lyr && lyr.offsetParent !== null) { e.preventDefault(); lyr.click(); showControls(); }
}
break;
case 'j': case 'J': case 'j': case 'J':
e.preventDefault(); seekRelative(-10); flashDbl(dblLeft); showControls(); break; e.preventDefault(); seekRelative(-10); flashDbl(dblLeft); showControls(); break;
case 'l': case 'L': case 'l': case 'L':