Page MenuHomePhabricator

TimedMediaHandler: Embed mode should handle case of file not existing
Open, LowPublic


When a file no longer exists it currently looks like this, which is rather odd:

<div class="embedded-commons-video"><iframe width="650" height="400" style="margin: 1em auto; border: 0px;" src="" frameborder="0"></iframe></div>

(Rendering at time of writing:)

It seems the hook for handling embedplayer=yes urls only applies when the file exists. When the file doesn't exist (e.g. never, or deleted since) then the page gets iframed normally, which looks rather odd.

When a file has been deleted, logged-in users would also the excerpt of the deletion log within this frame.

I'd recommend we improve this to always hook into this url pattern in the File namespace. Instead of only when the file exists.

And add handling for these two cases:

  1. File is not playable (not audio or video) - currently this creates a black iframe with no content at all.
  2. File does not exist - currently this creates a plain MediaWiki page view response.

In either case, we should display a concise error to the user within the embed-mode viewer. E.g. a simple message in white text on a black background would do.

Event Timeline

Krinkle created this task.Jun 19 2017, 3:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 19 2017, 3:00 PM

I noticed this particularly on Phabricator since T64270. When pasting a broken link (typo, incomplete url, etc.) or when the file was deleted mean-while, the embed is quite confusing. Especially because it renders with my personal toolbar etc.

Given the frame appears without any border or other indication that it is meant to be an embedded Commons video, I thought at first that it was a screenshot (which, after all, is a lot more common on Phabricator, except I wondered how someone managed to log-in as me)

brion moved this task from To sort to Player on the TimedMediaHandler board.Jan 20 2018, 1:02 AM
Jdforrester-WMF triaged this task as Low priority.May 17 2019, 10:36 AM