dweb-search-frontend
dweb-search-frontend copied to clipboard
Refactoring of Audio Player
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.