Just add the code to the given section of that url:
https://img.youtube.com/vi/<codigo>/0.jpg
Example
https://img.youtube.com/vi/uipTZ2re4Uk/0.jpg
What I did was leave a fixed image. When the user clicks on the image, iframe (without src) takes the attribute src
, which is engraved on a data-src
of the image.
These days, I did something like this:
$(function(){
$('#img').click(function ()
{
var src = $(this).data('src');
$('#frame').attr({src: src});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<img id="img" src="https://img.youtube.com/vi/zzOv14tnaWU/0.jpg" data-src="https://www.youtube.com/watch?v=zzOv14tnaWU" />
<iframe id="frame"></iframe>
Yes, you have to use the Youtube API to do this. But then you can put the cover manually. But the button to start the video and the cover will come off you will use the API. I will try to post you an example.
– Diego Souza