0

I have an android app which uses the MediaPlayer. I want to stream wav PCM audio to the app, so I am using MediaPlayer. My problem is that the MediaPlayer does not send the Range header so the server returns the whole file instead of small parts of it. How can I make the media player send the range header?

barisdad
  • 515
  • 7
  • 19
  • I could do that by sticking a local proxy between the remote server and `MediaPlayer`. That was before `MediaCodec` and `MediaExtractor` existed. There's also [ExoPlayer](http://google.github.io/ExoPlayer/) that may be of some help. – Dave Jan 12 '17 at 11:56
  • Why should a proxy help? won't the MediaPlayer still expect the whole file to be downloaded before starting playback? I am looking into exoplayer as we speak. seems to support it. – barisdad Jan 12 '17 at 12:43
  • The proxy helped because I had full control to what content the MediaPlayer would see. I would make range requests behind the scenes and just hand off content to the MediaPlayer as a continuous stream. – Dave Jan 12 '17 at 13:47
  • OK, but I don't think I can use a proxy. What's the relevance of MediaCodec and MediaExtractor? – barisdad Jan 12 '17 at 13:50
  • It worked well, but I emphasize that it was a workaround for not having MediaCodec. It was for an embedded system and we had no choice but to use the version of Android that was installed. – Dave Jan 12 '17 at 13:50

0 Answers0