0

I need to insert autoplaying YouTube video in Markdown, VS Code, how can I do it?

![video](YouTube link)
  • 1
    "Autoplaying" will depend heavily on your intended environment. Are you using VSCode to _edit_ the file, or do you expect your users to run VSCode too? In many environments it will be impossible. But even if you manage to to this, it is _extremely annoying_ and I urge you to reconsider. – Chris Sep 25 '21 at 14:22
  • You could try [this](https://stackoverflow.com/a/14276834/4826457) workaround... – Suraj Rao Sep 25 '21 at 14:23
  • @Suraj Rao I use VSCode to edit the file and use preview in it too. So I just wanna play video in preview screen in VSCode automatically – Денис Попков Sep 25 '21 at 14:27

1 Answers1

0

Open YouTube video in your browser → Press ShareEmbedCopy 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>
Tahmid Ali
  • 711
  • 6
  • 27
Basilios
  • 1
  • 1