Tagged: 

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #950556

    Hi,

    Upgraded to Enfold 4.3.1 on WP 4.9.5 and it seems the mediaelements.js from WP is not loading correctly.

    I looked at the options and try to disable the options in Enfold, but no result:

    https://img42.com/MDBvt+
    Full: https://img42.com/MDBvt+

    Then I looked at the code of enfold\functions.php and did some testing:

    https://img42.com/_gS9_+
    Full: https://img42.com/_gS9_+

    But when commenting 2 lines it is all back to normal:

    https://img42.com/z71tM+
    Full: https://img42.com/z71tM+

    For info all was fine with Enfold 4.2, so are my tests correct? Any other solution than commenting those lines?

    Thanks

    • This topic was modified 6 years, 5 months ago by resbangkok. Reason: I thought it was resolved but it is not. I think it's impossible to solve this as Enfold mess with mediaelementjs too deeper
    #951311

    Hey resbangkok,

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    1. Install and activate ” Temporary Login Without Password “.
    2. Go to ” Users > Temporary Logins ” on the left-side menu.
    3. Click ” Create New “.
    4. Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
      ( do be sure that we have enough time to debug ).
    5. Click ” Submit “.
    6. You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.

    When your issue is fixed, you can always remove the plugin!
    If you prefer to not use the plugin, you can manually create a admin user and post the login credentials in the “private data” field.

    Best regards,
    Nikko

    #951557
    This reply has been marked as private.
    #951709

    Hi resbangkok,

    I’m not really sure why that’s happening on the video when using the default editor, however if you use Advanced Layout Builder with textblock it does work properly.
    On your live site you can enable ALB and use a text block, for the meantime we’ll try to check further on the issue.

    Best regards,
    Nikko

    #952498

    Nikko,

    Thanks for checking. The only way we have to bypass this is to comment 2 lines of codes in the functions.php of the theme:

    https://img42.com/AFVqn+
    FULL: https://img42.com/AFVqn+

    We don’t really want to do that, so anyway for us to temporary overwrite that but in the child theme instead?

    #953139

    Hi,

    Use the wp_dequeue_script function and wp_print_scripts hook. More info here.

    // https://codex.wordpress.org/Function_Reference/wp_dequeue_script

    This may affect certain features in the theme.

    Best regards,
    Ismael

    #958520

    Hi Ismael,

    Thanks, I tried to add in the child theme function.php:

    wp_dequeue_script( 'wp-mediaelement' );
    wp_dequeue_style( 'wp-mediaelement' );

    But nothing changed. What am I missing?

    #959664

    Hi,

    Thank you for the update.

    Try to wrap it inside the “after_setup_theme” hook and include the wp_deregister_script function.

    add_action('after_setup_theme', 'ava_deregister_mejs', 9999);
    function ava_deregister_mejs() {
       wp_deregister_script( 'wp-mediaelement' );
       wp_dequeue_script( 'wp-mediaelement' );
       wp_dequeue_style( 'wp-mediaelement' );
    }

    If this is not working, try to replace “after_setup_theme” with “init” or “wp_loaded”.

    Best regards,
    Ismael

    #961993

    Hi Ismael,

    Thanks again for this. I’ve tried with “after_setup_theme”, “init” and “wp_loaded” but nothing happened still the same issue.

    The only think that is working is to directly comment lines 420 and 421 on the functions.php, this is weird as deregister should work.

    Not sure where this problem can come from.

    • This reply was modified 6 years, 6 months ago by resbangkok.
    #962972

    Hi,

    My bad. Those hooks comes before the actual “wp_enqueue_scripts”. Please try this one instead.

    
    add_action('wp_enqueue_scripts', 'ava_deregister_mejs', 9999);
    function ava_deregister_mejs() {
       wp_deregister_script( 'wp-mediaelement' );
       wp_dequeue_script( 'wp-mediaelement' );
       wp_dequeue_style( 'wp-mediaelement' );
    }

    You can also try “wp_head” and “wp_footer”.

    // https://codex.wordpress.org/Plugin_API/Action_Reference

    Best regards,
    Ismael

    #964623

    Hi Ismael,

    Still no luck. I tried wp_enqueue_scripts, wp_head, wp_footer but none of them are disabling it.

    I have upgraded to ENFOLD 4.4, not related but still I have to manually comment the two lines in the function.php to make it works.

    //load mediaelement js
    $condition = !( isset($options[‘disable_mediaelement’]) && $options[‘disable_mediaelement’] == “disable_mediaelement” ) && av_video_assets_required();
    $condition2 = ( version_compare( get_bloginfo( ‘version’ ), ‘4.9’, ‘>=’ ) ) && $condition;
    //avia_enqueue_script_conditionally( $condition , ‘wp-mediaelement’);
    //avia_enqueue_style_conditionally( $condition2 , ‘wp-mediaelement’); //With WP 4.9 we need to load the stylesheet seperately

    • This reply was modified 6 years, 5 months ago by resbangkok.
    #964655

    Hi,

    This code works on our installation. The theme doesn’t load the wp-element scripts and stylesheets when it’s added in the functions.php file. Please view the page source after adding it. Don’t forget to purge the cache and re-minify the scripts and stylesheets after adding the code.

    Best regards,
    Ismael

    #964666

    Alright, I have did the change again, purged everything, waited few minutes and opened a new incognito session then it is working.

    It was due to the cache like you pointed it out.

    Thank you again for your help!

    Here is final call added in functions.php of the CHILD theme in case someone have the same question:

    add_action('wp_enqueue_scripts', 'ava_deregister_mejs', 9999);
    function ava_deregister_mejs() {
       wp_deregister_script( 'wp-mediaelement' );
       wp_dequeue_script( 'wp-mediaelement' );
       wp_dequeue_style( 'wp-mediaelement' );
    }
    #965258

    Hi,

    Awesome! Thanks for the update. Please feel free to open a new thread if you need anything else.

    Have a nice day! :)

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘[NOT RESOLVED] Mediaelements from WP not loading’ is closed to new replies.