-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
I am trying to switch streaming from HttpDataSource to CronetDataSource. The way I am doing it by adding official ExoPlayer cronet extension: https://github.com/google/ExoPlayer/tree/release-v2/extensions/cronet
Then in code just change:
DataSource.Factory mDataSourceFactory = new DefaultDataSourceFactory(mContext, RemoteGateway.getUserAgent(), bandwidthMeter);
to:
DataSource.Factory mDataSourceFactory = new DefaultDataSourceFactory(
mContext,
bandwidthMeter,
new CronetDataSourceFactory(
new CronetEngineWrapper(mContext),
Executors.newSingleThreadExecutor(),
null,
bandwidthMeter,
RemoteGateway.getUserAgent()));
What happens is that the stream works without any issues when using HttpDataSource but fails with CronetDataSource. After debugging it turns out that CronetDataSource doesn't process Set-Cookie header(s) return by my streaming CDN (Amazon CloudFront) on master playlist response and doesn't pass those cookies on subsequent requests for AES key and/or chunklists.
I search for ExoPlayer documentation and wasn't able to find info how to correctly configure cookie management when Cronet extension is used.
Here is my ExoPlayer info:
D/CronetEngineWrapper: CronetEngine built using App-Packaged-Cronet-Provider
I/ExoPlayerImpl: Init ef5675b [ExoPlayerLib/2.10.1] [generic_x86, sdk_google_atv_x86, unknown, 25]
Thanks
Stefan