Load MediaPlayerElement after Infinity Scroll loads more posts

I am using Infinite Scroll on a site that is using a custom styled MediaPlayer Element (using Wordpress' built-in MediaElements.JS).

The style initially loads fine, but once Infinite Scroll loads content from the next page everything breaks. Instead of being loaded in their special MediaPlayerElements structure, they are loaded in plain html5 audio tags making them look completely different.

From what I've researched, it seems that this is do to MediaPlayerElement not being reloaded after Infinite Scroll gets the next page.

This is the live site that the issue is happening on.


I have found similar issues online from some years ago, but none of the solutions seem to fix the issue. Some of the solutions I looked at:

Topic infinite-scroll audio ajax customization Wordpress javascript

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.