mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 14:34:40 +00:00
fix(video): preserve transcript seek timestamps
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user