interface UrlResolverInterface (View source)

Defines the interface for the oEmbed URL resolver service.

The URL resolver is responsible for converting oEmbed-compatible media asset URLs into canonical resource URLs, at which an oEmbed representation of the asset can be retrieved.

Methods

getProviderByUrl(string $url)

Tries to determine the oEmbed provider for a media asset URL.

string
getResourceUrl(string $url, int $max_width = NULL, int $max_height = NULL)

Builds the resource URL for a media asset URL.

Details

Provider getProviderByUrl(string $url)

Tries to determine the oEmbed provider for a media asset URL.

Parameters

string $url

The media asset URL.

Return Value

Provider

The oEmbed provider for the asset.

Exceptions

ResourceException
ProviderException

string getResourceUrl(string $url, int $max_width = NULL, int $max_height = NULL)

Builds the resource URL for a media asset URL.

Parameters

string $url

The media asset URL.

int $max_width

(optional) Maximum width of the oEmbed resource, in pixels.

int $max_height

(optional) Maximum height of the oEmbed resource, in pixels.

Return Value

string

Returns the resource URL corresponding to the given media item URL.