0
Assuming I have a youtube video in an iframe on my website, how would it be possible to play the iframe by clicking anywhere in the body of the page without having the iframe take over the entire screen? For example by clicking anywhere on the page, or any other iframe, will this iframe be executed first? From now on, thank you! I’m setting up a puzzlee site and a certain page, as a consequence of the previous one, the user comes across a black screen and will have to interact by just clicking and waiting for the video to begin. I’ve tried to do something like this:
<a id="play-video" href="#">Reproduzir video</a><br />
<iframe id="video" width="1280" height="720"
src="//www.youtube.com/embed/xrel=0" frameborder="0"
allowfullscreen></iframe>
$(document).ready(function() {
$('#play-video').on('click', function(ev) {
$("#video")[0].src += "&autoplay=1";
ev.preventDefault();
});
});
But I cannot extend the function of playing video to any point on the screen.
Put the code in the question by mounting a [mcve] and explain the purpose of doing this, please.
– Woss
Edited, my friend.
– Kelvin Huggies