diff options
author | Chocobozzz <me@florianbigard.com> | 2023-06-05 11:13:38 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-06-29 10:17:59 +0200 |
commit | 638a2950215af1f11be8e8bdd136ca12e5176c32 (patch) | |
tree | 0bbbd3759ab0af38bc002c9397b5b18e79e6ef8d /client/src/standalone/videos/shared/video-fetcher.ts | |
parent | 52807a075fdc4933d20e882844f7835e9c38afeb (diff) | |
download | PeerTube-638a2950215af1f11be8e8bdd136ca12e5176c32.tar.gz PeerTube-638a2950215af1f11be8e8bdd136ca12e5176c32.tar.zst PeerTube-638a2950215af1f11be8e8bdd136ca12e5176c32.zip |
Support storyboards in embed
Diffstat (limited to 'client/src/standalone/videos/shared/video-fetcher.ts')
-rw-r--r-- | client/src/standalone/videos/shared/video-fetcher.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/client/src/standalone/videos/shared/video-fetcher.ts b/client/src/standalone/videos/shared/video-fetcher.ts index 76ba0a3ed..d52730b83 100644 --- a/client/src/standalone/videos/shared/video-fetcher.ts +++ b/client/src/standalone/videos/shared/video-fetcher.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { PeerTubeServerError } from '../../../types' | 1 | import { PeerTubeServerError } from '../../../types' |
2 | import { HttpStatusCode, LiveVideo, VideoDetails, VideoToken } from '../../../../../shared/models' | 2 | import { HttpStatusCode, LiveVideo, Storyboard, VideoDetails, VideoToken } from '../../../../../shared/models' |
3 | import { logger } from '../../../root-helpers' | 3 | import { logger } from '../../../root-helpers' |
4 | import { AuthHTTP } from './auth-http' | 4 | import { AuthHTTP } from './auth-http' |
5 | 5 | ||
@@ -36,8 +36,9 @@ export class VideoFetcher { | |||
36 | } | 36 | } |
37 | 37 | ||
38 | const captionsPromise = this.loadVideoCaptions({ videoId, videoPassword }) | 38 | const captionsPromise = this.loadVideoCaptions({ videoId, videoPassword }) |
39 | const storyboardsPromise = this.loadStoryboards(videoId) | ||
39 | 40 | ||
40 | return { captionsPromise, videoResponse } | 41 | return { captionsPromise, storyboardsPromise, videoResponse } |
41 | } | 42 | } |
42 | 43 | ||
43 | loadLive (video: VideoDetails) { | 44 | loadLive (video: VideoDetails) { |
@@ -71,6 +72,14 @@ export class VideoFetcher { | |||
71 | return window.location.origin + '/api/v1/videos/live/' + videoId | 72 | return window.location.origin + '/api/v1/videos/live/' + videoId |
72 | } | 73 | } |
73 | 74 | ||
75 | private loadStoryboards (videoUUID: string): Promise<Response> { | ||
76 | return this.http.fetch(this.getStoryboardsUrl(videoUUID), { optionalAuth: true }) | ||
77 | } | ||
78 | |||
79 | private getStoryboardsUrl (videoId: string) { | ||
80 | return window.location.origin + '/api/v1/videos/' + videoId + '/storyboards' | ||
81 | } | ||
82 | |||
74 | private getVideoTokenUrl (id: string) { | 83 | private getVideoTokenUrl (id: string) { |
75 | return this.getVideoUrl(id) + '/token' | 84 | return this.getVideoUrl(id) + '/token' |
76 | } | 85 | } |