From 9b5bb2cd06115d431c6cd459eb6034108db0d98b Mon Sep 17 00:00:00 2001 From: j Date: Fri, 30 Jun 2023 15:45:03 +0530 Subject: [PATCH 1/3] fix setting place to null --- source/UI/js/Map/MapEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/UI/js/Map/MapEditor.js b/source/UI/js/Map/MapEditor.js index 1b358d7f..64b36988 100644 --- a/source/UI/js/Map/MapEditor.js +++ b/source/UI/js/Map/MapEditor.js @@ -1041,7 +1041,7 @@ Ox.MapEditor = function(options, self) { var isResult = place && place.id[0] == '_', isUndefined = !!self.options.selected && !self.$list.value(self.options.selected, 'type'); - self.selectedPlace = place.id || ''; + self.selectedPlace = place && place.id ? place.id : ''; if (isResult && isUndefined) { Ox.print('place.id', place.id, 'self.options.selected', self.options.selected, 'type', self.$list.value(self.options.selected)); // define undefined place From 0dfed9de74008e7cfc5d2e40f75f2af753e44d7a Mon Sep 17 00:00:00 2001 From: j Date: Fri, 30 Jun 2023 15:56:41 +0530 Subject: [PATCH 2/3] no annotations --- source/UI/js/Video/VideoPlayerPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/UI/js/Video/VideoPlayerPanel.js b/source/UI/js/Video/VideoPlayerPanel.js index a1908bcb..336277e4 100644 --- a/source/UI/js/Video/VideoPlayerPanel.js +++ b/source/UI/js/Video/VideoPlayerPanel.js @@ -478,7 +478,7 @@ Ox.VideoPlayerPanel = function(options, self) { } function getAnnotations() { - return Ox.flatten(self.options.layers.map(function(layer) { + return !self.options.layers ? [] : Ox.flatten(self.options.layers.map(function(layer) { return layer.items.map(function(item) { return {id: item.id, 'in': item['in'], out: item.out, text: item.value}; }); From 543045ae6c7dffe7b0ad567a385a5d235b9aa9e5 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 30 Jun 2023 15:56:59 +0530 Subject: [PATCH 3/3] 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() {