Page MenuHomePhabricator

specifying image size to videos with thumbnail on English Wikipedia breaks the preview of the video
Closed, ResolvedPublic1 Estimated Story Points

Description

Screen Shot 2018-06-25 at 15.29.56.png (1×2 px, 1 MB)

In this example I specify the video thumbnail width as 300px and the preview first shows the video thumbnail as tiny and then dissapears (top right of the article)
https://en.wikipedia.org/wiki/Trump_administration_family_separation_policy

File available here
https://commons.wikimedia.org/wiki/File:Crying_children_who_have_been_separated_from_their_families_at_the_U.S._border.webm

I think I'm using the 2017 wikitext editor

Event Timeline

Please follow https://mediawiki.org/wiki/How_to_report_a_bug and provide a list of steps to reproduce, including links that allow others to try reproducing, plus information which editor is being used. Thanks!

I think the issue is TMH currently only knows about PHP HTML, so doesn't work with Parsoid HTML.

Deskana subscribed.

I guess this is an issue with TimedMediaHandler and not the visual editor?

matmarex subscribed.

Fixing T154844 (using PHP Parser rather than Parsoid for NWE previews) would also fix this.

In Chrome I'm not experiencing disappearing thumbnails or unusual size on https://en.wikipedia.org/wiki/User:Brion_Vibber_(WMF)/Video_VE_test when testing either of:

  • changing size of video through 'edit' / advanced
  • changing size of video by dragging the corner
  • inserting a new video

Can someone list steps to reproduce, or am I misunderstanding the issue?

(I do see that the thumbnail changes on the example taken from the referenced article; it looks like the 'thumbtime' parameter is not being passed through when the thumbnail is reloaded, so it gets the default time.)

@brion It's about the preview functionality of new wikitext editor, you have to enable "New wikitext mode" on https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-betafeatures, then you can access the editor at https://en.wikipedia.org/wiki/User:Brion_Vibber_(WMF)/Video_VE_test?veaction=editsource and use "Publish page…" → "Show preview".

In T198103#4317367, @brion wrote:

(I do see that the thumbnail changes on the example taken from the referenced article; it looks like the 'thumbtime' parameter is not being passed through when the thumbnail is reloaded, so it gets the default time.)

T198150: 'thumbtime' not preserved when re-generating view rendering of video thumbnail in VE

Gotcha -- yes, can reproduce the bug in Chrome and Safari. Thanks for filing the side bug. :)

Yeah, looks like the old-style mwembed player in TMH is getting confused about the parsoid-style markup and is ending up with a zero-size widget. Do y'all prefer that I try to fix the frontend to work with that markup, or leave it to to changing which markup is used (T154844)?

In T198103#4317513, @brion wrote:

Yeah, looks like the old-style mwembed player in TMH is getting confused about the parsoid-style markup and is ending up with a zero-size widget. Do y'all prefer that I try to fix the frontend to work with that markup, or leave it to to changing which markup is used (T154844)?

The former. When we switch all read HTML to use Parsoid output this work will need to be done anyway.

I'm having trouble reproducing this in an isolated environment.

MediaWiki-vagrant set up with:

  • with timedmediahandler role and whatever else I had already installed
  • added visualeditor role & re-provisioned
  • set in LocalSettings:
$wgVisualEditorEnableWikitext = true;
$wgVisualEditorEnableWikitextBetaFeature = true;

$wgDefaultUserOptions['visualeditor-newwikitext'] = 1;
$wgHiddenPrefs[] = 'visualeditor-newwikitext';

Copied my test page https://en.wikipedia.org/wiki/User:Brion_Vibber_(WMF)/Video_VE_test over. I get full-size thumbs and no attempt at a TimedMediaHandler transform. It looks like the loader JS for TMH's mwembedplayer isn't being loaded at all on the edit page or the preview, so its hook for 'wikipage.content' never gets called at runtime.

Production seems to still have the pre-merge MwEmbedSupport extension, but I don't see offhand what would cause it to be loading this loader JS before when it doesn't now.

Ah, I figured it out. It was only triggering when editing was started from the article view (in which case TMH was already loaded), whereas in most of my testing I was reloading at the action=edit page, with no TMH loaded. I can now reliably trigger it. :D

I'll clean it up so the behavior is more consistent when I'm fixing the other bits over on T198266.

Change 442365 had a related patch set uploaded (by Brion VIBBER; owner: Brion VIBBER):
[mediawiki/extensions/TimedMediaHandler@master] Fixes for parsoid-rendered previews in NWE / 2017 wikitext editor

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

Change 442365 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] Fixes for parsoid-rendered previews in NWE / 2017 wikitext editor

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

Vvjjkkii renamed this task from specifying image size to videos with thumbnail on English Wikipedia breaks the preview of the video to gcaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed brooke as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from gcaaaaaaaa to specifying image size to videos with thumbnail on English Wikipedia breaks the preview of the video .Jul 2 2018, 10:09 AM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to brooke.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot set the point value for this task to 1.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.