From d3bb94e3393221481014137285d1fb304e3d2bfe Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 30 Nov 2022 18:29:17 -0700 Subject: [PATCH] Handling when caption_path is empty. --- app/src/components/VideoPlayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/components/VideoPlayer.js b/app/src/components/VideoPlayer.js index 23315ead..86587344 100644 --- a/app/src/components/VideoPlayer.js +++ b/app/src/components/VideoPlayer.js @@ -73,7 +73,7 @@ function VideoPage({videoFile, prevFile, nextFile, setFavorite, ...props}) { let posterUrl = video.poster_path ? `${MEDIA_PATH}/${encodeURIComponent(video.poster_path)}` : null; let captionsUrl = video.caption_path ? `${MEDIA_PATH}/${encodeURIComponent(video.caption_path)}` : null; - let vttCaptions = video.caption_path.endsWith('.vtt'); + let vttCaptions = video.caption_path && video.caption_path.endsWith('.vtt'); let description = 'No description available.'; let viewCount = video.view_count;