making WEB

Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-11 00:47:52 +03:00
1 parent 7a18682b0e
commit 24fecc90f3
107 files changed
+14935 -1919

No files matched your search

@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest';
import { shouldCorrectVideoDrift } from '../lib/nowPlayingVideoSync';
describe('NowPlayingVideo drift correction', () => {
it('never seeks while unstarted, cued, or buffering', () => {
for (const state of [-1, 3, 5]) {
expect(shouldCorrectVideoDrift(state, 0, 30, 10_000)).toBe(false);
}
});
it('waits for cooldown and ignores small playing drift', () => {
expect(shouldCorrectVideoDrift(1, 0, 30, 1000)).toBe(false);
expect(shouldCorrectVideoDrift(1, 28, 30, 10_000)).toBe(false);
expect(shouldCorrectVideoDrift(1, 10, 30, 10_000)).toBe(true);
});
});