Twitch iframes no longer work

Description of the issue: When using iframes to load a twitch stream, it only shows a black screen for the video stream. The twitch UI loads in, just not the video/audio.

Steps to Reproduce (add as many as necessary): 1. 2. 3.
Paste this script into the console on any regular website (e.g. google/twitch/wikipedia), it will create an iframe as seen below and load a twitch channel. feel free to swap out the twitch channel name in the script to any streamer you want.

(() => {
  const existing = document.getElementById('test-iframe');
  if (existing) existing.remove();

  const iframe = document.createElement('iframe');
  iframe.id = 'test-iframe';
  iframe.src = 'https://player.twitch.tv/?channel=kaicenat&parent=' + location.hostname;
  iframe.style.position = 'fixed';
  iframe.style.top = '10px';
  iframe.style.right = '10px';
  iframe.style.width = '480px';
  iframe.style.height = '270px';
  iframe.style.zIndex = '99999';
  iframe.style.border = '2px solid #9146FF';
  iframe.allowFullscreen = true;
  document.body.appendChild(iframe);
})();

Actual Result (gifs and screenshots are welcome!):
Here is a screenshot example of an iframe being loaded within brave.

Expected result:
I expect the stream to load as normal like as seen here with the script executed in edge.

Reproduces how often:
100% of the time now.

Operating System and Brave Version(See the About Brave page in the main menu):
Brave is up to date
Brave 1.79.126 (Official Build) (arm64)
Chromium: 137.0.7151.119

Macos 14.1.1 | M2 Pro
Additional Information:
I found this issue out as I use this extension for twitch https://previews-app.com/ - it creates little preview windows for streamers when you hover over their name, but it has since broken. I think Twitch might be attempting to block Brave as a whole, possibly in some kind of get back for Brave blocking Twitch ads by default, I’m not sure. All I know is, since Brave made that announcement about it blocking twitch ads, iframes no longer work in Brave. I use Twitch turbo, so in theory no ads should attempt to load across the entire site if its something to do with ad delivery.

Outside of your script, do you see other embedded Twitch videos on sites display normally?

No they don’t load on other websites. for example, all streamers typically have a StreamElements page, where the stream is embedded. StreamElements is major/official partner with Twitch, so it shouldn’t be broken here - but it is when using Brave.

the reason I provided the script was just to make it easily reproducible for people here on the forums.

Thank you – will do some digging on this.

Thank you.
Found this post here of someone doing more investigation and figured it may help.
https://linustechtips.com/topic/1615501-brave-browser-now-blocks-twitch-ads-by-default/?do=findComment&comment=16752110

I found this thread by searching around the internet after being suddenly unable to play embedded Twitch streams in a website since yesterday in Brave. In Chrome, Edge and Firefox they work properly. There’s a GraphQL endpoint that is called in Twitch’s embed iframe to get a PlaybackAccessToken and apparently if your user agent is “Brave” it responds with server error. If you set the user agent to Google Chrome or Test or anything else, you get a playback token. I contacted Twitch support yesterday to debug the errors some of my webapp’s users were seeing and they recommended that I try a supported browser, which is when I discovered this.

Sec-ch-ua is being sniffed by Twitch, we’re investigating a fix

By using extensions like Requestly, it’s easy to overwrite sec-ch-ua. Could brave simply overwrite it?

Sure, we have an interim patch incoming soon, to avoid extension work arounds

1 Like