Skip to content

Commit

Permalink
readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcBrillault committed Jul 16, 2018
1 parent 57449c2 commit 658571f
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# embed
# Embryo/Embed

This is a library intended to easily embed data from different kind of sources.

## Installation

- via composer : `composer require embryo/embed`

## Usage


```php
<?php

require_once __DIR__.'/vendor/autoload.php';

$url = 'https://www.youtube.com/watch?v=2_HXUhShhmY';

$embed = new \Embryo\Embed\Embed($url);
echo $embed->getEmbeddedCode();
```

Will display :
```html
<iframe
width="400"
height="225"
src="https://www.youtube.com/embed/2_HXUhShhmY"
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen>
</iframe>
```

## Configuration

Some of the default values can be overrided by editing the correct env value.

We strongly suggest using [phpdotenv](https://github.com/vlucas/phpdotenv) to do so.

Available values are:
- `EMBED_WIDTH` (Used on videos, default value is 400)
- `EMBED_RATIO` (Used on videos, default value is 16/9)

## Available sources

- Video services
- DailyMotion
- Vimeo
- Youtube

## Suggesting another source

All suggestions are welcome, just create an issue here : https://github.com/MarcBrillault/embed/issues

0 comments on commit 658571f

Please sign in to comment.