I want to create an angularJS audio player based on soundmanager2. Before starting coding, I'm looking for advices on my current thought.
I plan to separate both player logic (sound manager wrapper) and player controls (buttons / scrubber)
I will also bootstrap the soundmanager with angular using .run()
The sound manager will be wrapped into a factory (soundplayer) and will return a soundmanager2 instance
The sound controls (buttons and scrubber + ideally a waveform if webaudio is supported) will be handled trough a directive (soundControls) wich will receive a soundplayer instance
What do you thinks ? Am I over engeeneering it, re-inventing the wheel or Am I on a good way ? Advices are welcome.
Thanks!
I finally opted for an event based communication. Once the directive is created, I emit an object containing the API I want to expose.
And from in my controller I handle this