2017 © Pedro PelĂĄez
 

library multiplayer

Builds customizable video embed codes from any URL.

image

fg/multiplayer

Builds customizable video embed codes from any URL.

  • Sunday, October 30, 2016
  • by fg
  • Repository
  • 7 Watchers
  • 37 Stars
  • 2,138 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 5 Forks
  • 2 Open issues
  • 7 Versions
  • 22 % Grown

The README.md

Multiplayer

A tiny library to build nice HTML embed codes for videos., (*1)

composer require fg/multiplayer

Example

$Multiplayer = new Multiplayer\Multiplayer();
$options = array(
    'autoPlay' => true,
    'foregroundColor' => 'BADA55'
);

echo $Multiplayer->html('http://www.dailymotion.com/video/xzn5qk', $options);
echo $Multiplayer->html('http://vimeo.com/47457051', $options);
echo $Multiplayer->html('http://www.youtube.com/watch?v=3qSMS4c5WAk', $options);

This code would produce:, (*2)

<iframe src="http://www.dailymotion.com/embed/video/xzn5qk?autoplay=1&foreground=#BADA55" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<iframe src="http://player.vimeo.com/video/47457051?autoplay=1&color=BADA55" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<iframe src="http://www.youtube-nocookie.com/embed/3qSMS4c5WAk?autoplay=1" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

Templating

You can customize the generated HTML code by passing a templating function:, (*3)

echo $Multiplayer->html($url, $options, function($playerUrl) {
    return '<iframe src="' . $playerUrl . '" class="video-player">'
});

A default one can also be set on instanciation:, (*4)

new Multiplayer\Multiplayer($services, function($playerUrl) {
    return '<iframe src="' . $playerUrl . '" class="video-player">'
});

The Versions

30/10 2016

dev-master

9999999-dev http://github.com/felixgirault/multiplayer

Builds customizable video embed codes from any URL.

  Sources   Download

The Requires

  • php >=5.4.0

 

html video media embed player

30/10 2016

1.2.1

1.2.1.0 http://github.com/felixgirault/multiplayer

Builds customizable video embed codes from any URL.

  Sources   Download

The Requires

  • php >=5.4.0

 

html video media embed player

12/11 2015

1.2.0

1.2.0.0 http://github.com/felixgirault/multiplayer

Builds customizable video embed codes from any URL.

  Sources   Download

The Requires

  • php >=5.4.0

 

html video media embed player

12/11 2015

dev-feature-template

dev-feature-template http://github.com/felixgirault/multiplayer

Builds customizable video embed codes from any URL.

  Sources   Download

The Requires

  • php >=5.4.0

 

html video media embed player

29/03 2014

1.1.0

1.1.0.0 http://github.com/felixgirault/multiplayer

Builds customizable video embed codes from any URL.

  Sources   Download

The Requires

  • php >=5.3.0

 

html video media embed player

11/07 2013

1.0.0

1.0.0.0 http://github.com/felixgirault/multiplayer

Builds customizable video embed codes from any URL.

  Sources   Download

The Requires

  • php >=5.3.0

 

html video media embed player

29/06 2013

0.0.1

0.0.1.0 http://github.com/felixgirault/multiplayer

Builds customizable video embed codes from any URL.

  Sources   Download

The Requires

  • php >=5.3.0

 

html video media embed player