I have a post which uses WP shortcode to display my video file.

It’s supposed to look like this:

enter image description here

But it looks like this:

enter image description here

After I click “Load More Posts” AJAX call.

The video player will look like the way I want after I click the post. It’s only when the post is loaded with AJAX that it appears like this.

Can anyone tell me what’s wrong?

Thanks.

1 Answer
1

I call mediaelementplayer() from ajax success function. It works for me.

$.get(ajaxPostUrl,function(data){

    var posts = $(data).find('.post');

    $('#post-container').append(posts);

    posts.find('video,audio').mediaelementplayer(/* Options */);

});

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *