Getting a 403 response code error from exoplayer
See original GitHub issueIssue description
When playing an http mp4 stream in my activity I get a 403 response code from exoplayer. When I plug the same url in the demo app it plays immediately. I have checked my code against the demo’s player activity and I can’t see any difference or missing code that would result in me getting the 403 and the demo app working. Can someone with better trained eyes check it out for me and point me in the right direction?
Reproduction steps
Pass url to custom exoplayer player activity. results in 403 response code. Demo app plays stream fine.
Link to test content
email sent to dev.exoplayer@gmail.com
Version of ExoPlayer being used
2.5.4
Device(s) and version(s) of Android being used
Pixel C 7.1.1
A full bug report captured from the device
E/EventLogger: internalError [3.76, loadError]
com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:211)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:137)
at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:692)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
E/EventLogger: playerFailed [3.78]
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:399)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:211)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:137)
at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:692)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)```
Issue Analytics
- State:
- Created 6 years ago
- Comments:30 (12 by maintainers)
Top Results From Across the Web
Getting a 403 response code error from ExoPlayer
Based from this thread, there might be an issue with the cookie handler/manager. Make sure that you are using the same CookieHandler in...
Read more >ExoPlayer Error 403 | B4X Programming Forum
403 means forbidden. same error using a standard browser. you may have to start over to track down the playlist. many possible explanations....
Read more >1705472 - ExoPlayer should send cookies with HTTP requests
HttpDataSource$InvalidResponseCodeException: Response code: 403 E ExoPlayerImplInternal: at org.mozilla.thirdparty.com.google.android.exoplayer2.upstream.
Read more >Troubleshooting - ExoPlayer
This error will occur if your app requests cleartext HTTP traffic (i.e., http:// rather than https:// ) when its Network Security Configuration does...
Read more >Developers - Getting a 403 response code error from exoplayer -
When playing an http mp4 stream in my activity I get a 403 response code from exoplayer. When I plug the same url...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@AquilesCanta Yes I am.
Seems like it was the cookie handler/manager after all. I made sure I was using the same CookieHandler in both my okhttp service class and the exo player activity and its working perfectly now.
Thanks for the time and help. Greatly appreciated!