fix(lab): preserve explicit replay seeks
This commit is contained in:
@@ -45,6 +45,13 @@ export function synchronizeRecordedEvidencePlayback(
|
||||
observed: RecordedObservationPlayback,
|
||||
range: RecordedEvidencePlaybackRange,
|
||||
): RecordedObservationPlayback {
|
||||
if (!current.playing) {
|
||||
// A paused transport also covers every explicit operator seek. Native
|
||||
// callbacks from the previously displayed frame remain stale until the
|
||||
// controlled video effect has applied that target, so they cannot move the
|
||||
// shared LAB clock at all while the operator state is paused.
|
||||
return current;
|
||||
}
|
||||
const currentSeconds = clampRecordedEvidenceSeconds(observed.currentSeconds, range);
|
||||
return {
|
||||
...current,
|
||||
|
||||
@@ -403,7 +403,23 @@ test("recorded VIDEO clock cannot reverse an explicit operator pause", () => {
|
||||
{ currentSeconds: 15.1, playing: true, rate: 1 },
|
||||
range,
|
||||
),
|
||||
{ currentSeconds: 15.1, playing: false, rate: 2 },
|
||||
{ currentSeconds: 15, playing: false, rate: 2 },
|
||||
);
|
||||
assert.deepEqual(
|
||||
synchronizeRecordedEvidencePlayback(
|
||||
{ currentSeconds: 10, playing: false, rate: 2 },
|
||||
{ currentSeconds: 15.1, playing: true, rate: 1 },
|
||||
range,
|
||||
),
|
||||
{ currentSeconds: 10, playing: false, rate: 2 },
|
||||
);
|
||||
assert.deepEqual(
|
||||
synchronizeRecordedEvidencePlayback(
|
||||
{ currentSeconds: 12, playing: true, rate: 2 },
|
||||
{ currentSeconds: 15.1, playing: true, rate: 1 },
|
||||
range,
|
||||
),
|
||||
{ currentSeconds: 15.1, playing: true, rate: 2 },
|
||||
);
|
||||
assert.deepEqual(
|
||||
synchronizeRecordedEvidencePlayback(
|
||||
|
||||
Reference in New Issue
Block a user