This is the code behind http://video.xenoveritas.org/ - for the most part.
The play.php script embeds video information, stored as a JSON file, into a web page that can then play back a video.
The basic code is written using PHP 5 and PHP will need to be available on your server. It probably already is.
The code itself uses video.js.
As of now, you need to compile a bunch of artifacts to build a final useful system. Compiling requires:
make
(possibly GNU make, but just any make should work)- Java (for the Closure Compiler)
- Closure Compiler
- nodejs (For LESS CSS and marked)
- LESS CSS
- marked
Once you have NodeJS installed, installing LESS CSS and marked is easy:
npm install -g lessc
npm install -g marked
To just create the minified versions of everything, just use make
.
However, to create a "deploy" copy, you can use make install
which
will create a version of all the files with their "deployed" versions.
You can set video_root
to be the base URL where the video appears in
the final domain, or leave it blank if everything is at the root
already.
So, for example, to have everything hosted under video
, use
video_root=/video install
.
The following are used to encode the video:
{
"title": "Video Title",
"description": "Description of the video",
"url": "video file name prefix",
"formats": [ "mp4", "webm" ],
"poster": "video.jpg",
"width": 640, "height": 480,
"duration": 600,
"previous": "prev",
"next": "next",
"playlist": "/playlist/videos"
}
The individual keys are as follows:
The title as shown on the page.
A brief bit of text displayed under the video that describes the video.
The URL to use for the video format, without an extension. The extensions will automatically be added via the "formats" field. This URL should not end with a '.' as it will be automatically added.
An array of extensions to add to the original URL, without the '.' at the start.
Sets the poster image. Defaults to the URL with ".jpg" added to it, just like the various video formats are defined.
The width and height of the video file in pixels. Yes, all formats must use the same width/height: each individual format is supposed to be a reencode of the same video to provide support for multiple browsers.
The length of the video in seconds. If you really want to, this can be a decimal, although that's ignored. This is purely informational. (This was required with jwplayer and is entirely ignored by video.js.)
If provided, a relative URL to the previous video in the playlist.
If provided, a relative URL to the next video in the playlist.
NOT IMPLEMENTED YET