WordPress.org

Support

Support » Plugins and Hacks » MP3-jPlayer » [Resolved] Javascript error in Safari & Chrome, WordPress 3.5

[Resolved] Javascript error in Safari & Chrome, WordPress 3.5

  • From Chrome’s error console:

    Uncaught Error: cannot call methods on slider prior to initialization; attempted to call method ‘option’ query.js:2

    Safari’s error console says the same (except it omits the word ‘uncaught’).

    This started after I updated from WordPress 3.4.2 to 3.5 yesterday.

    Safari 6.0.2, Chrome 23.0.1271.97, running in Mac OS 10.8.2 on a Mac Pro 8-core.

    mp3-jplayer 1.7.3 with customized GUI (customization was not done by the plug-in’s author, and AFAIK it did not involve altering Javascript – just css)

    This error doesn’t seem to occur in Firefox 17.01. It correlates with several problems – files not playing back, multiple songs being selected at once upon successive clicks, page jumping up to the top after clicking on a song, problems with time display, etc.

    I tried the following, and the problems remained:

    1. switched to the Twenty Twelve theme

    2. disabled all other plugins

    3. tried SCRIPT_DEBUG per these instructions in the Codex

    Clearing the browser cache and then re-loading the page seems to resolve the issues in Safari, and then the player works as expected; but this doesn’t seem to help in Chrome.

    Test page is here.

    http://wordpress.org/extend/plugins/mp3-jplayer/

Viewing 15 replies - 1 through 15 (of 25 total)
  • hi, same here, does anyone have a solution yet? chers, debug.

    I deleted the plugin and did a fresh install. (Mine had a customized GUI with additional CSS and button images.)

    The fresh install with default skin showed similar problems in Chrome and Safari (Mac).

    The problem seems to involve the jQuery UI slider (ui.slider.js). Someone with more javascript experience echoed this finding, and suggested it might be a conflict between the older version of js included with the plugin and the newer version installed with the WordPress 3.5 update.

    I emailed the developer about these issues, but so far haven’t heard anything. He appears to have abandoned this plugin, at least as of now. No posts from him in 9 months. Sad, because he seem seem to have put a lot of work into the plugin. And frustrating – I spent a lot of time customizing the GUI, and now I’m back to square one.

    okay, is see… you are totaly right, it’s a great player/project! what i did for my site is to downgrade back to 3.4.2 since the player is very important to my site since it’s for a musician. it worked after that tutorial: http://etuts.org/manually-downgrade-wordpress/

    would be great to post it here if someone knows any workaround, maybe an upgrade to new jplayer (http://www.jplayer.org) should be considered….

    chers, dago

    I’m a musician, so audio is crucial to my site.

    I thought the usual recommendation is to stay with the latest version of WP since they fix security issues. So I’m basically afraid to go back! 🙂

    I’m looking into using jplayer or soundmanager2 directly rather than via a plugin. I don’t yet know how to do that, but it might be worth it in the long run. I wouldn’t mind paying Soundcloud and using their players on my site, but I don’t like any of the GUIs (I don’t want to see waveforms except when I’m recording and editing!).

    More troubleshooting info to add to my above posts.

    Here’s the simplest way to see the problem:

    In Safari and Chrome (Mac), if the first thing you do after the page loads is click the ‘play’ button, the player seems to work ok. Subsequent clicks on another song will cause it to load and begin playback, as expected.

    However, if the first thing you do after the page loads is click on a song title instead, that title loads into the ‘current track’ display at the top of the player, but playback does not start, and if you had to scroll down to see the player, the page jumps back up to the top.

    If you then click on the play button, the selected song will play back, but with the following issues:

    1. The ‘elapsed time’ readout remains at 0:00.

    2, The ‘total time’ readout does not appear.

    3. The playback progress bar does not appear, and clicking along the timeline does not have any effect (it should cause playback to jump to the location where you clicked)

    Version 1.7.3 of MP3-jPlayer ships with a 1.8.10 version of jquery-ui.js.

    Don’t know if this’ll help, but could you try replacing the ui.slider.js file (in the plugin’s js folder) with an updated version and let us know if it helped?

    Version 1.9.2 of jquery-ui.js is available at http://code.jquery.com/ui/1.9.2/jquery-ui.js.

    I’d been wondering about that.

    But when I spoke with the developer yesterday, he said that mp3-jplayer first looks for WordPress’ included jQuery libraries (in the folder wp-includes); the versions in the plugin’s folders are only there in case they’re missing from WordPress for some reason.

    Per his suggestion, I checked in Firebug and saw that indeed WordPress 3.5’s versions of jQuery (1.8.3) and jQuery UI (1.9.2) are being loaded.

    I don’t know if this has any effect on the problem, but I told him that in WP 3.5, they changed the convention for suffixes for minified .js and .css files.

    He said he’ll look into the issue, but didn’t say exactly when. Here’s hoping….!

    Ack! I’m having the same issue and I need it for a project due next week.
    If anyone resolves the issue, please post!

    dagobertdebug,

    I’m surprised the downgrade worked for you. I never upgraded to WP 3.5 and I’m experiencing the issue as well. Though the issue for me seems to only exist for the text-based players and playlist widget when there are text players also loaded on the page. The playlist player widget works fine on my homepage and all other pages that don’t include the text-based players.

    For these text players, I just get dud links that say “Play” but don’t do anything. Not even jump to page top.

    Go ahead and ignore my last post. The issue I was having was merely having a sidebar widget exist at the same time as a shortcode in main content area. This didn’t used to cause a problem, but as soon as I removed the sidebar playlist widget, the individual mp3 players began working again.

    Tested in Chrome, Safari, & Firefox
    Running WordPress 3.4.2 (afraid to upgrade!)

    @bobk88
    Did you ever hear back about this issue? I was about to build a site with this and now Im hesitant.

    Yes – the developer email me last week saying he fixed the plugin and it would be available over the weekend. That didn’t happen.

    I recommend not using this plugin. I ended up using jplayer directly in my site (not via a plugin).

    Im a little annoyed because I just bought Jplayer Woocommerce extension so I wonder how thats gonna work. How is the direct code working out? Any issues?

    Is it difficult to set up manually? Because my client was hoping to be able to update it after Im finished!

    Direct code is working fine so far.

    Jplayer’s site has a ‘Quick Start‘ that walks you through the installation on a regular web site. You have to figure out how to adapt that to your WordPress theme.

    I’m using a paid WP theme called Catalyst. It provides areas where you can insert scripts easily into pages, the header, or both. I’m using these, and they seem to be working fine.

    If you don’t have that kind of feature, maybe you could write a simple plugin just to add the jplayer script(s) via ‘enqueue_script.’ (Or maybe there are plugins that make it easy to add your own scripts – try searching the repository.)

    Note that WordPress uses jQuery in ‘no-conflict’ mode (see the above link, about half way down the page). The bottom line is that you have to write ‘jQuery’ instead of using the dollar-sign shortcut ($) in the script where you add the links to your audio files. There were only 3 or 4 instances of this, so it’s not a big deal.

    Unfortunately, this is NOT mentioned on the jPlayer site, since their tutorial is aimed at regular (non-Wordpress) sites. Since I’m not a developer, I didn’t know the details about using non-included scripts with WordPress, and spent a lot of time wondering why jPlayer wasn’t working until I stumbled on the above page.

    jPlayer requires the core jQuery library. In my site, other plugins are already calling in jQuery, so I didn’t need to include a script for that.

    Note that in the Quick Start they link to an external jQuery library hosted by Google; if you weren’t already aware, you should either use WordPress’ included library, or disable it if you want to use an external one. Calling in two instances of a script can apparently cause problems and is not recommended.

    Hope this helps.

    I’m looking forward to a fix too. I really liked this plugin 🙂

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘[Resolved] Javascript error in Safari & Chrome, WordPress 3.5’ is closed to new replies.
Skip to toolbar