WordPress.org

Ready to get started?Download WordPress

Forums

HTML5 jQuery Audio Player
Javascript/jQuery problem (35 posts)

  1. KelvinAlf
    Member
    Posted 1 year ago #

    I was having a problem with the plugin conflicting with another plugin (NextGen Gallery). I emailed handhugsdesign as she had a similar problem and she helped lead me to my solution (thanks again!). Where the problem was at was with the following section of plugin.php:

    function pro_scripts_method() {
    $query = $_SERVER['PHP_SELF'];

    wp_deregister_script( 'hmp-jquery' );
    wp_register_script( 'hmp-jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js");

    wp_deregister_script( 'drag-jquery' );
    wp_register_script( 'drag-jquery', plugin_dir_url( __FILE__ )."player/js/jquery-ui-1.7.1.custom.min.js",true);
    if(strpos($query,'admin.php')!==false){
    wp_enqueue_script('hmp-jquery');
    wp_enqueue_script( 'drag-jquery' );
    }
    wp_register_style( 'hmp-style', plugin_dir_url( __FILE__ )."/includes/css/hmp-style.css");
    wp_enqueue_style( 'hmp-style' );
    }

    add_action('admin_enqueue_scripts', 'pro_scripts_method');

    I replaced it with:

    function pro_scripts_method() {
    $query = $_SERVER['PHP_SELF'];

    if(strpos($query,'admin.php')!==false){
    wp_enqueue_script('jquery-ui-sortable');
    }
    wp_register_style( 'hmp-style', plugin_dir_url( __FILE__ )."/includes/css/hmp-style.css");
    wp_enqueue_style( 'hmp-style' );
    }

    add_action('admin_enqueue_scripts', 'pro_scripts_method');

    Also I changed the following:

    <link href="<?php echo $pluginurl ; ?>includes/css/style.css" type="text/css" rel="stylesheet" media="screen" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="<?php echo $pluginurl ; ?>includes/jquery-jplayer/jquery.jplayer.js"></script>

    It is now:

    <link href="<?php echo $pluginurl ; ?>includes/css/style.css" type="text/css" rel="stylesheet" media="screen" />
    <?php require_once 'includes/ttw-music-player.php'; ?>

    This seems to have solved all my problems.

    http://wordpress.org/extend/plugins/html5-jquery-audio-player/

  2. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for posting this KelvinAlf. Just a question - what exactly was the problem that was happening with NextGEN?

    Just wondering because I have NextGEN running on my test site and the html5 player works fine with no conflict. So just would be helpful to know in what instances this is a problem...

    Thanks

  3. KelvinAlf
    Member
    Posted 1 year ago #

    Not a problem. The problem was that the function containing "player/js/jquery-ui-1.7.1.custom.min.js" conflicted with NextGen's drag & drop and also when I clicked Add Gallery/Images the page wouldn't render properly. This page helped me out a lot http://codex.wordpress.org/Function_Reference/wp_enqueue_script

  4. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks KelvinAlf. What version of the plugin are you using please?

  5. KelvinAlf
    Member
    Posted 1 year ago #

    I'm using 1.8 currently.

  6. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Pro or Free?

  7. KelvinAlf
    Member
    Posted 1 year ago #

    Pro

  8. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Ok great thanks. Will integrate the fix in next release. Appreciate the help in spotting this.

  9. KelvinAlf
    Member
    Posted 1 year ago #

    Not a problem, Jessie, handhugsdesign on here, helped point me out to where she had the same problem. In the code above I took out the jQuery call as I have it in my themes already but enqueueing that would probably be the same route to go. Good work on the plugin so far!

  10. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah thanks KelvinAlf - I fixed this in the lite version but must have forgotten to also add the proper enqueueing to the Pro version. Will ensure its added in next release

  11. KelvinAlf
    Member
    Posted 1 year ago #

    Sweet, thanks

  12. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    2.0 released with fix. Thanks for your help, and let me know any further issues.

  13. KelvinAlf
    Member
    Posted 1 year ago #

    Saw it, thank you!

  14. eeaston
    Member
    Posted 1 year ago #

    Hi there - I'm seeing this same problem using 2.1 of the Lite version, and all versions of NextGen gallery. Is it possible something has crept back in?
    Thanks

  15. mike022
    Member
    Posted 1 year ago #

    problem is still present in pro version 2.0

  16. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed in Pro 2.1

  17. tippa
    Member
    Posted 1 year ago #

    I am having the same issue with Lite Version 2.1 and NextGen.

  18. mike022
    Member
    Posted 1 year ago #

    the fact is i paid 28$ few days ago with that problem, is there a way to get the right version, i send you a private message few days ago without any answer. you gave me the 2.0 and i bought that version one week and a half ago. So far, the 2.1 was ready in lite version. How come i got the 2.0 pro ?

    i think that paying twice in two week will be too much for something that should work allready.

  19. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Latest version is 2.1 for both Pro and Lite... if you bought pro once you don't need to buy it again, you can just upgrade - you would have been sent an email with the file or you can use the automatic update which appears in your plugins area.

    @tippa
    Can you explain your NextGEN conflict in more detail please? On my test site I have nextGEN installed and can't see any problems?

  20. tippa
    Member
    Posted 1 year ago #

    The problem that I'm having is the html5 player plugin cause the drag and drop features of the nextgen gallery plugin not to work on the admin side. I have to disable the html5 plugin in order to edit/create an album. If I don't, when I try to add a gallery to an album, instead of dragging and dropping, my cursor just selects the text on screen.

  21. mike022
    Member
    Posted 1 year ago #

    thx for the upgrade but same problem as tippa..when trying to drag in nextgen manage album section, it just fall down at the bottom of the page,and cant drag anything.

  22. Musicalman
    Member
    Posted 1 year ago #

    Yep got this identical problem with 'Easing slider lite' mentioned in this thread:

    http://wordpress.org/support/topic/html5-jquery-audio-player-pro-conflicting-with-pro-easing-slider-lite?replies=3

    Hope this gets fixed soon!

  23. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Ok thanks for reporting back guys - this helps a lot. Sorry about this... it is a jQuery conflict which is being caused by my use of jQuery in the backend admin console. I've tried a work-around in the latest 2.1 release which worked for me in test environment, but obviously it's not fixed it for everyone.

    Thank you for your patience while I look into this further...

  24. mike022
    Member
    Posted 1 year ago #

    thx for your efforts

  25. srwells
    Member
    Posted 1 year ago #

    You are loading jQuery improperly in your plugin which is the source of these jQuery issues. You need to be using the wp_enqueue_script function rather than loading jQuery manually/directly. See: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    Until you properly load jQuery, you will create conflicts and javascript errors with other plugins that are loading jQuery properly.

  26. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks @srwells.

    In a nutshell, yeah I made a big boo boo here and built this plugin without a full understanding of how to include jQuery properly... I'm now aware of the problem, and I've been doing a lot of reading about how to include jQuery properly. I'm also getting some help on it from a more experienced plugin developer.... So.... working on it... and it will be fixed properly ASAP.

    Thank you to everyone who has helped identify the error, and sorry for the inconvenience! Learning curve for me! I appreciate your understanding and patience.

  27. Musicalman
    Member
    Posted 1 year ago #

    Glad to hear this main problem is now being worked on; respect!

  28. mike022
    Member
    Posted 1 year ago #

    me too,,,respect. will you name the fixed version 2.2 , just to be inform on which version gonna be the jquery fixed one.

    thx advanced

  29. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks guys. Yep should be 2.2 ... but will be very clear in the release notes and changelog what's been done to it so you can always check there.

  30. tippa
    Member
    Posted 1 year ago #

    Any update on this?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic