Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#43263 new enhancement

wp_audio_shortcode() preload default: should it be metadata or none?

Reported by: hearvox's profile hearvox Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.6
Component: Media Keywords:
Focuses: Cc:


Using this ticket to open a discussion about the audio tag’s preload attribute defaulting to
none in wp_audio_shortcode().

none won’t display the audio’s total time in the player (until the user hits play). So the effect of this default is millions of sites’ players display total times of “00:00”. (You can specify preload as a shortcode attr, but most sites don’t. )

Setting the preload attribute to metadata does extract and display total time upon page-load. Also metadata is both the wp_video_shortcode() default and the HTML-spec suggested default (to browser makers):

Bandwidth might be the valid concern, tho, as some browsers preload an excessive amount of metadata (I'm looking at you, Chrome) . See results of tests by @blobfolio:

FYI, the default 'preload' => 'none' is here:

FYI-2, you can change that with the wp_audio_shortcode filter (via regex on the HTML output):

Change History (1)

#1 @blobfolio
6 years ago

It is also worth noting that while Chrome is a bit greedy, the default behavior for the browser is preload="metadata" So it should be behavior its users are familiar with.

Note: See TracTickets for help on using tickets.