Move the error selecting times on restreamer to be common to both pages

pull/264/head
ElementalAlchemist 3 years ago committed by Mike Lang
parent ac79206ba0
commit 91cc331128

@ -74,6 +74,13 @@ async function loadVideoPlayer(playlistURL) {
globalPlayer.attachMedia(video);
return new Promise((resolve, _reject) => {
globalPlayer.on(Hls.Events.MEDIA_ATTACHED, () => {
const startTime = getStartTime();
const endTime = getEndTime();
if (endTime && endTime.diff(startTime).milliseconds < 0) {
addError(
"End time is before the start time. This will prevent video loading and cause other problems."
);
}
globalPlayer.loadSource(rangedPlaylistURL);
globalPlayer.on(Hls.Events.ERROR, (_event, data) => {

@ -90,14 +90,6 @@ function updateTimeSettings() {
}
updateDownloadLink();
const startTime = getStartTime();
const endTime = getEndTime();
if (endTime && endTime.diff(startTime).milliseconds < 0) {
addError(
"End time is before the start time. This will prevent video loading and cause other problems."
);
}
}
function generateDownloadURL(startTime, endTime, downloadType, allowHoles, quality) {

Loading…
Cancel
Save