อ้างถึง
.html
โค๊ด:
<video height="270" width="480" poster="http://content.bitsontherun.com/thumbs/bkaovAYt-320.jpg" autoplay="" loop="" controls="">
<source src="http://content.bitsontherun.com/videos/bkaovAYt-52qL9xLP.mp4">
<source src="http://content.bitsontherun.com/videos/bkaovAYt-27m5HpIu.webm">
<p class="warning">Your browser does not support HTML5 video.</p>
</video>
.js
โค๊ด:
$(window).scroll(function() {
$('video').prop('volume', $(this).scrollTop() > 1 ? 0 : 1);
});