MCPcopy
hub / github.com/callstack/agent-device / waitForPlayableVideo

Function waitForPlayableVideo

src/utils/video.ts:116–129  ·  view source on GitHub ↗
(
  filePath: string,
  options: { pollMs?: number; attempts?: number } = {},
)

Source from the content-addressed store, hash-verified

114}
115
116export async function waitForPlayableVideo(
117 filePath: string,
118 options: { pollMs?: number; attempts?: number } = {},
119): Promise<void> {
120 const pollMs = options.pollMs ?? 150;
121 const attempts = options.attempts ?? 12;
122
123 for (let attempt = 0; attempt < attempts; attempt += 1) {
124 if (await isPlayableVideo(filePath)) {
125 return;
126 }
127 await sleep(pollMs);
128 }
129}
130
131function isSwiftVideoValidatorUnavailable(stderr: string, stdout: string): boolean {
132 const combined = `${stderr}\n${stdout}`;

Callers 1

exportProcessedVideoFunction · 0.90

Calls 2

sleepFunction · 0.90
isPlayableVideoFunction · 0.85

Tested by

no test coverage detected