@romantic20, The plugin has no control over when or how the shortcode will be processed. This is done by WordPress.
Yes, I understand. But as far as I was able to find out in different sources, wordpress has problems with shortcodes in Ajax routines. So I was asking is there alternative way to show your video player, without shortcode maybe?
Hi again, Noor!
Ajax Load More plugin author said that I could use player reinitalization via their special function https://connekthq.com/plugins/ajax-load-more/docs/callback-functions/almcomplete/ – just have to find out what player’s function I should run with this function. May you please help me with it?
With the function name I would be able to reinitialize video player and it will be working normally, like in this example for Contact Form 7:
// Contact Form 7 (https://en-ca.wordpress.org/plugins/contact-form-7/)
window.almComplete = function(alm){
if(wpcf7){
wpcf7.initForm( $(‘.wpcf7-form’));
}
};
Without knowing this I will have to switch to alternative player, which would be pretty unfortunate, as I really like your player. So can you please help me with your initialization function?
Hi Noor, I’ve tested your plugin with other Ajax-powered themes and plugins – it doesn’t work with any of them! So when content is showing with Ajax – Videojs HTML5 Player isn’t showing at all because of incorrect initialization. So this is definitely a bug that should be addressed.
@romantic20, The player is automatically being initialized by the Videojs script after the page is loaded. The plugin is not manually initializing the player.
Yes, but many popular themes (like Divi) and plugins like ( YITH Infinite Scrolling) using Ajax to load post contents. And plugin not working with them.
So the question is: in situation, when your player loaded with Ajax, it has to be re-initialized (like it was done at page loading). How could it be done? With function maybe?
Actually, don’t bother yourself – I have found a solution by my own. Just used Ajax load more documentation (link to which I sent to you before) and VideoJS player documentation. Function, that makes your player to work in ajax calls:
<script>
jQuery(document).ready(function($){
window.almComplete = function(alm){
var massVideo = $(‘.vjs-big-play-centered’);
for(var i = 0; i < massVideo.length; i++){
videojs(massVideo[i]).ready(function(){});
}
}
});
</script>
No need to thank.