From 543045ae6c7dffe7b0ad567a385a5d235b9aa9e5 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 30 Jun 2023 15:56:59 +0530 Subject: [PATCH] no chapters --- source/UI/js/Video/VideoPlayer.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/UI/js/Video/VideoPlayer.js b/source/UI/js/Video/VideoPlayer.js index 8df95916..9a15bcf4 100644 --- a/source/UI/js/Video/VideoPlayer.js +++ b/source/UI/js/Video/VideoPlayer.js @@ -1794,20 +1794,22 @@ Ox.VideoPlayer = function(options, self) { function goToNext(type, direction) { // type can be 'chapter' or 'result' var position, positions; - if (type == 'chapter') { + if (type == 'chapter' && self.options.chapters) { positions = self.options.chapters.map(function(chapter) { return chapter.position; }); - } else if (type == 'result') { + } else if (type == 'result' && self.results) { positions = Ox.unique(self.results.map(function(result) { return result['in']; })); } - position = Ox.nextValue(positions, self.options.position, direction); - setPosition(position); - that.triggerEvent('position', { - position: self.options.position - }); + if (positions) { + position = Ox.nextValue(positions, self.options.position, direction); + setPosition(position); + that.triggerEvent('position', { + position: self.options.position + }); + } } function goToPoint() {