ipfs-examples / js-ipfs-examples

Collection of js-ipfs examples
246 stars 157 forks source link

browser-readablestream example not working #676

Open Aiaminm opened 1 year ago

Aiaminm commented 1 year ago

屏幕截图(1) How to play mp4 more easily? I'm not good at streaming..

dasein108 commented 1 year ago

I did such workaround and it works.

import { Readable } from "readable-stream";
....

// This stream will contain the requested bytes
stream = Readable.from(
  ipfs.cat(DOM.cidInput().value.trim(), {
    offset: start,
    length: end && end - start,
  })
);