解决有多个视频列表时的播放错误

This commit is contained in:
haiyangcui
2020-12-30 17:08:21 +01:00
parent ccbf4fb5d7
commit 0ad9b49224

View File

@@ -622,13 +622,12 @@ export default {
this.exportablePlaylist = false
this.fetchPlaylist().then(async (fullList) => {
var playlist = fullList[0].list
if (fullList.length > 1) {
playlist = fullList.find(x => x.flag === 'm3u8' || x.flag === 'mp4').list // 播放器支持的格式优先
}
const videoFlag = this.video.info.videoFlag
// 如果设定了特定的video flag, 获取该flag下的视频列表
const videoFlag = this.video.info.videoFlag
if (videoFlag) {
playlist = fullList.find(x => x.flag === videoFlag).list
} else if (fullList.length > 1 && fullList.find(x => x.flag === 'm3u8' || x.flag === 'mp4')) {
playlist = fullList.find(x => x.flag === 'm3u8' || x.flag === 'mp4').list // 播放器支持的格式优先
}
this.right.list = playlist
var url = playlist[index].split('$')[1]