mediawiki-extensions-EmbedVideo icon indicating copy to clipboard operation
mediawiki-extensions-EmbedVideo copied to clipboard

Support embedding external videos in galleries

Open jayktaylor opened this issue 5 months ago • 6 comments

Detailed Description

There should be a way for people to embed external videos from sites that EmbedVideo supports in galleries.

Context

Embedding videos in galleries is fairly common on enthusiast wiki sites, and a lot of them prefer to embed from somewhere like YouTube rather than a locally uploaded .mp4 file or something.

Possible Implementation

I have looked into possible implementations for this already for use on Weird Gloop's wikis, and discovered:

  • Fandom (and previously Gamepedia) use some kind of "fake" File handlers and have users "upload" external video (not the actual video, but some metadata representing it) so that they can be used in galleries without core modifications.
  • There doesn't really seem to be a good way of using gallery-related hooks in core MediaWiki to achieve simply allowing EmbedVideo parser tags to be used in galleries and parsed correctly. Both BeforeParserFetchFileAndTitle and AfterParserFetchFileAndTitle seem unsuitable.
  • We could potentially overwrite the core MediaWiki parser tag for to run through a method that we have in EV first, convert the syntax to something more palatable for the core MW code (like a fake file name) and then bounce it back to core's handler method (Parser::renderImageGallery), but this may make EV incompatible with other extensions that behave similarly. This is also probably an anti-pattern to what WMF would like in MW extensions.

Interested in thoughts on other potential implementations.

jayktaylor avatar Sep 07 '24 22:09 jayktaylor