Page MenuHomePhorge

Embedded videos are disproportionately huge
Open, Needs TriagePublic

Description

I'm not really sure if this is working as intended, but when you embed a video in a task, it is allowed to take up all the space it needs, up to 95% of the container width. This can make the task description quite hard to read, especially if there isn't much text. For example (this one's not even too bad), see https://phabricator.wikimedia.org/T392483. It'd be great if the size could be limited, like for images; maybe with an explicit size parameter.

Event Timeline

Thanks. Yes. I can reproduce. Relevant documentation:

https://we.phorge.it/book/phorge/article/remarkup/#embedding-images

The default args for images is {F123,size=thumb}, and the same should be for videos, but the size= seems not working for videos.

Also, the width= works for images and memes, but it seems also not working for videos.

Proposed Non-Solution

It's probably overkill to generate thumbnails for videos... like it happens for images and memes. Doing so would be very complicated and resource expensive so I discourage such generative approach.

Proposed Solution: just HTML/CSS

Just respecting the default size=thumb or custom width=something using just HTML/CSS would be super, probably (so, without thumbnail generation).


So, patch welcome.

See general code for images:

https://we.phorge.it/source/phorge/browse/master/src/applications/files/markup/PhabricatorImageRemarkupRule.php

Relevant code for videos:

https://we.phorge.it/source/phorge/browse/master/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php

P.S. I wonder... what happens if we expose the width/height here. But probably just touching that would be enough. Still, patch welcome 👍

https://we.phorge.it/source/phorge/browse/master/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php;cadc00d744ebcacca7fe56005f963a7b84eb1c4a$316-323