WordPress.org

Make WordPress Core

#24076 closed defect (bug) (invalid)

Post Formats: Uploading an unsupported video or audio file type results in a grey box

Reported by: ocean90 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

  • Create a new post
  • Choose video post format
  • Upload a .mov video

Result:

A grey box which size is 1920x1080px. In the upper left is the download link, since mediaelement/HTML5 doesn't support .mov videos.
IMO there should be a notice, which video files are supported.

Attachments (1)

24076.diff (424 bytes) - added by kovshenin 12 months ago.

Download all attachments as: .zip

Change History (9)

kovshenin12 months ago

comment:1 kovshenin12 months ago

  • Keywords has-patch added; needs-patch removed

Not sure at which point we can issue a notice about supported video file types.

24076.diff falls back to wp.media.string.link for unsupported video formats.

comment:2 ocean9011 months ago

  • Keywords needs-patch added; has-patch removed

Patch doesn't work for me. Still getting the grey box. After a refresh I get the link.

comment:3 kovshenin11 months ago

Patch still works although broken for post formats by [23843]. Working on a fix.

Update: actually no, the patch just didn't address that, my bad :)

Last edited 11 months ago by kovshenin (previous) (diff)

comment:4 follow-up: kovshenin11 months ago

Looked into this a little more and there are several issues that need to be addressed.

First is code duplication between post-formats.js and media-editor.js where we convert a chosen video to a shortcode. It seems like we can simply use wp.media.editor.send.attachment in post-formats.js which will take into account supported types in media-editor.js and produce the correct HTML code for the output. However, mediaPreview in that respect is slightly different since it does not operate on a shortcode, but rather renders a video from the attachment model.

Second is the whole UX flow of supported and unsupported media formats. During a mediaPreview with an attachment model, we can find out whether the file type is supported and render an error message if not. However, that only works during the video selection flow, so as soon as you save the post and cause a refresh, the preview will just render whatever HTML is in the PF meta, which is weird, especially since the preview area is not clearly marked as a preview area.

Finally, I think the HTML area is too permissive. We know we're expecting a video, but we're really accepting arbitrary HTML. I'm trying to think of a way we can restrict it to supported media only, including all possible video shortcodes, oEmbed, etc. Any ideas?

comment:5 in reply to: ↑ 4 SergeyBiryukov11 months ago

Replying to kovshenin:

Finally, I think the HTML area is too permissive. We know we're expecting a video, but we're really accepting arbitrary HTML. I'm trying to think of a way we can restrict it to supported media only, including all possible video shortcodes, oEmbed, etc. Any ideas?

Related: #24301

comment:6 follow-up: anderton11 months ago

When i tested, the issue was not only with .mov, but also for .AVI (different codecs), MKV (different codecs) and .MPG

comment:7 in reply to: ↑ 6 kovshenin11 months ago

  • Summary changed from Uploading .mov file results in a big grey box to Post Formats: Uploading an unsupported video or audio file type results in a grey box

Replying to anderton: Right, whatever is not supported by our MediaElement.js implementation and not limited to video.

comment:8 markjaquith11 months ago

  • Milestone 3.6 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Removing post formats UI from core: #24452

Note: See TracTickets for help on using tickets.