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`;
|
let masterM3U8 = `${masterJSONURL.split("/sep/")[0]}/sep/video/${bestVideo.id}/master.m3u8`;
|
||||||
|
const fallbackResolution = bestVideo.height > bestVideo.width ? bestVideo.width : bestVideo.height;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
urls: masterM3U8,
|
urls: masterM3U8,
|
||||||
|
@ -81,8 +82,8 @@ export default async function(obj) {
|
||||||
id: obj.id,
|
id: obj.id,
|
||||||
title: fileMetadata.title,
|
title: fileMetadata.title,
|
||||||
author: fileMetadata.artist,
|
author: fileMetadata.artist,
|
||||||
resolution: `${bestVideo["width"]}x${bestVideo["height"]}`,
|
resolution: `${bestVideo.width}x${bestVideo.height}`,
|
||||||
qualityLabel: `${resolutionMatch[bestVideo["width"]]}p`,
|
qualityLabel: `${resolutionMatch[bestVideo.width] || fallbackResolution}p`,
|
||||||
extension: "mp4"
|
extension: "mp4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue