![](/img/trans.png)
[英]video player - video.js - (Wait Until the Player is Ready) not working
[英]Video.js Player not working with Jquery Infinite Scroll
您好,由於某些原因,當我使用Jquery Infinite向下滾動時,下一頁上的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 );
通過無限滾動插件插入新視頻時,您可能需要重新初始化video.js(我看不到縮小的確切代碼)
嘗試將video.js代碼(如上所示)放在命名函數中,並在插入新的滾動內容時調用它
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.