Optional
uri: stringOptional
mimeType: stringOptional
gatewayUrl: stringthe fully resolved url + mime type of the media
Usage with fully formed url:
const Component = () => {
const resolved = useResolvedMediaType("https://example.com/video.mp4");
console.log("mime type", resolved.data.mimeType);
console.log("url", resolved.data.url);
return null;
}
Usage with ipfs cid:
const Component = () => {
const resolved = useResolvedMediaType("ipfs://QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvsd");
console.log("mime type", resolved.data.mimeType);
console.log("url", resolved.data.url);
return null;
}
Generated using TypeDoc
the uri to resolve (can be a url or a ipfs://<cid>)