New arc_vimeo and arc_youtube Plugins for Textpattern

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.

arc_vimeo

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:-

<txp:arc_if_vimeo video="[URL]"></txp:arc_if_vimeo>

Full documentation and a link to download the latest version of the plugin can be found on the arc_vimeo page.

arc_youtube

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
  • New <txp:arc_if_youtube> conditional tag (works the same as the <txp:arc_if_vimeo> tag)
  • 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>

Get the Plugins

Both plugins are available to download from the Textpattern section of this site. The code for both plugins is also available via Github.

Related Content

Published on


Comments

  1. Kevin |

    Am using your plugins. Super easy! Except I have to change the video URLs that I paste from https://vimeo.com/60061249 to http://vimeo.com/60061249. Vimeo and YouTube are all https these days. (Perhaps part of why I can’t get custom field to work, as well.)

  2. Andy |

    Hi Kevin, glad you like the plugins. It’s clearly a bug that they’re not accepting https URLs. I will fixing that ASAP. Thanks for pointing it out.