Add Video to README.md on Github Repository
by Alexandra Kropova from Mammoth Interactive
Do you want to embed a video with a thumbnail on your Github repository’s README markdown file? Learn how in this post!
Want to learn more? Enroll in Complete Web & App Development with Machine Learning For All (125 Hours). Free in the Mammoth Unlimited Membership. Get 250+ courses and 2,000 hours at a dirt-cheap price.
Video IDs in YouTube Links
Every video on YouTube has a video ID. This is the string that comes after watch?v=.
For example, in this link the video ID is jXnoFqcAkQA: “https://www.youtube.com/watch?v=jXnoFqcAkQA”
Grab a Thumbnail from YouTube URL
You can grab the thumbnail from a YouTube video with one of the 2 options below:
https://img.youtube.com/vi/<VIDEO ID>/maxresdefault.jpg
https://img.youtube.com/vi/<VIDEO ID>/hqdefault.jpg
An example of embedding a video on Github:
[![Video](https://img.youtube.com/vi/jXnoFqcAkQA/maxresdefault.jpg)](https://www.youtube.com/watch?v=jXnoFqcAkQA)
This code, put into a README.md file, uses markdown to embed a video thumbnail that links to the video. The alt text if the thumbnail cannot be found is “Video”.
Thumbnail not appearing?
The video must be published for the thumbnail to appear.
Suggest more solutions or ask a question in the comments below.
Want to learn more? Enroll in Complete Web & App Development with Machine Learning For All (125 Hours). Free in the Mammoth Unlimited Membership. Get 250+ courses and 2,000 hours at a dirt-cheap price.