Is it possible to unmute or change the volume while playing the video? I have tried it but it wont work.
var video = document.querySelector('video');enableInlineVideo(video);video.addEventListener('touchstart', function () {if (video.paused === false) {video.pause();}else{video.play();}});$('#volume').on('change', function() {$("#video").removeAttr('muted');video.volume=this.value;console.log(video.volume);});
Is it possible to unmute or change the volume while playing the video? I have tried it but it wont work.
var video = document.querySelector('video');
enableInlineVideo(video);
video.addEventListener('touchstart', function () {
if (video.paused === false) {
video.pause();
}
else{
video.play();
}
});
$('#volume').on('change', function() {
$("#video").removeAttr('muted');
video.volume=this.value;
console.log(video.volume);
});
<video id="video" autoplay muted playsinline src="file.mp4"></video>
<br><br>
<div id="video-controls">
<input type="range" id="volume" min="0" max="1" step="0.1" value="1" />
</div>