Ionic / cordova problem of embedding youtube

I tried to embed vevo video but I can't play it inside my phone, it says

It is restricted from playback on certain sites

I did some research, someone is facing the same issue

any fix for this? I saw some hybrid app overcame this issue but I have no idea how they do it. I’ve tried several plugin but it pump the video to be open in the youtube app.

You guys never notice this issue while embedding YouTube video? Or signed and published app will solved the restriction problem?

Did you ever find a solution?

Yes. You have to use a website, embed the youtube and then embed into ionic. It has limitation for example you can’t use Youtube API within ionic but that’s the only hack I know to solve the problem.

Interesting…I was considering that, but as a last resort. Have you yet tried using any Cordova YouTube Plugins based on the Android YT API? I might try that next, just not sure how well you can use Cordova plugins within Ionic.

base on Android YT API? I didn’t… I just use the web embed…

Can you please provide a sample code? How did you put the youtube iframe api in a webpage? I am curious about the webpage part. Thank you

Have you figured out a solution yet. I am facing the same problem

I found a hack. put the video on a host like and then iframe it into ionic.

1 Like

Sounds interesting. Could you please provide a more indepth explanation? Is it setting origin as one of the playerVars in iframe? Or do I have to host a website first and put embed every single video on the website?

youtube need a domain, so you just iframe the youtube video and then put that iframe in ionic, that is it.

@eldy Ha ha…it’s hack working fine to me and also you saved my life too.