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

Function makeEntry

packages/player/src/hyperframes-player.test.ts:737–761  ·  view source on GitHub ↗
(
    opts: {
      currentTime?: number;
      start?: number;
      duration?: number;
      driftSamples?: number;
    } = {},
  )

Source from the content-addressed store, hash-verified

735 });
736
737 function makeEntry(
738 opts: {
739 currentTime?: number;
740 start?: number;
741 duration?: number;
742 driftSamples?: number;
743 } = {},
744 ): DriftEntry {
745 // Include `pause`/`src` so `disconnectedCallback`'s teardown loop
746 // (`m.el.pause(); m.el.src = ""`) doesn't blow up when the player is
747 // removed at the end of the test — `_mirrorParentMediaTime` itself only
748 // touches `currentTime`.
749 const entry: DriftEntry = {
750 el: {
751 currentTime: opts.currentTime ?? 0,
752 src: "",
753 pause: vi.fn(),
754 },
755 start: opts.start ?? 0,
756 duration: opts.duration ?? 100,
757 driftSamples: opts.driftSamples ?? 0,
758 };
759 player._parentMedia.push(entry);
760 return entry;
761 }
762
763 it("initializes new parent-media entries with driftSamples=0", () => {
764 // Mock Audio just for this test so the audio-src bootstrap path produces

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected