It works for imgur.
For example something like https://i.imgur.com/mYNXTPw.gif can be requested as https://i.imgur.com/mYNXTPw.webm which gives:
It would be nice if Discourse detected .gif URLs from common providers such as imgur/gfycat
and just replaced image with looped video (already provided by site), as it saves a lot of bandwidth.