Manouri M
Manouri M

Reputation: 23

Embedding a YouTube livestream using the channel ID

I am using asp.net with C# and I need to have a page that shows the live streams from my youtube channel.

I want to embed a youtube live permanently using the channel id. I was following this tutorial https://webcam.io/blog/howto-embed-youtube-live.html but unfortunately it didn't work.

<div style="position:relative;height:0;padding-bottom:56.25%"><iframe src="https://www.youtube.com/embed/AYR_9fRDa8s?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="640" height="360" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>

When I copy the embed code from YouTube it gives me this which will change when a new live is created.

Please help me if you know how can I link it with the channel ID.

Thank you

Upvotes: 0

Views: 2820

Answers (1)

marianexyx
marianexyx

Reputation: 21

This formula works for me:

<iframe type="text/html" width="854" height="480" src="https://www.youtube.com/embed/live_stream?channel=[CHANNEL_ID]&autoplay=1"></iframe>

Upvotes: 2

Related Questions