document.querySelectorAll('.btn__play, .aud').forEach(item => {
item.addEventListener('click', function(){
sd.play();
});
})
var btn = document.querySelector('.btn__play');
var aud = document.querySelector('.aud');
function playPause() {
btn.addEventListener('click', () => {
if($('.btn__play').text() === 'Pause') {
$('.btn__play').text('Play');
aud.pause();
} else {
$('.btn__play').text('Pause');
aud.play();
}
});
}
playPause();
<?php
$dir = 'temp/';
$path = scandir("temp");
?>
<?php foreach ($path as $f) {
if($f != '.' and $f != '..') { ?>
<video src = "<?=$dir.$f?>" controls width="500px" height="250px"></video>
<? } ?>
<? } ?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML-Формы</title>
</head>
<body>
<p>Форма для отправки</p>
<form action="form.php" method="post" enctype="multipart/form-data">
<input type="file" name="filename"><br>
<input type="submit" value="Отправить">
</form>
<?php
$path = scandir("temp");
foreach($path as $f){
if($f != '.' and $f != '..'){
echo $f."<br>";
}
}
?>
<video src="<?= $f ?>"></video>
</body>
</html>
document.querySelectorAll('.btn__play, .aud').forEach(item => {
if(item.classList('btn__play')) {
this.addEventListener('click', () => {
});
}
});
В итоге получил ошибку..