(
filePath: string,
options: { pollMs?: number; attempts?: number } = {},
)
| 114 | } |
| 115 | |
| 116 | export 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 | |
| 131 | function isSwiftVideoValidatorUnavailable(stderr: string, stdout: string): boolean { |
| 132 | const combined = `${stderr}\n${stdout}`; |
no test coverage detected