您好,由于某种原因,当我使用 Jquery Infinite Scroll 向下滚动时,下一页上的 Video.js 播放器变成了普通的 html 5 播放器。http://orgasmal.com/ (SFW)
奇怪的是播放器在单独运行时可以正常工作。http://orgasmal.com/test/ (SFW) 如果有帮助,这里是播放器的代码:
<video id="ex2" class="video-js vjs-default-skin"
controls preload="auto"; loop data-setup='{"example_option":true}'>
<source src="http://codmemes.com/video/test.mp4" type='video/mp4' />
</video>
<script>_V_("ex2", {}, function(){
var myPlayer = this;
myPlayer.size(640,600);
myPlayer.play();
});</script>
function custom_infinite_scroll_js() {
if( ! is_singular() ) { ?>
<script>
var infinite_scroll = {
loading: {
img: "http://codmemes.com/wp-content/uploads/2013/03/27-1.gif",
msgText: "<?php _e( 'Loading More People...', 'custom' ); ?>",
finishedMsg: "<?php _e( 'Shit, you just hit the bottom of the internet.', 'custom' ); ?>"
},
"nextSelector":".nav-previous a",
"navSelector":".navigation",
"itemSelector":".box",
"contentSelector":".icontent"
};
jQuery( infinite_scroll.contentSelector ).infinitescroll( infinite_scroll );
</script>
<?php
}
}
add_action( 'wp_footer', 'custom_infinite_scroll_js',100 );