|
|
@ -272,13 +272,13 @@ window.addEventListener("DOMContentLoaded", async (event) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const imageTemplate = document.getElementById("video-info-thumbnail-template").value;
|
|
|
|
const imageTemplate = document.getElementById("video-info-thumbnail-template").value;
|
|
|
|
const [crop, loc] = getTemplatePosition();
|
|
|
|
const [crop, loc] = getTemplatePosition();
|
|
|
|
const queryParts = [
|
|
|
|
const query = new URLSearchParams({
|
|
|
|
`timestamp=${imageTime}`,
|
|
|
|
timestamp: imageTime,
|
|
|
|
`template=${imageTemplate}`,
|
|
|
|
template: imageTemplate,
|
|
|
|
`crop=${crop.join(",")}`,
|
|
|
|
crop: crop.join(","),
|
|
|
|
`location=${loc.join(",")}`,
|
|
|
|
location: loc.join(","),
|
|
|
|
];
|
|
|
|
});
|
|
|
|
imageElement.src = `/thumbnail/${globalStreamName}/source.png?${queryParts.join("&")}`;
|
|
|
|
imageElement.src = `/thumbnail/${globalStreamName}/source.png?${query}`;
|
|
|
|
imageElement.classList.remove("hidden");
|
|
|
|
imageElement.classList.remove("hidden");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -831,8 +831,8 @@ function updateWaveform() {
|
|
|
|
let waveformURL =
|
|
|
|
let waveformURL =
|
|
|
|
"/waveform/" + globalStreamName + "/" + videoInfo.video_quality + ".png?size=1920x125&";
|
|
|
|
"/waveform/" + globalStreamName + "/" + videoInfo.video_quality + ".png?size=1920x125&";
|
|
|
|
|
|
|
|
|
|
|
|
const queryStringParts = startAndEndTimeQueryStringParts();
|
|
|
|
const query = startAndEndTimeQuery();
|
|
|
|
waveformURL += queryStringParts.join("&");
|
|
|
|
waveformURL += query.toString();
|
|
|
|
|
|
|
|
|
|
|
|
const waveformElem = document.getElementById("waveform");
|
|
|
|
const waveformElem = document.getElementById("waveform");
|
|
|
|
waveformElem.src = waveformURL;
|
|
|
|
waveformElem.src = waveformURL;
|
|
|
@ -1374,7 +1374,10 @@ function handleLeavePage(event) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function generateDownloadURL(timeRanges, transitions, downloadType, allowHoles, quality) {
|
|
|
|
function generateDownloadURL(timeRanges, transitions, downloadType, allowHoles, quality) {
|
|
|
|
const queryParts = [`type=${downloadType}`, `allow_holes=${allowHoles}`];
|
|
|
|
const query = new URLSearchParams({
|
|
|
|
|
|
|
|
type: downloadType,
|
|
|
|
|
|
|
|
allow_holes: allowHoles,
|
|
|
|
|
|
|
|
});
|
|
|
|
for (const range of timeRanges) {
|
|
|
|
for (const range of timeRanges) {
|
|
|
|
let timeRangeString = "";
|
|
|
|
let timeRangeString = "";
|
|
|
|
if (range.hasOwnProperty("start")) {
|
|
|
|
if (range.hasOwnProperty("start")) {
|
|
|
@ -1384,13 +1387,13 @@ function generateDownloadURL(timeRanges, transitions, downloadType, allowHoles,
|
|
|
|
if (range.hasOwnProperty("end")) {
|
|
|
|
if (range.hasOwnProperty("end")) {
|
|
|
|
timeRangeString += range.end;
|
|
|
|
timeRangeString += range.end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
queryParts.push(`range=${timeRangeString}`);
|
|
|
|
query.append("range", timeRangeString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (const transition of transitions) {
|
|
|
|
for (const transition of transitions) {
|
|
|
|
queryParts.push(`transition=${transition}`);
|
|
|
|
query.append("transition", transition);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const downloadURL = `/cut/${globalStreamName}/${quality}.ts?${queryParts.join("&")}`;
|
|
|
|
const downloadURL = `/cut/${globalStreamName}/${quality}.ts?${query.toString()}`;
|
|
|
|
return downloadURL;
|
|
|
|
return downloadURL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|