I am trying to do
Here is the code inside my HTML
<iframe class="embed-responsive-item" id="placeYoutubeVideo"
style="display:none" src="#" style="display:none" allowfullscreen></iframe>
In jQuery I am trying to change the src of the video
var neww = 'https://youtu.be/NOubzHCUt48';
$('#placeYoutubeVideo').prop('src', neww)
But it is throwing the following error:
Refused to display 'https://www.youtube.com/watch?v=NOubzHCUt48&feature=youtu.be' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
How can I fix this?
If not possible is it possible to generate iframe with youtube url on click function?
help please.