You are here

public function Instagram::getRemoteThumbnailUrl in Video 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/video/Provider/Instagram.php \Drupal\video\Plugin\video\Provider\Instagram::getRemoteThumbnailUrl()

Get the URL of the remote thumbnail.

This is used to download the remote thumbnail and place it on the local file system so that it can be rendered with image styles. This is only called if no existing file is found for the thumbnail and should not be called unnecessarily, as it might query APIs for video thumbnail information.

Return value

string The URL to the remote thumbnail file.

Overrides ProviderPluginInterface::getRemoteThumbnailUrl

File

src/Plugin/video/Provider/Instagram.php, line 53

Class

Instagram
Plugin annotation @VideoEmbeddableProvider( id = "instagram", label = @Translation("Instagram"), description = @Translation("Instagram Video Provider"), regular_expressions = { "@^.*?instagram\.com\/p\/(?<id>(.*?))[\/]?$@i", }, …

Namespace

Drupal\video\Plugin\video\Provider

Code

public function getRemoteThumbnailUrl() {
  $data = $this
    ->getVideoMetadata();
  return 'http://instagr.am/p/' . $data['id'] . '/media/?size=l';
}