Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/felixgirault/multiplayer
- Owner: felixgirault
- Created: 2013-04-28T12:05:55.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-03-13T10:34:45.000Z (almost 6 years ago)
- Last Synced: 2024-11-20T02:37:50.763Z (about 2 months ago)
- Language: PHP
- Size: 25.4 KB
- Stars: 44
- Watchers: 9
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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 ''
});
```