MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / seekToCurrent

Function seekToCurrent

packages/studio/src/hooks/gsapRuntimePatch.ts:227–236  ·  view source on GitHub ↗

Re-render the timeline at the current playhead after an in-place edit.

(iframe: HTMLIFrameElement, timeline: RuntimeTimeline)

Source from the content-addressed store, hash-verified

225
226/** Re-render the timeline at the current playhead after an in-place edit. */
227function seekToCurrent(iframe: HTMLIFrameElement, timeline: RuntimeTimeline): void {
228 const player = playerOf(iframe);
229 const currentTime =
230 typeof player?.getTime === "function"
231 ? player.getTime()
232 : typeof timeline.time === "function"
233 ? timeline.time()
234 : 0;
235 player?.seek?.(Number.isFinite(currentTime) ? currentTime : 0);
236}
237
238/** Apply `change` to the resolved tween. `true` if applied, `false` to soft-reload.
239 * `global-set` is handled before this (no tween) and never reaches here. */

Callers 1

patchRuntimeTweenInPlaceFunction · 0.85

Calls 4

playerOfFunction · 0.85
timeMethod · 0.80
getTimeMethod · 0.65
seekMethod · 0.65

Tested by

no test coverage detected