fix(video): prevent preview/presentation playback loop
- Avoid per-render target.set dispatch that reset playback - Stop timer-based and per-frame React ticking while playing - Add regression tests for render-loop sources Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
|
||||
|
||||
void test('video playback: control preview does not dispatch target.set on every render', () => {
|
||||
const src = fs.readFileSync(
|
||||
path.join(root, 'app', 'renderer', 'control', 'ControlScenePreview.tsx'),
|
||||
'utf8',
|
||||
);
|
||||
// Регресс: зависимость `[... , scene, ...]` заставляла эффект с `target.set` срабатывать постоянно,
|
||||
// сбрасывая видео (доля секунды проигрывается и начинается сначала).
|
||||
assert.doesNotMatch(src, /\]\s*,\s*\[\s*[^\]]*\bscene\b/);
|
||||
});
|
||||
Reference in New Issue
Block a user