I'm building an app that fetches IPFS media on a certain page. I'm currently using the <object/>
tag to dynamically handle images and video but it doesn't work great.
In the app, I fetch the details of an item that stores media on ipfs so I'll get a hash and then load the src=''
using an ipfs gateway provider. However, the hash does not tell me if the asset is an image, video, or an svg so I don't have a way to use the correct HTML tag. Are there any npm packages that handle all types of media?
Also, are there any good npm packages/methods to safely run arbitrary svg files?