aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+video-editor/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-11 10:51:33 +0100
committerChocobozzz <chocobozzz@cpy.re>2022-02-28 10:42:19 +0100
commitc729caf6cc34630877a0e5a1bda1719384cd0c8a (patch)
tree1d2e13722e518c73d2c9e6f0969615e29d51cf8c /client/src/app/+video-editor/shared
parenta24bf4dc659cebb65d887862bf21d7a35e9ec791 (diff)
downloadPeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.gz
PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.tar.zst
PeerTube-c729caf6cc34630877a0e5a1bda1719384cd0c8a.zip
Add basic video editor support
Diffstat (limited to 'client/src/app/+video-editor/shared')
-rw-r--r--client/src/app/+video-editor/shared/index.ts1
-rw-r--r--client/src/app/+video-editor/shared/video-editor.service.ts28
2 files changed, 29 insertions, 0 deletions
diff --git a/client/src/app/+video-editor/shared/index.ts b/client/src/app/+video-editor/shared/index.ts
new file mode 100644
index 000000000..eaf88b6f4
--- /dev/null
+++ b/client/src/app/+video-editor/shared/index.ts
@@ -0,0 +1 @@
export * from './video-editor.service'
diff --git a/client/src/app/+video-editor/shared/video-editor.service.ts b/client/src/app/+video-editor/shared/video-editor.service.ts
new file mode 100644
index 000000000..5b7053039
--- /dev/null
+++ b/client/src/app/+video-editor/shared/video-editor.service.ts
@@ -0,0 +1,28 @@
1import { catchError } from 'rxjs'
2import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core'
4import { RestExtractor } from '@app/core'
5import { objectToFormData } from '@app/helpers'
6import { VideoService } from '@app/shared/shared-main'
7import { VideoEditorCreateEdition, VideoEditorTask } from '@shared/models'
8
9@Injectable()
10export class VideoEditorService {
11
12 constructor (
13 private authHttp: HttpClient,
14 private restExtractor: RestExtractor
15 ) {}
16
17 editVideo (videoId: number | string, tasks: VideoEditorTask[]) {
18 const url = VideoService.BASE_VIDEO_URL + '/' + videoId + '/editor/edit'
19 const body: VideoEditorCreateEdition = {
20 tasks
21 }
22
23 const data = objectToFormData(body)
24
25 return this.authHttp.post(url, data)
26 .pipe(catchError(err => this.restExtractor.handleError(err)))
27 }
28}