[wp-trac] [WordPress Trac] #40803: Audio or video files do not show on upload

WordPress Trac noreply at wordpress.org
Wed May 24 18:55:55 UTC 2017


#40803: Audio or video files do not show on upload
--------------------------+------------------------------
 Reporter:  karmatosed    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Widgets       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by timmydcrawford):

 * keywords:   => has-patch


Comment:

 Okay I have tracked down the issue here - it appears that by passing in
 the list of mimes for a given media type in
 https://core.trac.wordpress.org/browser/trunk/src/wp-admin/js/widgets
 /media-widgets.js#L252, the underlying {{{query.args.post_mime_type}}} the
 media modal uses to query/update the listing uses this same list of
 extensions.

 So in the case of the audio widget, the {{{mime}}} which is passed in when
 creating the insert state for the media modal is
 {{{audio/mpeg,audio/ogg,audio/mpeg,audio/wav}}}.  If you contrast that
 against the a media modal in the editor, with the "audio" filter set, the
 {{{post_mime_type}}} in the query is just {{{audio}}}.

 [[attachment:40803.1.diff]] fixes the issue by only passing in the media
 widgets mime type, instead of the explicit list of mime types.  This logic
 was originally introduced in https://github.com/xwp/wp-core-media-
 widgets/pull/173 to handle the filtering of .mov files so they would not
 show up as selectable in the video widget modal.  So with this diff, .mov
 files do show up, but when selected an error is still shown in the
 preview.

 It does seem to me that there might be a way to fix this in the wp.media
 logic too - because the initial display of the media modal with the
 explicit mimes works properly, just the subsequent refresh from observing
 uploads does not.

 /cc @westonruter

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


More information about the wp-trac mailing list