mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-13 00:58:08 +01:00
remove unneeded stuff :3
This commit is contained in:
parent
3b6c9789f9
commit
2eb634d12e
1 changed files with 1 additions and 45 deletions
46
css/app.js
46
css/app.js
|
@ -27,16 +27,6 @@ url.searchParams.delete('fx');
|
||||||
history.replaceState(null, '', url.toString());
|
history.replaceState(null, '', url.toString());
|
||||||
|
|
||||||
|
|
||||||
// Retrieve volume from local storage or set to max if not available
|
|
||||||
const initialVolume = localStorage.getItem('playerVolume') || 1;
|
|
||||||
const video = document.getElementById('video');
|
|
||||||
video.volume = initialVolume;
|
|
||||||
|
|
||||||
// Save volume to local storage whenever it changes
|
|
||||||
video.addEventListener('volumechange', function() {
|
|
||||||
localStorage.setItem('playerVolume', this.volume);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Get the progress bar and container elements
|
// Get the progress bar and container elements
|
||||||
const progressBar = document.querySelector(".progress-bar");
|
const progressBar = document.querySelector(".progress-bar");
|
||||||
const progressContainer = document.querySelector(".progress-container");
|
const progressContainer = document.querySelector(".progress-container");
|
||||||
|
@ -176,44 +166,10 @@ function time(seconds) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Save and resume video progress
|
|
||||||
const videoId = new URLSearchParams(window.location.search).get('v');
|
|
||||||
const localStorageKey = `progress-${videoId}`;
|
|
||||||
|
|
||||||
function saveProgress() {
|
|
||||||
localStorage.setItem(localStorageKey, video.currentTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeProgress() {
|
|
||||||
localStorage.removeItem(localStorageKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resumeProgress() {
|
|
||||||
const progress = localStorage.getItem(localStorageKey);
|
|
||||||
if (progress) {
|
|
||||||
video.currentTime = progress;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('beforeunload', () => {
|
|
||||||
saveProgress();
|
|
||||||
});
|
|
||||||
|
|
||||||
video.addEventListener('ended', () => {
|
|
||||||
removeProgress();
|
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
|
||||||
resumeProgress();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Adjust video element style on fullscreen change
|
// Adjust video element style on fullscreen change
|
||||||
const videoElement = document.getElementById("video");
|
const videoElement = document.getElementById("video");
|
||||||
videoElement.addEventListener("fullscreenchange", () => {
|
videoElement.addEventListener("fullscreenchange", () => {
|
||||||
videoElement.style.borderRadius = document.fullscreenElement === videoElement ? "0em" : "16px";
|
videoElement.style.borderRadius = document.fullscreenElement === videoElement ? "0em !important" : "16px";
|
||||||
});
|
});
|
||||||
|
|
||||||
function fetchUrls(urls) {
|
function fetchUrls(urls) {
|
||||||
|
|
Loading…
Reference in a new issue