Youtube Channel Integration Block

Download: Youtube Channel Integration Block

Jason Verhagen
12th January 2016
Item has a rating of 5

Youtube Channel Integration Block

Item has a rating of 5

Added 12th January 2016

Integrate YouTube channels into your web site. Specify a YouTube channel or user name and some other parameters and you can integrate videos and video info in your web site. The block can automatically update with new content as it is added to the YouTube channel.

System Requirements / Dependencies

PHP JSON Extension


Creative Commons Attribution 3.0 Unported License (CC BY 3.0)
Hi Jason. Some parts of this addon are no longer working (ie, lead text and pagination). Also the instructions for obtaining an API key need updating. Managed to recreate a similar output to your screenshot, though the Name field refused to take the channel ID and I cannot find a way to list recent uploads (maybe due to it not being a playlist). Would be nice to have a way to reverse the listing, so it picks the most recent video in a playlist if it cannot pull the  "feed?activity_view=1" data. First time I've tried this addon so perhaps I'm just not choosing the correct options.
Thanks for the report. I'll look into the issues and see what needs fixing. It'll probably take a few days since I'll have to read up on the YouTube API to see what has changed over the past two years. I'll also step through the setup process and update the documentation for obtaining the API key.

For the channel ID issue, can you provide the channel ID or possibly the whole comcode block code you used that didn't work as expected (in Whisper or Private Topic if you don't want to post it publicly)? It's possible it's incorrect options, but it's also very possible YouTube API changes are causing problems. For the sorting of the videos, the YouTube API once supported a way to select the sorting but for some odd reason YouTube removed it. I'll check to see if sorting has been brought back in the YouTube API.

Now that I have a better understanding of jQuery and AJAX, this addon could probably use an overhaul…the pagination should be more automatic and should just update the block element of the web page instead of having to manually create new pages with slightly different block parameters.
No problem and no rush. I will send the relevant details now and thanks for responding.
I've fixed the issue with the Name parameter not taking channel IDs. Until the update gets pulled into the site, you can grab the files from GitHub and upload them over the existing files. The updated files are /sources_custom/blocks/youtube_channel.php and /lang_custom/EN/youtube_channel.ini. After updating the files, just prefix the channel ID with id= when entering it in the Name field...and be aware, entering anything in the Name field will override anything in the Playlist ID field. So if you enter a YouTube username or channel ID in the Name field and a playlist ID in the Playlist ID field, the block will only display the channel uploads playlist and ignore the Playlist ID field.

To address some of the other issues in more depth… The lead text parameters (formorelead, formoretext, and formoreurl) are only used in the template when the Style parameter is set to 3. The template(s) would need to be customised to include those parameters where desired. For pagination, the block itself doesn't do pagination internally. If you had a channel or playlist with 100 videos and wanted 10 videos per page, you would need to manually create 10 comcode pages, add the YouTube Channel block to each of those pages, and change the start_video block parameter on each comcode page (start_video=1, max_videos=10 for page 1, start_video=11, max_videos=10 for page 2, etc). For sorting/ordering videos, the YouTube Data API is limited as far as which API calls allow sorting. The PlaylistItems API call I am using doesn't have any sorting options available. For YouTube user created playlists, the ordering in the block will match the order in the playlist on YouTube. If you wanted a different order, you would have to create your own version of the playlist with the ordering you want and then use your newly created YouTube playlist in the YouTube Channel block. For the YouTube-created channel uploads playlist that contain all videos uploaded to a channel, the ordering should always be reverse order by date and time so the newest uploads are listed first.
1 guest and 0 members have just viewed this.
Control functions:


Users online:

MVLipwig, Salman, Paul D, Philip, gabriel58

Forum statistics:
  • 1,084 topics, 5,240 posts, 6,114 members
  • Our newest member is yoyocoupons
Back to Top