diff --git a/thrimbletrimmer/scripts/IO.js b/thrimbletrimmer/scripts/IO.js index c682c69..cc69803 100644 --- a/thrimbletrimmer/scripts/IO.js +++ b/thrimbletrimmer/scripts/IO.js @@ -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, { diff --git a/thrimbletrimmer/scripts/playerSetup.js b/thrimbletrimmer/scripts/playerSetup.js index 35776f2..75a47d1 100644 --- a/thrimbletrimmer/scripts/playerSetup.js +++ b/thrimbletrimmer/scripts/playerSetup.js @@ -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; };