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. [Image &amp; Media](/categories/media)
4. /
5. jcisio/media-wrapper

ActiveLibrary[Image &amp; Media](/categories/media)

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 1mo ago

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 65% 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

3104d 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)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k22](/packages/bkwld-croppa)[marc1706/fast-image-size

fast-image-size is a PHP library that does almost everything PHP's getimagesize() does but without the large overhead of downloading the complete file.

959.4M20](/packages/marc1706-fast-image-size)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)

PHPackages © 2026

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