Mozinor
Mozinor

Reputation: 85

Embed Youtube Live Chat in Android Application

I'm trying to embed the Live Chat of a youtube live stream video in my Android app but it doesn't work

Here's what I tried

Embed the iframe directly in my Android application with <iframe src="https://www.youtube.com/live_chat?v=XXX&embed_domain=localhost"></iframe>

But after reading the Google documentation, it seems work just for sites

So I decided to embed the Live Chat directly on a site with a domain name

I created a live_chat.php page with <iframe src="https://www.youtube.com/live_chat?v=XXX&embed_domain=mydomaine.com"></iframe> (the live chat is displayed well on mydomaine.com)

Then in my Android application I did <iframe src="http://mydomaine.com/live_chat.php"></iframe>

But it still doesn't work, the iframe is empty

How can I display the chat that displays well on live_chat.php?

I use Ionic 4 with Cordova 8

Upvotes: 3

Views: 769

Answers (1)

Reqven
Reqven

Reputation: 1778

This is how I fixed iframes not working on real devices.
Set this in your config.xml file :

<allow-navigation href="*" />

I recommand using * in the first place for testing purpose to confirm whether your problem comes from this or not. Then you must replace it with the websites you want to allow in your app for security concerns.

Upvotes: 1

Related Questions