From ad5db1044c8599eaaaa2a578b350777ae996b068 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Nov 2021 14:35:08 +0100 Subject: Add ability to run transcoding jobs --- client/src/app/shared/shared-main/video/video.service.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'client/src/app/shared/shared-main/video/video.service.ts') diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index d135a27dc..9bfa397f8 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -21,6 +21,7 @@ import { VideoInclude, VideoPrivacy, VideoSortField, + VideoTranscodingCreate, VideoUpdate } from '@shared/models' import { environment } from '../../../../environments/environment' @@ -308,6 +309,17 @@ export class VideoService { ) } + runTranscoding (videoIds: (number | string)[], type: 'hls' | 'webtorrent') { + const body: VideoTranscodingCreate = { transcodingType: type } + + return from(videoIds) + .pipe( + concatMap(id => this.authHttp.post(VideoService.BASE_VIDEO_URL + '/' + id + '/transcoding', body)), + toArray(), + catchError(err => this.restExtractor.handleError(err)) + ) + } + loadCompleteDescription (descriptionPath: string) { return this.authHttp .get<{ description: string }>(environment.apiUrl + descriptionPath) -- cgit v1.2.3