Any idea on how I can totally disable or entirely remove the default/Native Wordpress video player?
3 Answers
welcome aboard.
WordPress uses Media Elements JS for default video/audio player. You can disable this scripts with this code. Please add this code to your theme's functions.php
function deregister_media_elements(){
wp_deregister_script('wp-mediaelement');
wp_deregister_style('wp-mediaelement');
}
add_action('wp_enqueue_scripts','deregister_media_elements');
PS. This code de-register mediaelements.js from all WordPress (with your current theme).
I just tested this method, by using this piece of code you will eliminate watching online option from users. The file will be automatically downloaded as somebody enters the page.
Serkan's answer removed only some mediaelement files for me. This removed it completely:
function deregister_media_elements(){
wp_deregister_script('mediaelement');
wp_deregister_style('mediaelement');
}
add_action('wp_enqueue_scripts','deregister_media_elements');