I am trying to embed a youtube video in my react.js website, I have tried multiple different code samples in my file as seen below:
<h1>Embedd Test1</h1>
<YouTube videoId="6pH4Ot-vFlc" />
<div>
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;"
allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/nqO6cEbXyKM"
width="560"></iframe>
</div>
<h1>Embedd Test2</h1>
<iframe width="420" height="315" src="https://www.youtube.com/embed/fnqO6cEbXyKM"></iframe>
<h1>Embedd Test3</h1>
<iframe width="872" height="499" src="https://www.youtube.com/embed/nqO6cEbXyKM"
title="Error fixed "www.youtube.com refused to connect" when trying to embed video in blogs or html page"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
</iframe>
But all of my embedded youtube videos always appear as "www.youtube.com refused to connect." both on localhost or in production at the url here: https://jermasearch.com/discogs2youtube
How can I embed YouTube videos in my react.js website? Is it a cors issue?