-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataSourceFactory with OkHttpDataSource ignored #116
Labels
Comments
Thanks for reporting! We discovered the same bug ourselves yesterday and it will be fixed soon. |
rohitjoins
pushed a commit
that referenced
this issue
Jul 13, 2022
The call doesn't currently reset the already loaded suppliers and factories. Also fix the supplier loading code to use a local copy of the current dataSourceFactory to avoid leaking an updated instance to a later invocation. Issue: #116 #minor-release PiperOrigin-RevId: 460721541
rohitjoins
pushed a commit
to google/ExoPlayer
that referenced
this issue
Jul 13, 2022
The call doesn't currently reset the already loaded suppliers and factories. Also fix the supplier loading code to use a local copy of the current dataSourceFactory to avoid leaking an updated instance to a later invocation. Issue: androidx/media#116 #minor-release PiperOrigin-RevId: 460721541
Fix by the commit above, will be released soon in ExoPlayer 2.18.1 / Media3 1.0.0-beta02. |
rohitjoins
pushed a commit
to google/ExoPlayer
that referenced
this issue
Jul 15, 2022
The call doesn't currently reset the already loaded suppliers and factories. Also fix the supplier loading code to use a local copy of the current dataSourceFactory to avoid leaking an updated instance to a later invocation. Issue: androidx/media#116 #minor-release PiperOrigin-RevId: 460721541 (cherry picked from commit 6be0d6e)
rohitjoins
pushed a commit
that referenced
this issue
Jul 15, 2022
The call doesn't currently reset the already loaded suppliers and factories. Also fix the supplier loading code to use a local copy of the current dataSourceFactory to avoid leaking an updated instance to a later invocation. Issue: #116 PiperOrigin-RevId: 460721541 (cherry picked from commit adc5051)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Media3 Version
1.0.0-beta01
Devices that reproduce the issue
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
I am trying to switch the network stack to OkHttp as described in the Exoplayer documentation. The player instance is created inside a MediaSessionService with a custom mediaSourceFactory containing the OkHttpDataSouce like so:
The mediaSource is never directly set anywhere else in the code, the only interaction is via the mediaController which I use to set MediaItem playlists.
Expected result
Player is expected to use the provided OkHttpClient for network connection.
Actual result
According to the logs, the player is still using DefaultHttpDataSource for communication instead of the provided OkHttpDataSource. The line of code where the actual data source creation by the factory would happen never gets called.
The reason I am trying to switch the network stack is that some of the online radio URLs that I try to play return 301 or 302 HTTP status codes. While information I found suggests that redirects should be working, I thought that maybe the DefaultHttpDataSource is one that doesn't handle it well at that OkHttp would handle it better. And if not I at least wanted to find out what is going on in the redirect which I thought would be easy by using an OkHttpClient with a logging interceptor. I also tried enabling cross protocol redirects (
setAllowCrossProtocolRedirects(true)
) on the DefaultHttpDataSource, but it didn't work - which I assume is also caused by the datasource being ignored.Media
The issue isn't caused by any specific media type, but that's the one I was testing it with:
Original URL http://stream.mangoradio.de/ (ERROR_CODE_IO_BAD_HTTP_STATUS, HTTP 301)
Redirected URL https://stream.laut.fm/mangoradio (this one plays just fine)
Bug Report
adb bugreport
to [email protected] after filing this issue.The text was updated successfully, but these errors were encountered: