0
我使用JavaScript插件,能够播放背景全宽YouTube视频:暂停/恢复YouTube视频时,在视野(滚动)
<script>
$(document).ready(function() {
$(".player").mb_YTPlayer();
});
</script>
<script>
var vids = ["list of videos"
]; // create your list of youtube videos
var currVid = vids[Math.floor(Math.random()*(vids.length-1))]; // this will grab a random video from the array.
var opts = { // keep all the options in an object
videoURL: currVid, // set the video to display
containment:'.video-section',
quality:'large',
autoPlay:true,
mute:true,
opacity:1
}
$(document).ready(function(){
document.getElementById("bgndVideo").dataset.property = JSON.stringify(opts); // change to this
$(".player").mb_YTPlayer(); // play!
});
</script>
我怎样才能使其当我暂停在网站上向下滚动并在视口中恢复时?
谢谢。
你尝试过什么到目前为止,哪里是你的企图监视滚动位置设置播放状态? – NewToJS