oEmbed consumer library

1.1.0 2013-03-27 20:37 UTC

This package is auto-updated.

Last update: 2024-05-23 04:17:55 UTC


Build Status

Simple consumer library for oEmbed with discovery support.


In this example the library automatically discovers the oEmbed enpoint for the resource, and asks for informations about the resource.


use Alb\OEmbed;

$response = OEmbed\Simple::request('', array(
    'maxwidth' => 400,
    'maxheight' => 300,

echo $response->getTitle();
echo $response->getHtml();

Advanced usage:


use Alb\OEmbed;

// instanciate a Provider from a known endpoint
$provider = new OEmbed\Provider('', 'json');

// request information about a resource
$response = $provider->request('');

The library is also capable of discovering the oEmbed enpoint from a resource URL (if the site supports it):


use Alb\OEmbed;

$discovery = new OEmbed\Discovery;
$provider = $discovery->discover('');

// or, using OEmbed\Simple:

$provider = OEmbed\Simple::getProvider('');