From 4f1ee7c865e7488f4b07bcb7742f9fd5924a1212 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Fri, 11 Aug 2023 17:43:11 +0200 Subject: [PATCH] local API: Support Post Live DVR videos --- src/renderer/views/Watch/Watch.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index a6de6edad651..12b5c56abeba 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -80,6 +80,7 @@ export default defineComponent({ liveChat: null, isLiveContent: false, isUpcoming: false, + isPostLiveDvr: false, upcomingTimestamp: null, upcomingTimeLeft: null, activeFormat: 'legacy', @@ -353,6 +354,7 @@ export default defineComponent({ this.isLive = !!result.basic_info.is_live this.isUpcoming = !!result.basic_info.is_upcoming this.isLiveContent = !!result.basic_info.is_live_content + this.isPostLiveDvr = !!result.basic_info.is_post_live_dvr const subCount = !result.secondary_info.owner.subscriber_count.isEmpty() ? parseLocalSubscriberCount(result.secondary_info.owner.subscriber_count.text) : NaN @@ -418,7 +420,7 @@ export default defineComponent({ result = bypassedResult } - if (this.isLive && !this.isUpcoming) { + if ((this.isLive || this.isPostLiveDvr) && !this.isUpcoming) { try { const formats = await getFormatsFromHLSManifest(result.streaming_data.hls_manifest_url) @@ -452,6 +454,8 @@ export default defineComponent({ this.showDashPlayer = false this.activeFormat = 'legacy' this.activeSourceList = this.videoSourceList + this.audioSourceList = null + this.dashSrc = null } else if (this.isUpcoming) { const upcomingTimestamp = result.basic_info.start_timestamp @@ -1124,11 +1128,11 @@ export default defineComponent({ }, enableDashFormat: function () { - if (this.activeFormat === 'dash' || this.isLive) { + if (this.activeFormat === 'dash') { return } - if (this.dashSrc === null) { + if (this.dashSrc === null || this.isLive || this.isPostLiveDvr) { showToast(this.$t('Change Format.Dash formats are not available for this video')) return }