多个播放视频列表时优先选择应用支持的

This commit is contained in:
buvta
2020-12-30 23:52:38 +08:00
parent 3a3e37f4bd
commit 23e693a314
2 changed files with 6 additions and 2 deletions

View File

@@ -621,8 +621,10 @@ export default {
this.isLive = false
this.exportablePlaylist = false
this.fetchPlaylist().then(async (fullList) => {
// 默认播放第一个video flag下面的视频
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下的视频列表
if (videoFlag) {

View File

@@ -244,6 +244,8 @@ const zy = {
const type = Object.prototype.toString.call(dd)
if (type === '[object Array]') {
for (const i of dd) {
const ext = Array.from(new Set(...i._t.split('#').map(e => e.split('$')[1].match(/\.\w+?$/))))
if (ext.length === 1) i._flag = ext[0].slice(1)
fullList.push(
{
flag: i._flag,
@@ -284,7 +286,7 @@ const zy = {
download (key, id) {
return new Promise((resolve, reject) => {
let info = ''
let downloadUrls = []
let downloadUrls = ''
this.getSite(key).then(res => {
const site = res
if (site.download) {