How to add muted and playsinline attributes to video?

I have a site in which I would like some videos to behave as GIFs. For these videos to be properly handled on iOS and in Chrome I need to add the following attributes to the video tag:

  • autoplay
  • loop
  • muted
  • playsinline

The first 2 tags seem to be supported in grav, but I can’t find out how to add the muted and playsinline tags. Is there a way to add these too?

Unless the docs are incomplete (possible!), looks like you need to revert to HTML to achieve this.

I notice you logged an issue to add these attributes to Grav’s media Markdown parameters, which should hopefully see it implemented in the near future.


Indeed, I did some more digging and noticed in VideoMedium.php that the tags were not supported. Thought it might be a good enhancement so logged an enhancement request.

Won’t be a difficult PR to code yourself if you are comfortable with PHP. :slight_smile: I will if you don’t.

1 Like

I’ve created a pull request. My first one, yay :raised_hands: Hope I did it right…