Opened 8 years ago
Closed 8 years ago
#40803 closed defect (bug) (fixed)
Audio or video files do not show on upload
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Widgets | Keywords: | has-patch commit |
Focuses: | Cc: |
Description (last modified by )
I think this is a media library issue, but I discovered it whilst testing the audio widget.
If you drag a file it doesn't appear in the library. Here is a gif to show:
It's worth noting for images, this does, here is a gif of that:
What would be great would be for the behaviour to be constant.
edit: updated to video also as issue thanks to @desrosj finding that
Attachments (3)
Change History (17)
This ticket was mentioned in Slack in #core-media by karmatosed. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by karmatosed. View the logs.
8 years ago
#4
follow-up:
↓ 5
@
8 years ago
To confirm, the same issue is happening when interacting with the media modal within the post editor - or is it only happening when using the audio widget?
#5
in reply to:
↑ 4
@
8 years ago
Replying to timmydcrawford:
To confirm, the same issue is happening when interacting with the media modal within the post editor - or is it only happening when using the audio widget?
I do not see the same behavior when editing a post. After uploading a video, it appears in the media library properly.
#6
@
8 years ago
- Description modified (diff)
- Summary changed from Audio file doesn't show on upload to Audio or video file doesn't show on upload
#7
@
8 years ago
- Component changed from Media to Widgets
@timmydcrawford only in widgets. Just tested and works for post/pages.
Changing to widgets to confirm.
#8
@
8 years ago
- Summary changed from Audio or video file doesn't show on upload to Audio or video files do not show on upload
Also, just to add details from our Slack conversation to the ticket.
When opening the modal initially, all pre-existing files of the correct type show up in the modal. This includes any files uploaded on previous page loads using the media widget. This is also not just a Customizer issue, it happens for me when editing media widgets in the admin as well.
#9
@
8 years ago
- Keywords has-patch added
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
.
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
#10
@
8 years ago
Dug a bit further and it looks like if we pass in an array of specific mime types, the query performs as expected. 40803.3.diff shows this approach, and maintains the proper filtering of .mov files. Note you can still drag and drop or upload a .mov file - but the original issue reported here is fixed by this diff.
#11
@
8 years ago
- Milestone changed from Awaiting Review to 4.8
Related issue of restricting file types during upload: https://github.com/xwp/wp-core-media-widgets/issues/128
I am also seeing this, but also happens with videos for me. Using Chrome v 58.0.3029.110.