Page MenuHomePhabricator

MultimediaViewer Pannellum integration
Open, LowPublic

Description

This is the frontend component of the work to provide pan and zoom capabilities for panoramic images on Wikimedia websites.

The idea is to tightly integrate Pannellum with MMV. I've noticed that the 3D extension adds a special viewer to MMV with loose integration, but this design choice is visible to the user in the form of performance degradation and visible flickering on load. So for this project, I'm arguing for implementation in core and MMV.

In 2014, Aaron Arcos split out the Canvas class from LightboxImage, writing:

	/**
	 * UI component that contains the multimedia element to be displayed.
	 * This first version assumes an image but it can be extended to other
	 * media types (video, sound, presentation, etc.).
	 */
	class Canvas extends UiElement {

That sounds promising, although the public methods of Canvas are still quite specific to image display. The assumption that MMV displays flat images is distributed throughout the codebase. For example in mmv.js class MultimediaViewer we have resize(), for responding to a resize of the viewport, which doesn't delegate the logic, it just requests the new image and notifies the Canvas when it is loaded. There is similarly no delegation to a media type handler in preloadThumbnails().

Canvas is a singleton and so the implementation can't easily be split by media type. I don't know what Aaron was planning when he wrote that comment.

The model and provider classes are also quite specific to flat image display.

In summary, substantial refactoring will be needed to introduce support for panoramic images to MMV.