Page MenuHomePhabricator

TMH iframe embed code doesn't pass width/height, doesn't create thumb/poster image unless 404 handler active
Closed, DeclinedPublic

Description

		// Setup the render parm
		$file = wfFindFile( $title );
		if ( !$file ) {
			// file was removed, show wiki page with warning
			return false;
		}
		$params = [
			'fillwindow' => true
		];
		$videoTransform = $file->transform( $params );

resulting url is something like:

/images/thumb/9/90/Furcifer_pardalis_moving_eyes.ogv/mid-Furcifer_pardalis_moving_eyes.ogv.jpg

with no actual file generated at that location.

In production this seems to 'work', with the 404 handler accepting input like:
https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Caminandes_-_Gran_Dillama_-_Blender_Foundation%27s_new_Open_Movie.webm/mid-Caminandes_-_Gran_Dillama_-_Blender_Foundation%27s_new_Open_Movie.webm.jpg

and producing a file even though there's no width specified.

Event Timeline

The problem is that we don't know the width at this stage. This is one of the reasons why Youtube only delivers a piece of Javascript that builds the player dynamically (and without JS, you don't get video). The piece of JS retrieves document.body.getBoundingClientRect (or something similar) and uses that information to help initialized the player.

We should be able to use a suitable default size here for non-JS path, with suitable JS injection if we really want to give a precise size.

More generally, might want to think about passing size params to the frame though along with other options. That's something for later though (needed for use of iframes to handle cross-wiki embedding and edit helpers)

Jdforrester-WMF subscribed.

Mass-Declining all open tasks about the Kaltura audio/video player, as that code is no longer used and has been deleted. See T306971 for more information.