0

您好,由于某种原因,当我使用 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 );
4

1 回答 1

0

当通过无限滚动插件插入新视频时,您可能需要重新初始化 video.js,(我看不到确切的代码,因为它被缩小了)

尝试将 video.js 代码(如上所示)放在命名函数中,并在插入新的滚动内容时调用它

于 2013-04-02T22:45:55.853 回答