Toolbox
  • Printable version
 
Toolbox
LANGUAGES
Language
Personal tools
Wikipedia Affiliate Button

Talk:Media handlers

From BrightByte

Jump to: navigation, search

sPD7Hk Great, thanks for sharing this article post.Really looking forward to read more. Awesome.

[edit] MediaHandler a mysterious beast

Has there been any head way on this front. I see that in my SVN copy of version 1.10 all media is passed through a MediaHandler.

So far only Images are used and any other type produces a MediaHandler::getHandler: no handler found for MIME Type. where MIME Type is what ever type you have (i.e. audio/mp3)

This suggests to me that one could program a MediaHandler similar to an extension. So I looked at the code to try and figure out how. Most unfortunately the abstract methods seem very Image oriented and I cannot find any documentation (Not even a rouge email on an obscure mailing list). I tried to mimic the ImageHandler but found the learning curve almost too steep.

I like that MediaWiki is moving in this direction but was wondering to what extent. Has anyone else attempted a MediaHandler extension yet?

[edit] As an example

I was attempting to provide a "how to display" non-displayable media types. Before version 1.10 in order to play an MP3 file I had to use the FlashMP3 extension. But forcing the layman user to remember Yet Another wikitext syntax was too much. I wanted a flash player to added to the HTML when ever you got the [[Media:File.mp3]] syntax.

The MediaHadler looks perfect for this. However I have yet been able to find were the MediaHandler actually processes the Output to HTML function.

Any ideas? -- Sukima 22:13, 1 May 2007 (CEST)

Yes, this seems to be pretty much what you are looking for. But this part of the code is pretty new, so there's not much documentation yet. I haven't looked to closely at the code, but it seems like all generation of HTML is done through ThumbnailImage::toHTML. The thumbnail image in turn is supplied by the ImageHandler's doTransform and getTransform (there's also getScriptedTransform). Not sure which is for what, perhaps look at the basic implementation for simple images to get an idea. If you register a MediaHandler for MP3s, you can controll what "ThumbnailImage" is returned (even if it's not an image at all), and what HTML is generated (insert an MP3 player or whatever).
As an alternative, have a look at the Player extension - it allows easy integration of any type of player for any format. It uses <tag> syntax though. -- Daniel 00:48, 2 May 2007 (CEST)

Well I will look into the code. Perhaps I'm a bit too bleeding edge. As for the above extension: That looks like a possibility. I will investigate further. I may have to use the extension untill the MediaHandler framework matures a bit. Thank you for the suggestions. -- Sukima 10:24, 2 May 2007 (CEST)