Merge branch 'master' into develop

# Conflicts:
#	package.json
#	src/js/plugins/vimeo.js
#	src/js/plugins/youtube.js
#	src/js/ui.js
#	yarn.lock
This commit is contained in:
Sam Potts
2020-11-14 13:11:24 +11:00
4 changed files with 13 additions and 17 deletions

View File

@@ -126,19 +126,13 @@ const vimeo = {
// Get poster image
if (!config.customControls) {
fetch(format(player.config.urls.vimeo.api, id), 'json').then((response) => {
if (is.empty(response)) {
fetch(format(player.config.urls.vimeo.api, src)).then((response) => {
if (is.empty(response) || !response.thumbnail_url) {
return;
}
// Get the URL for thumbnail
const url = new URL(response[0].thumbnail_large);
// Get original image
url.pathname = `${url.pathname.split('_')[0]}.jpg`;
// Set and show poster
ui.setPoster.call(player, url.href).catch(() => {});
ui.setPoster.call(player, response.thumbnail_url).catch(() => {});
});
}