You are here

public function Facebook::getRemoteThumbnailUrl in Video 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/video/Provider/Facebook.php \Drupal\video\Plugin\video\Provider\Facebook::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/Facebook.php, line 64

Class

Facebook
Plugin annotation @VideoEmbeddableProvider( id = "facebook", label = @Translation("Facebook"), description = @Translation("Facebook Video Provider"), regular_expressions = { "@^https?://www\.facebook\.com/.*(/videos/(?<id>\d+))@i", …

Namespace

Drupal\video\Plugin\video\Provider

Code

public function getRemoteThumbnailUrl() {
  $data = $this
    ->getVideoMetadata();
  return 'https://graph.facebook.com/' . $data['id'] . '/picture';
}