| 19 | decodeStorageVideo(video); |
| 20 | |
| 21 | function contentTypeForSubpath(subpath: string): string { |
| 22 | if (subpath.endsWith(".json")) return "application/json"; |
| 23 | if (subpath.endsWith(".mp4") || subpath.endsWith(".m4s")) return "video/mp4"; |
| 24 | if (subpath.endsWith(".jpg") || subpath.endsWith(".jpeg")) |
| 25 | return "image/jpeg"; |
| 26 | if (subpath.endsWith(".png")) return "image/png"; |
| 27 | if (subpath.endsWith(".aac")) return "audio/aac"; |
| 28 | if (subpath.endsWith(".webm")) return "audio/webm"; |
| 29 | if (subpath.endsWith(".m3u8")) return "application/x-mpegURL"; |
| 30 | return "application/octet-stream"; |
| 31 | } |
| 32 | |
| 33 | export const app = new Hono().use(withAuth); |
| 34 | |