Last Comment Bug 537718 - video should scale for a small window
: video should scale for a small window
Status: VERIFIED FIXED
[fixed-in-fx-team]
:
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: mozilla11
Assigned To: (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back)
:
Mentors:
Depends on: 700856
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-04 08:43 PST by kosver
Modified: 2012-02-01 05:27 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v0 - Resize the video if it is larger that the window in a synthetic document. Provide context menu to toggle the resizing. (10.69 KB, patch)
2011-08-16 07:57 PDT, Paul Adenot (:padenot)
dolske: review-
Details | Diff | Review
Patch for bug 537718 dependent upon bug 700856 (585 bytes, patch)
2011-11-10 12:38 PST, (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back)
dao+bmo: review+
roc: review+
Details | Diff | Review

Description kosver 2010-01-04 08:43:42 PST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2b5) Gecko/20091204 Firefox/3.6b5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2b5) Gecko/20091204 Firefox/3.6b5

When you have a small firefox window (or in general a small screen) and you visit http://domain.org/somvid.ogv, the video will be bigger than your browser. So you cannot see the whole video in one piece.

I suggest to implement something like for images. When the image is bigger than the window, than downscale that image to fit the window. So when the video is smaller than the window, downscale the video so it fits the screen. When hovering the video, controls should be added to zoom the video to the normal format.

This is really needed for netbooks and fennec!

Reproducible: Always

Steps to Reproduce:
1. set your screen resolution below or equal to 1440x900
2. open firefox
3. goto http://download.blender.org/peach/trailer/trailer_1080p.ogg
Actual Results:  
the movie is bigger than the window. The only way to see the full movie is to scroll.

Expected Results:  
the movie adapts himself to the window and is maximum the size of the window
Comment 1 Paul Adenot (:padenot) 2011-08-16 07:57:16 PDT
Created attachment 553474 [details] [diff] [review]
Patch v0 - Resize the video if it is larger that the window in a synthetic document. Provide context menu to toggle the resizing.

Here is a patch which implements this feature, which is likely to be useful since video are increasing in resolution, whereas monitor (especially on laptop) are bound to a low screen resolution.

This patch adds two strings, which may not be the best formulation, though.
Comment 2 Justin Dolske [:Dolske] 2011-09-21 16:49:47 PDT
Comment on attachment 553474 [details] [diff] [review]
Patch v0 - Resize the video if it is larger that the window in a synthetic document. Provide context menu to toggle the resizing.

Hmm. We should avoid adding additional UI if at all possible... I can't think of a very compelling use-case for _wanting_ the current behavior (unscaled, overflowing window size), and so the starting point should be to just clamp the maximum video size to the window (ie, scale down when needed).

This is in contrast to images, where it's not uncommon to find extreme width/height ratios (eg, web comics) that makes the scaled version unreadable even on large screens.

Unless there's some compelling reason to support it, I'd say someone wanting to view the 1:1 version should (1) do it in a tiny .html wrapper (2) use VLC (3) use an addon. Oh, and maybe page zoom?

Other nits:

1) Will "max-width: 100%" fix the width overflow? And just clamp the height to the window when needed?

2) Instead of the ratio just round and subtract a few pixels? Or, really, just use CSS and set a margin/padding? See bug 376997 / bug 472942.
Comment 3 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2011-11-01 12:10:12 PDT
We usually don't assign a target milestone until the patch has been landed in mozilla-central.
Comment 4 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2011-11-01 12:15:05 PDT
Unassigning due to lack of activity.

Please see this patch
    attachment 569847 [details] [diff] [review] [diff] [details] [review]
for the necessary CSS parts to change to make this work for videos, as well as try to keep it consistent with that patch so as to create as-little-as-possible bitrot for bug 376997.
Comment 5 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2011-11-10 12:38:57 PST
Created attachment 573602 [details] [diff] [review]
Patch for bug 537718 dependent upon bug 700856

If/when bug 700856 lands, we will only need to apply this patch to achieve the wanted behavior.
Comment 6 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2011-11-11 10:30:44 PST
Comment on attachment 573602 [details] [diff] [review]
Patch for bug 537718 dependent upon bug 700856

Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=d976af0736d2
Comment 7 Dão Gottwald [:dao] 2011-11-12 07:55:32 PST
Comment on attachment 573602 [details] [diff] [review]
Patch for bug 537718 dependent upon bug 700856

I'm not a peer for this code. roc or some other layout peer should review this still.
Comment 8 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2011-11-14 16:00:57 PST
https://hg.mozilla.org/integration/fx-team/rev/188ee9eaabe7
Comment 9 Rob Campbell [:rc] (:robcee) 2011-11-15 14:15:27 PST
https://hg.mozilla.org/mozilla-central/rev/188ee9eaabe7
Comment 10 Mihaela Velimiroviciu (:mihaelav) 2012-02-01 05:27:07 PST
Verified on latest Aurora (11.0a2) builds accross platforms (XP, Win7 x86, Win 7 64 bit, Ubuntu 11.04 x86, Ubuntu 11.04 64 bit, Mac 10.6) and video scales to fit browser window when it is larger than the window. 
Marking as VERIFIED.

Note You need to log in before you can comment on or make changes to this bug.