Closed Bug 537718 Opened 10 years ago Closed 8 years ago

video should scale for a small window


(Core :: Layout, enhancement)

Not set





(Reporter: nikosverschore, Assigned: jaws)



(Whiteboard: [fixed-in-fx-team])


(1 file, 1 obsolete file)

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, 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
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
Component: General → Video/Audio
Product: Firefox → Core
QA Contact: general →
OS: Linux → All
Hardware: x86 → All
Component: Video/Audio → Video/Audio Controls
Product: Core → Toolkit
QA Contact: →
Assignee: nobody → paul
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.
Attachment #553474 - Flags: review?(dolske)
Ever confirmed: true
Target Milestone: --- → mozilla8
Version: unspecified → Trunk
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.
Attachment #553474 - Flags: review?(dolske) → review-
We usually don't assign a target milestone until the patch has been landed in mozilla-central.
Target Milestone: mozilla8 → ---
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.
Assignee: paul → nobody
Whiteboard: [good first bug][mentor=jwein]
Whiteboard: [good first bug][mentor=jwein] → [good first bug][mentor=jwein][lang=js]
If/when bug 700856 lands, we will only need to apply this patch to achieve the wanted behavior.
Assignee: nobody → jwein
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.
Attachment #573602 - Flags: review?(dao) → review+
Component: Video/Audio Controls → Layout
Depends on: 700856
Product: Toolkit → Core
QA Contact: → layout
Whiteboard: [good first bug][mentor=jwein][lang=js]
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
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.
You need to log in before you can comment on or make changes to this bug.