fix(studio): a preview clip's track is taken only as a whole number (#8447)

* fix(studio): a preview clip's track, start and length enter the timeline only as numbers

* fix(studio): a preview clip's track is taken only as a whole number, as the runtime writes it
This commit is contained in:
Miguel Ángel
2026-11-22 06:32:19 +00:00
committed by GitHub
parent 77f3b55fd3
commit bf21bf9f78
2 changed files with 2 additions and 2 deletions
@@ -986,6 +986,6 @@ describe("createTimelineElementFromManifestClip — received clip numbers", () =
expect([honest.track, honest.authoredTrack, honest.start, honest.duration]).toEqual([
3, 3, 1.5, 2,
]);
expect(clip(Number.NaN).track).toBe(0);
expect([clip(Number.NaN).track, clip(1.5).track, clip(-1).track]).toEqual([0, 0, -1]);
});
});
@@ -82,7 +82,7 @@ export function createTimelineElementFromManifestClip(params: {
hostEl?: Element | null;
}): TimelineElement {
const { clip, fallbackIndex, doc } = params;
const numericTrack = finiteNumber(clip.track) ?? 0;
const numericTrack = Number.isSafeInteger(clip.track) ? clip.track : 0;
let hostEl = params.hostEl ?? null;
const transitionLabels = doc
? transitionLabelsForDocument(doc, (doc.defaultView as IframeWindow | null)?.__timelines)