Link to home
Start Free TrialLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

Access-Control-Allow-Origin not working for iframe youtube embed video

I got this sample code

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Documento sin título</title>
</head>

<body>
<iframe width="100%" height="315" src="https://www.youtube.com/embed/RpXYHrsQE2Y"  allowfullscreen></iframe>
</body>
</html>

Open in new window


https://www.grupossc.com/pruebas/youtube.php

Why chrome show me this errors? is there a way to fix them?
User generated image
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Can you add


enablejsapi=1&origin=https%3A%2F%2Fwww.grupossc.com%2Fpruebas

Open in new window


to the URL in the iframe and see if it helps?

Like this

https://www.youtube.com/embed/RpXYHrsQE2Y?enablejsapi=1&origin=https%3A%2F%2Fwww.grupossc.com%2Fpruebas

Open in new window

Avatar of altariamx2003

ASKER

Done,  but chrome show me the same errors


User generated image
ASKER CERTIFIED SOLUTION
Avatar of altariamx2003
altariamx2003
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It was worth a try :)