[wp-trac] [WordPress Trac] #40921: Inconsistent Handling of mp4 by Audio Widget

WordPress Trac noreply at wordpress.org
Sat Oct 14 19:59:04 UTC 2017


#40921: Inconsistent Handling of mp4 by Audio Widget
-------------------------------------------------+-------------------------
 Reporter:  toddhalfpenny                        |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Media                                |  Release
 Severity:  normal                               |     Version:  3.6
 Keywords:  2nd-opinion dev-feedback has-        |  Resolution:
  screenshots has-patch needs-unit-tests         |     Focuses:
-------------------------------------------------+-------------------------
Changes (by blobfolio):

 * keywords:  2nd-opinion dev-feedback has-screenshots => 2nd-opinion dev-
     feedback has-screenshots has-patch needs-unit-tests


Comment:

 The new patch `40921.2.diff` includes two functions that late-hook into
 the `wp_check_filetype_and_ext` filter.

 `wp_check_mp4_filetype_and_ext()` analyses ID3 data for files with the
 generic `.mp4` extension, renaming audio-only content to the more
 appropriate `.m4a`.

 `wp_check_ogg_filetype_and_ext()` analyses ID3 data for files with the
 generic `.ogg` extension, renaming video-only content to the more
 appropriate `.ogv`.

 How does everyone feel about this approach? It feels right to me.

   - Handling these checks as part of the media upload process ensures
 correct handling thereafter (widget/icon/embed associations will always be
 accurate).
   - Using separate filters for each type keeps the per-function line
 counts within reason, while also providing an easy template to follow for
 additional formats (looking at you, `.asf`!).

 @mikeschroder, @westonruter any thoughts? If you think this is the way
 forward, I'll add in some unit tests.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40921#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list