Keep pause across Coolify restarts, apply the chosen still from the image picker, and remux clips with Range/faststart so finished video can be scrubbed.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { existsSync } from 'node:fs'
|
||||
import { sendPathWithRange } from '~/server/utils/httpRange'
|
||||
|
||||
export default defineEventHandler((event) => {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
@@ -9,8 +10,8 @@ export default defineEventHandler((event) => {
|
||||
if (!existsSync(path)) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'Video file is missing' })
|
||||
}
|
||||
setHeader(event, 'Content-Type', 'video/mp4')
|
||||
setHeader(event, 'Content-Disposition', `inline; filename="${safeDownloadName(clipTitle(clip))}.mp4"`)
|
||||
setHeader(event, 'Cache-Control', 'private, no-store')
|
||||
return readFileSync(path)
|
||||
return sendPathWithRange(event, path, 'video/mp4', {
|
||||
'Content-Disposition': `inline; filename="${safeDownloadName(clipTitle(clip))}.mp4"`,
|
||||
'Cache-Control': 'private, max-age=0, must-revalidate'
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user