MCPcopy Index your code
hub / github.com/heygen-com/hyperframes / createVideo

Function createVideo

packages/core/src/runtime/media.test.ts:5–14  ·  view source on GitHub ↗
(attrs: Record<string, string>)

Source from the content-addressed store, hash-verified

3import type { RuntimeMediaClip } from "./media";
4
5function createVideo(attrs: Record<string, string>): HTMLVideoElement {
6 const el = document.createElement("video");
7 for (const [key, value] of Object.entries(attrs)) {
8 el.setAttribute(key, value);
9 }
10 // jsdom doesn't compute media duration, so we stub it
11 Object.defineProperty(el, "duration", { value: NaN, writable: true, configurable: true });
12 document.body.appendChild(el);
13 return el;
14}
15
16function createAudio(attrs: Record<string, string>): HTMLAudioElement {
17 const el = document.createElement("audio");

Callers 1

media.test.tsFile · 0.85

Calls 2

entriesMethod · 0.80
setAttributeMethod · 0.65

Tested by

no test coverage detected