start with streamer

This commit is contained in:
Jurgis Sakalauskas
2022-12-14 15:55:50 +02:00
parent d999897068
commit df6bf9465f
12 changed files with 263 additions and 38 deletions
+9 -3
View File
@@ -1,7 +1,8 @@
import { Controller, Get, Param } from '@nestjs/common';
import { Controller, Get, Head, Param, Req, Res } from '@nestjs/common';
import ApiResponse from '../Dto/api-response.dto';
import { AllFilesService } from './all-files.service';
import { TitleTypeEnum } from './Enum/title-type.enum';
import { Request, Response } from 'express';
@Controller('api/all')
export class AllFilesController {
@@ -23,8 +24,13 @@ export class AllFilesController {
}
@Get('play/:fileId')
play(@Param('fileId') fileId: string) {
return { will: 'return a playable stream of ' + fileId };
@Head('play/:fileId')
play(
@Param('fileId') fileId: string,
@Req() request: Request,
@Res() response: Response,
) {
this.allFilesService.play(fileId, request, response);
}
@Get(':titleId/:seasonId?')