I use ExoPlayer for playback of videos from url in my app and need to set an authorization header for each video. DefaultHttpDataSource can be used for that. For example,
DefaultHttpDataSource source = new DefaultHttpDataSource(Util.getUserAgent(mContext, "appAgent"), null);
source.setRequestProperty("Authorization", authToken);
MediaSource is needed to prepare the player. The question is how to create a MediaSource based on DefaultHttpDataSource? Both of the constructors of ExtractorMediaSource require DataSource.Factory, not DataSource.