Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1324222

    Hi,

    In an effort to squeeze the last few ms loading time improvement out of my website, I have a question about the standard WP mediaplayer scripts and css. I was experimenting with deregistering the script and css for that WP included mediaplayer stuff (/wp-includes/js/mediaelement/) like this in my child theme functions.php:

    function deregister_media_elements(){
       wp_deregister_script('wp-mediaelement');
       wp_deregister_style('wp-mediaelement');
    }
    add_action('wp_enqueue_scripts','deregister_media_elements');

    As far as I can tell from my experiments, this change does not affect any video capability within Enfold, not even including videos in a post the standard WP way… :-)

    Am I right in this and can I do this without harm when using Enfold, or am I missing something?

    Thanks in advance for clarifying,
    Rob

    #1324356

    Hey Rob,

    Thank you for the inquiry.

    You can actually toggle the script in the Enfold > Performance > Self hosted videos and audio features (WP-Mediaelement scripts) settings. The script is used for html5 videos and audios, so you can safely deregister the script if you are not using any of those. However, some plugins automatically requires the script, which might cause an error or produce a warning if the script is deregistered.

    Best regards,
    Ismael

    #1324366

    Hi Ismael,

    Thanks for the confirmation and the info, good to know. I already had that toggle set, but the player script + css continued to load on translated pages, I will take that up with the plugin developer too. That’s why I wanted to deregister it completely.

    Have a good day!
    Rob

    • This reply was modified 3 years, 2 months ago by rob2701.
    #1324390

    Hi Rob,

    Thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1324391

    Hi Rikard,

    Thanks for the help, you can close it.

    Rob

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Question about WP media-elements and Enfold’ is closed to new replies.