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, orundefinedif the URI is invalid.mimeType: The mime type of the media, orundefinedif the URI is invalid.