mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
* fix(studio): preview lookups find the element the timeline bound when an id repeats * fix(studio): preview lookups prefer the element's own file, and a pasted element gets its own hf-id * fix(studio): scrub audio, panel reads and gestures act on the bound element, one scan per pass * refactor(studio): one owner for the selected node lookup, and scrub indexes only audio * fix(studio): the panel's tween list matches class tweens against the selected element itself
17 lines
845 B
TypeScript
17 lines
845 B
TypeScript
import { usePlayerStore } from "../store/playerStore";
|
|
import { scrubPreviewAudio, stopScrubPreviewAudio } from "./timelineIframeHelpers";
|
|
import { getTimelineElementIndexes } from "./timelineElementIndexes";
|
|
|
|
export { stopScrubPreviewAudio };
|
|
|
|
// Scrub the music track's audio at a seeked composition time (paused-seek only).
|
|
// Skipped when audio is muted or the time falls outside the music clip.
|
|
export function scrubMusicAtSeek(iframe: HTMLIFrameElement | null, nextTime: number): void {
|
|
const s = usePlayerStore.getState();
|
|
const music = getTimelineElementIndexes(s.elements).musicElement;
|
|
if (!music || s.audioMuted) return;
|
|
const rel = nextTime - music.start;
|
|
const audioFileTime = rel >= 0 && rel <= music.duration ? (music.playbackStart ?? 0) + rel : null;
|
|
scrubPreviewAudio(iframe, audioFileTime, music, s.audioVolume);
|
|
}
|