Embera is a Oembed consumer library written in PHP. Basically what it does is take urls from a text and queries the matching
service for information about the media.
If you are like me, in most cases all you want is to convert a simple Url to a valid html embed code. Now, the sweet thing about Embera, is that some providers allow you to skip the part about making the request to a Oembed Provider and still get a valid html embed code! Read the Offline Support section for more information.
On the other hand, there are some oembed providers that dont return html embedable code - Embera detects this and most of the time, it tries to generate a valid html code for you to use.
Check out the Basic Usage instructions for more information.
Embera alternatives and similar libraries
Based on the "Miscellaneous" category.
Alternatively, view Embera alternatives based on common mentions on social networks and blogs.
Whoops9.5 0.0 L5 Embera VS WhoopsPHP errors for cool kids
Country List9.1 0.0 Embera VS Country List:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats.
Annotations8.9 5.4 L4 Embera VS AnnotationsAnnotations Docblock Parser
Hprose-PHP7.9 0.0 L3 Embera VS Hprose-PHPHprose is a cross-language RPC. This project is Hprose 3.0 for PHP
PHPVerbalExpressions7.8 0.0 L5 Embera VS PHPVerbalExpressionsPHP Regular expressions made easy
SuperClosure7.0 1.0 L4 Embera VS SuperClosureSerialize closures. Not maintained. Consider using opis/closure.
dotenv-linter6.9 7.0 Embera VS dotenv-linter⚡️Lightning-fast linter for .env files. Written in Rust 🦀
Pagerfanta6.7 0.0 L5 Embera VS PagerfantaPagination library for PHP applications with support for several data providers
Underscore6.5 0.0 L4 Embera VS UnderscoreA PHP port of the Underscore JS library.
JSON Lint6.4 4.5 L2 Embera VS JSON LintJSON Lint for PHP
Essence5.8 0.0 L5 Embera VS EssenceExtracts information about web pages, like youtube videos, twitter statuses or blog articles.
sabre/vobject5.4 5.6 L3 Embera VS sabre/vobject:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects
LiteCQRS5.3 0.0 L5 Embera VS LiteCQRSSmall convention based CQRS library for PHP
Spork5.2 0.0 L5 Embera VS SporkExperimental library for forking PHP
html2text5.1 0.0 Embera VS html2textA PHP component to convert HTML into a plain text format
Knapsack5.0 0.0 L3 Embera VS KnapsackCollection pipeline library for PHP
RMT5.0 0.0 L5 Embera VS RMTRMT is a handy tool to help releasing new version of your software
Token Bucket4.9 0.0 L5 Embera VS Token BucketImplementation of the Token Bucket algorithm in PHP.
JSONPCallbackValidator4.9 1.7 L5 Embera VS JSONPCallbackValidatorJSONP callback validator.
Prooph Service Bus4.8 0.0 L5 Embera VS Prooph Service BusPHP Lightweight Message Bus supporting CQRS.
LadyBug4.7 0.0 L5 Embera VS LadyBugPHP 5.3+ Extensible Dumper
Lodash-PHP4.7 0.0 Embera VS Lodash-PHPEasy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP
PHPCR4.7 0.0 L4 Embera VS PHPCRPort of the Java Content Repository (JCR) to PHP.
vat.php4.4 0.0 L5 Embera VS vat.phpPHP library for dealing with European VAT
noCAPTCHA4.2 0.0 L5 Embera VS noCAPTCHA:passport_control: Helper for Google's new noCAPTCHA (reCAPTCHA v2 & v3)
PHP-GPIO4.2 0.0 L5 Embera VS PHP-GPIOA PHP library to play with the Raspberry PI's GPIO pins
ClassPreloader4.1 0.0 L5 Embera VS ClassPreloaderOptimizes class loading performance by generating a single PHP file containing all of the autoloaded files.
PHP PassBook4.0 1.0 L5 Embera VS PHP PassBookiOS passbook library for PHP
Metrics4.0 1.0 L3 Embera VS MetricsSimple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.
Flux4.0 0.0 L5 Embera VS FluxFluent regular expressions in PHP
Nmap3.4 0.0 L5 Embera VS Nmapnmap is a PHP wrapper for Nmap.
Slimdump3.3 0.0 L5 Embera VS SlimdumpA tool for creating configurable dumps of large MySQL-databases.
git-profile3.3 0.0 L5 Embera VS git-profileUtility that helps you switch git configurations with ease.
Cake Utility3.0 0.0 L3 Embera VS Cake Utility[READ-ONLY] CakePHP Utility classes such as Inflector, Text, Hash, Security and Xml. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp
RedisSessionHandler2.8 0.0 L5 Embera VS RedisSessionHandlerAn alternative Redis session handler for PHP featuring per-session locking and session fixation protection
html-object2.7 0.0 L5 Embera VS html-objectA set of classes to create and manipulate HTML objects abstractions
print_o2.7 0.0 L5 Embera VS print_oAn object graph visualizer
Opengraph2.5 0.0 L2 Embera VS OpengraphA PHP 5.3+ and PHP 7.3 framework for OpenGraph Protocol
Graphviz2.1 2.1 L5 Embera VS GraphvizPHP Graphviz library
Sslurp2.0 0.0 L5 Embera VS SslurpSslurp is a simple library which aims to make properly dealing with SSL in PHP suck less.
Procrastinator1.8 0.0 L5 Embera VS ProcrastinatorExecute time consuming tasks as late as possible in a request
Chief1.5 0.0 L5 Embera VS ChiefCommand bus package for PHP
PHP Expression1.5 0.0 L4 Embera VS PHP ExpressionPHP Expression Language
Jumper1.5 0.0 L5 Embera VS JumperPHP remote closure executor
Alias1.3 0.0 L5 Embera VS AliasFuelPHP Framework - Class and Namespace alias library
Lambda PHP1.2 0.0 L5 Embera VS Lambda PHPLambda calculus interpreter in PHP.
Yell1.0 0.0 Embera VS YellPHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.
PSON-PHP0.7 0.0 Embera VS PSON-PHPPHP implementation of PSON
PHPStackA TCP/IP stack proof of concept written in PHP.
Access the most powerful time series database as a service
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Embera or a related project?
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](doc/02-providers.md).
Install the latest stable version with:
$ 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
require '....../Autoloader.php'; use Embera\Embera; $embera = new Embera();
- PHP >= 7.0 (It should work on 5.6)
- Curl or allow_url_fopen should be enabled
The most common or basic example is this one:
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:
Hi! Have you seen this video? <iframe width="459" height="344" src="https://www.youtube.com/embed/J---aiyznGQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen ></iframe> Its the best!
You can also inspect urls for their oembed data:
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
Array ( [https://vimeo.com/374131624] => Array ( [type] => video [version] => 1.0 [provider_name] => Vimeo [provider_url] => https://vimeo.com/ [title] => VACATION movie [author_name] => Andrey Kasay [author_url] => https://vimeo.com/andreykasay [is_plus] => 0 [account_type] => basic [html] => <iframe src="......."></iframe> [width] => 426 [height] => 240 [duration] => 146 [description] => Остросюжетное кино про жизнь [thumbnail_url] => https://i.vimeocdn.com/video/832478725_295x166.jpg [thumbnail_width] => 295 [thumbnail_height] => 166 [thumbnail_url_with_play_button] => https://i.vimeocdn.com/......Fcrawler_play.png [upload_date] => 2019-11-19 06:27:37 [video_id] => 374131624 [uri] => /videos/374131624 [embera_using_fake_response] => 0 [embera_provider_name] => Vimeo ) [https://www.flickr.com/photos/bees/8597283706/in/photostream] => Array ( [type] => photo [flickr_type] => photo [title] => Durumu [author_name] => bees [author_url] => https://www.flickr.com/photos/bees/ [width] => 1024 [height] => 723 [url] => https://live.staticflickr.com/8385/8597283706_7b51ea50b1_b.jpg [web_page] => https://www.flickr.com/photos/bees/8597283706/ [thumbnail_url] => https://live.staticflickr.com/8385/8597283706_7b51ea50b1_q.jpg [thumbnail_width] => 150 [thumbnail_height] => 150 [web_page_short_url] => https://flic.kr/p/e6HjVq [license] => All Rights Reserved [license_id] => 0 [html] => ......... [version] => 1.0 [cache_age] => 3600 [provider_name] => Flickr [provider_url] => https://www.flickr.com/ [embera_using_fake_response] => 0 [embera_provider_name] => Flickr [html_alternative] => ........ ) )
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.
- [Usage/Configuration instructions](doc/01-usage.md)
- [Supported providers](doc/02-providers.md)
- [Using provider collections](doc/03-provider-collections.md)
- [Using fake Responses](doc/04-fake-responses.md)
- [Using responsive embeds](doc/05-responsive-embeds.md)
- [Enabling cache](doc/06-caching.md)
- [Advanced Usage](doc/07-advanced-usage.md)
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](doc/01-usage.md) to update it.
The other major change is that the
inspectUrlInfo() method is now called
HtmlFormatter class does not exist anymore since the library allows now other type
Updating should be fairly easy, check the documentation.
Submitting bugs and feature requests
Bugs and feature request are tracked on GitHub
Michael Pratt - [email protected] - http://www.michael-pratt.com 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.
Embera is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
*Note that all licence references and agreements mentioned in the Embera README section above are relevant to that project's source code only.