-
Notifications
You must be signed in to change notification settings - Fork 856
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
[Android] App crashes on mp3 play with setDataSourceFD failed
or MEDIA_ERROR_UNKNOWN
even with try/catch
#1260
Comments
Thanks for the detailed report: Can you test again with |
Confirmed in AP 1.1.1 Edit: I researched a little bit and checked the audio codec:
I noticed that the Format Profile is Layer 2 instead of Layer 3. So basically its |
Sorry, I have since switched to What is really worrying here is not so much that it does not play some file, but that it crashes even inside try/catch block... |
Result of Two Beeps when Logs
Result of testing the record of a stream when Logs
|
java.io.IOException: setDataSourceFD failed
or what:MEDIA_ERROR_UNKNOWN {what:1} extra:MEDIA_ERROR_UNKNOWN {extra:-38}
even with try/catch
java.io.IOException: setDataSourceFD failed
or what:MEDIA_ERROR_UNKNOWN {what:1} extra:MEDIA_ERROR_UNKNOWN {extra:-38}
even with try/catchsetDataSourceFD failed
or MEDIA_ERROR_UNKNOWN
even with try/catch
In the rare case, that an media player error occurs (like when playing unsupported media sources), the player still is in the "prepared" state, although the internal MediaPlayer state isn't anymore. Then it could keep calling methods, which lead to an illegal MediaPlayer state. By resetting this variable on a media error, this should not make the library crash anymore, but still emit the error. Fixes #1260 Fixes #1331
# Description - Replace Platform Method Channels (from platform -> to lib) with Event Channels - Combined Event stream for player (`PlayerEvent`) and global (`GlobalEvent`) events - Add methods `create`, `dispose` and `getEventStream` to `AudioplayersPlatformInterface` - Add method `getGlobalEventStream` to `GlobalAudioplayersPlatformInterface` - Add log stream `player.onLog()` and `AudioPlayer.global.onLog()` - Example for using Logger - Throw PlatformException on Method Error via Method Channel (lib -> platform) - Emit PlatformException on Event Error via Event Channel (platform -> lib) `player.eventStream.listen().onError()` and `AudioPlayer.global.eventStream.listen().onError()` - Add docs ## Breaking Change ### Migration instructions **audioplayers**: | Before | After | |---|---| | deprecated `AudioPlayer.global.changeLogLevel(LogLevel.info)` | `Logger.logLevel = LogLevel.info` | | deprecated `AudioPlayer.global.logLevel` | `Logger.logLevel` | | deprecated `AudioPlayer.global.log()` | `Logger.log()` or `Logger.error()` | | deprecated `AudioPlayer.global.info()` | `Logger.log()` | | deprecated `AudioPlayer.global.error()` | `Logger.error()` | | `ForPlayer<>` | _removed_ | **audioplayers_platform_interface**: | Before | After | |---|---| | `LogLevel` | _moved_ to `audioplayers` package | | `StreamsInterface` | _removed_ | | `ForPlayer<>` | _removed_ | ## Related Issues Closes #106 Closes #151 Closes #1266 Can handle error of #1260 Related to #208 and #933, but cannot hide Android MediaPlayer logs This would bypass: flutter/flutter#69103
Checklist
App crashes on playing this mp3 file
Current bug behaviour
App crashes with: "MediaPlayer error with what:MEDIA_ERROR_UNKNOWN {what:1} extra:MEDIA_ERROR_SYSTEM"
Expected behaviour
App plays sound
Steps to reproduce
Logs
Full Logs
Flutter doctor:
Audio Files/URLs/Sources
Screenshots
Environment information
Platform 1: android
OS name and version: api32
Device: emulator
build mode:
debug
error peculiarities (optional): try.catch does not help!?
The text was updated successfully, but these errors were encountered: