When padding video in editor, maintain video playback position in the same spot when possible

mike/debug-playlists
ElementalAlchemist 3 years ago committed by Mike Lang
parent 4bac4a46d0
commit a942af9cb4

@ -78,12 +78,20 @@ window.addEventListener("DOMContentLoaded", async (event) => {
rangesData.push({ start: rangeStartTime, end: rangeEndTime });
}
const videoElement = document.getElementById("video");
const currentVideoPosition = dateTimeFromVideoPlayerTime(videoElement.currentTime);
globalStartTimeString = wubloaderTimeFromDateTime(newStart);
globalEndTimeString = wubloaderTimeFromDateTime(newEnd);
updateSegmentPlaylist();
globalPlayer.once(Hls.Events.LEVEL_LOADED, (_data) => {
const newVideoPosition = videoPlayerTimeFromDateTime(currentVideoPosition);
if (newVideoPosition !== null) {
videoElement.currentTime = newVideoPosition;
}
let rangeErrorCount = 0;
for (const [rangeIndex, rangeData] of rangesData.entries()) {
const rangeContainer = rangeDefinitionsElements[rangeIndex];

Loading…
Cancel
Save