aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/shared/video-fetcher.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-05 11:13:38 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 10:17:59 +0200
commit638a2950215af1f11be8e8bdd136ca12e5176c32 (patch)
tree0bbbd3759ab0af38bc002c9397b5b18e79e6ef8d /client/src/standalone/videos/shared/video-fetcher.ts
parent52807a075fdc4933d20e882844f7835e9c38afeb (diff)
downloadPeerTube-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.ts13
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 @@
1import { PeerTubeServerError } from '../../../types' 1import { PeerTubeServerError } from '../../../types'
2import { HttpStatusCode, LiveVideo, VideoDetails, VideoToken } from '../../../../../shared/models' 2import { HttpStatusCode, LiveVideo, Storyboard, VideoDetails, VideoToken } from '../../../../../shared/models'
3import { logger } from '../../../root-helpers' 3import { logger } from '../../../root-helpers'
4import { AuthHTTP } from './auth-http' 4import { 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 }