Tagged: mediaelement
-
AuthorPosts
-
May 3, 2018 at 8:10 am #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:
Full: https://img42.com/MDBvt+Then I looked at the code of enfold\functions.php and did some testing:
Full: https://img42.com/_gS9_+But when commenting 2 lines it is all back to normal:
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, 6 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
May 4, 2018 at 5:49 am #951311Hey resbangkok,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
- Install and activate ” Temporary Login Without Password “.
- Go to ” Users > Temporary Logins ” on the left-side menu.
- Click ” Create New “.
- 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 ). - Click ” Submit “.
- 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,
NikkoMay 4, 2018 at 11:41 am #951557This reply has been marked as private.May 4, 2018 at 2:56 pm #951709Hi 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,
NikkoMay 7, 2018 at 6:15 am #952498Nikko,
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:
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?
May 8, 2018 at 6:43 am #953139Hi,
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,
IsmaelMay 18, 2018 at 10:09 am #958520Hi 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?
May 21, 2018 at 11:24 am #959664Hi,
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,
IsmaelMay 25, 2018 at 9:48 am #961993Hi 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.
May 28, 2018 at 8:34 am #962972Hi,
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,
IsmaelMay 31, 2018 at 5:57 am #964623Hi 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, 6 months ago by resbangkok.
May 31, 2018 at 7:44 am #964655Hi,
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,
IsmaelMay 31, 2018 at 8:41 am #964666Alright, 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' ); }
June 1, 2018 at 12:28 pm #965258 -
AuthorPosts
- The topic ‘[NOT RESOLVED] Mediaelements from WP not loading’ is closed to new replies.