Safari already accepts MP4 in an <img> tag and it is autoplayed, muted and looped [1]. Sadly, Chrome doesn't want to implement it [2].
[1] https://developer.apple.com/documentation/webkit/delivering_...
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=791658...