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
* HTML editorsHTMLChrome* HTML 5* YouTube

Avatar of undefined
Last Comment
Michel Plungjan
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
altariamx2003
Flag of Mexico image

ASKER

Done,  but chrome show me the same errors


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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
It was worth a try :)
HTML
HTML

HTML (HyperText Markup Language) is the main markup language for creating web pages and other information to be displayed in a web browser, providing both the structure and content for what is sent from a web server through the use of tags. The current implementation of the HTML specification is HTML5.

62K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo