google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.01k forks source link

OOM when HLS playlist redirects (302) to non m3u resource (MPEG-TS ) #2301

Closed stari4ek closed 7 years ago

stari4ek commented 7 years ago
ojw28 commented 7 years ago

I doubt we'll be gracefully handling the transition to play the MPEG-TS stream any time soon, but we should figure out the data isn't an HLS playlist and bail out with an error, rather than consuming the stream until we OOM.

stari4ek commented 7 years ago

Proper Exception (with resolved url?) would be nice. It will help to switch to proper MediaSource on player level, where source type is identified

ojw28 commented 7 years ago

It looks like it would be straightforward to include the resolved URL in the exception. The exception type will be some kind of "unexpected content" exception. Note that it wont tell you what the content is, only that it's not an HLS playlist. That should be sufficient though. You can try ExtractorMediaSource with the resolved URL. If you get an UnrecognizedInputFormatException when you try that then something else has happened (e.g. you've probably hit a paywall rather than media content).