videojs/video.js — pull request #1588 by heff (2014-10-16 01:13:36+00:00)
Title: Automatic cleanup of listeners on other components

Implemented half of #1544. Now instead of using:

player.on('some-event', vjs.bind(this, fn));

You can use:

this.on(player, 'some-event', fn);

Using the second form will automatically clean up the listener whenever either the player or the component is disposed. And 'player' can be replaced with any other component.

When implementing this in existing components I found a few places we weren't removing listeners on dispose, and they should be fixed now with this.