henry-rodrick / hlsjs-ipfs-loader

A js-ipfs loader for the hls.js JavaScript HLS client
MIT License
60 stars 31 forks source link

stream.on is not a function #1

Closed whydna closed 6 years ago

whydna commented 6 years ago

I'm getting the following error after following the instructions in the README.

Any idea whats wrong?

dist/index.js:167 Uncaught TypeError: stream.on is not a function
    at index.js:167
    at pull.collect (files.js:227)
    at reduce.js:10
    at drain.js:20
    at map.js:19
    at next (index.js:22)
    at index.js:39
    at Array.<anonymous> (index.js:10)
    at next (index.js:26)
    at index.js:39
0xVasconcelos commented 6 years ago

+1 Same here.

0xVasconcelos commented 6 years ago

The problem is in ipfs.files.cat function, hlsjs-ipfs-loader expects an stream data to pipe and receives a Uint8Array that isn't directly readable. I'll check better tomorrow.

henry-rodrick commented 6 years ago

Thanks for making me aware of this. Must be a change to how ipfs.files.cat works... I’ll look into this as soon as possible (or if you already have a patch for this feel free to create a pull request). Cheers

0xVasconcelos commented 6 years ago

I fixed the problem, I'll send a pull request in some minutes.

henry-rodrick commented 6 years ago

Thanks a lot! I’ll publish a new npm version when I’m at the computer.

henry-rodrick commented 6 years ago

Alright, version 0.1.2 has been published and the example now runs fine (tested in Firefox as well).

https://www.npmjs.com/package/hlsjs-ipfs-loader

Closing this issue now. Thanks again @lucaslg26 for the patch!

whydna commented 6 years ago

Wow thank you guys!