mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 01:39:37 +02:00
Add video chapters support
This commit is contained in:
parent
7113f32a87
commit
77b70702d2
101 changed files with 1957 additions and 158 deletions
|
@ -195,10 +195,11 @@ export class PeerTubeEmbed {
|
|||
const {
|
||||
videoResponse,
|
||||
captionsPromise,
|
||||
chaptersPromise,
|
||||
storyboardsPromise
|
||||
} = await this.videoFetcher.loadVideo({ videoId: uuid, videoPassword: this.videoPassword })
|
||||
|
||||
return this.buildVideoPlayer({ videoResponse, captionsPromise, storyboardsPromise, forceAutoplay })
|
||||
return this.buildVideoPlayer({ videoResponse, captionsPromise, chaptersPromise, storyboardsPromise, forceAutoplay })
|
||||
} catch (err) {
|
||||
|
||||
if (await this.handlePasswordError(err)) this.loadVideoAndBuildPlayer({ ...options })
|
||||
|
@ -210,9 +211,10 @@ export class PeerTubeEmbed {
|
|||
videoResponse: Response
|
||||
storyboardsPromise: Promise<Response>
|
||||
captionsPromise: Promise<Response>
|
||||
chaptersPromise: Promise<Response>
|
||||
forceAutoplay: boolean
|
||||
}) {
|
||||
const { videoResponse, captionsPromise, storyboardsPromise, forceAutoplay } = options
|
||||
const { videoResponse, captionsPromise, chaptersPromise, storyboardsPromise, forceAutoplay } = options
|
||||
|
||||
const videoInfoPromise = videoResponse.json()
|
||||
.then(async (videoInfo: VideoDetails) => {
|
||||
|
@ -233,11 +235,13 @@ export class PeerTubeEmbed {
|
|||
{ video, live, videoFileToken },
|
||||
translations,
|
||||
captionsResponse,
|
||||
chaptersResponse,
|
||||
storyboardsResponse
|
||||
] = await Promise.all([
|
||||
videoInfoPromise,
|
||||
this.translationsPromise,
|
||||
captionsPromise,
|
||||
chaptersPromise,
|
||||
storyboardsPromise,
|
||||
this.buildPlayerIfNeeded()
|
||||
])
|
||||
|
@ -260,6 +264,7 @@ export class PeerTubeEmbed {
|
|||
const loadOptions = await this.playerOptionsBuilder.getPlayerLoadOptions({
|
||||
video,
|
||||
captionsResponse,
|
||||
chaptersResponse,
|
||||
translations,
|
||||
|
||||
storyboardsResponse,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue