Skip to content

Commit

Permalink
Fix js error when clicking play/pause when using video.js as viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Jun 17, 2024
1 parent 402faeb commit 9a87e29
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions web/skins/classic/views/js/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,15 @@ function progressBarNav() {

function handleClick(event) {
if (panZoomEnabled) {
const targetId = event.target.id;
if (!event.target.closest('#wrapperEventVideo')) {
return;
}

//event.preventDefault();
const monitorId = eventData.MonitorId; // Event page
if (event.target.id) {
//We are looking for an object with an ID, because there may be another element in the button.
var obj = event.target;
} else {
var obj = event.target.parentElement;
}
const obj = event.target.id ? event.target : event.target.parentElement;

if (obj.className.includes('btn-zoom-out') || obj.className.includes('btn-zoom-in')) return;
if (obj.className.includes('btn-edit-monitor')) {
Expand All @@ -1045,12 +1046,14 @@ function handleClick(event) {
}
}

const obj_id = obj.getAttribute('id');
//if (obj.getAttribute('id').indexOf("liveStream") >= 0 || obj.getAttribute('id').indexOf("button_zoom") >= 0) { //Montage & Watch page
if (obj.getAttribute('id').indexOf("evtStream") >= 0 ||
obj.getAttribute('id').indexOf("button_zoom") >= 0 ||
obj.querySelector('video')) { //Event page
if (obj_id && (
obj_id.indexOf("evtStream") >= 0 ||
obj_id.indexOf("button_zoom") >= 0 ||
obj.querySelector('video'))
) { //Event page
//panZoom[monitorId].setOptions({disablePan: false});

zmPanZoom.click(monitorId);
}
} else {
Expand Down

0 comments on commit 9a87e29

Please sign in to comment.