From 9c99beaf9bfc32a8bda661f87e4ed8666673d032 Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Tue, 19 Nov 2024 11:17:21 +0100 Subject: [PATCH] #25 Fix video files not playing on iOS --- app/package.json | 2 +- app/src/render.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/package.json b/app/package.json index 5b7132b..501c4b1 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "immich-public-proxy", - "version": "1.5.1", + "version": "1.5.2", "scripts": { "dev": "ts-node src/index.ts", "build": "npx tsc", diff --git a/app/src/render.ts b/app/src/render.ts index 98691eb..677fdea 100644 --- a/app/src/render.ts +++ b/app/src/render.ts @@ -39,7 +39,8 @@ class Render { if (asset.type === AssetType.video) { const range = (req.range || '').replace(/bytes=/, '').split('-') const start = parseInt(range[0], 10) || 0 - headers.range = `bytes=${start}-${start + 2499999}` + const end = parseInt(range[1], 10) || start + 2499999 + headers.range = `bytes=${start}-${end}` headerList.push('cache-control', 'content-range') res.setHeader('accept-ranges', 'bytes') res.status(206) // Partial Content @@ -98,8 +99,8 @@ class Render { } ], attributes: { - preload: false, - controls: true + playsinline: 'playsinline', + controls: 'controls' } }) }