-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffering radio stream #3164
Comments
We need more complete information to help with issues like this. For example information about the type of stream you're trying to play (and preferable a link to an example). |
Mp3 stream from Internet (for example http://79.174.68.63:7999/luxury). Please look at function createMediaPlayerIfNeeded. (But it default init for exoplayer) |
If you have a three minute buffer, does that imply three minutes of latency (e.g. the audio the user hears is three minutes behind "live")? |
I don't see the point to increase so much your buffer size. private static final int DEFAULT_MIN_BUFFER_MS = 5000;
private static final int DEFAULT_MAX_BUFFER_MS = 10000;
private static final int DEFAULT_BUFFER_FOR_PLAYBACK_MS = 3500;
private void createMediaPlayerIfNeeded() {
if (mExoPlayer == null) {
mExoPlayer = ExoPlayerFactory.newSimpleInstance(
new DefaultRenderersFactory(mContext),
new DefaultTrackSelector(),
new DefaultLoadControl(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE),
DEFAULT_MIN_BUFFER_MS, DEFAULT_MAX_BUFFER_MS, DEFAULT_BUFFER_FOR_PLAYBACK_MS, DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS));
AudioAttributes.Builder builder = new AudioAttributes.Builder()
.setContentType(C.CONTENT_TYPE_MUSIC);
mExoPlayer.setAudioAttributes(builder.build());
mExoPlayer.setPlayWhenReady(true);
mExoPlayer.addListener(this);
}
} |
@ojw28 I want to implement the following behavior: |
@djerom I have customized the settings but it didn't help me. |
As already asked above, does that imply three minutes of latency (e.g. the audio the user hears is three minutes behind "live")? |
No, I want to play "live" and buffering some next time of stream. Is it possible ? |
It's fundamentally impossible to be both "live" and have three minutes of media buffered, since that would require you to have buffered three minutes of content from the future. Please clarify the question. Thanks. |
So for what DEFAULT_MIN_BUFFER_MS, DEFAULT_MAX_BUFFER_MS used in DefaultLoadControl ? I think that for buffering media. |
They're used as documented. Note that the "will attempt" part of the documentation is important. If the serving side doesn't allow the client to buffer that much media, then the client wont be able to do so. I took a look at the stream mentioned earlier in this thread (http://79.174.68.63:7999/luxury). The server allows the client to buffer ~145 seconds of media. Increasing I think the problem you're seeing isn't that the duration of media you want isn't being buffered. It's that the player attempts to reconnect too quickly in the case of a network error, rather than first playing out all of the media that's in the buffer. This issue is tracked by #1606, so you should follow that for updates. |
Ok, Thanks for your help. |
Issue description
I use exoplayer for playing radio stream. And I have question related to buffering:
How to increase it?
I found the following issue (#2438) but increase DEFAULT_MIN_BUFFER_MS and DEFAULT_MAX_BUFFER_MS doesn't help me.
Now I have about 20-30 sec buffering when Internet off. I want to increase it to 3 min.
It is not server issue because Ios client support buffering about 3 min for the same server.
Could you help me ? may be need change another settings ?
Please see my code:
LoadControl loadControl = new DefaultLoadControl(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE), 2DEFAULT_MIN_BUFFER_MS,
2DEFAULT_MAX_BUFFER_MS, DEFAULT_BUFFER_FOR_PLAYBACK_MS, DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS);
Version of ExoPlayer being used
r2.5.1
Device(s) and version(s) of Android being used
Galaxy note 5 - Android 6.0.1
The text was updated successfully, but these errors were encountered: