Skip to content
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

Exception from ExoPlayer #29

Closed
volgin opened this issue Jan 26, 2020 · 5 comments
Closed

Exception from ExoPlayer #29

volgin opened this issue Jan 26, 2020 · 5 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@volgin
Copy link

volgin commented Jan 26, 2020

I ran into one mp3 file which causes the following exception, when playing on Android:

E/ExoPlayerImplInternal(19071): Source error.
E/ExoPlayerImplInternal(19071): com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor, Ac4Extractor) could read the stream.
E/ExoPlayerImplInternal(19071): 	at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractorHolder.selectExtractor(ProgressiveMediaPeriod.java:1095)
E/ExoPlayerImplInternal(19071): 	at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:974)
E/ExoPlayerImplInternal(19071): 	at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391)
E/ExoPlayerImplInternal(19071): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ExoPlayerImplInternal(19071): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ExoPlayerImplInternal(19071): 	at java.lang.Thread.run(Thread.java:919)

The file actually starts playing and sounds normal. Unfortunately, the audio player becomes unresponsive - all further calls (setting a new file/URL) fail. The audio player appears to be permanently stuck in the .connecting state.

The same file plays with no problems on iPhone. I also ran a check to see if this is a valid mp3 file, and it is.

  1. Any ideas why a file would play normal on iPhone (and in web browsers), but fail on Android?

  2. Is there a way to catch such exceptions?

@ryanheise ryanheise self-assigned this Jan 26, 2020
@ryanheise
Copy link
Owner

The only thing I can think of is that it might not really be an mp3 file. Maybe you can try opening the file on your desktop or laptop using software that can show you the codec info. Once I know what format it is, I can try to enable that in ExoPlayer.

@volgin
Copy link
Author

volgin commented Jan 26, 2020

Good catch. It was a wrong codec.

I still need to be able to catch such exceptions and, ideally, prevent the player from crashing. Currently we cannot pre-validate every file that we play. Skipping files that ExoPlayer cannot play would be a good enough solution.

@volgin
Copy link
Author

volgin commented Jan 26, 2020

After looking through the plugin code, it appears that there is no way out of AudioPlaybackState.connecting. No other method can be called from this state, making it a dead-end if a player is stuck in this state.

@ryanheise
Copy link
Owner

I'll use #31 to track the exception reporting code.

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
No open projects
just_audio
  
To do
Development

No branches or pull requests

2 participants