Skip to content

Hide Twitch iFrame If Channel Not Live

We have a site embedding Twitch streams. They have events for a channel going offline. So when a stream is live, then it goes offline, I can essentially then hide the iframe. However, I’m wanting to have it so if when the page is loaded, and the channel is already offline, the iframe doesn’t show.

Any ideas and thoughts much appreciated.

Thanks in advance!



You probably already posted the solution yourself.
In the link you posted there’s a js call you can use to get the state of the stream.


You probably can use this to show/hide your iframes.

User contributions licensed under: CC BY-SA
10 People found this is helpful