From f9e549dd33f9da531f04c377f43364f90a178f33 Mon Sep 17 00:00:00 2001 From: Preston Date: Sun, 24 May 2020 17:46:26 -0400 Subject: [PATCH] Another fix for dash formats --- .../components/ft-video-player/ft-video-player.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index e4e88d50..2bc5b9c9 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -115,6 +115,10 @@ export default Vue.extend({ selectedDefaultQuality: function () { let selectedQuality = null + if (this.sourceList.length === 0) { + return this.defaultQuality + } + const maxAvailableQuality = parseInt(this.sourceList[this.sourceList.length - 1].qualityLabel.replace(/p|k/, '')) switch (maxAvailableQuality) { @@ -168,8 +172,11 @@ export default Vue.extend({ } this.activeSourceList.forEach((source) => { - if (this.determineDefaultQuality(source.qualityLabel)) { - selectedQuality = source.qualityLabel + console.log(source) + if (typeof (source.qualityLabel) !== 'undefined') { + if (this.determineDefaultQuality(source.qualityLabel)) { + selectedQuality = source.qualityLabel + } } }) @@ -264,6 +271,10 @@ export default Vue.extend({ }, determineDefaultQuality: function (label) { + if (this.useDash) { + return false + } + if (label.includes('p')) { const selectedQuality = parseInt(label.replace('p', '')) return this.defaultQuality === selectedQuality