Check Youtube live chat is available before embedding

Viewed 97

Is it possible to check the availability of a Youtube live stream's chat programmatically?

I'm successfully embedding the chatbox using the following:

<iframe
  src="https://www.youtube.com/live_chat?v=ecHbnqUuqeE&embed_domain=localhost"
  width="100%"
  height="100%">
</iframe>

The issue is this embeds a chatbox with the text Chat is disabled for this live stream.

If you go to the original stream on Youtube, you'll see there is a chatbox that was enabled. I believe Livestream creators can toggle whether or not the chatbox can be embedded.

My question is, can I check whether the chat is enabled prior to embedding it in my site?

0 Answers
Related