Page MenuHomePhabricator

Stockphoto gadget on Commons: "Use this file on the web" iframe embed code does not provide correct width and height values
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Visit a video media file on Commons (example)
  • Click/tap the "Use this file" link next to the globe icon.
  • A dialog/modal appears with easy to copy-and-paste bits, including iframe code to embed the video file.
  • Copy the HTML code to your site and preview the output.
  • Video has a with of "null" and a height of "20" regardless of actual dimensions.

example-iframe-video-embed.png (368×639 px, 92 KB)

What happens?:
For whatever reason the video dimensions (or a scaled approximation) are not passed to the generated HTML code.

What should have happened instead?:
The HTML code should contain a useful width and height.

Other information (browser name/version, screenshots, etc.):

  • I recall this working in the past, and only noticed the issue post-switch to video.js. It could be coincidental, but perhaps there was a change related to video.js passing this information to the dialog?
  • It appears this attribution and reuse feature of Commons is handled by MediaWiki:Gadget-Stockphoto.js. Since I do not know where the issue lies, I'm creating this ticket. :) I have mentioned this issue on the talk page of that gadget as well..

Event Timeline

ashley subscribed.

(removing tags related to the Video extension, a social tool not enabled on WMF wikis)

Aklapper renamed this task from "Use this file on the web" iframe embed code for Common videos do not provide correct width and height values to Stockphoto gadget on Commons: "Use this file on the web" iframe embed code does not provide correct width and height values.Sep 13 2022, 9:38 PM

Thank you @TheDJ for looking at this. I've done a little (very little!) testing and can confirm it appears to be working as intended. As a small side note, there does appear to be some minor layout and spacing issues. In both Safari and Chrome on MacOS.

The labels and icons appear rather close to one another.

Screenshot 2024-05-02 at 1.46.48 PM.png (362×1 px, 308 KB)

The fields are a little truncated.

Screenshot 2024-05-02 at 1.46.55 PM.png (620×1 px, 274 KB)

Screenshot 2024-05-02 at 1.55.44 PM.png (412×1 px, 132 KB)