Media

For Video or Images

Quite often a client will want a component that accepts both videos and images.

Our Media component is that catch-all.

Unless we know for a fact that the client will be uploading only images, we recommend reaching for the Media component whenever possible.

Quite simply, you pass whatever media is coming down via the media prop. In sanity, we provide a condition option where the client can choose the type of media they're uploading (image, video, etc.)

The Media component uses this condition value to determine what component is ultimately rendered.

You also have the option of passing down videoControls, as well as type and ratio for further fine-tuning.

💡
See something that is out of date or that could be improved?Please let the team know!1. You can create a Github issue2. Pull down the repo and create a PR with your suggested changes implimented.3. Or just let someone know in the R&P Slack Channel.We love making things better.