PHPackages                             jcisio/media-wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jcisio/media-wrapper

ActiveLibrary

jcisio/media-wrapper
====================

2.0(8y ago)5140↓100%1[1 issues](https://github.com/jcisio/MediaWrapper/issues)GPL-2.0+PHPPHP &gt;=5.3.5CI failing

Since Mar 9Pushed 6y ago2 watchersCompare

[ Source](https://github.com/jcisio/MediaWrapper)[ Packagist](https://packagist.org/packages/jcisio/media-wrapper)[ RSS](/packages/jcisio-media-wrapper/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/b6e80d9304d85343d9e94e2697c4aff8d0f097455213eb29c65ca5ad810ee1c6/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6a636973696f2f4d65646961577261707065722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/jcisio/MediaWrapper)[![Code Climate](https://camo.githubusercontent.com/f0bcaed9821b2d025792bea499bdbef3bb67871d2020a6b3b2ff4884b1dbc627/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6a636973696f2f4d65646961577261707065722f6261646765732f6770612e737667)](https://codeclimate.com/github/jcisio/MediaWrapper)[![Test Coverage](https://camo.githubusercontent.com/17b97f6250adeb3154f986a9b91cfc2c6e95e36d5a14ebe7287ed24660c01400/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6a636973696f2f4d65646961577261707065722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/jcisio/MediaWrapper)

Introduction
------------

[](#introduction)

- Author: Hai-Nam Nguyen (jcisio)
- Homepage:
- Requires **PHP 5.6** or later
- It is used by Drupal modules like [Internet Sources field](http://drupal.org/project/isfield) or [Content Attachment](http://drupal.org/project/attach).

Quick start
-----------

[](#quick-start)

Example:

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

```
phpunit

```

or if you don't have PHPUnit:

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

```

Use cases
---------

[](#use-cases)

MediaWrapper is extensible.

### Write your own wrapper

[](#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

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

```

### Override the output

[](#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.

### Responsive player

[](#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.

Another solution is to use the excellent and tiny [Fitvids JS](http://fitvidsjs.com/) jQuery plugin to make all videos responsive. It takes care of your CSS.

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~341 days

Recently: every ~366 days

Total

6

Last Release

3055d ago

Major Versions

1.7 → 2.02017-11-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/0641d8f15bea905bba7726ef78508ff879277e08326f2c14fbd03726cbe89da9?d=identicon)[jcisio](/maintainers/jcisio)

---

Top Contributors

[![jcisio](https://avatars.githubusercontent.com/u/243907?v=4)](https://github.com/jcisio "jcisio (96 commits)")[![damienmckenna](https://avatars.githubusercontent.com/u/429?v=4)](https://github.com/damienmckenna "damienmckenna (1 commits)")[![DuaelFr](https://avatars.githubusercontent.com/u/370584?v=4)](https://github.com/DuaelFr "DuaelFr (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jcisio-media-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/jcisio-media-wrapper/health.svg)](https://phpackages.com/packages/jcisio-media-wrapper)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
