3 namespace Drupal\media\OEmbed;
6 * Defines an interface for an oEmbed resource fetcher service.
8 * The resource fetcher's only responsibility is to retrieve oEmbed resource
9 * data from an endpoint URL (i.e., as returned by
10 * \Drupal\media\OEmbed\UrlResolverInterface::getResourceUrl()) and return a
11 * \Drupal\media\OEmbed\Resource value object.
13 interface ResourceFetcherInterface {
16 * Fetches an oEmbed resource.
19 * Endpoint-specific URL of the oEmbed resource.
21 * @return \Drupal\media\OEmbed\Resource
22 * A resource object built from the oEmbed resource data.
24 * @see https://oembed.com/#section2
26 * @throws \Drupal\media\OEmbed\ResourceException
27 * If the oEmbed endpoint is not reachable or the response returns an
28 * unexpected Content-Type header.
30 public function fetchResource($url);