Page MenuHomePhabricator

Playback of video in media gallery.
Closed, ResolvedPublic

Description

At the moment, videos are not playable in the Gallery (only a thumbnail of the video is shown). The opposite should be the case. :)

It's not difficult to enable video playback in Android, however: Android does not support the Theora video format natively, which a lot of our videos are encoded in. This will complicate things enormously.

This also encompasses T85766, since animated GIFs can also be considered "videos" of sorts.

Event Timeline

Dbrant raised the priority of this task from to Medium.
Dbrant updated the task description. (Show Details)
Dbrant subscribed.

So the good news is, WebM videos should play natively in Android 2.3 and up, and all our Theora videos are cross-converted into WebM as well.

I've got some JavaScript code in the demo page for my JavaScript video decoding experiments which uses API 'imageinfo' and 'transcodestatus' queries to fetch the various available transcodes and pick one: https://github.com/brion/ogv.js/blob/master/src/demo/demo.js#L234

You'd basically want to grab a WebM version that fits the screen (or just the 360p default if available). For audio, .ogg files *should* play in Android natively but if they don't I can help rig up an alternative.

It might be simplest to just drop the media file into a WebView, if it shows inline.... but I'm not sure on phones, especially older phones, if that works inline as expected or not. (A web view should also handle animated GIFs.)

Per IRC discussion we found that the 'transcodestatus' only works on Commons directly; rather than special-casing, recommend using 'videoinfo' 'derivatives' option to get them, eg:

https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&prop=videoinfo&format=json&viprop=derivatives&titles=File%3AMonks%20at%20Mahagandhayon%20Monastery%2C%20Amarapura%2C%20Mandalay%2C%20Myanmar%20-%2020141207.webm

Change 184416 had a related patch set uploaded (by Alex Monk):
Video playback in Gallery.

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

Patch-For-Review

Change 184416 merged by jenkins-bot:
Video playback in Gallery.

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

Checked it for 'Barack Obama' article video on 2.0-alpha-2015-03-30

  • the video works in online mode (from Saved pages also)
  • the video works in offline mode - from Saved pages.
Etonkovidova set Security to None.