fix streaming issue with Safari

This commit is contained in:
La macchina desiderante 2024-05-24 22:37:32 +02:00
parent b0710671b3
commit 7b1d712904
1 changed files with 11 additions and 1 deletions

View File

@ -28,6 +28,16 @@ export async function GET(req: Request, { params }: GetParams) {
responseType: "stream", responseType: "stream",
}); });
return new Response(response.data); const headers = new Headers();
headers.set('Content-Type', 'video/mp4');
headers.set('Cache-Control', 'no-cache');
headers.set('Accept-Ranges', 'bytes');
headers.set('Content-Length', response.headers['content-length']);
headers.set('Content-Disposition', 'inline');
return new Response(response.data, {
headers,
});
} }