Seek video to start if position is small.

This commit is contained in:
John Preston 2018-10-31 14:22:36 +04:00
parent 5aa2e66d02
commit 2d1fdc4485
1 changed files with 7 additions and 0 deletions

View File

@ -1947,6 +1947,13 @@ void MediaView::toggleVideoPaused() {
}
void MediaView::restartVideoAtSeekPosition(TimeMs positionMs) {
// Seek works bad: it seeks to the next keyframe after positionMs.
// At least let user to seek to the beginning of the video.
if (positionMs < 1000
&& (!_videoDurationMs || (positionMs * 20 < _videoDurationMs))) {
positionMs = 0;
}
_autoplayVideoDocument = _doc;
if (_current.isNull()) {