vimeo oembed api
This commit is contained in:
		@ -200,7 +200,7 @@ const defaults = {
 | 
			
		||||
    vimeo: {
 | 
			
		||||
      sdk: 'https://player.vimeo.com/api/player.js',
 | 
			
		||||
      iframe: 'https://player.vimeo.com/video/{0}?{1}',
 | 
			
		||||
      api: 'https://vimeo.com/api/v2/video/{0}.json',
 | 
			
		||||
      api: 'https://vimeo.com/api/oembed.json?url={0}',
 | 
			
		||||
    },
 | 
			
		||||
    youtube: {
 | 
			
		||||
      sdk: 'https://www.youtube.com/iframe_api',
 | 
			
		||||
 | 
			
		||||
@ -123,19 +123,13 @@ const vimeo = {
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    // Get poster image
 | 
			
		||||
    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(() => { });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // Setup instance
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user