fregante / iphone-inline-video

📱 Make videos playable inline on the iPhone (prevents automatic fullscreen)
https://npm.im/iphone-inline-video
MIT License
2.05k stars 300 forks source link

Setting of volume or mute/unmute while playing is not working. #111

Closed windchime18 closed 7 years ago

windchime18 commented 7 years ago

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>

fregante commented 7 years ago

iOS does not support volume changes.

Mute toggling is tracked in #56

windchime18 commented 7 years ago

Thank you for your prompt reply. :) 👍