Video file uploaded to Moralis Storage not working

When creating NFT’s, I give users the option to either upload media to Moralis IPFS or ‘regular’ cloud storage. IPFS works fine, but the video uploaded to Moralis Cloud Storage does not work/render, although the size of the player is correct:

https://5q6ce5oht43m.moralis.io:2053/server/files/yHoH5zgSj7XR4r53B76MoBRSZ7NkzUSC29jcY26K/262dcf1fba0d118b31e1a4a301a4c58e_sample-mp4-file.mp4

Same video but uploaded on IPFS: https://ipfs.moralis.io:2053/ipfs/QmTv2Tx9XQeLrvg8rs9LCCih6FrHt2mXs3LVBt23ZD7eE7

An uploaded image works fine (ok not here in preview hehe, but it works):
https://5q6ce5oht43m.moralis.io:2053/server/files/yHoH5zgSj7XR4r53B76MoBRSZ7NkzUSC29jcY26K/9151f0b4daae1e40098fb054ed910c13_fox.png

const nftVideo = new Moralis.File(item.animationFile.name, item.animationFile)
if (IPFSUpload.value) {
  ///store video on IPFS
  nftVideo.saveIPFS().then(() => {
    console.log(nftVideo.ipfs());
    item.animation_url = 'ipfs://'+nftVideo.hash()
    console.log('nftVideo uploaded', item.animation_url)
    resolve()
  }, (error) => {
    console.error('ERROR uploading video to Moralis IPFS')
  });
} else {
  ///store animation on Moralis Storage
  nftVideo.save().then((response) => {
    console.log('nftVideo uploaded', response)
    item.animation_url = response._url
    resolve()
  }, (error) => {
    console.error('ERROR uploading video to Moralis storage')
    reject()
  });
}

console.log(‘nftVideo uploaded’, response):

No errors, all looks fine, just the video does not play from remote url.

Hi,
It looks like that .mp4 url serves a 95 bytes png file instead of an mp4 file.
I don’t know why it happens.

thanks for checking @cryptokid

@Yomoo looks like a real bug to me, please check

Tried another one, same data, one using file.saveIPFS() and one using file.save(), where only IPFS works:

https://ipfs.moralis.io:2053/ipfs/QmcvvRYAAJ7xsJiHQjy1ZAY5LUiXdbMzpVs6MA5e2nUk8g

and

https://5q6ce5oht43m.moralis.io:2053/server/files/yHoH5zgSj7XR4r53B76MoBRSZ7NkzUSC29jcY26K/137aaf245e6ceb0090bec4cb928099bf_walking_dead.mp4

Hi @matiyin

Already checking

1 Like

@matiyin

We’ve tested on several browsers and on some of them video from Moralis storage works.
It’s not probably an issue, if you want to show video on your site you need to install extra player for supporting all browsers.

By the way, Moralis storage is not for storaging NFTs . For storaging metadata you need to use IPFS

Hope this will help you :man_mechanic:

1 Like

thanks for checking, I tried on different browsers Brave, Firefox, Chromium.

There’s ‘some’ issue with the file encoding using file.save() instead of file.saveIPFS()
The video uploads, but cannot play. I’ve tried a few different mp4’s, no difference.

I’ve set up a simplified version by pulling moralis-ipfs-upload from https://github.com/MoralisWeb3/demo-apps

One of my mp4 uploads works:
https://ipfs.moralis.io:2053/ipfs/QmTv2Tx9XQeLrvg8rs9LCCih6FrHt2mXs3LVBt23ZD7eE7
The other only sound:
https://ipfs.moralis.io:2053/ipfs/QmZa5e6qkdhvBVUbqkzbrwKXq3Ui5yXCdcoxCt1NyrpBDP

When I change to ‘normal’ upload both files don’t play/stream:

  async function upload () {
    const fileInput = document.getElementById("file");
    const data = fileInput.files[0];
    const file = new Moralis.File("moralis.mp4", data);
    // const file = new Moralis.File("moralis.png", data);
    // await file.saveIPFS();
    await file.save();
    // console.log(file.hash());
    console.log(file.url());
}

@Yomoo I will try to DM you to send yo the 2 sample files I’m using, so you can try on your side.

Regarding saving the IPFS, yes I use that for NTF’s, but this is for a different feature, where I need more centralized control over my storage.

Cheers!