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,3 +1,5 @@
|
||||
import { sendBufferWithRange } from '~/server/utils/httpRange'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const query = getQuery(event)
|
||||
const filename = String(query.filename || '')
|
||||
@@ -12,8 +14,8 @@ export default defineEventHandler(async (event) => {
|
||||
throw createError({ statusCode: res.status, statusMessage: 'Failed to fetch video from ComfyUI' })
|
||||
}
|
||||
const buf = Buffer.from(await res.arrayBuffer())
|
||||
setHeader(event, 'Content-Type', res.headers.get('content-type') || 'video/mp4')
|
||||
setHeader(event, 'Content-Disposition', `inline; filename="${filename}"`)
|
||||
setHeader(event, 'Cache-Control', 'private, max-age=3600')
|
||||
return buf
|
||||
return sendBufferWithRange(event, buf, res.headers.get('content-type') || 'video/mp4', {
|
||||
'Content-Disposition': `inline; filename="${filename}"`,
|
||||
'Cache-Control': 'private, max-age=0, must-revalidate'
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user