no chapters

This commit is contained in:
j 2023-06-30 15:56:59 +05:30
parent 0dfed9de74
commit 543045ae6c

View file

@ -1794,21 +1794,23 @@ 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'];
}));
}
if (positions) {
position = Ox.nextValue(positions, self.options.position, direction);
setPosition(position);
that.triggerEvent('position', {
position: self.options.position
});
}
}
function goToPoint() {
that.triggerEvent('gotopoint');