|
|
@ -17,7 +17,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const newStartField = document.getElementById("stream-time-setting-start");
|
|
|
|
const newStartField = document.getElementById("stream-time-setting-start");
|
|
|
|
const newStart = dateObjFromInputTime(newStartField.value);
|
|
|
|
const newStart = dateObjFromBusTime(newStartField.value);
|
|
|
|
if (!newStart) {
|
|
|
|
if (!newStart) {
|
|
|
|
addError("Failed to parse start time");
|
|
|
|
addError("Failed to parse start time");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -26,7 +26,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
|
|
|
|
const newEndField = document.getElementById("stream-time-setting-end");
|
|
|
|
const newEndField = document.getElementById("stream-time-setting-end");
|
|
|
|
let newEnd = null;
|
|
|
|
let newEnd = null;
|
|
|
|
if (newEndField.value !== "") {
|
|
|
|
if (newEndField.value !== "") {
|
|
|
|
newEnd = dateObjFromInputTime(newEndField.value);
|
|
|
|
newEnd = dateObjFromBusTime(newEndField.value);
|
|
|
|
if (!newEnd) {
|
|
|
|
if (!newEnd) {
|
|
|
|
addError("Failed to parse end time");
|
|
|
|
addError("Failed to parse end time");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -54,8 +54,8 @@ window.addEventListener("DOMContentLoaded", async (event) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
globalStartTimeString = getWubloaderTimeFromDateWithMilliseconds(newStart);
|
|
|
|
globalStartTimeString = wubloaderTimeFromDateObj(newStart);
|
|
|
|
globalEndTimeString = getWubloaderTimeFromDateWithMilliseconds(newEnd);
|
|
|
|
globalEndTimeString = wubloaderTimeFromDateObj(newEnd);
|
|
|
|
|
|
|
|
|
|
|
|
updateSegmentPlaylist();
|
|
|
|
updateSegmentPlaylist();
|
|
|
|
|
|
|
|
|
|
|
@ -98,31 +98,25 @@ window.addEventListener("DOMContentLoaded", async (event) => {
|
|
|
|
document.getElementById("stream-time-setting-start-pad").addEventListener("click", (_event) => {
|
|
|
|
document.getElementById("stream-time-setting-start-pad").addEventListener("click", (_event) => {
|
|
|
|
const startTimeField = document.getElementById("stream-time-setting-start");
|
|
|
|
const startTimeField = document.getElementById("stream-time-setting-start");
|
|
|
|
let startTime = startTimeField.value;
|
|
|
|
let startTime = startTimeField.value;
|
|
|
|
startTime = parseInputTimeAsNumberOfSeconds(startTime);
|
|
|
|
startTime = dateObjFromBusTime(startTime);
|
|
|
|
if (isNaN(startTime)) {
|
|
|
|
if (isNaN(startTime)) {
|
|
|
|
addError("Couldn't parse entered start time for padding");
|
|
|
|
addError("Couldn't parse entered start time for padding");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
startTime -= 60;
|
|
|
|
startTime.setMinutes(startTime.getMinutes() - 1);
|
|
|
|
const startTimeDate = new Date(globalBusStartTime);
|
|
|
|
startTimeField.value = busTimeFromDateObj(startTime);
|
|
|
|
startTimeDate.setSeconds(startTimeDate.getSeconds() + startTime);
|
|
|
|
|
|
|
|
startTime = getBusTimeFromDateObj(startTimeDate);
|
|
|
|
|
|
|
|
startTimeField.value = startTime;
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("stream-time-setting-end-pad").addEventListener("click", (_event) => {
|
|
|
|
document.getElementById("stream-time-setting-end-pad").addEventListener("click", (_event) => {
|
|
|
|
const endTimeField = document.getElementById("stream-time-setting-end");
|
|
|
|
const endTimeField = document.getElementById("stream-time-setting-end");
|
|
|
|
let endTime = endTimeField.value;
|
|
|
|
let endTime = endTimeField.value;
|
|
|
|
endTime = parseInputTimeAsNumberOfSeconds(endTime);
|
|
|
|
endTime = dateObjFromBusTime(endTime);
|
|
|
|
if (isNaN(endTime)) {
|
|
|
|
if (isNaN(endTime)) {
|
|
|
|
addError("Couldn't parse entered end time for padding");
|
|
|
|
addError("Couldn't parse entered end time for padding");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
endTime += 60;
|
|
|
|
endTime.setMinutes(endTime.getMinutes() + 1);
|
|
|
|
const endTimeDate = new Date(globalBusStartTime);
|
|
|
|
endTimeField.value = busTimeFromDateObj(endTime);
|
|
|
|
endTimeDate.setSeconds(endTimeDate.getSeconds() + endTime);
|
|
|
|
|
|
|
|
endTime = getBusTimeFromDateObj(endTimeDate);
|
|
|
|
|
|
|
|
endTimeField.value = endTime;
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const addRangeIcon = document.getElementById("add-range-definition");
|
|
|
|
const addRangeIcon = document.getElementById("add-range-definition");
|
|
|
@ -245,9 +239,9 @@ async function initializeVideoInfo() {
|
|
|
|
eventEndTime.setMinutes(eventEndTime.getMinutes() + 2);
|
|
|
|
eventEndTime.setMinutes(eventEndTime.getMinutes() + 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
globalStartTimeString = getWubloaderTimeFromDateWithMilliseconds(eventStartTime);
|
|
|
|
globalStartTimeString = wubloaderTimeFromDateObj(eventStartTime);
|
|
|
|
if (eventEndTime) {
|
|
|
|
if (eventEndTime) {
|
|
|
|
globalEndTimeString = getWubloaderTimeFromDateWithMilliseconds(eventEndTime);
|
|
|
|
globalEndTimeString = wubloaderTimeFromDateObj(eventEndTime);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
document.getElementById("waveform").classList.add("hidden");
|
|
|
|
document.getElementById("waveform").classList.add("hidden");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -282,13 +276,13 @@ async function initializeVideoInfo() {
|
|
|
|
|
|
|
|
|
|
|
|
if (earliestStartTime && earliestStartTime < eventStartTime) {
|
|
|
|
if (earliestStartTime && earliestStartTime < eventStartTime) {
|
|
|
|
earliestStartTime.setMinutes(earliestStartTime.getMinutes() - 1);
|
|
|
|
earliestStartTime.setMinutes(earliestStartTime.getMinutes() - 1);
|
|
|
|
globalStartTimeString = getWubloaderTimeFromDateWithMilliseconds(earliestStartTime);
|
|
|
|
globalStartTimeString = wubloaderTimeFromDateObj(earliestStartTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (latestEndTime && latestEndTime > eventEndTime) {
|
|
|
|
if (latestEndTime && latestEndTime > eventEndTime) {
|
|
|
|
// If we're getting the time from a previous draft edit, we have seconds, so one minute is enough
|
|
|
|
// If we're getting the time from a previous draft edit, we have seconds, so one minute is enough
|
|
|
|
latestEndTime.setMinutes(latestEndTime.getMinutes() + 1);
|
|
|
|
latestEndTime.setMinutes(latestEndTime.getMinutes() + 1);
|
|
|
|
globalEndTimeString = getWubloaderTimeFromDateWithMilliseconds(latestEndTime);
|
|
|
|
globalEndTimeString = wubloaderTimeFromDateObj(latestEndTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -466,10 +460,10 @@ function getBusTimeFromTimeString(timeString) {
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const time = dateObjFromWubloaderTime(timeString);
|
|
|
|
const time = dateObjFromWubloaderTime(timeString);
|
|
|
|
return getBusTimeFromDateObj(time);
|
|
|
|
return busTimeFromDateObj(time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getBusTimeFromDateObj(time) {
|
|
|
|
function busTimeFromDateObj(time) {
|
|
|
|
const busTimeMilliseconds = time - globalBusStartTime;
|
|
|
|
const busTimeMilliseconds = time - globalBusStartTime;
|
|
|
|
let remainingBusTimeSeconds = busTimeMilliseconds / 1000;
|
|
|
|
let remainingBusTimeSeconds = busTimeMilliseconds / 1000;
|
|
|
|
|
|
|
|
|
|
|
@ -638,11 +632,11 @@ function generateDownloadURL(timeRanges, downloadType, allowHoles, quality) {
|
|
|
|
for (const range of timeRanges) {
|
|
|
|
for (const range of timeRanges) {
|
|
|
|
let timeRangeString = "";
|
|
|
|
let timeRangeString = "";
|
|
|
|
if (range.hasOwnProperty("start")) {
|
|
|
|
if (range.hasOwnProperty("start")) {
|
|
|
|
timeRangeString += getWubloaderTimeFromDateWithMilliseconds(range.start);
|
|
|
|
timeRangeString += wubloaderTimeFromDateObj(range.start);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
timeRangeString += ",";
|
|
|
|
timeRangeString += ",";
|
|
|
|
if (range.hasOwnProperty("end")) {
|
|
|
|
if (range.hasOwnProperty("end")) {
|
|
|
|
timeRangeString += getWubloaderTimeFromDateWithMilliseconds(range.end);
|
|
|
|
timeRangeString += wubloaderTimeFromDateObj(range.end);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
queryParts.push(`range=${timeRangeString}`);
|
|
|
|
queryParts.push(`range=${timeRangeString}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1057,14 +1051,6 @@ function wubloaderTimeFromVideoHumanTime(videoHumanTime) {
|
|
|
|
return wubloaderTimeFromVideoPlayerTime(videoPlayerTime);
|
|
|
|
return wubloaderTimeFromVideoPlayerTime(videoPlayerTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dateObjFromInputTime(inputTime) {
|
|
|
|
|
|
|
|
const inputSeconds = parseInputTimeAsNumberOfSeconds(inputTime);
|
|
|
|
|
|
|
|
if (isNaN(inputSeconds)) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Date(globalBusStartTime.getTime() + 1000 * inputSeconds);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getPlaylistData() {
|
|
|
|
function getPlaylistData() {
|
|
|
|
const player = getVideoJS();
|
|
|
|
const player = getVideoJS();
|
|
|
|
// Currently, this only supports a single playlist. We only give one playlist (or master playlist file) to VideoJS,
|
|
|
|
// Currently, this only supports a single playlist. We only give one playlist (or master playlist file) to VideoJS,
|
|
|
|