Universal Video: An HTML5 Video Plugin For WordPress
Universal Video is a simple plugin for WordPress that allows users to quickly and easily add HTML5 video to their WordPress blogs through the use of shortcodes.
As there is no overall consensus between web browsers on which video format to use for HTML5 video playback, users are required to provide multiple video formats in order for their videos to be viewable across all browsers. The typical HTML5 video process requires users to provide an “ogg” video, a “H.264″ video, and a flash version for browsers without HTML5 video capabilities. Universal Video simplifies the coding process when embedding videos to your blog.
How To Use Universal Video
You will need to have an ogg video (.ogv format) and a H.264 video (.m4v) with the same file name uploaded to your “uploads” folder inside the “wp-content” folder in your WordPress directory. (Example: “home-video.ogv” and “home-video.m4v”)
The basic shortcode for inserting HTML5 video into your posts or pages is simple:
[video src="filename" height="xxx" width="xxx"]
If you have two videos named “home-video.ogv” and “home-video.m4v” with video dimensions of 640px by 480px then the shortcode you would use is as follows:
[video src="home-video" height="480" width="640"]
And if you choose to use a poster image, simply upload your desired image to the “uploads” folder along with your video files in the “wp-content” folder and the markup would look like the following:
[video src="home-video" height="480" width="640" poster="home-image.jpg"]
This shortcode will generate the necessary markup for HTML5 video playback, and if HTML5 playback is not possible for the viewer, then the video will be presented in Flash format through the use of Flowplayer.
- The video file extension is not needed in the shortcode. In fact, don’t put the extension in there at all. The shortcode fills that part in for you.
- Height and width are not technically necessary for HTML5 video playback. However, these dimensions are necessary for proper Flash playback.
- Universal Video supports the “.ogv” ogg video format and the “.m4v” H.264 video format. To convert your videos, it is recommended to use the Miro Video Converter and Handbrake.
- Future versions will include support for more video attributes such as “poster”. The latest release, version 0.2, supports poster images for HTML5 video.
Questions or comments? Leave your feedback below!