Add floating synced lyrics with picture-in-picture fallback

This commit is contained in:
Jonathan Sykes
2026-10-03 14:54:23 +08:00
parent d7721045fb
commit b72d2e36a6
6 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
const { test } = require('node:test'), assert = require('node:assert/strict');
const { support, wrap } = require('./lyrics-window');
test('floating lyrics prefer document PiP, fall back only when capture and video PiP work', () => { assert.equal(support({ documentPiP: true }), 'document'); assert.equal(support({ canvas: true, videoPiP: true }), 'video'); assert.equal(support({ canvas: true }), null); });
test('canvas lyric wrapping preserves cue line breaks', () => { assert.deepEqual(wrap('Because You are God\nYou can do anything', t => t.length, 12), ['Because You', 'are God', 'You can do', 'anything']); });