Wordpress media library not working - mediaelementplayer is not a function

13.6k views Asked by At
Uncaught TypeError: b(...).not(...).filter(...).mediaelementplayer is not a function

I am getting this issue after wordpress latest update 4.9. I am using this library in my plugin to allow users to upload images using the wp media upload. It was working fine, but after the latest update it is returning the error as I mentioned above.

2

There are 2 answers

1
user8994543 On

By adding the following code in functions.php file, error should be resolved.

add_action('wp_enqueue_scripts', 'my_register_javascript', 100);

function my_register_javascript() {
  wp_register_script('mediaelement', plugins_url('wp-mediaelement.min.js', __FILE__), array('jquery'), '4.8.2', true);
  wp_enqueue_script('mediaelement');
}
0
Ursu Alexandr On
  1. Does it appear on post/page edit?
  2. 'Add Media' button is not working?

If you answer 'yes' on both questions take a look if jQuery is not loaded twice, if so, load one only or implement JQuery.noConflict().