video should scale for a small window

VERIFIED FIXED in mozilla11

Status

()

Core
Layout
--
enhancement
VERIFIED FIXED
8 years ago
6 years ago

People

(Reporter: kosver, Assigned: jaws)

Tracking

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

8 years ago
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

Updated

8 years ago
Component: General → Video/Audio
Product: Firefox → Core
QA Contact: general → video.audio

Updated

8 years ago
OS: Linux → All
Hardware: x86 → All
Component: Video/Audio → Video/Audio Controls
Product: Core → Toolkit
QA Contact: video.audio → video.audio

Updated

6 years ago
Assignee: nobody → paul
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.
Attachment #553474 - Flags: review?(dolske)

Updated

6 years ago
Status: UNCONFIRMED → ASSIGNED
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
Status: ASSIGNED → NEW
Whiteboard: [good first bug][mentor=jwein]

Updated

6 years ago
Whiteboard: [good first bug][mentor=jwein] → [good first bug][mentor=jwein][lang=js]
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 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
Attachment #573602 - Flags: review?(dao)
Assignee: nobody → jwein
Status: NEW → ASSIGNED
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+

Updated

6 years ago
Component: Video/Audio Controls → Layout
Depends on: 700856
Product: Toolkit → Core
QA Contact: video.audio → layout
Whiteboard: [good first bug][mentor=jwein][lang=js]
Attachment #573602 - Flags: review?(roc)
Attachment #573602 - Flags: review?(roc) → review+
Attachment #553474 - Attachment is obsolete: true
https://hg.mozilla.org/integration/fx-team/rev/188ee9eaabe7
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/188ee9eaabe7
Status: ASSIGNED → RESOLVED
Last Resolved: 6 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.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.