Closed
Bug 449149
Opened 16 years ago
Closed 16 years ago
Add support for <audio controls>
Categories
(Toolkit :: Video/Audio Controls, enhancement)
Toolkit
Video/Audio Controls
Tracking
()
VERIFIED
FIXED
mozilla1.9.1b3
People
(Reporter: jcranmer, Assigned: roc)
References
Details
(Keywords: verified1.9.1)
Attachments
(1 file, 2 obsolete files)
15.85 KB,
patch
|
roc
:
review+
enndeakin
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
The lack of <audio controls> makes it harder for me to put an <audio> in my blog without surprising people going to planet...
Comment 1•16 years ago
|
||
The work in bug 448909 should be applicable to this bug, the APIs for <audio> and <video> are basically the same. I wouldn't be surprised if just hooking up the video controls XBL to <audio> Just Worked, although I'm not sure what layout size an <audio> element is supposed to be.
OS: Linux → All
Hardware: PC → All
Assignee | ||
Comment 2•16 years ago
|
||
We really should have this. We're broken without it.
Assignee: nobody → roc
Flags: blocking1.9.1+
Comment 3•16 years ago
|
||
Do <audio> elements default to any particular size (assuming one was not explicitly set)?
Assignee | ||
Comment 4•16 years ago
|
||
That's up to us. I plan to make them automatically size to the preferred height of the controls.
Assignee | ||
Comment 5•16 years ago
|
||
-- Let frame construction create nsVideoFrames for <audio> elements
-- But make <audio> elements without 'controls' be display:none in forms.css
(so an <audio> element without 'controls' can be made visible using author-set 'display'; 449149-2.html tests this)
-- nsVideoFrame shouldn't try to paint video unless it's a video element
-- The intrinsic size of an <audio> element is 300px wide and the preferred height of the controls
-- The controls for an <audio> element should not fade out automatically.
-- Currently videocontrols.xml is relying on auto-fade-in/out to handle dynamic changes to the 'controls' attribute. That won't work for <audio> elements. So I've removed those dynamic checks and I'm using forms.css to set visibility:hidden on the controls when the 'controls' attribute is not set.
Attachment #352476 -
Flags: superreview?(bzbarsky)
Attachment #352476 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•16 years ago
|
Attachment #352476 -
Flags: review?(dolske)
Assignee | ||
Comment 6•16 years ago
|
||
Comment on attachment 352476 [details] [diff] [review]
fix
Need Justin's review on videocontrols.xml
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs review]
Comment 7•16 years ago
|
||
Comment on attachment 352476 [details] [diff] [review]
fix
>+ // Note that forms.css specifies display:none for audio elements
>+ // without the "controls" attribute.
How come that's in forms.css and not html.css, by the way? It doesn't seem form-related at all.
>+++ b/layout/generic/nsVideoFrame.cpp
nsVideoFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
> {
> // XXX The caller doesn't account for constraints of the height,
> // min-height, and max-height properties.
I'm not sure what this comment has to do with the intrinsic width getter functions. I realize it was already here (and in GetPrefWidth()), but I think it should be removed.
>+++ b/layout/style/forms.css
As above, maybe all the audio/video stuff should be in html.css.
>+video:not([controls]) > xul|videocontrols, audio:not([controls]) > xul|videocontrols {
>+ visibility: hidden;
>+}
>+
>+audio:not([controls]) {
>+ display: none;
> }
Should that second rule be !important? Or do we want to allow sites to bind XBL of their own to <audio> or something?
If it becomes !important, the audio part of the :not([controls]) rule can, imo, be removed (though with comments that it needs readding if the !important is removed).
r+sr=bzbarsky with the nits
Attachment #352476 -
Flags: superreview?(bzbarsky)
Attachment #352476 -
Flags: superreview+
Attachment #352476 -
Flags: review?(bzbarsky)
Attachment #352476 -
Flags: review+
Assignee | ||
Comment 8•16 years ago
|
||
(In reply to comment #7)
> (From update of attachment 352476 [details] [diff] [review])
> >+ // Note that forms.css specifies display:none for audio elements
> >+ // without the "controls" attribute.
>
> How come that's in forms.css and not html.css, by the way? It doesn't seem
> form-related at all.
Yeah, it should be html.css. Want me to move it?
> >+++ b/layout/generic/nsVideoFrame.cpp
> nsVideoFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
> > {
> > // XXX The caller doesn't account for constraints of the height,
> > // min-height, and max-height properties.
>
> I'm not sure what this comment has to do with the intrinsic width getter
> functions. I realize it was already here (and in GetPrefWidth()), but I think
> it should be removed.
OK
> >+video:not([controls]) > xul|videocontrols, audio:not([controls]) > xul|videocontrols {
> >+ visibility: hidden;
> >+}
> >+
> >+audio:not([controls]) {
> >+ display: none;
> > }
>
> Should that second rule be !important? Or do we want to allow sites to bind
> XBL of their own to <audio> or something?
I think it's reasonable to allow authors to style <audio>. We allow them to style <head> for example. But we could go with !important if you prefer.
> If it becomes !important, the audio part of the :not([controls]) rule can, imo,
> be removed (though with comments that it needs readding if the !important is
> removed).
Sure.
Comment 9•16 years ago
|
||
Comment on attachment 352476 [details] [diff] [review]
fix
Looks fine to me, though do note that your patch appears to be on top of the work in bug 461680, which got backed out.
Also, I'm not a toolkit peer, so technically Enn should rs this. (Although it's really just trivial JS changes...)
Attachment #352476 -
Flags: review?(dolske) → review+
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs review] → [needs landing]
Assignee | ||
Comment 10•16 years ago
|
||
Updated for comments
Attachment #352476 -
Attachment is obsolete: true
Attachment #352617 -
Flags: superreview+
Attachment #352617 -
Flags: review+
Assignee | ||
Comment 11•16 years ago
|
||
Comment on attachment 352617 [details] [diff] [review]
fix v2
Better get Enn to sign off on the toolkit change
Attachment #352617 -
Flags: review?(enndeakin)
Assignee | ||
Comment 12•16 years ago
|
||
Oops, I broke things in the move to html.css
Attachment #352617 -
Attachment is obsolete: true
Attachment #352622 -
Flags: superreview+
Attachment #352622 -
Flags: review+
Attachment #352617 -
Flags: review?(enndeakin)
Assignee | ||
Updated•16 years ago
|
Attachment #352622 -
Flags: review?(enndeakin)
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs landing] → [needs review]
Comment 13•16 years ago
|
||
Comment on attachment 352622 [details] [diff] [review]
fix v3
> // XXX add support for dynamically hiding controls w/o waiting for mouseout?
>- if (!this.Utils.video.controls)
>- return;
Why are you removing this part?
Assignee | ||
Comment 14•16 years ago
|
||
Because I'm using CSS to automatically hide the controls when the 'controls' attribute is missing. See the end of comment #5. The rule is
+video:not([controls]) > xul|videocontrols,
+audio:not([controls]) > xul|videocontrols {
+ visibility: hidden;
+}
So we don't need or want the controls binding to worry about whether the 'controls' attribute is set. Note that visiblity:hidden makes the controls impervious to events as well.
Updated•16 years ago
|
Attachment #352622 -
Flags: review?(enndeakin) → review+
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs review] → [needs landing]
Assignee | ||
Comment 15•16 years ago
|
||
Pushed 4178997e692a to trunk.
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 191 landing]
Comment 17•16 years ago
|
||
dbaron, Roc,
Are there any examples of sites that have implemented <audio controls> in their videos? Looking to verify this bug, but can't find any content out there. Thanks.
Assignee | ||
Comment 18•16 years ago
|
||
If you open a .wav file in the browser you'll get an element with controls.
Comment 19•15 years ago
|
||
Verified fix on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090420 Minefield/3.6a1pre
and Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b4pre) Gecko/20090420 Shiretoko/3.5b4pre
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
Comment 20•15 years ago
|
||
Additional verification: While helping someone in IRC I created a sample html file with the audio tag and the controls attribute, which displays the controls when loaded. Without the controls attribute you don't see the controls.
Updated•15 years ago
|
Component: Video/Audio → Video/Audio Controls
Product: Core → Toolkit
QA Contact: video.audio → video.audio
Target Milestone: mozilla1.9.1b3 → ---
Version: Trunk → unspecified
Updated•15 years ago
|
Target Milestone: --- → mozilla1.9.1b3
You need to log in
before you can comment on or make changes to this bug.
Description
•