This is the website of Andy Carter a Textpattern and Drupal web developer living in the Steel city.
This plugin retrieves recent videos from the popular Youtube website and embeds them into your website. Recent videos from a user’s uploads or favourites, or with a given tag/keyword can be simply retrieved; alternatively you can specify a Youtube feed url. The Youtube player’s appearance can also be customised as with the arc_youtube plugin.
arc_recent_youtube uses SimplePie 1.0 b3.2 for feed retrieval and must be uploaded to your Textpattern install. The relevant SimplePie files are included in the download file.
<txp:arc_recent_youtube feed=“http://gdata.youtube.com/feeds/base/standardfeeds/GB/most_recent” />
<txp:arc_recent_youtube user=“bbc” />
<txp:arc_recent_youtube tag=“cartoon” />
Define the Youtube feed you want to retrieve recent videos from using one of the following attributes (in order of priority):-
Only one feed is retrieved, however, if you assign more than one of the above attributes then the one with highest priority overrides the others.
| Attribute | Description | Default | Example |
|---|---|---|---|
| limit | Maximum number of videos to return | 5 | limit=“1” |
| vplayer1 | ‘1’ to show video, ‘0’ to hide | 1 | vplayer=“0” |
| vlabel | ‘1’ to show video titles, ‘0’ to turn off | 1 | vlabel=“0” |
| vlabeltag | Wraptag for video titles | h4 | vlabeltag=“p” |
| link | Set to ‘1’ to link video titles to the Youtube video page | 1 | link=“1” |
| label | Label for the top of the list | no label | label=“My Youtube favourites” |
| labeltag | Independent wraptag for label | unset | labeltag=“h3” |
| break | HTML tag (without brackets), or string, used to separate the videos | br | break=“li” |
| wraptag | HTML tag to be used as the wraptag, without brackets | unset | wraptag=“div” |
| class | CSS class attribute for wraptag | arc_recent_youtube | class=“youtube” |
1 Turning off the video using vplayer enables you to return just a linked list of video titles.
You can customise the appearance of the Youtube flash player using this plugin to define colours, size, and language settings like with the arc_youtube plugin.
| Attribute | Description | Default | Example |
|---|---|---|---|
| width | Width of video | 425 | width=“200” |
| height | Height of video | 344 | height=“150” |
| color1 | Six-digit hexadecimal colour code (if color1 and color2 are unset then the default Youtube colour scheme is used) | unset | color1=“2b405b” |
| color2 | Six-digit hexadecimal colour code | unset | color2=“6b8ab6” |
| border | ‘1’ to show border, ‘0’ to hide border | 0 | border=“1” |
| fs | ‘1’ to allow full screen, ‘0’ to disable full screen mode | 1 | |
| lang | Language code for player, by default this is set to English “en” | en | lang=“fr” |
| Attribute | Description | Default | Example |
|---|---|---|---|
| caching | ‘1’ to cache feed, ‘0’ to turn caching off | 1 | caching=“0” |
| cache_dir | Absolute path to the SimplePie cache directory (must be writable) | ||
| cache_time | Time in minutes that the cache files are stored before being refreshed | 60 | cache_time=1440 |
| simplepie | Absolute path to the SimplePie class file | /[path_to_txp]/lib/ | simplepie=”/classes/” |
If you have installed the SimplePie class file somewhere other than the textpattern/lib/ directory then you need to specify the absolute path using the simplepie attribute.
<txp:arc_recent_youtube user=“bbc” />
<txp:arc_recent_youtube user=“bbc” color1=“006699” color2=“54abd6” limit=“1” />
This just outputs the most recent upload from the user and modifies the appearance of the Flash player.
<txp:arc_recent_youtube tag=“cartoon” caching=“0” />
This retrieves videos tagged as ‘cartoon’ without caching, every page load will retrieve the feed. This is not recommended.
Is it possible to define more than one tag? It would be great.
— Nicolas · Thu May 19, 09:35 PM