(controller)
| 131 | const mp4Body = mp4Response.body; |
| 132 | const mp4Stream = new ReadableStream<Uint8Array>({ |
| 133 | async start(controller) { |
| 134 | try { |
| 135 | const reader = mp4Body.getReader(); |
| 136 | let done = false; |
| 137 | while (!done) { |
| 138 | const chunk = await reader.read(); |
| 139 | done = chunk.done; |
| 140 | if (chunk.value) controller.enqueue(chunk.value); |
| 141 | } |
| 142 | controller.close(); |
| 143 | } catch { |
| 144 | controller.close(); |
| 145 | } |
| 146 | }, |
| 147 | }); |
| 148 | |
| 149 | return new NextResponse(mp4Stream, { |
no test coverage detected