-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57449c2
commit 658571f
Showing
1 changed file
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |