The player is one of my personal favorites and I await eagerly for the guys at WordPress to either make it commercially available as a self-hosted player, or open it up to the Open Source community - as they've already done with certain components .
This article will provide you with shortcode that will render a VideoPress video in your WordPress website (with optional meta data). Player options such as looping, autoplay, and the offset start time are all available as shortcode attributes. The player itself has a share button that launches a blind that offers embed code, download links and a permalink.
A PHP version is available for download. Requires Simple Cache.
[videopress v="https://videopress.com/v/iQnkO4EL"] (a video that demonstrates the features of the player) will render as follows.
By default the video will display the video title, length, and description - with the description silenced by the attribute of
meta="0". To render a video without the description, and and starting at the 80 second mark, we'll use the shortcode of
[videopress v="https://videopress.com/v/kUJmAcSf" meta="0" offset="80"] (attributes are discussed below).
The following shortcode attributes are available.
vis the full video URL or just the video ID.
widthrefers to the default video width. Ensure you hardcode it to a suitable width that suits your own WordPress post container.
heightis the height of the video container. The video will automatically scale based on your width. You should only define it if the default video doesn't scale correctly.
loop="1". False by default.
autoplayon page load, use
autoplay="1". False by default.
offset="300"- where the value is the number of seconds. In this case, 5 minutes.
metais the small container under your video with video data. Use
meta="0"to remove it. We cache the result as a transient for occasions when the video title or description changes.
The Shortcode Function
Copy and paste the WordPress function into your theme's
functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.
- Additional information can be extracted from the JSON result and included to style the meta box to your liking.
- The video duration format can be altered as described here.