useResolvedMediaType
Hook for resolving the media type and URL of a given URI (including IPFS URIs).
The <MediaRenderer />
component renders the relevant.
HTML element for a given URL, including IPFS URIs. e.g. <img>
for images, <video>
for videos, etc.
Example
Usage with fully formed url
Usage with IPFS cid
Parameters
Returns
The hook returns an object containing two properties:
url
: The fully resolved URL, orundefined
if the URI is invalid.mimeType
: The mime type of the media, orundefined
if the URI is invalid.