Page MenuHomePhabricator

Embedded Commons videos on Phabricator are broken
Closed, ResolvedPublic

Description

As discussed earlier this month at T116515: Enable embedding of media from Wikimedia Commons, videos from Commons no longer work when embedded here on Phabricator, see e.g. the example video in the announcement blog post - tested in Chromium ("Requests to the server have been blocked by an extension." - even when I have no browser extension enabled) and Firefox, which throws the following error message in the console:

Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source: (function (NAVIGATOR, OBJECT) {

    OBJ.... new_feature_embed_videos_from_commons_into_phabricator_markup:1
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source: (function (ERROR) {

    const V8_STACK_.... new_feature_embed_videos_from_commons_into_phabricator_markup:1
Content Security Policy: The page’s settings blocked the loading of a resource at https://commons.wikimedia.org/wiki/File:Saving_and_sharing_search_queries_in_Phabricator.webm?embedplayer=yes (“frame-src”).

Event Timeline

mmodell moved this task from To Triage to Next on the Phabricator board.

This seems to be fixed, although (minor issue) it displays a broken-image graphic in the preview

Screenshot of broken-image graphic (See top-left corner of video):

image.png (834×967 px, 53 KB)

I'm at a loss as to why it's showing a broken preview thumbnail. It doesn't seem to be triggering any CSP errors for the thumb.

For the video above, I see a request for[1] and that responds with a 404.

When I load the video directly on commons, it loads the thumb from[2]:

  • [1] https://upload.wikimedia.org/wikipedia/commons/thumb/6/68/Dr._MacIntyre's_X-Ray_film.webm/mid-Dr._MacIntyre's_X-Ray_film.webm.jpg
  • [2] https://upload.wikimedia.org/wikipedia/commons/thumb/6/68/Dr._MacIntyre's_X-Ray_film.webm/480px--Dr._MacIntyre's_X-Ray_film.webm.jpg
Aklapper renamed this task from Embedded Commons videos are broken to Embedded Commons videos on Phabricator are broken.Aug 23 2018, 5:07 PM
Aklapper added a project: Phabricator.
Aklapper removed a project: Phabricator.

Should this really not be tagged Phabricator?

Nah, but may I offer Kaltura player or Thumbor? :

This seems like a leftover special case that the Thumbor URL parser ignored. I'm not inclined to introduce this special rule to Thumbor, which introduces cache splitting for no good reason. Nothing else than embedded TMH needs it. TMH should just specify a px size to the thumbnail in that case. It's not clear to me what happens with "mid", it's probably supposed to generate an original-sized thumbnail? Which really isn't the best idea, but I imagine was deemed OK for video, probably because 4K videos were uncommon back then.

TMH should be aware of the original size when it generates the thumbnail URL and thus specifying it as a px- parameter should be trivial.

Change 463697 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/extensions/TimedMediaHandler@master] Specify thumbnail width for the fillwindow case

https://gerrit.wikimedia.org/r/463697

Change 463697 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] Specify thumbnail width for the fillwindow case

https://gerrit.wikimedia.org/r/463697

Jdforrester-WMF assigned this task to Gilles.

Fixed in master.