Skip to content

Easily embed video or social media to your website

Notifications You must be signed in to change notification settings

MarcBrillault/embed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintainability Test Coverage

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

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

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

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

Will display :

<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 overridden by editing the correct env value.

We strongly suggest using 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 on the repository's tracker

About

Easily embed video or social media to your website

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages