From 29cdae7f8e9167b809ac59b901da65d6102fa89c Mon Sep 17 00:00:00 2001 From: Preston Date: Fri, 30 Apr 2021 17:43:12 -0400 Subject: [PATCH] Fix issue with recent live streams not being playable and update credits link in about --- src/renderer/views/About/About.js | 2 +- src/renderer/views/Watch/Watch.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/renderer/views/About/About.js b/src/renderer/views/About/About.js index 92e71756..6d749f80 100644 --- a/src/renderer/views/About/About.js +++ b/src/renderer/views/About/About.js @@ -69,7 +69,7 @@ export default Vue.extend({ { icon: 'users', title: this.$t('About.Credits'), - content: `${this.$t('About.FreeTube is made possible by')} ${this.$t('About.these people and projects')}` + content: `${this.$t('About.FreeTube is made possible by')} ${this.$t('About.these people and projects')}` }, { icon: 'heart', diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 12901855..7b0dbee3 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -291,7 +291,7 @@ export default Vue.extend({ this.videoLikeCount = isNaN(result.videoDetails.likes) ? 0 : result.videoDetails.likes this.videoDislikeCount = isNaN(result.videoDetails.dislikes) ? 0 : result.videoDetails.dislikes } - this.isLive = result.player_response.videoDetails.isLive + this.isLive = result.player_response.videoDetails.isLive || result.player_response.videoDetails.isLiveContent this.isLiveContent = result.player_response.videoDetails.isLiveContent this.isUpcoming = result.player_response.videoDetails.isUpcoming ? result.player_response.videoDetails.isUpcoming : false @@ -359,8 +359,14 @@ export default Vue.extend({ } else { this.videoLengthSeconds = parseInt(result.videoDetails.lengthSeconds) if (result.player_response.streamingData !== undefined) { - this.videoSourceList = result.player_response.streamingData.formats.reverse() - this.downloadLinks = result.formats.map((format) => { + if (typeof (result.player_response.streamingData.formats) !== 'undefined') { + this.videoSourceList = result.player_response.streamingData.formats.reverse() + } else { + this.videoSourceList = result.player_response.streamingData.adaptiveFormats.reverse() + } + this.downloadLinks = result.formats.filter((format) => { + return typeof format.mimeType !== 'undefined' + }).map((format) => { const qualityLabel = format.qualityLabel || format.bitrate const itag = format.itag const fps = format.fps ? (format.fps + 'fps') : 'kbps'