Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support setting request properties on DefaultHttpDataSourceFactory #2166

Closed
trckashyap opened this issue Dec 7, 2016 · 5 comments
Closed

Comments

@trckashyap
Copy link

Need to send custom headers to our server while streaming media URL.
Please provide an API to support this in Exoplayer v2.
Earlier we used to do this via DefaultHttpDataSource(setRequestProperty method), but now its not exposed in Renderers or RendererBuilder.

-Kashyap.

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2016

  • There is no class called RendererBuilder, as far as I can see?
  • You can implement your own HttpDataSource.Factory to generating instances of DefaultHttpDataSource that are configured the way you want them, so I think this is possible. If you don't think this works, please clarify why not.
  • We could make it easier by allowing request properties to be set on DefaultHttpDataSourceFactory. Would that help?

@trckashyap
Copy link
Author

Allowing request properties to be set on DefaultHttpDataSourceFactory would be great else we need to build our own ExtractorRendererBuilder, HlsRendererBuilder etc to add headers after createDataSource() is done.

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2016

I'm really struggling to follow what you're referring to. There are no classes called RendererBuilder, ExtractorRendererBuilder or HlsRendererBuilder in ExoPlayer V2. It shouldn't be much work at all to implement your own HttpDataSource.Factory to support this case, as per my second bullet point above, until we add support to the default one.

@trckashyap
Copy link
Author

Thanks...Tried out implementing my own Factory and successfully able to do it, but in future it would be great if a method is exposed similar to createDataSource() in Factory.

@ojw28 ojw28 changed the title No Provision to set custom headers in ExoPlayer-v2 Support setting request properties on DefaultHttpDataSourceFactory Dec 7, 2016
@ojw28 ojw28 reopened this Dec 7, 2016
@ojw28 ojw28 changed the title Support setting request properties on DefaultHttpDataSourceFactory Support setting request properties on DefaultHttpDataSourceFactory Dec 7, 2016
@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2016

Note: We should also add support for the okhttp and cronet factories.

ojw28 added a commit that referenced this issue Jan 6, 2017
Issue: #2166

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143703258
@ojw28 ojw28 closed this as completed Jan 9, 2017
@google google locked and limited conversation to collaborators Jun 28, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants