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

fix: Race condition when playing/pausing audio #1705

Merged
merged 5 commits into from
Nov 20, 2023

Conversation

Gustl22
Copy link
Collaborator

@Gustl22 Gustl22 commented Nov 16, 2023

Description

Fixes #1687

Instead we could also set the state always at the beginning of each method, but this raises these problems:

  • If the operation in the method throws an error, the state doesn't match the native players state
  • The state doesn't reflect the current real world audio state, as it's maybe still preparing/buffering and not actually playing

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, refactor:,
    docs:, chore:, test:, ci: 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.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Related Issues

#1687

@Gustl22 Gustl22 requested a review from spydon November 16, 2023 14:18
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do the methods need to be split up into a private and a public method? 🤔

@Gustl22 Gustl22 merged commit 463b2a1 into main Nov 20, 2023
7 checks passed
@Gustl22 Gustl22 deleted the gustl22/1687-race-condition branch November 20, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition when playing/pausing audio
2 participants