2017-25 © Pedro Peláez
 

library embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

image

mpratt/embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  • Monday, April 3, 2017
  • by mpratt
  • Repository
  • 14 Watchers
  • 162 Stars
  • 199,051 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 35 Forks
  • 10 Open issues
  • 30 Versions
  • 10 % Grown

The README.md

Embera - PHP Oembed consumer library

Build Status Total Downloads Monthly Downloads Latest Stable Version, (*1)

Support via PayPal, (*2)

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., (*3)

Installation

Install the latest stable version with:, (*4)

$ 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., (*5)

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:, (*6)

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:, (*7)

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:, (*8)

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, (*9)

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., (*10)

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., (*11)

Documentation

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., (*12)

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

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., (*14)

Updating should be fairly easy, check the documentation., (*15)

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub, (*16)

Author

Michael Pratt - yo@michael-pratt.com - http://www.michael-pratt.com See also the list of contributors which participated in this project., (*17)

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

Support via PayPal, (*19)

License

Embera is licensed under the MIT License - see the LICENSE file for details, (*20)

The Versions

03/04 2017

dev-master

9999999-dev https://github.com/mpratt/Embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

instagram twitter youtube oembed vimeo embed vine auto embed embed text url embed

15/07 2016

1.9.3

1.9.3.0 https://github.com/mpratt/Embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

instagram twitter youtube oembed vimeo embed vine auto embed embed text url embed

10/05 2016

1.9.2

1.9.2.0 https://github.com/mpratt/Embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

instagram twitter youtube oembed vimeo embed vine auto embed embed text url embed

22/04 2016

1.9.1

1.9.1.0 https://github.com/mpratt/Embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

instagram twitter youtube oembed vimeo embed vine auto embed embed text url embed

06/04 2016

1.9.0

1.9.0.0 https://github.com/mpratt/Embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

instagram twitter youtube oembed vimeo embed vine auto embed embed text url embed

21/01 2016

1.8.15

1.8.15.0 https://github.com/mpratt/Embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

instagram twitter youtube oembed vimeo embed vine auto embed embed text url embed

11/01 2016

1.8.14

1.8.14.0 https://github.com/mpratt/Embera

Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

instagram twitter youtube oembed vimeo embed vine auto embed embed text url embed

10/01 2016

1.8.13

1.8.13.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

03/11 2015

1.8.12

1.8.12.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

30/10 2015

1.8.11

1.8.11.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

19/06 2015

1.8.10

1.8.10.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

04/06 2015

1.8.9

1.8.9.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

28/05 2015

1.8.8

1.8.8.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

19/05 2015

1.8.7

1.8.7.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

05/02 2015

1.8.6

1.8.6.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

01/02 2015

1.8.5

1.8.5.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

26/11 2014

1.8.4

1.8.4.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

24/11 2014

1.8.3

1.8.3.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

17/10 2014

1.8.2

1.8.2.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

07/08 2014

1.8.1

1.8.1.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

29/05 2014

1.8.0

1.8.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

21/05 2014

1.7

1.7.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

21/03 2014

1.6

1.6.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

17/01 2014

1.5

1.5.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

08/11 2013

1.4

1.4.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

03/11 2013

1.3

1.3.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

21/10 2013

1.2

1.2.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

15/10 2013

1.1

1.1.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

24/09 2013

1.0

1.0.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed

11/09 2013

0.9

0.9.0.0 https://github.com/mpratt/Embera

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.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

youtube oembed vimeo embed auto embed