videojs/videojs-contrib-hls — pull request #143 by chikathreesix (2014-09-04 08:17:26+00:00)
Title: Abort XHR properly in setCurrentTime

Related to #141, when `this.segmentXhr_.abort()` is called in `videojs.Hls.prototype.setCurrentTime`, `onreadystatechange` in `videojs.Hls.xhr` is also called and it will increment mediaIndex in [the callback](https://github.com/videojs/videojs-contrib-hls/blob/master/src/videojs-hls.js#L406).
Because of this issue, my rewind button that rewind the video for 1 second didn't work properly. It pointed to the next segment so I couldn't rewind for a short period of time.

The abort method is supposed not to trigger `readystatechange` event according to [the specification](http://www.w3.org/TR/XMLHttpRequest/#the-abort()-method), so my suggestion is just setting null to onreadystatechange to abort XHR properly. This is like a workaround for the abort issue, so I think ideally videojs.Hls.xhr should return their own wrapper for native XHR that has its own abort method.