Sometime it’s necessary to display the Thumbnail Image of a youtube
video from URL. So in this tutorial am going to example you how to get
the thumbnail image of a video from youtube. Here am using PHP to
obtain the output.
To fetch the video thumbnail image from Youtube, first we need the get the video id from given URL.
Now we can explode the URL and get the video ID (In this case 5wqbC3_ZOQg) using php.
Now pass this video id to the img src tag
This will display you the first thumbnail image. if you want to use
second or third image just change the number in image src tag.

- //Youtube URL
- https://www.youtube.com/watch?v=5wqbC3_ZOQg
- //explode the url to get video id and save the id to a variable
- $fetch=explode("v=", $url);
- $videoid=$fetch[1];
- //Display the image
- //Display 1st thumbnail
- echo '<img src="http://img.youtube.com/vi/'.$videoid.'/1.jpg" height="90" width="100">';
- //Display 1st thumbnail
- echo '<img src="http://img.youtube.com/vi/'.$videoid.'/2.jpg" height="90" width="100">';
Hope that you like this article if so please share the article. Thank You !
Hey really fantastic video. thanks for share!! Visit my site- Youtube Support Call Toll Free No +1-800-231-4635.
ReplyDelete