Skip to content

fix(android): onPlayerStateChanged is not called when audio has completed playing#1523

Merged
Gustl22 merged 4 commits into
bluefireteam:mainfrom
fzyzcjy:patch-5
May 29, 2023
Merged

fix(android): onPlayerStateChanged is not called when audio has completed playing#1523
Gustl22 merged 4 commits into
bluefireteam:mainfrom
fzyzcjy:patch-5

Conversation

@fzyzcjy

@fzyzcjy fzyzcjy commented May 29, 2023

Copy link
Copy Markdown
Contributor

Description

Close #1522

I am not sure whether this is the best way, but I can confirm it fixes the bug I see, and IMHO there are not infinitely many handler callbacks, so skipping this cancelation does not cause harm.

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.

Breaking Change

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

Related Issues

@Gustl22

Gustl22 commented May 29, 2023

Copy link
Copy Markdown
Collaborator

Nice catch!

Do you think updateRunnable?.let { handler.removeCallbacks(it) } would do the trick?

But I'm a bit confused about the comment below this, but it should't make a big difference, as the runnable (and it's loop) will end after one update circle. We may should test this once anyway :)

@Gustl22 Gustl22 changed the title Fix onPlayerStateChanged is not called when audio has completed playing fix: onPlayerStateChanged is not called when audio has completed playing May 29, 2023
@Gustl22 Gustl22 changed the title fix: onPlayerStateChanged is not called when audio has completed playing fix(android): onPlayerStateChanged is not called when audio has completed playing May 29, 2023
@fzyzcjy

fzyzcjy commented May 29, 2023

Copy link
Copy Markdown
Contributor Author

Do you think updateRunnable?.let { handler.removeCallbacks(it) } would do the trick?

I am not sure. If it only removes that one specific runnable then maybe yes?

@fzyzcjy

fzyzcjy commented May 29, 2023

Copy link
Copy Markdown
Contributor Author

Btw this is partially why I do hope to implement #1527 - then there is no such callbacks, runnables, threads, etc!

@Gustl22 Gustl22 self-requested a review May 29, 2023 07:49
@Gustl22

Gustl22 commented May 29, 2023

Copy link
Copy Markdown
Collaborator

@fzyzcjy Is it ok for you to merge it like this (after my changes)?

@fzyzcjy

fzyzcjy commented May 29, 2023

Copy link
Copy Markdown
Contributor Author

LGTM! (not tested yet though)

@Gustl22 Gustl22 merged commit 293d6c0 into bluefireteam:main May 29, 2023
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.

(with PR) onPlayerStateChanged is not called when audio has completed playing

2 participants