refactor(vtt-thumbnail): [PKG-VTT-THUMB-04] preserve legacy types and expose async runtime entry

This commit is contained in:
Harvey Zhao committed 2026-09-13 09:30:57 +08:00
1 parent 7f2906ae52
commit db358a3ae4
33 files changed
+3864 -98

No files matched your search

+12
View File
@@ -11,6 +11,18 @@ async function flush() {
}
const count = env => [...env.listeners.values()].reduce((sum, items) => sum + items.length, 0)
test('VTT candidate preserves callable default identity without adding synchronous fields to the registration Promise', async () => {
const env = create()
assert.equal(env.factory.default, env.factory)
assert.equal(env.factory.default.default, env.factory)
assert.equal(Object.getOwnPropertyDescriptor(env.factory, 'default').writable, true)
const pending = env.factory.default({})(env.art)
assert.equal(pending.name, undefined)
assert.deepEqual(Object.keys(pending), [])
assert.equal((await pending).name, 'artplayerPluginVttThumbnail')
await env.emit('destroy')
})
test('VTT candidate retains asynchronous registration, live style, floored bounds and literal image paths', async () => {
const env = create({ deferred: true })
const option = { vtt: '/folder/cues.vtt', style: {} }