How to embed a YouTube live stream via Channel ID

Trying to embed a Live Stream channel ID instead of a video ID. The purpose of that is because there’s a new stream every week, so the channel ID would automatically update the video. The video ID requires I manually change the URL every week.

The channel ID link doesn’t seem to work. Not sure if the YouTube component event recognizes channel IDs.

Anyone know more about this?

3 Likes

I figured it out. For anyone interested, the YouTube component does not recognize channel IDs. You need to add an HTML embed. This is the code:

<style>
.embed-container { 
position: relative; 
padding-bottom: 56.25%;  /*this ensures aspect ratio is 16:9*/
} 

.embed-container iframe, .embed-container object, .embed-container embed { 
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
</style>

<div class='embed-container'>
<iframe src='https://www.youtube.com/embed/live_stream?channel=[Channel ID]' frameborder='0' allowfullscreen></iframe>
</div>

Be sure to replace the “[Channel ID]” in the iframe with your own. You can find it by navigating to www.youtube.com/account_advanced. See the image below.

6 Likes

Thanks for discovering & sharing that with us! Can you tell me what you did to set an image as the default display for the embed window when your channel isn’t currently live?

1 Like

hey @mrwildenfree mine automatically generated an image, but im not sure how if it was anything I did or didn’t do. A quick solution would be to add a background image to the html embed so something shows if your video isn’t generating a thumbnail.

How do you have yours currently setup?

1 Like

What image did it generate automatically? Did it pull a thumbnail from your YouTube account streaming setup? Or did it just use this…

1 Like

No, it should pull something from your channel. Is your live stream set to private or unlisted?

1 Like

It’s not my account, so I figured this was the part that wasn’t right. They may not have a stream thumbnail set yet. Working on it. Will let you know! Thanks!

2 Likes

Can you share the page that you used this on so I can see it “in action”? TY!

1 Like
2 Likes

Thank you.

It seems my client must not have live embed access as I’ve used your formula and the video is not currently available.

Make sure your client replaces the Channel ID with their own. It can be found in youtube.com/account_advanced.

Yup! We eventually learned that a channel must have 1,000 followers or a certain amount video watch time before they are allowed the live stream :frowning:

Thank you! Hopefully, we’ll be able to implement this in the future.

1 Like

Is the live chat from youtube? How did you embed the live chat on your page?

No, YouTube’s live chat is not embeddable from what I’ve seen. I used Chatroll. It’s not that great though. If you have developer knowledge, I would use PubNub.

Thank you so much for your input. That’s really helpful. I am low on the dev side - more of a designer - so I am looking at Chatroll - Pubnub looks very interesting but did make my head hurt a little.