PHPackages                             cschoenfeld/html5video - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cschoenfeld/html5video

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cschoenfeld/html5video
======================

HTML5 video tag writer

1.4(11y ago)129PHPPHP &gt;=5.3.0

Since Jul 23Pushed 11y ago1 watchersCompare

[ Source](https://github.com/cschoenfeld/HTML5-Video)[ Packagist](https://packagist.org/packages/cschoenfeld/html5video)[ RSS](/packages/cschoenfeld-html5video/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

```
HTML5 Video Class

Writes a properly formatted  tag into a web page,
with a minimum of fuss and with usable defaults.

ASSUMPTIONS:
If these assumptions are not met, there are function calls you can use to override them.
However, having things set up this way will mean you spend less time and write less code.

1. Constant: BASE_URL exists, with trailing slash.
Example: http://www.mysite.com/

2. Constant: BASEPATH exists, with trailing slash.
Example: /var/htdocs/mysite/

3. Your video files and poster image are located in a /media/ directory, at the BASEPATH.

4. A Flash-based MP4 player called "flvplayer.swf" is located at the BASE_URL.

INSTALLATION:
To install via Composer, put the following in your composer.json file:
{
	"require": {
		"cschoenfeld/html5video": "dev-master"
	}
}

Then, just run "composer install" from the command line.

USAGE:

First, prepare your video files and poster image.
You will need 3 video formats: .mp4, .webm, and .ogv. Example:
	myvideo.mp4
	myvideo.webm
	myvideo.ogv
	myvideo.jpg

Minimal sample code:
(3 lines of code to render a video.)

	require_once html5video.php;
	try {
		$video = new html5video('videlement', 'myvideo'); // ID of the  tag, filename of the video files.
		$video->setDimensions(640, 480); // Width, height
		$video->render();
	} catch (Exception $ex) {
		// Replace this code if you want to handle exceptions more gracefully.
		die('ERROR: ' . $ex->getMessage());
	}

Extended sample code:
(Overriding the class defaults, using additional features.)

	require_once html5video.php;
	try {
		$video = new html5video('videlement', 'myvideo');
		$video->setDimensions(640, 480);
		$video->setLocalDir('videos/people/charles'); // Specify an alternate local directory for the media files.
		$video->setBaseURL('http://www.mysite.com/'); // Needed if you don't have a BASE_URL constant defined.
		$video->setBasepath('/var/htdocs/mysite/'); // Needed if you don't have a BASEPATH constant defined.
		$vide->changeFilenames('myvideo-filename.mp4', 'thisvideo.ogv'); // Override the names of individual media files.
		$video->setFlashURL('assets/flash/vidplayer.swf'); // Override the default location of the Flash player.
		$video->use_amazon('https://s3.amazonaws.com/mybucket/'); // Pull videos from Amazon S3 storage.
		$video->useControls(false); // Don't show player controls.
		$video->setAutoplay(true); // Make the video start playing as soon as it loads.
		$video->render();
	} catch (Exception $ex) {
		// Replace this code if you want to handle exceptions more gracefully.
		die('ERROR: ' . $ex->getMessage());
	}

Note:
If you need to capture the HTML output to a variable, instead of writing it directly to the page,
then replace the "render()" line of the example with this:

	$vid_HTML = $video->render(false);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4313d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88eabe35dee06d545fc6a2f5b42cd2f65a082ba1ec7cefa03ee13b645fda3396?d=identicon)[chas42](/maintainers/chas42)

---

Top Contributors

[![cschoenfeld](https://avatars.githubusercontent.com/u/1215791?v=4)](https://github.com/cschoenfeld "cschoenfeld (10 commits)")

### Embed Badge

![Health badge](/badges/cschoenfeld-html5video/health.svg)

```
[![Health](https://phpackages.com/badges/cschoenfeld-html5video/health.svg)](https://phpackages.com/packages/cschoenfeld-html5video)
```

###  Alternatives

[gilek/yii2-gtreetable

yii2-gtreetable is an extension of Yii 2 Framework, which is wrapper for bootstrap-gtreetable plug-in, on the other hand it provides functionality which allows to save the nodes states into database.

4111.8k](/packages/gilek-yii2-gtreetable)

PHPackages © 2026

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