+ 1

I keep getting this error. Please tell me what I am doing wrong.

I am building a webpage in Code Playground and I added a youtube video to the page. When I hit run, the video shows and plays on the page but I keep getting this error: Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file https//youtube.com/embed/hoy19ZFRbeE. Domains, protocols and ports must match. I used this code to put the video on the page: <iframe src=" https://www.youtube.com/embed/hoY19ZFRbeE" width="300" height="315"></iframe> What am I doing wrong?

25th Apr 2017, 2:28 AM
Hassan El-Essawi
Hassan El-Essawi - avatar
5 Answers
+ 6
I cannot reproduce your error ( tested with @Calvin Lee link ), but maybe you can try to use the Iframe Player API from Youtube to handle video player dynamically: https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player
25th Apr 2017, 5:20 AM
visph
visph - avatar
+ 4
Your code can run without issue. Please double check. https://code.sololearn.com/WRxL4g80WUHG/?ref=app
25th Apr 2017, 3:07 AM
CalviŐ˛
CalviŐ˛ - avatar
+ 1
Try https instead of http in your link.
25th Apr 2017, 2:41 AM
Jeth
Jeth - avatar
+ 1
@Jeth, I tried that. Still the same error.
25th Apr 2017, 2:43 AM
Hassan El-Essawi
Hassan El-Essawi - avatar