cladera / videojs-offset

VideoJS plugin for play a segment of a video.
MIT License
64 stars 43 forks source link

Issue with _restartBeginning = false #70

Open ducto opened 3 years ago

ducto commented 3 years ago

Description

When I tried to set _restartBeginning = false and have the video reached the end then replay, it does not start at the beginning of the offset we set

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. Init videojs offset with _restartBeginning = false, play the video until it reaches the end. To make the issue clearly observe-able, please set the offsetStart around ~ 00:01 second
  2. Press replay button

Results

Expected

The video replay at the video's offsetStart position

Actual

The video replay at the this._offsetEnd - this._offsetStart position and if we set _offsetStart = 1 second, the video just replay in 1 second then stop

Error output

If there are any errors at all, please include them here.

Additional Information

In onPlayerTimeUpdate function, I found that:

if (!this._restartBeginning) { this.currentTime(this._offsetEnd - this._offsetStart); } else { .... }

versions

videojs

what version of videojs does this occur with?

browsers

what browser are affected?

OSes

what platforms (operating systems and devices) are affected?

plugins

are any videojs plugins being used on the page? If so, please list them below.

roypardi commented 3 years ago

I see this too – and am struggling to figure out how to fix it.