amzn / exoplayer-amazon-port

Official port of ExoPlayer for Amazon devices
Apache License 2.0
173 stars 80 forks source link

HLS Playback issue #28

Closed abhishek-gangwar closed 6 years ago

abhishek-gangwar commented 6 years ago

Source error. com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403

Getting the above error with the hls stream. The same stream url works on Safari without any issue. But with amazon fire tv the same hls url is giving the above error.

Also HlsMediaSource is giving the warning in Android studio 3.0.1 as mentioned below 'HlsMediaSource(android.net.Uri, com.google.android.exoplayer2.upstream.DataSource.Factory, int, android.os.Handler, com.google.androidexoplayer2.source.MediaSourceEventListener)' is deprecated. This inspection reports where deprecated code is used in the specified inspection scope.

Why is that so, and what are the other options?

peddisri commented 6 years ago

Can you share the URL?

abhishek-gangwar commented 6 years ago

No url is confidential to us, but I can assure you that it works perfectly fine on any other platform, even with android Media Player also.

peddisri commented 6 years ago

Will you be able to send it to our email id , if not put it up here?

abhishek-gangwar commented 6 years ago

That's not possible for me. Really sorry.

peddisri commented 6 years ago

Can't do much about it then. 403 HTTP response code means that the URL is forbidden to be accessed by the device. Is the FTV device connected to the same network as the laptop when you use safari browser.

abhishek-gangwar commented 6 years ago

Yes, FTV device is connected to the same network as safari. Also if I use Android Media Player on the Same fire tv device it works perfectly fine. Our hls is a standard url, which works across all devices. That's why 403 HTTP response looks strange to us. I have seen many other people reported the same issue with exo player. But couldn't find a solution anywhere

https://www.google.co.in/search?q=Source+error.com.google.android.exoplayer2.upstream.HttpDataSource%24InvalidResponseCodeException%3A+Response+code%3A+403&ie=utf-8&oe=utf-8&client=firefox-b-ab&gfe_rd=cr&dcr=0&ei=g8ZlWoeUIvTx8Aeo4Zm4CA

peddisri commented 6 years ago

User agent? Does the server need authentication/whitelisting of the user agent?

abhishek-gangwar commented 6 years ago

Yes server requires authentication.

peddisri commented 6 years ago

so most likely, connections from FTV is not authenticated / accepted by server. Find out why. That' all I can help right now.

abhishek-gangwar commented 6 years ago

If that is the case then why it is not happening with Android Media Player?

peddisri commented 6 years ago

Most likely the User agent is making the difference. Find out the user agent used in Android Media Player and use the same in Exo. Exo supports configuring the user agent.

abhishek-gangwar commented 6 years ago

Yes, it is the user agent which is making the difference. Thanks for your help.

but can someone please comment on the warning in Android studio 3.0.1 as mentioned below 'HlsMediaSource(android.net.Uri, com.google.android.exoplayer2.upstream.DataSource.Factory, int, android.os.Handler, com.google.androidexoplayer2.source.MediaSourceEventListener)' is deprecated. This inspection reports where deprecated code is used in the specified inspection scope.