From 8822463ac7511dd2104d9ef8dd45415eee53ae32 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 17 Feb 2022 13:30:50 -0500 Subject: [PATCH] Handle empty endtime more gracefully. If there is a next event just jump to it. --- web/skins/classic/views/js/event.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index 94e132cc1..6e12c6b59 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -52,14 +52,19 @@ function vjsReplay() { var overLaid = $j("#videoobj"); overLaid.append('

No more events

'); } else { - var endTime = (Date.parse(eventData.EndDateTime)).getTime(); + if (!eventData.EndDateTime) { + // No EndTime but have a next event, just go to it. + streamNext(true); + return; + } + var endTime = Date.parse(eventData.EndDateTime).getTime(); var nextStartTime = nextEventStartTime.getTime(); //nextEventStartTime.getTime() is a mootools workaround, highjacks Date.parse if ( nextStartTime <= endTime ) { streamNext(true); return; } - var overLaid = $j("#videoobj"); vid.pause(); + var overLaid = $j("#videoobj"); overLaid.append('

'); var gapDuration = (new Date().getTime()) + (nextStartTime - endTime); var messageP = $j('.vjsMessage');