Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/felixgirault/multiplayer

An utility to display video players painlessly from any service.
https://github.com/felixgirault/multiplayer

Last synced: about 1 month ago
JSON representation

An utility to display video players painlessly from any service.

Awesome Lists containing this project

README

        

Multiplayer
===========

A tiny library to build nice HTML embed codes for videos.

```sh
composer require fg/multiplayer
```

Example
-------

```php
$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:

```html

```

Templating
----------

You can customize the generated HTML code by passing a templating function:

```php
echo $Multiplayer->html($url, $options, function($playerUrl) {
return ''
});
```

A default one can also be set on instanciation:

```php
new Multiplayer\Multiplayer($services, function($playerUrl) {
return ''
});
```