UI updates
This commit is contained in:
parent
59c1daeac5
commit
95fde911c5
7 changed files with 241 additions and 36 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue