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="https://commons.wikimedia.org/wiki/File:Example.webm?embedplayer=yes" 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:
- File is not playable (not audio or video) - currently this creates a black iframe with no content at all. https://commons.wikimedia.org/wiki/File:Example.svg?embedplayer=yes
- File does not exist - currently this creates a plain MediaWiki page view response. https://commons.wikimedia.org/wiki/File:Adsalm.webm?embedplayer=yes
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.