You are here

public function Resource::getThumbnailUrl in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media/src/OEmbed/Resource.php \Drupal\media\OEmbed\Resource::getThumbnailUrl()

Returns the URL of the resource's thumbnail image.

Return value

\Drupal\Core\Url|null The absolute URL of the thumbnail image, or NULL if there isn't one.

File

core/modules/media/src/OEmbed/Resource.php, line 415

Class

Resource
Value object representing an oEmbed resource.

Namespace

Drupal\media\OEmbed

Code

public function getThumbnailUrl() {
  return $this->thumbnailUrl ? Url::fromUri($this->thumbnailUrl)
    ->setAbsolute() : NULL;
}