Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

Embera

> 前端框架
Open source

A Oembed consumer library, that gives you information about urls. It helps you replace urls to youtube or vimeo for example, with their html embed code. It has

355 stars0 likes1 views
WebsiteGitHub

About

A Oembed consumer library, that gives you information about urls. It helps you replace urls to youtube or vimeo for example, with their html embed code. It has

Embera - PHP Oembed consumer library

Embera is an Oembed consumer library written in PHP. It takes urls from a text and queries the matching service for information about the media and embeds the resulting html. It supports +150 sites, such as Youtube, Twitter, Livestream, Dailymotion, Instagram, Vimeo and many many more.

Installation

Install the latest stable version with:

bash
$ composer require mpratt/embera:~2.0

Standalone Installation (without Composer)

Download the latest release or clone this repository and include the Àutoloader.php file inside the Embera/src directory.

php
require '....../Autoloader.php';

use Embera\Embera;

$embera = new Embera();

Requirements

  • PHP >= 7.0 (It should work on 5.6)
  • Curl or allow_url_fopen should be enabled

Basic Usage

The most common or basic example is this one:

php
use Embera\Embera;

$embera = new Embera();
echo $embera->autoEmbed('Hi! Have you seen this video? https://www.youtube.com/watch?v=J---aiyznGQ Its the best!');

The last example returns something like the following text:

xml
Hi! Have you seen this video?

Its the best!

You can also inspect urls for their oembed data:

php
use Embera\Embera;

$embera = new Embera();
print_r($embera->getUrlData([
    'https://vimeo.com/374131624',
    'https://www.flickr.com/photos/bees/8597283706/in/photostream',
]));

That will return something like this

…

The response data depends on the provider, each of them returns information about the consulted media, however this library always tries to provide an embeddable html key that can be used to embed the information on a html document.

This library has fake responses / Offline support which is a way of getting the html embeddable code without the need of querying the oembed provider. It also has caching support, provider collections, responsive embeds and many other features. You can find out more by reading the documentation below.

Documentation

  • Usage/Configuration instructions
  • Supported providers
  • Using provider collections
  • Using fake Responses
  • Using responsive embeds
  • Enabling cache
  • Advanced Usage

Migrating from version >= 1.9.x

The folder structure has changed, the library is now in the src folder and you can find an autoloader there if you are not using composer.

The configuration array has changed in order to make it simpler. Take a look at the Usage/Configuration instructions to update it.

The other major change is that the inspectUrlInfo() method is now called getUrlData(). The HtmlFormatter class does not exist anymore since the library allows now other type of templating.

Updating should be fairly easy, check the documentation.

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub

Author

Michael Pratt - - See also the list of contributors which participated in this project.

If you like this library, it has been useful to you and want to support me, you can do it via paypal.

License

Embera is licensed under the MIT License - see the LICENSE file for details

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPdailymotionembed-videosfacebookhtml-embeddable

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架