title: How to pipe a readable stream into a URL.createObjectURL without waiting for the whole file?
body: <p>I know it's doable with mediaSource but media source doesn't support all video formats (like fragmented mp4 for example). Which is a problem because my application doesn't have a server that can fix the file. It's a client side application only.</p>
  
  <pre><code>const blob = await ipfs.getBlobFromStream(hash)
  
  const url = URL.createObjectURL(blob)
  
  this.setState({...this.state, videoSrc: url})
  
  const getBlobFromStream = async (hash) =&gt; {
  
    return new Promise(async resolve =&gt; {
  
      let entireBuffer
  
      const s = await stream(hash)
      s.on('data', buffer =&gt; {
  
        console.log(buffer)
  
        if (!entireBuffer) {
          entireBuffer = buffer
        }
        else {
          entireBuffer = concatTypedArrays(entireBuffer, buffer)
        }
  
      })
  
      s.on('end', () =&gt; {
  
        const arrayBuffer = typedArrayToArrayBuffer(entireBuffer)
        const blob = new Blob(arrayBuffer)
        resolve(blob)
      })
  
    })
  
  }
  </code></pre>
  
  <p>this is the code i'm using right now, which basically waits for the entire file and puts it in a single array and then into a blob and then into URL.createObjectURL</p>