mirror of
https://github.com/diced/zipline.git
synced 2025-04-11 23:31:17 -05:00
fix: audio & video scrubbing (#576)
* fix video scrubbing * fix scrubbing for audio as well
This commit is contained in:
parent
974e9f7fa2
commit
317c7365f8
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,11 @@ function dbFileDecorator(fastify: FastifyInstance, _, done) {
|
|||
this.header('Content-Length', size);
|
||||
this.header('Content-Type', download ? 'application/octet-stream' : file.mimetype);
|
||||
this.header('Content-Disposition', `inline; filename="${encodeURI(file.originalName || file.name)}"`);
|
||||
if (file.mimetype.startsWith('video/') || file.mimetype.startsWith('audio/')) {
|
||||
this.header('Accept-Ranges', 'bytes');
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range
|
||||
this.header('Content-Range', `bytes 0-${size - 1}/${size}`);
|
||||
}
|
||||
|
||||
return this.send(data);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue