1

Learning NodeJs and Blob, and I Try to Create a Blob from a Video File in NodeJS. And send this in a Json file to my Client. Data will be Fetch inside GetStaticProps in NextJS.

Here is What I Created in NodeJS Server :

const fileBuffer = fs.readFileSync(filePath); // Path is something like example.com/video.mp4
const blob = new Blob([fileBuffer], { type: 'video/mp4' });
blobUrl = URL.createObjectURL(blob); // Return blob:nodedata:c3b1baf2-fba8-404f-8d3c-a1184a3a6db2

It retrun this :

blob:nodedata:c3b1baf2-fba8-404f-8d3c-a1184a3a6db2

But How can I use it in Client ? <video src="blob:nodedat..." is not Working, so I am doing something wrong for sure

Can you help me uderstand what is wrong ?

Lucas
  • 85
  • 9

0 Answers0