Allow external audio session managers via a public protocol #844
svenmeyers89
started this conversation in
Ideas
Replies: 2 comments 1 reply
|
This pain point was raised in another channel, and I originally planned to address it within the upcoming Guided Navigator (which supports media overlays). However, since that won't ship until v4, please feel free to open a PR from |
1 reply
|
Thanks, @mickael-menu , and sorry for the delay. Here's the PR with a minimal set of changes to support external audio session handling: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
While integrating the Readium SDK, I noticed that
AudioSessionis designed to act as the app's central audio session manager. Since the audio session is a process-wide resource on iOS, many apps already have their own manager (mine included), making it difficult to coordinate with Readium without taking on an unwanted dependency or fighting for control.I'd like to propose providing a small public protocol that extracts the coordination surface Readium consumers need:
The existing
AudioSessionclass would conform to this protocol and could remain the default value at the relevant injection point (e.g.PublicationSpeechSynthesizeror the top-level navigator), so there would be no breaking changes for existing integrators. The benefit is that external developers who already manage their app's audio session can inject their own implementation, giving them full ownership over activation, deactivation, and interruption handling — which Apple expects to be app-controlled anyway. It also makes the audio layer independently testable.I would be happy to put together a draft PR if this direction sounds good.
All reactions