2017 © Pedro Peláez
 

library media-wrapper

image

jcisio/media-wrapper

  • Wednesday, November 8, 2017
  • by jcisio
  • Repository
  • 2 Watchers
  • 5 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Build Status Code Climate Test Coverage, (*1)

Introduction

Quick start

Example:, (*2)

include 'MediaWrapper/MediaWrapper.php';
$m = MediaWrapper::getInstance()->getWrapper('http://www.youtube.com/watch?v=vyfzw09jjEo');
// Print the thumbnail.
print $m->thumbnail();
// Print the full player.
print $m->player();
// Set default player options.
$m->player_options(array('width' => '200', 'height' => '100'));
// Print the full player again with new default options.
print $m->player();
// Override default options and print the full player.
print $m->player(array('height' => '120'));

Test with PHPUnit:, (*3)

phpunit

or if you don't have PHPUnit:, (*4)

Composer install --dev
vendor/phpunit/phpunit/phpunit

Use cases

MediaWrapper is extensible., (*5)

Write your own wrapper

You can look at the MediaWrapper/Wrapper folder for examples. Once you have your wrapper, include that file and register that wrapper using, (*6)

MediaWrapper::getInstance()->register();

Override the output

You can extend a wrapper, keep the pattern and override the player() function. Do not forget to unregister the old wrapper so that only yours takes care of that pattern., (*7)

Responsive player

MediaWrapper in most cases uses the default player provided by each service. To make the player responsive (e.g. width = 100%), you can use CSS to make the iframe responsive. There are a lot of tutorials out there., (*8)

Another solution is to use the excellent and tiny Fitvids JS jQuery plugin to make all videos responsive. It takes care of your CSS., (*9)

The Versions

08/11 2017

dev-master

9999999-dev

  Sources   Download

MIT GPL-2.0+

The Requires

  • php >=5.3.5

 

The Development Requires

by Hai-Nam Nguyen

08/11 2017

2.0

2.0.0.0

  Sources   Download

MIT GPL-2.0+

The Requires

  • php >=5.3.5

 

The Development Requires

by Hai-Nam Nguyen

12/07 2017

1.7

1.7.0.0

  Sources   Download

MIT GPL-2.0+

The Requires

  • php >=5.3.5

 

The Development Requires

by Hai-Nam Nguyen

23/10 2014

1.6

1.6.0.0

  Sources   Download

MIT GPL-2.0+

The Requires

  • php >=5.3.5

 

The Development Requires

by Hai-Nam Nguyen

16/09 2014

1.5

1.5.0.0

  Sources   Download

The Requires

  • php >=5.3.5

 

The Development Requires

05/11 2013

1.4

1.4.0.0

  Sources   Download

The Requires

  • php >=5.3.5

 

The Development Requires

09/03 2013

1.3

1.3.0.0

  Sources   Download

The Requires

  • php >=5.3.5

 

The Development Requires