Run caption logic earlier to avoid subtitles from not showing up.

This commit is contained in:
Preston 2020-08-26 17:21:44 -04:00
parent 3b4cf386a8
commit 80b60f6d32
1 changed files with 9 additions and 9 deletions

View File

@ -241,6 +241,15 @@ export default Vue.extend({
this.videoDislikeCount = result.videoDetails.dislikes
this.isLive = result.player_response.videoDetails.isLiveContent
const captionTracks =
result.player_response.captions &&
result.player_response.captions.playerCaptionsTracklistRenderer
.captionTracks
if (typeof captionTracks !== 'undefined') {
await this.createCaptionUrls(captionTracks)
}
if (this.videoDislikeCount === null) {
this.videoDislikeCount = 0
}
@ -321,15 +330,6 @@ export default Vue.extend({
this.createLocalStoryboardUrls(templateUrl)
}
const captionTracks =
result.player_response.captions &&
result.player_response.captions.playerCaptionsTracklistRenderer
.captionTracks
if (typeof captionTracks !== 'undefined') {
await this.createCaptionUrls(captionTracks)
}
this.isLoading = false
})
.catch(err => {