public function ProviderPluginBase::renderThumbnail in Video 8.2
Same name and namespace in other branches
- 8 src/ProviderPluginBase.php \Drupal\video\ProviderPluginBase::renderThumbnail()
File
- src/
ProviderPluginBase.php, line 102
Class
- ProviderPluginBase
- A base for the provider plugins.
Namespace
Drupal\videoCode
public function renderThumbnail($image_style, $link_url) {
$this
->downloadThumbnail();
$output = [
'#theme' => 'image',
'#uri' => !empty($image_style) ? ImageStyle::load($image_style)
->buildUrl($this
->getLocalThumbnailUri()) : $this
->getLocalThumbnailUri(),
];
if ($link_url) {
$output = [
'#type' => 'link',
'#title' => $output,
'#url' => $link_url,
];
}
return $output;
}