dweb-search-frontend icon indicating copy to clipboard operation
dweb-search-frontend copied to clipboard

Refactoring of Audio Player

Open femans opened this issue 2 years ago • 0 comments

The audio player software has become more complex than necessary.

audioControls.ts has a reactive object that implements the IAudio interface, which references a player that implements the IMediaPlayer interface. The IAudio object passes itself as a context to the player, so that callbacks can be made to update the reactive values.

This IMediaPlayer interface shadows the Howl player, which is slightly impractical in usage (in a reactive environment), making the IMediaPlayer less than ideal.

Because of this structure, a lot of calls hence and forth need to be made between the IAudio object and IMediaPlayer callbacks.

Potentially, the IMediaPlayer interface and the IAudio interface could be combined into a single MediaPlayer class, making the code easier to analyze and maintain.

femans avatar Sep 27 '22 14:09 femans