【问题标题】:Insert embeded YouTube video in Markdown, VS Code在 Markdown、VS Code 中插入嵌入的 YouTube 视频
【发布时间】:2021-11-18 10:38:34
【问题描述】:

我需要在 Markdown、VS Code 中插入自动播放的 YouTube 视频,我该怎么做?

![video](YouTube link)

【问题讨论】:

  • “自动播放”在很大程度上取决于您的预期环境。您是在使用 VSCode 来编辑文件,还是希望您的用户也运行 VSCode?在许多环境中,这是不可能的。但即使你设法做到这一点,它非常烦人,我敦促你重新考虑。
  • 您可以尝试this 解决方法...
  • @Suraj Rao 我使用 VSCode 编辑文件并在其中使用预览。所以我只想在 VSCode 的预览屏幕中自动播放视频

标签: markdown


【解决方案1】:

在浏览器中打开 YouTube 视频 → 按 ShareEmbedCopy iframe 并将其粘贴到您的降价文档中。

或者只是复制下面的代码并将 YOUTUBE_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>

【讨论】:

    猜你喜欢
    • 2011-08-10
    • 2015-02-27
    • 2017-09-01
    • 2021-02-02
    • 1970-01-01
    • 2012-12-20
    • 1970-01-01
    • 2021-12-04
    • 2012-06-25
    相关资源
    最近更新 更多