从youtube嵌入缩略图和视频(php - Wordpress)

I would like to find out the php code where you able to embed the thumbnail from a youtube video to a website and when you clic on the thumbnail the video starts to play. All of this one using a shortcode (php) to add within of the post and typing into this shortcode the Video ID (got from Youtube) that you want to post. I have tried the follow code but it does not work and not include all my needs shown above.

Finally, I would like to join the shortcode shows below with [video] shortcode available for Wordpress, because I want to change the video player to the built-in WordPress player, which doesn't have the familiar Youtube styling.

Also, I searched the internet and I did not find all neccesary information

May you help me? Thanks in advance.

PHP Code:

function mininaturas_youtube($atts) {
    extract(shortcode_atts(array(
         'id' => '',
         'img' => '0',
         'align'=>'left'
    ), $atts));
   $align_class='align'.$align;
   return '<img src="http://img.youtube.com/vi/'.$id.'/'.$img.'.jpg" alt="" class="'.$align_class.'" />';
}
add_shortcode('miniatura_youtube', 'miniaturas_youtube');

To be added within of the post:

[miniatura_youtube id="3Jt7-nBfULU" img="0" align="center"]

I was able to do something with an iframe, like so:

function mininaturas_youtube_func( $atts ) {
    $a = shortcode_atts( array(
        'id' => 'dQw4w9WgXcQ'
    ), $atts);
    return '<iframe width="560" height="315" src="https://www.youtube.com/embed/' . $a["id"] . '" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
}
add_shortcode( 'miniatura_youtube', 'mininaturas_youtube_func' );

You can add your other parameters in the same manner as 'id' if you need them.

As it is noted here https://codex.wordpress.org/Shortcode_API :

'id' => 'dQw4w9WgXcQ' just represents the default id if no other id is provided

Hope this helps!

Edit Also just for clarity I used the same short code as you

[miniatura_youtube id="XXXXXXXXXXX"]