mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
feat(server): add hls playlist hint (#29150)
* add playlist hint * update api * unused import * update crf in tests
This commit is contained in:
parent
cbe34d7931
commit
7ef2de6b53
11 changed files with 153 additions and 22 deletions
|
|
@ -6,6 +6,7 @@ import { HLS_PLAYLIST_CONTENT_TYPE } from 'src/constants';
|
|||
import { Endpoint, HistoryBuilder } from 'src/decorators';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import {
|
||||
HlsPlaylistHeaderDto,
|
||||
HlsSegmentHeaderDto,
|
||||
HlsSegmentParamDto,
|
||||
HlsSessionParamDto,
|
||||
|
|
@ -50,8 +51,17 @@ export class VideoStreamController {
|
|||
description: 'Returns an HLS media playlist for one variant of the streaming session.',
|
||||
history: new HistoryBuilder().added('v3').alpha('v3'),
|
||||
})
|
||||
getMediaPlaylist(@Auth() auth: AuthDto, @Param() { id, sessionId }: HlsVariantParamDto) {
|
||||
return this.service.getMediaPlaylist(auth, id, sessionId);
|
||||
getMediaPlaylist(
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id, sessionId, variantIndex }: HlsVariantParamDto,
|
||||
@Headers() headers: HlsPlaylistHeaderDto,
|
||||
) {
|
||||
try {
|
||||
headers = HlsPlaylistHeaderDto.create(headers);
|
||||
} catch (error) {
|
||||
throw new ZodValidationException(error);
|
||||
}
|
||||
return this.service.getMediaPlaylist(auth, id, sessionId, variantIndex, headers[ImmichHeader.HlsPosition]);
|
||||
}
|
||||
|
||||
@Get(':id/video/stream/:sessionId/:variantIndex/:filename')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue