vimeo: fall back to width
for quality label if unable to map
This commit is contained in:
parent
04ce4c0645
commit
7420337ea2
1 changed files with 3 additions and 2 deletions
|
@ -71,6 +71,7 @@ export default async function(obj) {
|
|||
}
|
||||
|
||||
let masterM3U8 = `${masterJSONURL.split("/sep/")[0]}/sep/video/${bestVideo.id}/master.m3u8`;
|
||||
const fallbackResolution = bestVideo.height > bestVideo.width ? bestVideo.width : bestVideo.height;
|
||||
|
||||
return {
|
||||
urls: masterM3U8,
|
||||
|
@ -81,8 +82,8 @@ export default async function(obj) {
|
|||
id: obj.id,
|
||||
title: fileMetadata.title,
|
||||
author: fileMetadata.artist,
|
||||
resolution: `${bestVideo["width"]}x${bestVideo["height"]}`,
|
||||
qualityLabel: `${resolutionMatch[bestVideo["width"]]}p`,
|
||||
resolution: `${bestVideo.width}x${bestVideo.height}`,
|
||||
qualityLabel: `${resolutionMatch[bestVideo.width] || fallbackResolution}p`,
|
||||
extension: "mp4"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue