Reputation: 3761
I'm making an android app that can play audio streams from URLs.
Activity contains a simple Play/Pause button and a Seekbar.
I've managed to play the stream by running the media player as a service but now I want to achieve buffering.
Buffering in the sense that, when the mediaplayer starts, I want the stream to be saved in a buffer or a temporary location.
Also I want to show this buffered amount in the seekbar (probably as a secondary progress) & when the user drags the seekbar to any buffered point, the player should play that stream without any disruption.
So, I'm seeking a decent tutorials for this. I tried searching but not able to find a simpler solution for Version >= 2.3. (But, if it works for 2.2 also, that be great too)
Thank You
Upvotes: 1
Views: 4636
Reputation: 2475
I used the internet radio streaming posted in an answer here: Online radio streaming app for Android
And then I used some of this guy's work for implementing a visualizer: https://github.com/felixpalmer/android-visualizer
I'm having a trouble on the Samsung S3 though. Have you had any issues with streaming internet radio? It works fine on Samsung Music, Note, Note II, S II, S III mini, (even) S4 and Google Nexus phones, but supposedly because of some firmware buffer setting on the S3, it's just not streaming music on an S3.
I've gotten results like streaming after 2-5 minutes, but who wants to wait 5 minutes for a radio stream to start - no one!
I've discovered that it sometimes depends on the bitrate of the stream. For example, a 96 kb/s bitrate stream started playing instantly on the S3, while a 128 kb/s bitrate stream took 2+ minutes. Which actually just does not make sense, since one would think that the higher bitrate stream would fill the buffer quicker than the lower bitrate stream.
Do you have any advice or suggestions for me? I have questions here and here.
Upvotes: 1