UI updates

This commit is contained in:
biglyderv 2024-11-25 14:12:43 -05:00
parent 59c1daeac5
commit 95fde911c5
7 changed files with 241 additions and 36 deletions

View file

@ -37,12 +37,12 @@ function prog(vid, bar) {
}
function controls(vid) {
let isFull = false;
let bar = vid.querySelector('.progressbar');
let video = vid.querySelector('video');
let play = vid.querySelector('.play');
video.onclick = play.onclick = () => {
play.querySelector('img').src = !video.paused ? '/static/img/play.svg' : '/static/img/stop.svg';
if (video.paused) {
@ -52,6 +52,16 @@ function controls(vid) {
video.pause();
}
vid.querySelector('.full').onclick = (e) => {
isFull = !isFull;
e.target.src = isFull ? '/static/img/tiny.svg' : '/static/img/full.svg';
if (isFull) {
vid.classList.add('full')
} else {
vid.classList.remove('full')
}
}
bar.onclick = (e) => moveBar(e, bar, video);
video.addEventListener('timeupdate', () => prog(video,bar));