I'm using Exoplayer (androidx v1.0.1) to implement dynamic ad insertion (DAI) and i must set some custom headers when "live" in playing and remove those headers when ads rolling.
Without headers "live" will not play and i want to remove them when ads rolling to avoid any conflig with google
Right now i set them globaly:
mDefaultHttpDataSourceFactory = DefaultHttpDataSource.Factory()
.setAllowCrossProtocolRedirects(true)
.setDefaultRequestProperties(mCustomHeaders)
.setUserAgent(mContext.getString(R.string.player_name))
.setTransferListener(
DefaultBandwidthMeter.Builder(mContext)
.setResetOnNetworkTypeChange(false)
.build())
What listener(s) or method(s) should i use to add/remove those headers? Even on prefetch
Thanks