Skip to content

fix: onPrepared event to wait until player is ready / finished loading the source#1469

Merged
Gustl22 merged 94 commits into
mainfrom
gustl22/prepare-event
May 8, 2023
Merged

fix: onPrepared event to wait until player is ready / finished loading the source#1469
Gustl22 merged 94 commits into
mainfrom
gustl22/prepare-event

Conversation

@Gustl22

@Gustl22 Gustl22 commented Apr 11, 2023

Copy link
Copy Markdown
Collaborator

Description

Add a callback when the player has prepared its source, which is tangled to the asynchronous setSource method, to improve experience, when player should actually play and not wait for the player to prepare / load the source.

  • Fix: cannot play same source twice on Linux

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

Closes #1118
Closes #1384
Closes #1359
#1191

Comment thread packages/audioplayers/lib/src/audioplayer.dart Outdated
@Gustl22 Gustl22 marked this pull request as ready for review April 11, 2023 21:58
@Gustl22 Gustl22 marked this pull request as draft April 11, 2023 21:59
@Gustl22 Gustl22 marked this pull request as ready for review April 15, 2023 00:28
@Gustl22 Gustl22 marked this pull request as draft April 15, 2023 00:30
@Gustl22 Gustl22 marked this pull request as ready for review April 19, 2023 12:08
Gustl22 added 17 commits May 3, 2023 13:21
# Conflicts:
#	.github/workflows/test.yml
#	packages/audioplayers/example/integration_test/lib_test.dart
#	packages/audioplayers/lib/src/audioplayer.dart
#	packages/audioplayers_android/android/src/main/kotlin/xyz/luan/audioplayers/AudioplayersPlugin.kt
#	packages/audioplayers_linux/linux/audio_player.cc
#	packages/audioplayers_linux/linux/audioplayers_linux_plugin.cc
# Conflicts:
#	packages/audioplayers/example/integration_test/lib_test.dart
#	packages/audioplayers_linux/linux/audio_player.cc
@Gustl22

Gustl22 commented May 8, 2023

Copy link
Copy Markdown
Collaborator Author

@spydon do you agree merging it like that. I expect flutter/flutter#126209 to take some time... 😅

@spydon

spydon commented May 8, 2023

Copy link
Copy Markdown
Member

@spydon do you agree merging it like that. I expect flutter/flutter#126209 to take some time... 😅

Sure, since we're tracking it on our side.
Well written Flutter bug!

@Gustl22 Gustl22 merged commit 50f5636 into main May 8, 2023
@Gustl22 Gustl22 deleted the gustl22/prepare-event branch May 8, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants