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

avplayer audio provider: Fixes seek and state on iOS and macOS #8741

Merged
merged 1 commit into from
May 27, 2024

Conversation

tito
Copy link
Member

@tito tito commented May 26, 2024

The previous implementation was using playAtTime_, but 100% sure it was not working as playAtTime_ schedules the audio to play at a specific time, not to seek within the current audio file. To seek to a specific position in the audio, we should use the currentTime property of AVAudioPlayer.

In addition, i added a delegate to correctly catch when the sound is stopping when reaching eof, which make the state property correctly work.

Maintainer merge checklist

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: xxx label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.
  • Unittests are included in PR.
  • Properly documented, including versionadded, versionchanged as needed.

The previous implementation was using playAtTime_, but 100% sure it was
not working as playAtTime_ schedules the audio to play at a specific
time, not to seek within the current audio file. To seek to a specific
position in the audio, we should use the currentTime property of
AVAudioPlayer.

In addition, i added a delegate to correctly catch when the sound is
stopping when reaching eof, which make the state property correctly
work.
@misl6 misl6 changed the title Fixes avplayer seek and state on iOS (not tested on OSX) avplayer audio provider: Fixes seek and state on iOS and macOS May 27, 2024
@misl6 misl6 added this to the 3.0.0 milestone May 27, 2024
Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

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

Tested on macOS, works great.
Updated title.

LGTM. Thank you!

@misl6 misl6 merged commit 3eadfd9 into master May 27, 2024
75 checks passed
@misl6 misl6 deleted the mathieu/core-avplayer-fix-seek-state branch May 27, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants