Embedding Twitch Channel

Greetings,
I’m pretty much begginer and I’m trying to embed twitch channel to my website for hours, but I just can’t figure it out, so could someone more experienced help me?

My site is: http://hellk.funsite.cz/hellk/
Twitch channel: https://www.twitch.tv/hellkevilk

What I’ve tried:

iframe src=“https://player.twitch.tv/?channel=hellkevilk&parent=hellk.funsite.cz&parent=www.hellk.funsite.cz” frameborder=“0” allowfullscreen=“true” scrolling=“no” height=“500” width=“500”></iframe

Error from console:
Refused to frame ‘https://player.twitch.tv/’ because an ancestor violates the following Content Security Policy directive: “frame-ancestors https://hellk.funsite.cz https://www.hellk.funsite.cz”.

Thank you, Jacob.

Hey! I’ve been trying to get it to work myself also, I’ve followed all the instructions but still get the “refused to connect” error message. I’m not sure what else to do. Hopefully, someone can help us out!

Your website is not on forced HTTPS, that is the issue

The non HTTPs fails the HTTPS version works

I had force my website to use https and it works, I don’t know if it would work for you too djthirty, but I added .htaccess file to my website space and in there I copied:

RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_USER_AGENT} !(BlackBerry)
RewriteCond %{HTTP_USER_AGENT} !(Windows\sNT\s5\.[12])
RewriteCond %{HTTP_HOST} ^(www\.)?yourwebsite.com
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]

where you have to overwrite the “yourwebsite.com” section
Thank you, Jacob

That fix is relevant if you are using apache :smiley:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.