A couple of new Textpattern plugins are ready for release today: the new arc_vimeo (for embedding Vimeo videos) and the all new version 2.0.2 of arc_youtube (for embedding Youtube videos). Both have been designed to play nicely with each other using new conditional tags.
First up is a brand new plugin for embedding the Vimeo video player in your Textpattern sites.
<txp:arc_vimeo video="[URL]" />
It works pretty much the same as the existing arc_youtube plugin. You can either pass it a Vimeo video ID or a valid Vimeo URL. These are passed either directly via the video parameter or use a custom field defined by the custom parameter.
You can customise the Vimeo player’s appearance by setting a colour for the UI components (using the color parameter) and toggle on/off various other bits of information like the video’s title (title parameter) and badge (badge parameter).
As well as the main
<txp:arc_vimeo> tag there is also a conditional tag for checking that a URL is a valid Vimeo video one:-
Full documentation and a link to download the latest version of the plugin can be found on the arc_vimeo page.
To coincide with the release of arc_vimeo I’ve completely rewritten the code for arc_youtube, added new options and added a new conditional tag.
Here’s a summary of what’s new with version 2:-
- Complete rewrite of the code
<txp:arc_if_youtube>conditional tag (works the same as the
- Lots of new parameters
- hd and ssl parameters removed (they are no longer applicable)
Full documentation and a link to download the latest version of the plugin can be found on the arc_youtube page.
Using arc_vimeo and arc_youtube Together
The new conditional tags provided with these two plugins means that they can easily be used together with a shared custom field for defining a video URL.
For example, if you have a custom field ‘video’ you can check if the contents of the field are a valid Vimeo URL first and display the Vimeo video, otherwise try and display a Youtube video:-
<txp:arc_if_vimeo custom="video"> <txp:arc_vimeo custom="video" /> <txp:else /> <txp:arc_youtube custom="video" /> </txp:arc_if_vimeo>