johndyer/mediaelement — pull request #779 by odnamrataizem (2013-02-26 10:30:39+00:00)
Title: Properly clean up player when calling MediaElementPlayer.remove()

(taking a shot at #653 and #670)

Some features manipulate elements outside the player container (including but not limited to attaching events to `document` and `window`), which are not properly reversed when calling `MediaElementPlayer.remove()`.

This commit does the following changes to enable easy cleanup:
- features can now specify cleanup routines, named 'clean' + feature name;
- `mejs.players` is now a hash keyed by the players' IDs;
- new `MediaElementPlayer` methods: `globalBind()` and `globalUnbind()`, which are simple wrappers to event (un)binding to `document` and/or `window` that use the player ID as a namespace.