How to embed a video into GitHub README.md?

后端 未结 6 892
旧巷少年郎
旧巷少年郎 2020-12-02 03:31

Is it possible to embed a flash video into README.md on GitHub? It isn\'t showing up: https://github.com/mattdipasquale/PicSciP

6条回答
  •  情深已故
    2020-12-02 04:10

    I strongly recommend placing the video in a project website created with GitHub Pages instead of the readme, like described in VonC's answer; it will be a lot better than any of these ideas. But if you need a quick fix just like I needed, here are some suggestions.

    Use a gif

    See aloisdg's answer, result is awesome, gifs are rendered on github's readme ;)

    Use a video player picture

    You could trick the user into thinking the video is on the readme page with a picture. It sounds like an ad trick, it's not perfect, but it works and it's funny ;).

    Example:

    [![Watch the video](https://i.imgur.com/vKb2F1B.png)](https://youtu.be/vt5fpE0bzSY)
    

    Result:

    Use youtube's preview picture

    You can also use the picture generated by youtube for your video.

    For youtube urls in the form of:

    https://www.youtube.com/watch?v=

    The preview urls are in the form of:

    https://img.youtube.com/vi/

    Example:

    [![Watch the video](https://img.youtube.com/vi/T-D1KVIuvjA/maxresdefault.jpg)](https://youtu.be/T-D1KVIuvjA)
    

    Result:

    Use asciinema

    If your use case is something that runs in a terminal, asciinema lets you record a terminal session and has nice markdown embedding.

    Hit share button and copy the markdown snippet.

    Example:

    [![asciicast](https://asciinema.org/a/113463.png)](https://asciinema.org/a/113463)
    

    Result:

提交回复
热议问题