From d833d63bb81841e463b1821c06c3338da7198afe Mon Sep 17 00:00:00 2001 From: jmal Date: Wed, 27 Mar 2024 16:17:23 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8=E6=B7=BB=E5=8A=A0=E6=BA=90=E6=96=87=E4=BB=B6=E5=92=8C?= =?UTF-8?q?=E8=BD=AC=E7=A0=81=E5=90=8E=E7=9A=84=E4=B8=A4=E7=A7=8D=E7=94=BB?= =?UTF-8?q?=E8=B4=A8=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/VideoPreview.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/preview/VideoPreview.vue b/src/components/preview/VideoPreview.vue index 2937a0c..6fb2bb5 100644 --- a/src/components/preview/VideoPreview.vue +++ b/src/components/preview/VideoPreview.vue @@ -129,6 +129,7 @@ export default { if (this.shareId) { videoUrl = fileConfig.publicPreviewUrl(this.file, window.shareId, this.$store.getters.shareToken) } + const originUrl = videoUrl if (this.file.m3u8) { videoUrl = `${fileConfig.baseUrl}/video/hls/${this.file.m3u8}` if (this.shareId) { @@ -138,6 +139,20 @@ export default { } this.option.url = videoUrl if (this.file.m3u8) { + const supported = ['flv', 'mp4', 'ogg', 'mkv', 'webm', 'hls', 'mov'] + if (supported.includes(this.file.suffix.toLowerCase())) { + this.option.quality = [ + { + default: true, + html: 'HD', + url: this.option.url, + }, + { + html: '原文件', + url: originUrl, + } + ] + } this.option.customType = { m3u8: this.playM3u8 }