Page MenuHomePhabricator

Video URLS with ?uselang query string result in the video player to not work
Closed, ResolvedPublicBUG REPORT

Description

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

  • Make sure you are logged out of Wikimedia Commons
  • Visit a video URL and append a valid "?uselang" query string (example)
  • Press the play button

What happens?:

  • Pressing the play button appears to reload the page and the video does not play

What should have happened instead?:

  • Pressing the Play button plays the video with the Timed Text of the language specified in the query string

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

  • This does work if you are logged into the wiki! The player loads and the subtitles appear in the language set by the ?uselang query string

Not sure if this is related, but the console is also displaying a "Error: View mediainfoview does not exist" message.

First noticed and reported here: https://commons.wikimedia.org/wiki/Commons_talk:Timed_Text#Create_a_link_to_display_specific_subtitles

Event Timeline

It reloads the File page for me. Unless I'm fast enough to click the Play button again before the reload has finished as that does play the video for me.

I think this might be a Commons specific issue. If you disable gadgets with safemode=true, things seem to work fine. That would indicate that something is hooking into the link of the video button.

I think this might be a Commons specific issue. If you disable gadgets with safemode=true, things seem to work fine. That would indicate that something is hooking into the link of the video button.

I think you're on to something. If I go to a page on Meta-wiki with a video, set the ?uselang string, and play the video it works.

Example: https://meta.wikimedia.org/wiki/Wikimedia_Foundation/Communications/A_Wiki_Minute?uselang=nl

from ext.gadget.AnonymousI18N

if (conf.wgUserLanguage !== conf.wgContentLanguage) {
    $(document).on('click', 'a[href]', function(e) {
        var href_attr = $(this).attr('href')
          , href_full = this.href;
        if (href_attr.substr(0, 1) !== '#' && href_attr !== '' && href_full.substr(0, 4) === 'http' && href_full.indexOf('.wik') !== -1 && href_full.indexOf('.org') !== -1 && href_full.indexOf('Special:Set') === -1 && e.ctrlKey !== true && e.metaKey !== true) {
            e.preventDefault();
            location.href = AnonymousI18N.getUrlForLanguage(href_full, wgAnonUserLanguage);
        }
    });

We can probably use stopPropagation in the videoJS play handler, or Exclude <a role=button> from ext.gadget.AnonymousI18N

TheDJ claimed this task.

Fixed