-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Provide options to allow for customising the iOS/macOS specific session settings #101
Conversation
This is a draft for now but it would be great to hear what @jfversluis and @borrmann think. And of course anyone else in the community :) |
I like that approach. It makes clear how it works on iOS.
KeepSessionAlive would be the current implementation. EndSession would end the audio session on FinishedPlaying and EndSessionAndNotifyOthers would end the audio session and additionally notify other audio players that listen to this event. |
Thanks. Is your suggestion aimed at determining whether we effectively call |
yes exactly, for EndSession and EndSessionAndNotifyOthers |
…is/Plugin.Maui.SimpleAudioPlayer into feature/sl-issue-91-ios-session
I haven't been able to test these changes on iOS or macOS yet but I believe this API surface should be good for a review. |
Not sure how exactly, but I guess it would be nice to surface something for this in the sample app to try out the different options as well? But for now this seems great to me! |
I did update the sample to use the new approach. We could add some comments in there to cover different scenarios? |
Yeah what I was thinking is more some controls to switch between the options. But that can be a follow up, if it can even be done at all? Maybe not for all options, not sure. |
Oh yes good idea! Yes we can support that |
The aim of this PR is to allow developers to configure the
AVAudioSession
options when running on the Apple based platforms. It opens us up to being able to configure other platforms should we need also.The result gives the following API changes/additions:
AddAudio
extension method to configure the shared settings much like the options based approach in modern apps:This fits with developers making use of dependency injection, for those that aren't there is the following:
And then finally there is the ability to pass in an instance of the options class when creating a player or reader which will override these shared settings:
Fixes #91
Fixes #53
Fixes #70