fix(video): preserve transcript seek timestamps

This commit is contained in:
yiling
2026-12-03 15:25:28 +08:00
parent 3952928b88
commit 5daa2a8f92
9 changed files with 262 additions and 44 deletions
@@ -29,4 +29,14 @@ describe('createTranscriptTimeline', () => {
expect(at(4000)).toBeUndefined()
expect(createTranscriptTimeline([])(0)).toBeUndefined()
})
it('uses the new segment at an exact millisecond after converting the seek through seconds', () => {
const at = createTranscriptTimeline([
{ id: 'before', startMs: 1800, endMs: 2010, text: '' },
{ id: 'after', startMs: 2010, endMs: 2200, text: '' },
])
expect(at(2009.999)).toBe('before')
expect(at((2010 / 1000) * 1000)).toBe('after')
})
})