Fix breakage of the stream page

pull/235/head
ElementalAlchemist 3 years ago committed by Mike Lang
parent 2508610b4e
commit 6fc8710166

@ -138,11 +138,15 @@ function generateDownloadURL(startTime, endTime, downloadType, allowHoles, quali
const endURLTime = getWubloaderTimeFromDate(endTime); const endURLTime = getWubloaderTimeFromDate(endTime);
const queryParts = [ const queryParts = [
`start=${startURLTime}`,
`end=${endURLTime}`,
`type=${downloadType}`, `type=${downloadType}`,
`allow_holes=${allowHoles}`, `allow_holes=${allowHoles}`,
]; ];
if (startURLTime) {
queryParts.push(`start=${startURLTime}`);
}
if (endURLTime) {
queryParts.push(`end=${endURLTime}`);
}
const downloadURL = `/cut/${globalStreamName}/${quality}.ts?${queryParts.join("&")}`; const downloadURL = `/cut/${globalStreamName}/${quality}.ts?${queryParts.join("&")}`;
return downloadURL; return downloadURL;

@ -1,10 +1,10 @@
var globalLoadedVideoPlayer = false;
var globalVideoTimeReference = TIME_FRAME_AGO;
const TIME_FRAME_UTC = 1; const TIME_FRAME_UTC = 1;
const TIME_FRAME_BUS = 2; const TIME_FRAME_BUS = 2;
const TIME_FRAME_AGO = 3; const TIME_FRAME_AGO = 3;
var globalLoadedVideoPlayer = false;
var globalVideoTimeReference = TIME_FRAME_AGO;
window.addEventListener("DOMContentLoaded", async (event) => { window.addEventListener("DOMContentLoaded", async (event) => {
commonPageSetup(); commonPageSetup();
const timeSettingsForm = document.getElementById("stream-time-settings"); const timeSettingsForm = document.getElementById("stream-time-settings");
@ -78,7 +78,9 @@ function updateTimeSettings() {
updateDownloadLink(); updateDownloadLink();
if (getEndTime() < getStartTime()) { const startTime = getStartTime();
const endTime = getEndTime();
if (endTime && endTime < startTime) {
addError( addError(
"End time is before the start time. This will prevent video loading and cause other problems." "End time is before the start time. This will prevent video loading and cause other problems."
); );

Loading…
Cancel
Save