问题
I am building a Chrome Extension. I'm having difficulty embedding a YouTube video using an iframe. Up until recently, everything worked fine, but, as of lately, I am not able to play the video anymore. I am getting the following error:
Uncaught Error: Failed to construct 'IntersectionObserver': Unable to get root node in main frame to track.
at new IZ (https://www.youtube.com/yts/jsbin/player-en_GB-vflW62qlm/base.js:3707:122)
at new c2 (https://www.youtube.com/yts/jsbin/player-en_GB-vflW62qlm/base.js:3991:112)
at c2.create (https://www.youtube.com/yts/jsbin/player-en_GB-vflW62qlm/base.js:6988:333)
at Gi.<anonymous> (https://www.youtube.com/yts/jsbin/www-embed-player-vfl-i_LLs/www-embed-player.js:507:269)
at Gi.l.jb (https://www.youtube.com/yts/jsbin/www-embed-player-vfl-i_LLs/www-embed-player.js:507:308)
at Ki (https://www.youtube.com/yts/jsbin/www-embed-player-vfl-i_LLs/www-embed-player.js:505:143)
at Gi.l.oa (https://www.youtube.com/yts/jsbin/www-embed-player-vfl-i_LLs/www-embed-player.js:498:176)
at https://www.youtube.com/yts/jsbin/www-embed-player-vfl-i_LLs/www-embed-player.js:557:378
Chrome bug maybe? Can anything be done to tackle the issue?
I checked the window
object and IntersectionObserver
exists, so I am quite curious as to why this might be happening.
来源:https://stackoverflow.com/questions/42496144/intersectionobserver-error-when-embedding-a-youtube-video-in-an-iframe