title: Stream MP4 on Android while verifying
body: <p>I am trying to create an application which lets a user watch an MP4 movie from an unknown source. This third-party source serves as the 'content deliverer' who is untrusted and voluntarily serving the movie. I have checksums of, say, 1MB blocks of data to verify integrity. This makes it possible to have multiple deliverers without worrying about content modification.</p>
  
  <p>The problem is that the videos are ~1-2GB, which makes it difficult to download before watching as that kills the streaming idea. I had tried using libvlc with a locally-running NanoHTTPD server on the device which served as a verification pass of the 1MB blocks. The problem with this is that VLC doesn't seem to support partial content at start. As soon as the request came in, I replied with <code>206 Partial Content</code> and gave a partial response, headers set appropriately. LibVLC played it, and died after 3 seconds because it assumed this was the end of the file and didn't issue another HTTP request.</p>
  
  <p>I have tried the same with ExoPlayer (from Google) and Android's MediaPlayer/VideoView but all had the same problem. Google chrome, however, plays it perfectly fine.</p>
  
  <p>I'm now looking for alternatives to be able to stream from unknown sources while only knowing checksums of blocks (or whatever verification method) without downloading the entire video or hurting the servers. I liked the idea of partial content but it just doesn't work as I hoped.</p>