Page MenuHomePhabricator

Rework TMH's HTML output for video/audio transforms to be more forward-compatible
Closed, DeclinedPublic

Description

The HTML output of the audio/video elements, their container, and their subelements, is currently kinda specific to the transformation with the Kaltura player... especially the popup transform mode that drops a big blob of HTML in an attribute.

Should clean up the HTML to be cleaner, and usable as a base for both old Kaltura player and VideoJS. Probably clean up the popup transform mode so it doesn't stick in all that stuff in the attribute... either load it separately (maybe via embed iframe?) or properly embed it in the markup tree.

Scrawling some notes at https://www.mediawiki.org/wiki/User:Brion_VIBBER/Media_rendering_encapsulation_2

Event Timeline

brion claimed this task.
brion raised the priority of this task from to Medium.
brion updated the task description. (Show Details)
brion added a project: TimedMediaHandler.
brion moved this task to Doing on the TimedMediaHandler board.
brion subscribed.

Going back to older notes in https://www.mediawiki.org/wiki/User:Brion_VIBBER/Media_rendering_encapsulation ... A couple key things:

  • need to be able to specify the source resource by name -- there's no 'a' link around a video or audio to get it from.
    • expanding the parsoid image spec we'd perhaps put the 'resource' attribute onto the audio/video/canvas/iframe/div ... but I see no spec for that attribute in HTML5. Would we have to use an mw-data attrib or something?
    • stuff like the packed-gallery resizing code (see T77988) needs to be able to reference the actual element and adjust width/height... How much can we rely on the structure when fetching those elements?

General note:

  • should we handle the 'popup' logic entirely client-side? Eg always embed a video element even for for small sizes, but take over the click handler in JS to move/copy it to a popup?

General note:

  • should we handle the 'popup' logic entirely client-side? Eg always embed a video element even for for small sizes, but take over the click handler in JS to move/copy it to a popup?

This is what I'm currently going for with https://gerrit.wikimedia.org/r/#/c/285075/ and I'm hopeful that I might even be able to use that for both MwEmbedPlayer AND VideoJS.

We ended up going with a parser cache key tweak / version check instead. Seems ok so far.