Created
October 30, 2018 00:35
-
-
Save KarneAsada/37f252e2e658391286e780c5d5b6a60a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/server/routes/hls-player.js b/server/routes/hls-player.js | |
index f6b6b61..bd0e9c1 100644 | |
--- a/server/routes/hls-player.js | |
+++ b/server/routes/hls-player.js | |
@@ -50,13 +50,6 @@ function processStory(tStoryObj) { | |
// Set Chapter Id | |
chapter.id = chapter._id | |
const { currentVersion } = chapter | |
- const chapterImage = currentVersion.renderedImage || currentVersion.baseImage | |
- if (chapterImage && chapterImage.path) { | |
- chapter.start = totalDuration | |
- chapter.duration = 6000 | |
- chapter.image = chapterImage.path.replace(gcsDomain, imageCDN) | |
- return chapter | |
- } | |
// Add start and duration times to each chapter | |
const chapterVideo = currentVersion.intermediateVideo | |
@@ -67,6 +60,16 @@ function processStory(tStoryObj) { | |
totalDuration += chapter.duration | |
return chapter | |
} | |
+ | |
+ // Set chapter image if no video exists | |
+ const chapterImage = currentVersion.renderedImage || currentVersion.baseImage | |
+ if (chapterImage && chapterImage.path) { | |
+ chapter.start = totalDuration | |
+ chapter.duration = 6000 | |
+ chapter.image = chapterImage.path.replace(gcsDomain, imageCDN) | |
+ return chapter | |
+ } | |
+ | |
console.error(`No video object for chapter ${chapter._id}`) | |
return undefined | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment