How to embed a live YouTube channel in a website?

Social media platforms play an important role for the businesses in today’s world. Different social media platforms help businesses to communicate with potential or loyal customers. YouTube is one the social media platforms which helps  for-profit or non-profit businesses to live stream their events or  share their messages to customers or viewers. In this blog, we will go over the details to embed a live YouTube channel in a website.

You may be struggling with or looking for ways to embed a live YouTube channel into your WordPress / Drupal website or a static web page, you may find the helpful information on this page.

Follow the below steps to get the URL of the  desired YouTube channel:

Get YouTube Channel ID

  1. Open YouTube in the web browser, type the name of the desired YouTube channel in the search box and hit enter.
Channel Name Search
YouTube Channel name showing after searching in YouTube website

2. Then, click on the image  or name of YouTube channel as showing in the screenshot above and you will be taken to channel’s home page.

3. Copy the channel’s id (after ‘/channel/’) from the URL as shown below in red rectangular box.

YouTube Channel Id showing in URL (address bar)

Get a code to embed a live YouTube channel

4. If the channel is live, then click on the the link with text ‘Live Now’ from the list. This will start the live streaming video. Otherwise, click on any already streamed video of the channel to play the video.

5. Now, click on the the text “SHARE’ under live video or recorded video as shown below.

YouTube Share link
YouTube Share link

6. Then click on <Embed> option as shown below.

Share options
YouTube Video Share dialog with Embed highlighted in red box

7. This will open a pop up with the embed code for iframe on the right side as shown in screenshot below.

Embed Video iframe code
Video Embed code dialog

8. Click on the label “COPY’ to copy the HTML code you would use to embed the live stream YouTube channel.

Replace the video id in the embed code (displayed after /embed/ as shown in screenshot above in step 7) with the following text:

live_stream?channel=CHANNEL_ID

Where CHANNEL_ID is the channel id copied in step 3. So, the iframe code should like this:

Final iFrame code needed to embed a live YouTube channel
Final iFrame code needed to embed a live YouTube channel

Embed a live YouTube channel code in a website

9. Now open a text editor of your choice and paste the code into the ‘<body>’ tag, save the file as ‘.html’ and open the page for testing.

If the channel is live and autoplay didn’t work on page load, you will see an image and click on the Play icon to start the video.

10.  Steps to embed YouTube channel in a WordPress or Drupal

a. WordPress: In a page or post, click on ‘+’ to add block, choose “Custom HTML” and paste the embed code into that block. Click on Preview in block Toolbar and you should be able to see the channel video there.

b. Drupal: Go to Structure -> Block Layout -> Custom block library tab -> Add custom block.

Provide the Block Description and change ‘Text Format’ to ‘Full HTML’ . Then click on ‘Source’ in the Editor bar, copy the embed code and paste it into the Editor body, then click again on ‘Source’ and you should be able to see the preview of the channel video. Now, save the block.

Please visit our Blog page for to read more posts.

Disclaimer: This blog post is for informational purposes only and is provided as it is. Read Disclaimer