首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Video.js播放器不支持Jquery无限滚动

Video.js播放器不支持Jquery无限滚动
EN

Stack Overflow用户
提问于 2013-04-03 06:04:32
回答 1查看 502关注 0票数 0

你好,由于某种原因,当我用Jquery无限滚动向下滚动时,下一页的Video.js播放器变成了一个普通的html5播放器。黑莓( http://orgasmal.com/ )

奇怪的是,当播放器单独工作时,它工作得很好。http://orgasmal.com/test/如果有帮助的话,下面是播放器的代码:

代码语言:javascript
复制
 <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 );
EN

回答 1

Stack Overflow用户

发布于 2013-04-03 06:45:56

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

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15775260

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档