I am trying to run a broadcast link, but this link only works with the so-called user-agent and referer How can I add it this Option
I am trying to run a broadcast link, but this link only works with the so-called user-agent and referer How can I add it this Option
You should be able to set it with the HttpDataSourceFactory. n.b. this is against Media3, but I believe it's almost the same.
val dataSourceFactory = DefaultHttpDataSource.Factory()
.setUserAgent("XXX")
.setDefaultRequestProperties(mapOf("Referer" to "https://example.org/"))
player =
ExoPlayer.Builder(this)
.setMediaSourceFactory(DefaultMediaSourceFactory(dataSourceFactory))
.build()