WP REST - video and audio players
I'm building a VUE JS based theme, and I'm using WP REST v2. There is a problem - I can't make video and audio playlists work (built-in WP core feature). I already added:
wp_enqueue_style( 'wp-mediaelement' );
wp_enqueue_script( 'wp-playlist' );
but from there I'm not sure how to make it work.
I just can't make it work. When I insert content from the REST API into DOM the video and and music playlists are not working.
I have access to WPPlaylistView
so I also tried:
jQuery(.wp-playlist:not(:has(.mejs-container))).each(function() { return new WPPlaylistView({ el: this }); });
But I'm still getting the error : Uncaught TypeError: Cannot read property 'replace' of undefined
Does somebody know how to deal with this problem? How can I make these WordPress playlists work when the player code is added to the DOM after the page loads?