You are here

public function Dailymotion::getRemoteThumbnailUrl in Video 8

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

Class

Dailymotion
Plugin annotation @VideoEmbeddableProvider( id = "dailymotion", label = @Translation("Dailymotion"), description = @Translation("Dailymotion Video Provider"), regular_expressions = { "@dailymotion\.com/video/(?<id>[^/_]+)_@i", }, …

Namespace

Drupal\video\Plugin\video\Provider

Code

public function getRemoteThumbnailUrl() {
  $data = $this
    ->getVideoMetadata();
  return 'http://www.dailymotion.com/thumbnail/video/' . $data['id'];
}