perf: 视频播放器添加源文件和转码后的两种画质选择
This commit is contained in:
parent
f398f78039
commit
d833d63bb8
@ -129,6 +129,7 @@ export default {
|
|||||||
if (this.shareId) {
|
if (this.shareId) {
|
||||||
videoUrl = fileConfig.publicPreviewUrl(this.file, window.shareId, this.$store.getters.shareToken)
|
videoUrl = fileConfig.publicPreviewUrl(this.file, window.shareId, this.$store.getters.shareToken)
|
||||||
}
|
}
|
||||||
|
const originUrl = videoUrl
|
||||||
if (this.file.m3u8) {
|
if (this.file.m3u8) {
|
||||||
videoUrl = `${fileConfig.baseUrl}/video/hls/${this.file.m3u8}`
|
videoUrl = `${fileConfig.baseUrl}/video/hls/${this.file.m3u8}`
|
||||||
if (this.shareId) {
|
if (this.shareId) {
|
||||||
@ -138,6 +139,20 @@ export default {
|
|||||||
}
|
}
|
||||||
this.option.url = videoUrl
|
this.option.url = videoUrl
|
||||||
if (this.file.m3u8) {
|
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 = {
|
this.option.customType = {
|
||||||
m3u8: this.playM3u8
|
m3u8: this.playM3u8
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user