mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 10:40:08 +08:00
多个播放视频列表时优先选择应用支持的
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user