Live streams on react-native app

Hi guys, I’m developing react-native expo app. I want to show live stream of our company in our app. I’m trying to “Embedding Twitch” but it needs parent which is domain. As you know mobile apps has no domain and I’m getting “ERR_BLOCKED_BY_RESPONSE”. Is there any way to handle this.

I’ll give you the same answer I gave someone else in Discord.

See if you can adapt the electron solution - twitch_misc/player/electron at main · BarryCarlyon/twitch_misc · GitHub

Or use a webview to open an iFrame to your website with the required Stream/played.

Cant apply your electron suggestion to Ionic (unless I’m missing something?).
Ionic itself is a WebView, so you can’t open a webview in a webview – the closest to this would be loading an external site which has an iframe of the twitch embed, which ultimately gets blocked anyway.
You can open an in-app browser, but that’s a fullscreen thing that cannt be resized and thus wont be used (realistically) to embed a stream in the app.

One person mentioned that it works on Android, but not on iOS, but didn’t elaborate further.

Second paragraph

On Android its working perfect but in the iOS App the iframe will not be shown and no player is available. Just a white screen.

The only workaround, and I say that as a stretch, would be to create a custom plugin for capacitor which would resize the main capacitor webview to make space and stack another WebView in the UI stack - but this is far from ideal. That has to be some sort of workaround for this.

This works for me, (on droid and iOS), but I’m not using ionic as my framework so unable to test that solution.

Yeah, it seems like it should work, but I’m getting ERR_BLOCKED_BY_RESPONSE.
I have an iframe which is loading in the page https://linode.miaz.xyz/twp/ (personal site with twitch embed iframe).
So it looks like Capacitor Webview → iframe with my site → iframe with Twitch embed.

the iframe on this page has the wrong parent it should be linode.miaz.xyz it shouldn’t need a localhost parent (but you could always specify both)

Just updated it now - even with the correct parent it’s the same result unfortunately.

Your page is still showing one parent of localhost
The page needs to work on it’s own before trying it inside you app

Through chrome a hard-refresh updated it to the correct parent.

But I can see on the iframe on my mobile app the iframe source has the correct twitch iframe embed:

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