Since switching from Mediaplayer to a simple implementation Exoplayer I have noticed much improved load times but I\'m wondering if there is any built in functionality such
Parsing the Shoutcast Metadata Protocol consists of two parts:
curl -v -H "Icy-MetaData:1" http://ice1.somafm.com/defcon-128-mp3
Part one can be done without OkHttp based on ExoPlayer 2.6.1 (in Kotlin):
// Custom HTTP data source factory with IceCast metadata HTTP header set
val defaultHttpDataSourceFactory = DefaultHttpDataSourceFactory(userAgent, null)
defaultHttpDataSourceFactory.setDefaultRequestProperty("Icy-MetaData", "1")
// Produces DataSource instances through which media data is loaded.
val dataSourceFactory = DefaultDataSourceFactory(
applicationContext, null, defaultHttpDataSourceFactory)
Part two is more involved and posting all the code is a little to much. You might want to take a look at the ExoPlayer2 extension I created instead:
github.com/saschpe/android-exoplayer2-ext-icy
It does not depend on OkHttp and is used in my Soma FM streaming radio application for Android called Alpha+ Player.