-
-
Notifications
You must be signed in to change notification settings - Fork 45
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 android crash Dispose() call in PlaybackEnded event #122
Conversation
- Fix warning "mediaplayer went away with unhandled events"
if (isDisposed) | ||
{ | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this. I am wondering if this is the correct fix or whether we should move the PlaybackEnded?.Invoke(this, e);
line to the end of this method?
I can't decide which is best. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably the state in which you expect the player to be then PlaybackEnded
is called is the end of the playback position so I would say it's fine like that. But after checking the other place where PlaybackEnded
is called seems like it's always the opposite with a Seek(0) before PlaybackEnded?.Invoke()
so it's probably better to keep it coherent.
I will check if that's work fine and update the PR if you good with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great! Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great! Thank you
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
Allow the creation of a IAudioPlayer that will be disposed imediatly after ending.