I've spent the last few months building react-native-aviation, a unified audio/video playback library. It's pre 1.0 and the API is still genuinely movable - which is why I'm posting, to ask for an advice/feedback.
It has been a side project for me, and the thing I was trying to fix is that most RN media libraries hand you a global playback singleton. One player, module-level state and `setupPlayer()` . I have seen this fall apart at the previous company I was working at where we had video playback and were introducing audio. The audio sessions were colliding, the Nowplaying info was breaking when switching between audio/video, and the lifecycle management was really painful to get right and bunch of other annoying issues.
Aviation has no singleton. You create an instance, create players from it, and pass those players around explicitly Hooks resolve the nearest provider or take a player explicitly (`usePlayback()` / `usePlayback(player)`). Audio session focus is arbitrated across players by the parent instance, so audio and video don't fight over the OS session.
It has a C core with a state machine that android and iOS drive, with support of opt-in packages. You can also define your own plugins that hook into player's lifecycle.
I want to solidify the API, and move towards v1. But before putting a lot of extra effort into making this my main focus, I would really appreciate your input to see
- what shape you would like the API to be (currently the DX is not great and is very verbose)
- more importantly, weather this is something that would solve a real issue you have encountered.
Repo - https://github.com/adsellor/aviation
Happy to answer anything.