YouTube
The Youtube engine imports videos from YouTube through the YouTube Data API: the videos of a playlist, of a channel, or the results of a search. Each video becomes an item with its title, description, thumbnails and a ready embed code, so you can post videos as Joomla articles or K2 items.
What you need
A YouTube Data API v3 key:
- Open the Google Cloud Console and create a project, or pick one.
- Enable YouTube Data API v3 for it.
- Under Credentials, create an API key. Restrict it to the YouTube Data API.
The API has a daily quota. Each run uses part of it; searches use more than playlists. Keep Max Results and the schedule reasonable.
Output fields [oe]
| Field | Value |
|---|---|
id |
The video ID |
link |
https://www.youtube.com/watch?v=... |
title |
The video title |
description |
The description, between your HTML Before Description and HTML After Description |
published_at |
The publication date |
default_image, medium_image, high_image, standard_image, maxres_image |
The thumbnails in each size |
channel_title, channel_id |
The channel |
embed |
The <iframe> player, with your embed settings |
Basic tab
- Source Type: Playlist, Channel or Search.
- ID: the playlist ID (
PL...) for Playlist, the channel ID (UC...) for Channel, or, optionally, a channel ID to limit a search to that channel. - Search Query: the keywords, for Search and Channel. With Channel, only that channel's videos are searched.
- Sort Order (Search): Date (Most Recent), Rating, Relevance, Title or View Count.
- Max Results: the number of videos per run. Default 10.
- YouTube API Key: your key.
Advanced tab: the embed code
- Embed Width, Embed Height: default
800pxand443px. Use100%for the width in responsive templates. - Autoplay, Allow Fullscreen, Show Captions, Show Related Videos, Show Video Title.
- Start Time (seconds), End Time (seconds): play only part of the video.
- Before Embed HTML, After Embed HTML: HTML around the player, such as a wrapper
<div class="video">. - HTML Before Description, HTML After Description: HTML around the description.
Example pipe
| Article field [ia] | From |
|---|---|
title |
title |
introtext |
embed |
fulltext |
description |
images |
high_image, saved with Save Image |
publish_up |
published_at |
Set Allow Unsafe HTML to Yes in the Content adapter, or Joomla's text filters remove the iframe.
Find the IDs
- Playlist ID: the part after
list=in the playlist address. - Channel ID: starts with
UC. On the channel page, open About, Share channel, Copy channel ID.
Youtube Embed processor
The Youtube Embed processor was meant to get the title, author, thumbnail and embed code of any YouTube link found in other content. In the current version it returns the same sample video for every link, so don't use it. The Youtube engine's own embed field works.