fix(studio): make static-seek adapter honor keepPlaying option (#1089)

createStaticSeekPlaybackAdapter.seek now accepts the same options as the
PlaybackAdapter contract and aligns the default-pause semantics with
wrapTimeline (hardened in 3e7b464b). Without keepPlaying the adapter
clears its `playing` flag and cancels the RAF ticker, so on non-GSAP
compositions a scrub during playback no longer leaves the iframe
silently advancing while the public seek wrapper marks isPlaying=false.

Follow-up to #863 review: jrusso called out the type drift and invited
a separate PR; this also closes the asymmetry with wrapTimeline.

Co-authored-by: Carlos Alcaraz <193642530+calcarazgre646@users.noreply.github.com>
This commit is contained in:
Carlos Alcaraz Gregor
2026-05-27 00:50:30 -04:00
committed by GitHub
co-authored by Carlos Alcaraz
parent 7cde0d9554
commit 8ecef4b939
2 changed files with 177 additions and 6 deletions
@@ -113,12 +113,20 @@ export function createStaticSeekPlaybackAdapter(
playing = false;
stopTicker();
},
seek: (time) => {
seek: (time, options) => {
renderSeek(time);
if (playing) {
playStartTime = currentTime;
playStartNow = clock.now();
if (options?.keepPlaying) {
if (playing) {
playStartTime = currentTime;
playStartNow = clock.now();
}
return;
}
// Default seek aligns with wrapTimeline: stop the RAF ticker so the
// adapter's `playing` flag matches the public seek contract instead of
// silently driving renderSeek in the background.
playing = false;
stopTicker();
},
getTime: () => currentTime,
getDuration: () => safeDuration,