The exoplayer library seems so complicated to me. Can someone help me how to pass url radio station using exoplayer library? I tried with MediaPlayer, it works great, but it takes so much time to prepare. Here is what I have tried.
exoPlayer = ExoPlayer.Factory.newInstance(RENDERER_COUNT); Allocator allocator = new DefaultAllocator(BUFFER_SEGMENT_SIZE); DataSource dataSource = new DefaultUriDataSource(getApplicationContext(), null, userAgent); Mp3Extractor extractor = new Mp3Extractor(); ExtractorSampleSource sampleSource = new ExtractorSampleSource( uri, dataSource, extractor, allocator, BUFFER_SEGMENT_COUNT * BUFFER_SEGMENT_SIZE); MediaCodecAudioTrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource); exoPlayer.prepare(audioRenderer); exoPlayer.setPlayWhenReady(true);
I do not understand how to get userAgent and what does it mean?
android exoplayer
Mladen rakonjac
source share