CreateJS / SoundJS

A Javascript library for working with Audio. It provides a consistent API for loading and playing audio on different browsers and devices. Currently supports WebAudio, HTML5 Audio, Cordova / PhoneGap, and a Flash fallback.
http://createjs.com/
MIT License
4.42k stars 838 forks source link

Adds Support for `{id:"", src:""}` Format... #318

Open probityrules opened 4 years ago

probityrules commented 4 years ago

This fixes a few issues with the {src: "path/to/file", id: "audioId"} format for both sound registration and sound removal:

  1. registerSounds passes the id to registerSound for each entry if it's defined.
  2. Registration accepts src property in a hash.
  3. Registration correctly accepts file-types in hash (parameter/variable name mismatch).
  4. Sound removal accepts {id: "audioId"} format to mirror sound registration, like SoundJS v1.
  5. Put in a rejection analogous to _fetchByUrlArray for _fetchByUrlHash since it appeared to be missing.