User:TheDJ/mediahandler

MediaHandler and associated classes are mixing lots of responsibilities and we should untangle them. They are:


 * Parse metadata from specific file formats
 * Represent interpreted metadata of files
 * Inform what thumbnails should be generated
 * Render the HTML for the thumbnail and its wrapper.

One of the biggest problems this creates is that we currently have the following relations:


 * file extension *-1 mime type
 * mime type *-1 mediahandler
 * mediahandler 1-* metadataparser
 * mediahandler 1-1 thumbnail engine
 * mediahandler 1-1 thumbnail HTML renderer

You can override a media handler for jpg completely, if you want, but you cannot easily modify the html it generates depending on a specific piece of metadata. This is especially a problem for formats that require some level of interaction or extra modifiers like:
 * PDF/Djvu browsing
 * Audio/video players
 * Animated formats for png, gif, webp (which you might want to transcode to video)
 * Alternate viewers for panorama or 360 projections
 * And in general, overriding a partial case of a built in mediahandler

Therefor, media handlers are currently choke points. A similar problem extends towards MultiMediaViewer, which is file-extension based.