[wp-trac] [WordPress Trac] #43263: wp_audio_shortcode() preload default: should it be metadata or none?
WordPress Trac
noreply at wordpress.org
Thu Feb 8 19:18:01 UTC 2018
#43263: wp_audio_shortcode() preload default: should it be metadata or none?
-------------------------+-----------------------------
Reporter: hearvox | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.6
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
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):
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#attr-
preload
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:
https://wordpress.slack.com/archives/C02SX62S6/p1518116191000138
FYI, the default `'preload' => 'none'` is here:
https://core.trac.wordpress.org/browser/tags/4.9/src/wp-
includes/media.php#L2223
FYI-2, you can change that with the `wp_audio_shortcode` filter (via regex
on the HTML output):
https://gist.github.com/hearvox/098774e9887442d39ddc6e34bedb10b1
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43263>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list