WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Audio Players not showing after upgrade (11 posts)

  1. Dodger57
    Member
    Posted 2 months ago #

    Hello,

    Just upgraded to 3.9.1 - after doing so all of our audio players are missing. They appear to be there when the source is viewed but not on the page. I've disabled plugins, tried other browsers but still a no show on the players. Here is one of the pages in question. The players should be just above the "download" links.

    http://www.ktbb.com/audio/

    The page is using the loop on an external site. Worked perfectly before the upgrade - not sure what the deal is. Any ideas? I don't want to have to use a plugin if I don't have to.

    Thanks
    Daf

  2. kmessinger
    Volunteer Moderator
    Posted 2 months ago #

    http://validator.w3.org/check?verbose=1&uri=http://www.ktbb.com/audio/
    shows errors at each player's short code. 3.91 shouldn't change any html.

    Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the default theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    - re-uploading all files & folders - except the wp-content folder and wp-config.php & root .htaccess files - from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

  3. Dodger57
    Member
    Posted 2 months ago #

    Hello - thank you for the reply!

    -Yes
    -Yes
    -Yes via FTP
    -Yes - created new directory with fresh files then copy content/config to it. Rename directories. This is how I upgrade. Tried it again - still no joy.

    Still no players.

    Here is another site that using the exact same system - but has not been updated yet - and it get's the same validation errors on WP code but the players work fine.

    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.crossbrandcowboychurch.org%2Fsermons.php

    Thanks

  4. kmessinger
    Volunteer Moderator
    Posted 2 months ago #

    The code is different on the sites.

    Working site
    <audio id="audio-4843-2" class="wp-audio-shortcode" controls="controls" style="width: 100%" preload="none">

    Non-working site
    <audio id="audio-292079-2" class="wp-audio-shortcode" controls="controls" style="width: 100%; visibility: hidden;" preload="none">

    Removing the visibility and the player shows up.

  5. Dodger57
    Member
    Posted 2 months ago #

    Ah - so that's interesting. But since WordPress is generating that code how do I remove the visibility part of the style tag? And what part of the upgrade put it there?? Like I said it worked perfectly before the upgrade so there must be something in the new files to this effect.

    Thanks!

  6. Dodger57
    Member
    Posted 2 months ago #

    Okay - so I did a search through the 3.9.1 files and found the offending style in includes/media.php - removed it and the players are back. Thank you!

    But my question now is ... why? Why would they code it to where the players are hidden? Makes no sense to me.

    here is the code:

    $atts = array(
    		'class'    => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ),
    		'id'       => sprintf( 'audio-%d-%d', $post_id, $instances ),
    		'loop'     => $loop,
    		'autoplay' => $autoplay,
    		'preload'  => $preload,
    		'style'    => 'width: 100%; visibility: hidden',
    	);
  7. kmessinger
    Volunteer Moderator
    Posted 2 months ago #

    Good question. I will forward this on and see if anyone knows.

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 2 months ago #

    The visibility is set to hidden, but the media-element-player JS and CSS code makes it show up again with the proper player controls and so forth. This is a bug fix for a potential race condition.

    More info here: https://core.trac.wordpress.org/changeset/28182

    Specifically, the reason your players were not showing properly was not really because of the visibility hidden, but because that page at http://www.ktbb.com/audio/ is somewhat incomplete.

    None of the mediaelementplayer JS or CSS code is showing up on that page. In fact, none of the normal WordPress header elements are. So, I suspect the problem is that your theme lacks the correct wp_head() and possibly the wp_footer() calls in the header.php and footer.php files, respectively.

    Before the ending </head>, your page needs to have this code:
    <?php wp_head(); ?>

    And before the ending </body>, this code:
    <?php wp_footer(); ?>

    These let WordPress insert things into the header and footer, like Javascript code and CSS stylesheets, etc. Those are necessary for the normal operation of these shortcodes. Not every browser supports a simple HTML5 <audio> tag, the media-element-player code included in WordPress is what makes that audio tag cross-browser.

  9. Dodger57
    Member
    Posted 2 months ago #

    kmessinger - thank you for your help with this! We got it working again and I appreciate that! :)

    Samuel Wood - I understand and I think that is key. Since these were external loop applications I did not include the head/footer calls - and everything worked for years. Recent upgrade apparently make this necessary. Note that adding just the head call will not fix - both head and footer calls must be present for the audio shortcode to work properly.

    Thank you both for your time today, I believe this is resolved. :)

  10. quangn
    Member
    Posted 1 month ago #

    I got another problem, Im missing the button shuffle and option to auto-play, is there a way to add it or i have to wait for update?:/

  11. sundberg
    Member
    Posted 1 month ago #

    Hi! This looks exactly like the problem I was having. And, yes, my markup was lacking the <?php wp_head(); ?> and <?php wp_footer() ?> codes. The site had been launched back in 2007 and is in obvious need of some tuning up!

    Thank you!!

Reply

You must log in to post.

About this Topic

Tags

No tags yet.