You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with playing stream radio(Icecast backend). It appears while phone switches cell stations. Audio stops playing. On the other hand If I switch off and then switch on WiFi audio playback stops but then starts again. It happens only on mobile data. Also interesting thing that playback stops immediately on WiFi toggle, I was sure that it should continue playing from buffer till it ends.
Icecast station url: http://hitfm.kz/mp3/URBAN
Here is my code
MediaSource mediaSource;
ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
Handler mHandler;
SimpleExoPlayer mPlayer;
public UnderExoMediaPlayer(Context context) {
mHandler = new Handler();
TrackSelection.Factory videoTrackSelectionFactory = new FixedTrackSelection.Factory();
TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
DefaultAllocator allocator = new DefaultAllocator(true, 256);
LoadControl loadControl = new DefaultLoadControl(allocator, 25000, 30000, 1000, 5000); //
min buffer, max buffer, start buffer, resume buffer
mPlayer = ExoPlayerFactory.newSimpleInstance(context, trackSelector, loadControl);
dataSourceFactory = new DefaultHttpDataSourceFactory(
Util.getUserAgent(context, "myRadio"), new TransferListener<DataSource>() {
@Override
public void onBytesTransferred(DataSource source, int bytesTransferred) {
if(!ready && ExoPlayer.STATE_READY == mPlayer.getPlaybackState()){
if(mOnPreparedListener != null) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
mOnPreparedListener.onPrepared();
}
});
}
ready = true;
}
}
});
}
public void setDataSource(final Context context, Uri uri) {
mPlayer.setPlayWhenReady(false);
mediaSource = new ExtractorMediaSource(uri, dataSourceFactory, extractorsFactory,
mHandler, new ExtractorMediaSource.EventListener() {
@Override
public void onLoadError(IOException error) {
mPlayer.prepare(mediaSource);
}
});
}
How can I fix this behavior?
Reproduction steps
Sit in the car, listen to the radio and drive around blocks
Version of ExoPlayer being used
Exoplayer:r2.2.0
Device(s) and version(s) of Android being used
Problem appears on all devices. In my case it is Google Pixel
The text was updated successfully, but these errors were encountered:
Playing out the remaining buffer rather than stopping immediately for this use case is tracked by #1606. For the "stopping" case, you haven't provided sufficient information for us to tell what happened. Please supply a full bugreport as requested in the issue template, captured shortly after encountering the failure.
Issue description
There is a problem with playing stream radio(Icecast backend). It appears while phone switches cell stations. Audio stops playing. On the other hand If I switch off and then switch on WiFi audio playback stops but then starts again. It happens only on mobile data. Also interesting thing that playback stops immediately on WiFi toggle, I was sure that it should continue playing from buffer till it ends.
Icecast station url: http://hitfm.kz/mp3/URBAN
Here is my code
How can I fix this behavior?
Reproduction steps
Sit in the car, listen to the radio and drive around blocks
Version of ExoPlayer being used
Exoplayer:r2.2.0
Device(s) and version(s) of Android being used
Problem appears on all devices. In my case it is Google Pixel
The text was updated successfully, but these errors were encountered: