zohararad/audio5js — pull request #54 by mikerudolph (2014-12-04 21:59:07+00:00)
Title: Properly ensure events are only bound to listeners once.

Related to issue https://github.com/zohararad/audio5js/issues/53

using `.bind()` returns a new function so previously when binding event listeners onto the HTML5 DOM element there was no correct reference being passed when calling `unbindEvents` this left event listeners being leaked and never unbound properly. This fixes issue #53 because all events now are properly unbound before `setAttribute('src', '');` gets called in the destroy method which throws an error.

We should still keep issue #53 open as after reading the docs, calling `setAttribute('src', '');` forces the Audio element to attempt to load the current page as the source value.