Support linking to specific times in restreamer

mike/debug-playlists
ElementalAlchemist 3 years ago committed by Mike Lang
parent 8e8ace6f3c
commit 210ae6f92a

@ -56,6 +56,9 @@
<div>
<button id="stream-time-settings-submit" type="submit">Load Playlist</button>
</div>
<div>
<a href="" id="stream-time-link">Link to this time range</a>
</div>
</form>
<video id="video" preload="auto"></video>

@ -7,6 +7,16 @@ var globalVideoTimeReference = TIME_FRAME_AGO;
window.addEventListener("DOMContentLoaded", async (event) => {
commonPageSetup();
const queryParams = new URLSearchParams(window.location.search);
if (queryParams.has("start")) {
document.getElementById("stream-time-frame-of-reference-utc").checked = true;
document.getElementById("stream-time-setting-start").value = queryParams.get("start");
if (queryParams.has("end")) {
document.getElementById("stream-time-setting-end").value = queryParams.get("end");
}
}
await loadDefaults();
const timeSettingsForm = document.getElementById("stream-time-settings");
@ -90,6 +100,15 @@ function updateTimeSettings() {
}
updateDownloadLink();
const startTime = getStartTime();
const endTime = getEndTime();
const queryParts = [];
queryParts.push(`start=${wubloaderTimeFromDateTime(startTime)}`);
if (endTime) {
queryParts.push(`end=${wubloaderTimeFromDateTime(endTime)}`);
}
document.getElementById("stream-time-link").href = `?${queryParts.join("&")}`;
}
function generateDownloadURL(startTime, endTime, downloadType, allowHoles, quality) {

Loading…
Cancel
Save