2

I'm working on a radio Android app in which I'd like to have options to rewind/fast-forward/back to live the audio stream.

It seems that it's not possible with Mediaplayer (I can't find any method to do that), so how can I do that?

The developer of the iOS version of the app is using the RadioKit SDK. Is there anything similar for Android?

jul
  • 36,404
  • 64
  • 191
  • 318
  • I'm now aware of such SKD's for android, but yes, the MediaPlayer does not support this functionality as answered here http://stackoverflow.com/questions/10849961/speed-control-of-mediaplayer-in-android I guess players that support this feature use some third-party libraries and/or some native implementations – Droidman Nov 06 '13 at 11:44
  • What sort of streaming protocol are you talking about? – Dave Nov 06 '13 at 12:50
  • @Droidman I don't need to modify the speed of the stream, I just want to be able to rewind/fast-forward the live stream. – jul Nov 06 '13 at 13:56
  • When you say you don't want to modify the speed of the stream, but want rwnd/ffwd, you want to be able to seek to particular times, correct? Ie, display a search bar to the user so they visualize time moving at various rates, then you can seek to the correct point when they want to resume. (This is what I call fake trickplay, although I'm not sure if that's a technical term.) It's not easy to do with straight HTTP, and I'm not aware of anything like the RadioKit library for Android. It is possible, though, if you're willing to do the work. – Dave Nov 06 '13 at 16:07
  • You would have to start by inserting a proxy server on the device and handle communication with the remote source yourself. Then connect the MediaPlayer to your proxy. – Dave Nov 06 '13 at 16:08
  • @Dave Yes, I want to be able to rewind or fast-forward (when possible) by 30s, like in [this app](https://itunes.apple.com/ca/app/wfmu-radio/id324175340?mt=8) – jul Nov 06 '13 at 16:11

1 Answers1

0

I found this link that goes over some of the reasons why HTTP streaming isn't well-supported on Android. You can write your own HTTP streaming client and insert it as a proxy between the MediaPlayer and the media source, but that is the only way as far as I am aware. As far as trick mode, there is no real fast-forward or rewind protocol built into HTTP streaming. You have to simply request the correct byte from the server (see here for a little more info). The good news is it should be much easier to estimate the byte to request given a time position for audio than video (I've seen some pretty ridiculous algorithms for video).

Dave
  • 4,282
  • 2
  • 19
  • 24