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:
@@ -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(() => {});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user