thrimbletrimmer: Handle getting trim time when no valid trim time is set

Just return null instead
pull/163/head
Mike Lang 5 years ago
parent dbad2b4082
commit 58a2a0402d

@ -248,6 +248,9 @@ thrimbletrimmerSubmit = function(state) {
console.log(wubData);
console.log(JSON.stringify(wubData));
if (!wubData.video_start) {alert("No start time set"); return;}
if (!wubData.video_end) {alert("No end time set"); return;}
//Submit to thrimshim
var rowId = /id=(.*)(?:&|$)/.exec(document.location.search)[1];
fetch("/thrimshim/"+rowId, {

@ -87,6 +87,8 @@ getRealTimeForPlayerTime = function(discontinuities, playbackIndex) {
streamStart = lastDiscontinuity.segmentTimestamp;
playbackIndex -= lastDiscontinuity.playbackIndex;
}
return new Date(streamStart.getTime()+playbackIndex*1000).toISOString();
var realTime = streamStart.getTime()+playbackIndex*1000;
return (isFinite(realTime)) ? new Date(realTime).toISOString() : null;
};

Loading…
Cancel
Save