Really, if you seek past the end you go back to the beginning?  That's a change from the old code which just seeks to the end of the video in this case.  Though note that the math is pretty goofy there... you have player.currentTime = player.currentTime + player.duration - player.currentTime. 

If we've seeked past the end, set seekTime to player.duration. If we've seekd past the beginning, set seekTime to 0.

Then just fastSeek to seekTime