interface ResourceFetcherInterface (View source)

Defines an interface for an oEmbed resource fetcher service.

The resource fetcher's only responsibility is to retrieve oEmbed resource data from an endpoint URL (i.e., as returned by \Drupal\media\OEmbed\UrlResolverInterface::getResourceUrl()) and return a \Drupal\media\OEmbed\Resource value object.

Methods

fetchResource(string $url)

Fetches an oEmbed resource.

Details

Resource fetchResource(string $url)

Fetches an oEmbed resource.

Parameters

string $url

Endpoint-specific URL of the oEmbed resource.

Return Value

Resource

A resource object built from the oEmbed resource data.

Exceptions

ResourceException

See also

https://oembed.com/#section2