2017 © Pedro Peláez
 

library video-embed

Video embed library

image

ivopetkov/video-embed

Video embed library

  • Thursday, July 12, 2018
  • by ivopetkov
  • Repository
  • 1 Watchers
  • 4 Stars
  • 1,932 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 9 Versions
  • 13 % Grown

The README.md

Video Embed

Simple library that returns embed information for a given video url., (*1)

Supported video services: Dailymotion, Facebook, Flickr, Hulu, Kickstarter, The New York Times, Ted, Vimeo, Vine, YouTube., (*2)

Build Status Latest Stable Version codecov.io License Codacy Badge, (*3)

Download and install

  • Install via Composer
composer require ivopetkov/video-embed
  • Download the zip file

Download the latest release from our GitHub page, unzip and include the autoload.php file., (*4)

Usage

$videoEmbed = new IvoPetkov\VideoEmbed('https://www.youtube.com/watch?v=Pwe-pA6TaZk');

// IvoPetkov\VideoEmbed Object
// (
//     [url] => https://www.youtube.com/watch?v=Pwe-pA6TaZk
//     [html] => 




//     [width] => 480
//     [height] => 270
//     [duration] => 
//     [title] => Where the Hell is Matt? 2012
//     [description] => 
//     [thumbnail] => Array
//         (
//             [url] => https://i.ytimg.com/vi/Pwe-pA6TaZk/hqdefault.jpg
//             [width] => 480
//             [height] => 360
//         )
//     [author] => Array
//         (
//             [name] => Matt Harding
//             [url] => https://www.youtube.com/user/mattharding2718
//         )
//     [provider] => Array
//         (
//             [name] => YouTube
//             [url] => https://www.youtube.com/
//         )
//     [rawResponse] => {"html": "\u003ciframe width=\"480\" height=\"270\" ...
// )

$videoEmbed->setSize(800, 600); // will set a new width and height in the video html code

Documentation

Classes

IvoPetkov\VideoEmbed

Constants

const string VERSION, (*5)

Properties

public string $url, (*6)

      The video url, (*7)

public string $html, (*8)

      The video html code, (*9)

public string|int $width, (*10)

      The video width, (*11)

public string|int $height, (*12)

      The video height, (*13)

public int $duration, (*14)

      The video duration, (*15)

public string $title, (*16)

      The video title, (*17)

public string $description, (*18)

      The video description, (*19)

public array $thumbnail, (*20)

      An array containing an url and sizes for the video thumbnail image, (*21)

public array $author, (*22)

      An array containing the name and the url of the author, (*23)

public array $provider, (*24)

      An array containing the name and the url of the provider, (*25)

public string $rawResponse, (*26)

      The raw response from the provider embed endpoint, (*27)

Methods
public __construct ( [ string $url ] )

Creates a new VideoEmbed object and load it if an url is specified, (*28)

Parameters, (*29)

      $url, (*30)

            The video url, (*31)

Returns, (*32)

      No value is returned., (*33)

public void load ( string $url )

Loads the data for the url specified, (*34)

Parameters, (*35)

      $url, (*36)

            The video url, (*37)

Returns, (*38)

      No value is returned, (*39)

public void setSize ( string|int $width , string|int $height )

Sets new width and height in the video html code, (*40)

Parameters, (*41)

      $width, (*42)

            Thew new width, (*43)

      $height, (*44)

            Thew new height, (*45)

Returns, (*46)

      No value is returned, (*47)

License

Video Embed is open-sourced software. It's free to use under the MIT license. See the license file for more information., (*48)

Author

This library is created by Ivo Petkov. Feel free to contact me at @IvoPetkovCom or ivopetkov.com., (*49)

The Versions

12/07 2018

dev-master

9999999-dev

Video embed library

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

12/07 2018

v0.2.1

0.2.1.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

12/07 2018

v0.2.0

0.2.0.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

11/07 2018

v0.1.2

0.1.2.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

15/05 2017

v0.1.1

0.1.1.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

22/09 2016

v0.1.0

0.1.0.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

15/09 2016

v0.0.3

0.0.3.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

14/09 2016

v0.0.2

0.0.2.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

25/04 2016

v0.0.1

0.0.1.0

Video embed library

  Sources   Download

MIT

The Requires

  • php >=5.5.0