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(ios): emit state passed to handleAudioPlayerStateChange #1928

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

puckey
Copy link
Collaborator

@puckey puckey commented Feb 15, 2023

I noticed double State.Playing events and tracked it down to this issue in ios.

@puckey puckey requested a review from dcvz as a code owner February 15, 2023 15:10
Copy link
Collaborator

@bradfloodx bradfloodx left a comment

Choose a reason for hiding this comment

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

🤘

if (player.playerState == AudioPlayerState.failed) {
private func getPlaybackStateBodyKeyValues(state: AudioPlayerState) -> Dictionary<String, Any> {
var body: Dictionary<String, Any> = ["state": State.fromPlayerState(state: state).rawValue]
if (state == AudioPlayerState.failed) {
body["error"] = getPlaybackStateErrorKeyValues()
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious and want to learn more about the codebase; shouldn't the state be passed to the getPlaybackStateErrorKeyValues as well, if changing this? Now The state === AudioPlayerState.failed check will not be the same state as the error-values function are checking on in line 741?

@dcvz dcvz merged commit a65fdcd into doublesymmetry:main Feb 21, 2023
shawna-donnelly pushed a commit to heistdotcom/react-native-track-player that referenced this pull request Apr 4, 2023
shawna-donnelly pushed a commit to heistdotcom/react-native-track-player that referenced this pull request Apr 4, 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.

4 participants