You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 media state isn't anymore. Then it could keep calling methods, which lead to an illegal media player state. By resetting this variable on a media error, this should not make the library crash anymore, but still emit the error.
I would have added a test, but the crash is not reproducible with the library tests, only with an app integration / driver test, which is far too much overhead to implement.
Checklist
The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs:, chore: etc).
I have read the Contributor Guide and followed the process outlined for submitting PRs.
I have updated/added tests for ALL new/updated/fixed functionality.
I have updated/added relevant documentation and added dartdoc comments with ///, where necessary.
I have updated/added relevant examples in example.
Gustl22
changed the title
fix(android): reset prepared state on player error (fixes #1260)
fix(android): reset prepared state on player error (fixes #1260, fixes #1331)
Feb 13, 2023
Gustl22
changed the title
fix(android): reset prepared state on player error (fixes #1260, fixes #1331)
fix(android): reset prepared state on player error
Feb 13, 2023
@Gustl22@spydon Thanks for your work on this package.
When will this fix be released to pub.dev?
Edit:
I managed to use the updated version with a git dependency hig-dev@48f8750
It will probably be a while until the next release since we now have AudioPool in both flame_audio and AudioPlayers, so we have to migrate away flame_audio from that first.
@Gustl22@spydon Thanks for your work on this package.
When will this fix be released to pub.dev?
Edit:
I managed to use the updated version with a git dependency hig-dev@48f8750
It will probably be a while until the next release since we now have AudioPool in both flame_audio and AudioPlayers, so we have to migrate away flame_audio from that first.
Thanks for the info. If anyone else needs the fix sooner, you can reference audioplayers in your pubspec.yaml in the meantime like follows:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
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 media state isn't anymore. Then it could keep calling methods, which lead to an illegal media player state. By resetting this variable on a media error, this should not make the library crash anymore, but still emit the error.
I would have added a test, but the crash is not reproducible with the library tests, only with an app integration / driver test, which is far too much overhead to implement.
Checklist
fix:,feat:,docs:,chore:etc).///, where necessary.Breaking Change
Related Issues
Fixes #1260
Fixes #1331