Search code examples
flashgithubembedmarkdown

How to embed a video into GitHub README.md?


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


Solution

  • Update May 2021:

    Video uploads now generally available

    Video upload is now supported everywhere you can author Markdown in GitHub, including from the mobile app.

    Share demos, show reproduction steps, and more in issue, pull request, and discussion comments as well as on repository Markdown files such as READMEs.

    As Lauren Brose (Product Manager for GitHub Issues) details, this can help:

    • Help a maintainer reproduce a bug
    • Provide context on pull requests for reviewers
    • Share how a feature might take shape
    • Upload your video from anywhere! (Uploading videos from both the iOS and Android GitHub mobile apps is now available to all users)

    Note: as commented by Sancarn, webm (open web media project) does not seem to be directly supported.
    Although... as noted by Garrett LeSage:

    If you change the extension from .webm to .mov (or just tack on .mov after .webm), @GitHub accepts the video and even displays it inline.

    Matthew Gregg adds:

    Does webm play on iOS devices? This might be why they soft block.


    Update Feb. 2021, as noted by Abhishek Singh in the comments, and Nat Friedman on Twitter:

    You can now – finally! – drop images and videos (mp4, gif) onto the Markdown file editor on GitHub.

    image and video

    Paste works too, if you're into that kind of thing.
    It's worked in issues and PRs for a while; what's new here is support in markdown files.

    GitHub Enterprise Server tends to lag http://github.com by a couple of months, but it will get there in a future release.

    Kyle Daigle (Senior Director of Special Projects at GitHub) adds:

    Currently, the file is stored as an asset outside the repository (sort of like an image uploaded to an image).
    (Uploads to githubusercontent and stores it there. Then makes a link in the markdown to that uploaded image.)

    The team is interested in exploring adding the image to the repo too... would you want something like that?

    Sven-Michael Stübe comments:

    I usually add the images to my repo. Especially if you host your blog as github page w/ a custom domain.

    But I think this feature would also add a lot of complexity. It's not a big pain to add the image manually. For PRs+Comments the drag&drop is more essential

    Kyle answers:

    For the blog case (which is what made us think about image upload to the repo) you're totally right.
    This type of drag and drop is helpful when adding an image to a README or other in-repo documentation though (when you don't want to upload to the repo).

    That feature has come a long way since its initial proposal... back in 2012(!)


    Update Dec. 2020: see "Video upload public beta ", which embeds video (embedding only, not link/reference)

    https://i0.wp.com/user-images.githubusercontent.com/22751162/101841526-ebf6ff00-3afa-11eb-965d-5ce11efdb9f8.png?ssl=1


    2010: The "Github Flavored Markdown" doesn't support this kind of feature for any page:

    An old support thread "Embed YouTube videos in markdown files" stated:

    With pages.github.io, yes, everywhere else, no.

    (Note: as detailed in "Github Top-Level Project Page", github.io is the new domain for user and organization pages since April 2013.
    The page GitHub publication is presented here)

    This could be a feature request like the syntax highlighting was.

    For instance: "HTML5 video in markdown" (August 2010):

    Is there any way to implement a HTML5 video into the README.markdown file?

    Not currently but we might be expanding what you can do with the READMEs in the future.

    In the meantime, you can do this with GitHub Pages and our Wikis.


    Benjamin Oakes confirms in the comments (May 2012):

    I sent in a support request. The response was that embedding videos is not supported.