import howler from 'howler';

export default (depencencies, conf) => {
  const deps = {
    Howl: howler.Howl,
    ...depencencies,
  };

  const { sound = {}, settings = {} } = conf || {};
  const player = new deps.Howl(sound);

  if (settings.oneAtATime) {
    const play = player.play.bind(player);
    let lastPlay;
    player.play = function (...args) {
      if (lastPlay) {
        this.stop(lastPlay);
      }
      lastPlay = play(...args);
      return lastPlay;
    };
  }

  return player;
};

@@ -23,16 +23,392 @@
 wler';%0A%0A
+/**%0A * Create handler for sound player functionalities.%0A * This uses the %60howler%60 package to create a player.%0A * @param  %7BObject%7D depencencies%0A * @param  %7BFunction%7D depencencies.Howl%0A * @param  %7BObject%7D conf - Player configuration%0A * @param  %7BObject%7D conf.sound - Configuration passed to %60howler.Howl%60.%0A * @param  %7BObject%7D conf.settings - Sound settings%0A * @return %7BHowl%7D%0A */%0A
 export d

create player module