I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.

I want to be able to log the start and end times of any seeks within the plaback, so we know if the user has not actually watched a section of the video. The player seems to offer events to support this, but I am struggling to get correct timings from it.

When the user skips through a video the player emits the following events in order: pause, seeking, seeked, play.

If I query the player object at any of these events using currentTime() the result is always the end time for the seek, even on the initial pause event. This means I can log where the seek ended but not where it started.

Can anyone help me to find the position in the video where the seek begins?

If this is not possible, I'd settle for a way to disable seeking during playback.

EDIT: adding code as requested. It's pretty simple:

```
var trackedPlayer = videojs('pvp-player');

trackedPlayer.on("play", function (e) {
    console.log("Video playback started: " + trackedPlayer.currentTime());
});

trackedPlayer.on("pause", function (e) {
    console.log("Video playback paused: " + trackedPlayer.currentTime());
});

trackedPlayer.on("seeking", function (e) {
    console.log("Video seeking: " + trackedPlayer.currentTime());
});

trackedPlayer.on("seeked", function (e) {
    console.log("Video seek ended: " + trackedPlayer.currentTime());
});

trackedPlayer.on("ended", function (e) {
    console.log("Video playback ended.");
});

```

If I can get all the tracking I want I will replace console.log with ajax calls to store the data.
['https://Stackoverflow.com/questions/29743729', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664914/']
For a more accurate solution, you can listen to the events that trigger the seek such as mousedown on progress bar, left key, right key etc., and get the current time from these events.
For example in version 7.10.2 you can do the following,

```
let seekStartTime;

player.controlBar.progressControl.on('mousedown', () => seekStartTime = player.currentTime());
player.controlBar.progressControl.seekBar.on('mousedown', () => seekStartTime = player.currentTime());
player.on('keydown', (e) => {
    if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
         seekStartTime = player.currentTime();
    }
});

console.log(seekStartTime);

```

**Note 1:** There are two seperate mousedown event listeners for progress control and seek bar. This is because the video can be seeked by clicking outside the seek bar on the progress control as well.

**Note 2:** Seeking using hotkey numbers does not pause the video. However, if necessary you can add those keydown listeners too.
Try with this code to know the length of video.

```
var duration = document.getElementById("duration");
var vid_duration = Math.round(document.getElementById("video").duration);
    //alert(vid_duration);
duration.innerHTML = vid_duration;
    //duration.firstChild.nodeValue = vid_duration;

```