Hold a driven video at the end of its file instead of restarting (#404)
A driven video plays on for about 100 ms after the last key, until the speed reading says it stands. With the key close to the end of the file, that runs the video past it. The browser then marks it ended, and follow() called play() on it in every frame. Per the HTML spec an ended video starts over from the beginning of its file on play(). The sprite flashed the first picture one to three times before it held. - An ended video now counts as standing at its end. follow() holds it and seeks to the wanted picture instead of playing it again. - The end of the file counts as an end too, not only the end of the clip. Tests: - e2e 66o plays an animation in once mode to 1.95 s of the 2 s test video and records the player time in every frame. It must never jump back, and the last picture must stand. - Against the old follow() 66o fails, the player jumps back to 0 once. A first version with the key at 1.9 s stayed green, the video never reached the end of the file. - e2e 66 on melektaus-atx: ALL PASSED, 26 checks. - Unit video-library, video-follow, video-clock: 31 passed. - tsc, eslint, Prettier clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
43fd22a763
commit
843b110bcb
3 files changed
+32
-2
No files matched your search
@@ -148,7 +148,8 @@ export class VideoLibrary {
|
||||
target: drivenTimeOf(play, drive.time, element.duration),
|
||||
speed: drive.reading?.speed ?? 0,
|
||||
current: element.currentTime,
|
||||
end: play.end,
|
||||
// A video that ran to the end of its file starts over from its first picture on play().
|
||||
end: element.ended ? element.currentTime : Math.min(play.end, element.duration),
|
||||
});
|
||||
if (step.seek !== null) this.seek(element, drive, step.seek);
|
||||
if (step.kind === 'hold') {
|
||||
|
||||
Reference in new issue
Block a user