Reputation: 65
I need to insert autoplaying YouTube video in Markdown, VS Code, how can I do it?
![video](YouTube link)
Upvotes: 1
Views: 8218
Reputation: 674
iframe
I made an API which gets the video's thumbnail, then adds a play button and backdrop to it.
[![](https://markdown-videos-api.jorgenkh.no/youtube/{video_id})](https://youtu.be/{video_id})
Clicking on the image will open the video in your browser.
[![](https://markdown-videos-api.jorgenkh.no/youtube/dQw4w9WgXcQ)](https://youtu.be/dQw4w9WgXcQ)
GitHub repo can be found here -> https://github.com/Snailedlt/Markdown-Videos
I also made a website to generate the code for you based on the link: https://markdown-videos.jorgenkh.no/
Upvotes: 6
Reputation: 19
Open YouTube video in your browser → Press Share
→ Embed
→ Copy
iframe and paste it in your markdown document.
Or just copy code the below and replace YOUTUBE_LINK with your link
<center>
<iframe width="560"
height="315"
src="YOUTUBE_LINK"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</center>
Upvotes: -1