Embeddding Thumbnail Youtube videoHow do I get a YouTube video thumbnail from the YouTube API?How do I get a YouTube video thumbnail from the YouTube API?how to show youtube video thumbnailsError loading youtube video in modal dialog with chromeHow do you embed YouTube Playlist with JavaScript and not iframe?Javascript to auto play youtube video?Iframe youtube multiple videos trackingAutoplay Embedded YouTube videos in the background?Instead of played automatically, Youtube video do nothing or show suggested videosEmbedding the thumbnails Youtube Videos (php) WordpressEmbedding the thumbnail and video from youtube (php - Wordpress)

What is the highest possible temporary AC at level 1, without any help from others?

What ways have you found to get edits from non-LaTeX users?

How to handle self harm scars on the arm in work environment?

How is water heavier than petrol, even though its molecular weight is less than petrol?

Were Alexander the Great and Hephaestion lovers?

How to communicate to my GM that not being allowed to use stealth isn't fun for me?

Meaning of 'lose their grip on the groins of their followers'

What is the actual quality of machine translations?

Soft question: Examples where lack of mathematical rigour cause security breaches?

Is it possible to have the age of the universe be unknown?

How can I end combat quickly when the outcome is inevitable?

Union with anonymous struct with flexible array member

How did old MS-DOS games utilize various graphic cards?

Overlapping String-Blocks

Longest bridge/tunnel that can be cycled over/through?

How is John Wick 3 a 15 certificate?

How to hide rifle during medieval town entrance inspection?

Thread Pool C++ Implementation

Mathematically, why does mass matrix / load vector lumping work?

Is it possible to have a wealthy country without a middle class?

Giant Steps - Coltrane and Slonimsky

How to tell your grandparent to not come to fetch you with their car?

What is wrong with this proof that symmetric matrices commute?

Winning Strategy for the Magician and his Apprentice



Embeddding Thumbnail Youtube video


How do I get a YouTube video thumbnail from the YouTube API?How do I get a YouTube video thumbnail from the YouTube API?how to show youtube video thumbnailsError loading youtube video in modal dialog with chromeHow do you embed YouTube Playlist with JavaScript and not iframe?Javascript to auto play youtube video?Iframe youtube multiple videos trackingAutoplay Embedded YouTube videos in the background?Instead of played automatically, Youtube video do nothing or show suggested videosEmbedding the thumbnails Youtube Videos (php) WordpressEmbedding the thumbnail and video from youtube (php - Wordpress)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I need embed the thumbnail from a Youtube video and when I clic on the thumbnail the video start to play.
I got the following php code (see php code below) where the video is embedded but I need the code where the thumbnail is embedded too and it starts to play when you clic on the thumnail. I think the code for the video to start playing is the below of the following one (see js code below).



PHP Code:



<?php
function mininaturas_youtube_func( $atts )
$a = shortcode_atts( array(
'id' => ''
), $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' );
?>


Js Code (my try):



$(document).ready(function()
$("#play").click(function()
$("#remove").hide();
$("#add").show();
);
);


Could you help to include the php code (into the PHP Code section) to embedded the thumbnail of the Youtube video and review the js code?
Thanks










share|improve this question




























    1















    I need embed the thumbnail from a Youtube video and when I clic on the thumbnail the video start to play.
    I got the following php code (see php code below) where the video is embedded but I need the code where the thumbnail is embedded too and it starts to play when you clic on the thumnail. I think the code for the video to start playing is the below of the following one (see js code below).



    PHP Code:



    <?php
    function mininaturas_youtube_func( $atts )
    $a = shortcode_atts( array(
    'id' => ''
    ), $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' );
    ?>


    Js Code (my try):



    $(document).ready(function()
    $("#play").click(function()
    $("#remove").hide();
    $("#add").show();
    );
    );


    Could you help to include the php code (into the PHP Code section) to embedded the thumbnail of the Youtube video and review the js code?
    Thanks










    share|improve this question
























      1












      1








      1








      I need embed the thumbnail from a Youtube video and when I clic on the thumbnail the video start to play.
      I got the following php code (see php code below) where the video is embedded but I need the code where the thumbnail is embedded too and it starts to play when you clic on the thumnail. I think the code for the video to start playing is the below of the following one (see js code below).



      PHP Code:



      <?php
      function mininaturas_youtube_func( $atts )
      $a = shortcode_atts( array(
      'id' => ''
      ), $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' );
      ?>


      Js Code (my try):



      $(document).ready(function()
      $("#play").click(function()
      $("#remove").hide();
      $("#add").show();
      );
      );


      Could you help to include the php code (into the PHP Code section) to embedded the thumbnail of the Youtube video and review the js code?
      Thanks










      share|improve this question














      I need embed the thumbnail from a Youtube video and when I clic on the thumbnail the video start to play.
      I got the following php code (see php code below) where the video is embedded but I need the code where the thumbnail is embedded too and it starts to play when you clic on the thumnail. I think the code for the video to start playing is the below of the following one (see js code below).



      PHP Code:



      <?php
      function mininaturas_youtube_func( $atts )
      $a = shortcode_atts( array(
      'id' => ''
      ), $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' );
      ?>


      Js Code (my try):



      $(document).ready(function()
      $("#play").click(function()
      $("#remove").hide();
      $("#add").show();
      );
      );


      Could you help to include the php code (into the PHP Code section) to embedded the thumbnail of the Youtube video and review the js code?
      Thanks







      javascript php css wordpress






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 17:59









      ffnffn

      63




      63






















          1 Answer
          1






          active

          oldest

          votes


















          0














          By Using this you can embedded thumbnail to video.



          Each YouTube video has 4 generated images. They are predictably formatted as follows:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg


          The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg


          For the high quality version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg


          There is also a medium quality version of the thumbnail, using a url similar to the HQ:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg


          For the standard definition version of the thumbnail, use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg


          For the maximum resolution version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg


          All of the above urls are available over http too. Additionally, the slightly shorter hostname i3.ytimg.com works in place of img.youtube.com in the example urls above.



          Click For More Answer.






          share|improve this answer

























          • Thanks. I knew this info because I read the post you say, previously. The question is how I might integrate the php code I wrote above with the thumbnail Youtube video that I comment. Thanks in advance.

            – ffn
            Mar 24 at 21:00











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326813%2fembeddding-thumbnail-youtube-video%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          By Using this you can embedded thumbnail to video.



          Each YouTube video has 4 generated images. They are predictably formatted as follows:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg


          The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg


          For the high quality version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg


          There is also a medium quality version of the thumbnail, using a url similar to the HQ:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg


          For the standard definition version of the thumbnail, use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg


          For the maximum resolution version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg


          All of the above urls are available over http too. Additionally, the slightly shorter hostname i3.ytimg.com works in place of img.youtube.com in the example urls above.



          Click For More Answer.






          share|improve this answer

























          • Thanks. I knew this info because I read the post you say, previously. The question is how I might integrate the php code I wrote above with the thumbnail Youtube video that I comment. Thanks in advance.

            – ffn
            Mar 24 at 21:00















          0














          By Using this you can embedded thumbnail to video.



          Each YouTube video has 4 generated images. They are predictably formatted as follows:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg


          The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg


          For the high quality version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg


          There is also a medium quality version of the thumbnail, using a url similar to the HQ:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg


          For the standard definition version of the thumbnail, use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg


          For the maximum resolution version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg


          All of the above urls are available over http too. Additionally, the slightly shorter hostname i3.ytimg.com works in place of img.youtube.com in the example urls above.



          Click For More Answer.






          share|improve this answer

























          • Thanks. I knew this info because I read the post you say, previously. The question is how I might integrate the php code I wrote above with the thumbnail Youtube video that I comment. Thanks in advance.

            – ffn
            Mar 24 at 21:00













          0












          0








          0







          By Using this you can embedded thumbnail to video.



          Each YouTube video has 4 generated images. They are predictably formatted as follows:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg


          The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg


          For the high quality version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg


          There is also a medium quality version of the thumbnail, using a url similar to the HQ:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg


          For the standard definition version of the thumbnail, use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg


          For the maximum resolution version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg


          All of the above urls are available over http too. Additionally, the slightly shorter hostname i3.ytimg.com works in place of img.youtube.com in the example urls above.



          Click For More Answer.






          share|improve this answer















          By Using this you can embedded thumbnail to video.



          Each YouTube video has 4 generated images. They are predictably formatted as follows:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg

          https://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg


          The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg


          For the high quality version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg


          There is also a medium quality version of the thumbnail, using a url similar to the HQ:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg


          For the standard definition version of the thumbnail, use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg


          For the maximum resolution version of the thumbnail use a url similar to this:



          https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg


          All of the above urls are available over http too. Additionally, the slightly shorter hostname i3.ytimg.com works in place of img.youtube.com in the example urls above.



          Click For More Answer.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 18:13

























          answered Mar 24 at 18:05









          Arun SolomonArun Solomon

          986




          986












          • Thanks. I knew this info because I read the post you say, previously. The question is how I might integrate the php code I wrote above with the thumbnail Youtube video that I comment. Thanks in advance.

            – ffn
            Mar 24 at 21:00

















          • Thanks. I knew this info because I read the post you say, previously. The question is how I might integrate the php code I wrote above with the thumbnail Youtube video that I comment. Thanks in advance.

            – ffn
            Mar 24 at 21:00
















          Thanks. I knew this info because I read the post you say, previously. The question is how I might integrate the php code I wrote above with the thumbnail Youtube video that I comment. Thanks in advance.

          – ffn
          Mar 24 at 21:00





          Thanks. I knew this info because I read the post you say, previously. The question is how I might integrate the php code I wrote above with the thumbnail Youtube video that I comment. Thanks in advance.

          – ffn
          Mar 24 at 21:00



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326813%2fembeddding-thumbnail-youtube-video%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현