Closed
Bug 689374
Opened 13 years ago
Closed 6 years ago
Specialized HTML5 audio controls for small-dimensions
Categories
(Toolkit :: Video/Audio Controls, defect)
Toolkit
Video/Audio Controls
Tracking
()
RESOLVED
FIXED
People
(Reporter: jaws, Unassigned, Mentored)
References
Details
(Whiteboard: [lang=js])
Attachments
(15 obsolete files)
Similar to bug 462117, we need to have a way to either reduce the amount of visible controls or restyle them to fit smaller dimensions when HTML5 <audio> tags have widths & heights that don't fit the default sizes.
Reporter | ||
Updated•13 years ago
|
Whiteboard: [good first bug][mentor=jwein]
Reporter | ||
Comment 1•13 years ago
|
||
This bug is similar to bug 462117, except we can't base our calculations off of |videoHeight| and |videoWidth|. We should be able to use much of the same code, but will just have to depend on different width/height for our calculations.
Comment 2•13 years ago
|
||
I've created a test page by modifying a test page from the earlier bug ( http://panuhorsmalahti.fi/audiodimensions.html ). I'll take a shot at creating a patch later.
Reporter | ||
Comment 3•13 years ago
|
||
(In reply to Panu Horsmalahti from comment #2)
> I've created a test page by modifying a test page from the earlier bug (
> http://panuhorsmalahti.fi/audiodimensions.html ). I'll take a shot at
> creating a patch later.
Cool, please let me know if there is anything I can do to help you out with getting started.
Reporter | ||
Comment 4•13 years ago
|
||
The changes necessary to fix this bug should be made in /toolkit/content/widgets/videocontrols.xml
Whiteboard: [good first bug][mentor=jwein] → [good first bug][mentor=jwein][lang=js]
Comment 5•13 years ago
|
||
If nobody is currently working on this, I can pick it up.
Reporter | ||
Updated•13 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Updated•13 years ago
|
Whiteboard: [good first bug][mentor=jwein][lang=js] → [good first bug][mentor=jaws][lang=js]
Reporter | ||
Updated•12 years ago
|
Assignee: bhatnagar.anurag → nobody
Status: ASSIGNED → NEW
Whiteboard: [good first bug][mentor=jaws][lang=js] → [mentor=jaws][lang=js]
For a project in our Software Engineering class, we would like to work on this bug. Thank you!
Reporter | ||
Comment 8•12 years ago
|
||
Great! Let me know of any questions you may have :)
Assignee: nobody → dragonfiredtb
Status: NEW → ASSIGNED
Hey Jared, I dont know if Bao mentioned to you that I'm his partner for the Software Engineering class. I will take a look at this bug and let you know if I have any questions.
Comment 10•12 years ago
|
||
Jared, So for the bug, the main issue is adjusting the visible controls to fit within the <audio> tags right? If so, the changes im proposing is to write a javascript function that can get the height and width and compare it to the default one and scale the controls accordingly with the height and width.
Reporter | ||
Comment 11•12 years ago
|
||
What do you mean by "the default one"? Basically, the buttons in the audio controls have a fixed width. The scrubber is the only flexible width item in the controls and that grows to consume the available space.
You can look at the code that was changed for bug 462117, https://hg.mozilla.org/mozilla-central/rev/5a45436b3c18, for an example.
Comment 12•12 years ago
|
||
what i meant by the default one is the width and height for the <audio> tags. Thank you for the reference to bug 462117. which url link should I look at to see where the bug happens?
Reporter | ||
Comment 13•12 years ago
|
||
You should be able to use http://panuhorsmalahti.fi/audiodimensions.html for testing.
Comment 14•12 years ago
|
||
ok thank you for the link. I'll start working on it soon and make the changes accordingly. Thanks.
Comment 15•12 years ago
|
||
Hey Jared, i compared the submitted code from bug 462117 and see the changes inside videocontrols.css and videocontrols.xml. I was wondering what parts of the code I should focus on so that the visible controls fit the dimensions?
Comment 16•12 years ago
|
||
Tests should include how text from the <track> element appears from bug 833385.
Comment 17•11 years ago
|
||
Attachment #754684 -
Flags: review?(jaws)
Flags: needinfo?(jaws)
Reporter | ||
Comment 18•11 years ago
|
||
Comment on attachment 754684 [details] [diff] [review]
First attempt at fixing the audio controls
This attachment doesn't show what has been added, removed, or changed.
You'll have to resubmit the patch following the steps that are described here: https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F
Attachment #754684 -
Flags: review?(jaws)
Comment 19•11 years ago
|
||
Attachment #754684 -
Attachment is obsolete: true
Attachment #754890 -
Flags: review?(jaws)
Reporter | ||
Comment 20•11 years ago
|
||
Comment on attachment 754890 [details] [diff] [review]
First attempt at fixing the audio controls
Review of attachment 754890 [details] [diff] [review]:
-----------------------------------------------------------------
This patch includes the code changes from bug 730626. Please separate these changes. This patch also changed a bunch of lines from having leading space characters to leading tab characters.
Please fix up these two issues and reupload.
Attachment #754890 -
Flags: review?(jaws)
Comment 21•11 years ago
|
||
Attachment #754890 -
Attachment is obsolete: true
Attachment #755188 -
Flags: review?(jaws)
Reporter | ||
Comment 22•11 years ago
|
||
Comment on attachment 755188 [details] [diff] [review]
First attempt at fixing the audio controls
Review of attachment 755188 [details] [diff] [review]:
-----------------------------------------------------------------
This patch is based off a non-existent revision. Can you try getting a new clone of the mozilla-central tree and making your changes again?
Attachment #755188 -
Flags: review?(jaws) → review-
Comment 23•11 years ago
|
||
Attachment #755188 -
Attachment is obsolete: true
Attachment #755554 -
Flags: review?(jaws)
Reporter | ||
Comment 24•11 years ago
|
||
Comment on attachment 755554 [details] [diff] [review]
First attempt at fixing the audio controls
Review of attachment 755554 [details] [diff] [review]:
-----------------------------------------------------------------
Much of this code is duplicated in the two cases. It seems that the only part that needs to be handled separately is calculating the height and width of the media element.
::: toolkit/content/widgets/videocontrols.xml
@@ +1337,5 @@
> _overlayPlayButtonWidth : 64,
> adjustControlSize : function adjustControlSize() {
> + if (this.isAudioOnly){
> + let audioHeight = this.video.clientHeight;
> + let audioWidth = this.video.clientWidth;
What values do audioHeight and audioWidth have?
If this patch works, then we can probably change nothing except removing the "if (this.isAudioOnly) return" code and renaming videoHeight and videoWidth to mediaHeight and mediaWidth, respectively.
Attachment #755554 -
Flags: review?(jaws)
Comment 25•11 years ago
|
||
Attachment #755554 -
Attachment is obsolete: true
Attachment #755710 -
Flags: review?(jaws)
Reporter | ||
Comment 26•11 years ago
|
||
What values do mediaWidth and mediaHeight have for <audio> elements? What happens when the page doesn't specify a size for the element?
Flags: needinfo?(seanchen)
Comment 27•11 years ago
|
||
Attachment #755710 -
Attachment is obsolete: true
Attachment #755710 -
Flags: review?(jaws)
Attachment #757011 -
Flags: feedback?(jaws)
Flags: needinfo?(seanchen)
Reporter | ||
Comment 28•11 years ago
|
||
Comment on attachment 757011 [details] [diff] [review]
Added console.log for debugging.
Review of attachment 757011 [details] [diff] [review]:
-----------------------------------------------------------------
Hi Sean, we don't need to check in these log statements. Do you have answers to the previous questions?
Attachment #757011 -
Flags: feedback?(jaws)
Comment 29•11 years ago
|
||
I cannot see the values for mediaWidth and mediaHeight through console.log. Where would I be able to see the results from console.log? For the second question, are you talking about mediaWidth and mediaHeight when they don't specify a size?
Reporter | ||
Comment 30•11 years ago
|
||
(In reply to Sean Chen from comment #29)
> I cannot see the values for mediaWidth and mediaHeight through console.log.
> Where would I be able to see the results from console.log?
We talked about this over IRC.
> For the second
> question, are you talking about mediaWidth and mediaHeight when they don't
> specify a size?
Yes, when a webpage is simply:
<html><body><audio src="foo.mp4" controls/></body></html>
Comment 31•11 years ago
|
||
Here are the results I have for mediaWidth and mediaHeight for the audio elements.
Media Height: 0 Media Width: 25
Media Height: 0 Media Width: 48
Media Height: 0 Media Width: 96
Media Height: 0 Media Width: 192
Media Height: 0 Media Width: 383
Media Height: 0 Media Width: 96
Media Height: 0 Media Width: 48
Media Height: 0 Media Width: 25
when the page doesn't specify a size for the <audio> element, it would use only the css code that is set up for the width and height percentages.
The problem with the code now is that when I take out if(this.isAudioOnly) return; it would not show the audio controls and scrubber. What I wanted to do was to have it set up the width and height for the audio controls respectively and determine whether or not to reduce the size of the dimensions. I was wondering if I can get some feedback on how I can solve this problem.
Reporter | ||
Comment 32•11 years ago
|
||
Bao or Sean, can you test out this patch? It seems to fix all the issues with the audio control sizing, as well as fixing issues with entering fullscreen and toggling playback for audio elements.
Attachment #757011 -
Attachment is obsolete: true
Attachment #758368 -
Flags: feedback?(bduong)
Flags: needinfo?(jaws)
Comment 33•11 years ago
|
||
Attachment #758409 -
Flags: review?(jaws)
Attachment #758409 -
Flags: feedback?(jaws)
Comment 34•11 years ago
|
||
Attachment #758409 -
Attachment is obsolete: true
Attachment #758409 -
Flags: review?(jaws)
Attachment #758409 -
Flags: feedback?(jaws)
Attachment #758419 -
Flags: review?(jaws)
Attachment #758419 -
Flags: feedback?(jaws)
Comment 35•11 years ago
|
||
Attachment #758419 -
Attachment is obsolete: true
Attachment #758419 -
Flags: review?(jaws)
Attachment #758419 -
Flags: feedback?(jaws)
Attachment #758427 -
Flags: review?(jaws)
Attachment #758427 -
Flags: feedback?(jaws)
Comment 36•11 years ago
|
||
Attachment #758429 -
Flags: review?(jaws)
Attachment #758429 -
Flags: feedback?(jaws)
Comment 37•11 years ago
|
||
Attachment #758427 -
Attachment is obsolete: true
Attachment #758429 -
Attachment is obsolete: true
Attachment #758427 -
Flags: review?(jaws)
Attachment #758427 -
Flags: feedback?(jaws)
Attachment #758429 -
Flags: review?(jaws)
Attachment #758429 -
Flags: feedback?(jaws)
Attachment #758430 -
Flags: review?(jaws)
Attachment #758430 -
Flags: feedback?(jaws)
Reporter | ||
Comment 38•11 years ago
|
||
Comment on attachment 758430 [details] [diff] [review]
Patch v1.0
Review of attachment 758430 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/content/widgets/videocontrols.xml
@@ +1346,5 @@
> _playButtonWidth : 0,
> _durationLabelWidth : 0,
> _muteButtonWidth : 0,
> _fullscreenButtonWidth : 0,
> + _controlBarHeight : 28,
I don't see why setting this to 28 will change anything. The initial value is overwritten in setupInitialState().
Attachment #758430 -
Flags: review?(jaws)
Attachment #758430 -
Flags: review-
Attachment #758430 -
Flags: feedback?(jaws)
Reporter | ||
Updated•11 years ago
|
Attachment #758368 -
Flags: feedback?(bduong)
Comment 39•11 years ago
|
||
Attachment #758430 -
Attachment is obsolete: true
Attachment #758718 -
Flags: review?(jaws)
Attachment #758718 -
Flags: feedback?(jaws)
Reporter | ||
Comment 40•11 years ago
|
||
Comment on attachment 758718 [details] [diff] [review]
Patch v1.0
Review of attachment 758718 [details] [diff] [review]:
-----------------------------------------------------------------
What is the difference between this patch and the one that I uploaded?
Attachment #758718 -
Flags: review?(jaws)
Attachment #758718 -
Flags: feedback?(jaws)
Comment 41•11 years ago
|
||
Apparently since you didnt think that _controlBarHeight set to 28 wont make a difference. I changed it back to 0. I tried out your patch and it worked fine once i set the height to 28px on the test file. So I was wondering what else should I change?
Reporter | ||
Comment 42•11 years ago
|
||
Well, we'll only need to change something if it's not working correctly. Unfortunately, we don't have a plan for what to do with media elements that have a height of 0, since we don't want to change the way the page is laid out.
I'll move my original patch forward for review.
Reporter | ||
Updated•11 years ago
|
Attachment #758718 -
Attachment is obsolete: true
Reporter | ||
Comment 43•11 years ago
|
||
This patch combines a few different fixes for our audio controls. I can split them to separate bugs if you'd like, or we can just update the bug summary to reflect the various fixes.
Attachment #758368 -
Attachment is obsolete: true
Attachment #759349 -
Flags: review?(dolske)
Comment 44•11 years ago
|
||
Comment on attachment 759349 [details] [diff] [review]
Patch v1.1
Review of attachment 759349 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/content/widgets/videocontrols.css
@@ +91,5 @@
>
> .controlBar[size="hidden"],
> .controlBar[size="small"] .durationBox,
> .controlBar[size="small"] .durationLabel,
> +.controlBar[size="small"] .scrubberStack,
Why is this changing from visibility:hidden to visibility:collapse?
::: toolkit/content/widgets/videocontrols.xml
@@ +1035,5 @@
> },
>
> toggleFullscreen : function () {
> + if (this.isAudioOnly)
> + return;
This seems wrong. If it's an audio file, we just shouldn't show the FS button/menu instead of making it do nothing. And we have code to do that -- is it broken?
@@ +1068,5 @@
>
> clickToPlayClickHandler : function(e) {
> + // Don't toggle playback for non-left clicks or for
> + // audio-only media since there is nothing visual to click on.
> + if (e.button != 0 || this.isAudioOnly)
Similar comment -- this handler is only attached to two elements...
- clickToPlay, which should be hidden for audio-only elements
- controlsSpacer, which should be height=0 for <audio>
I think only controlsSpacer would actually be clickable in the first place, for <video src=audio-only.ogg> since video gets a default height. Is there a reason to make clicking not work in this specific case?
::: toolkit/themes/osx/global/media/videocontrols.css
@@ +48,5 @@
> }
>
> +.controlBar[size="small"] > .playButton {
> + margin-right: 0;
> +}
Hmm, was this broken for small-dimension <video>? *tests* oh dear. Did we goof this from the beginning, or did something else make this regress?
It's resetting the negative-margin used for the scrubber overlap, which has basically always been there... :|
Attachment #759349 -
Flags: review?(dolske) → review-
Reporter | ||
Comment 45•11 years ago
|
||
(In reply to Justin Dolske [:Dolske] from comment #44)
> Comment on attachment 759349 [details] [diff] [review]
> Patch v1.1
>
> Review of attachment 759349 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: toolkit/content/widgets/videocontrols.css
> @@ +91,5 @@
> >
> > .controlBar[size="hidden"],
> > .controlBar[size="small"] .durationBox,
> > .controlBar[size="small"] .durationLabel,
> > +.controlBar[size="small"] .scrubberStack,
>
> Why is this changing from visibility:hidden to visibility:collapse?
Because <video> or <audio> that were 64px wide still couldn't fit the controls. Video doesn't matter much, who does that anyway lol?, but for <audio> I can picture people wanting a small 64px wide x 35px high element.
> ::: toolkit/content/widgets/videocontrols.xml
> @@ +1035,5 @@
> > },
> >
> > toggleFullscreen : function () {
> > + if (this.isAudioOnly)
> > + return;
>
> This seems wrong. If it's an audio file, we just shouldn't show the FS
> button/menu instead of making it do nothing. And we have code to do that --
> is it broken?
We now have dblclick on the controlsSpacer to enter fullscreen.
> @@ +1068,5 @@
> >
> > clickToPlayClickHandler : function(e) {
> > + // Don't toggle playback for non-left clicks or for
> > + // audio-only media since there is nothing visual to click on.
> > + if (e.button != 0 || this.isAudioOnly)
>
> Similar comment -- this handler is only attached to two elements...
>
> - clickToPlay, which should be hidden for audio-only elements
> - controlsSpacer, which should be height=0 for <audio>
>
> I think only controlsSpacer would actually be clickable in the first place,
> for <video src=audio-only.ogg> since video gets a default height. Is there a
> reason to make clicking not work in this specific case?
An audio element with a specified height that is greater than 28px will have a non-zero height controlsSpacer. That blank area shouldn't react to clicks since it's not obvious you are clicking on something.
> ::: toolkit/themes/osx/global/media/videocontrols.css
> @@ +48,5 @@
> > }
> >
> > +.controlBar[size="small"] > .playButton {
> > + margin-right: 0;
> > +}
>
> Hmm, was this broken for small-dimension <video>? *tests* oh dear. Did we
> goof this from the beginning, or did something else make this regress?
>
> It's resetting the negative-margin used for the scrubber overlap, which has
> basically always been there... :|
We didn't goof this from the beginning. The change above from visibility:hidden to visibility:collapse makes this change necessary, but it now means that we can have the play/pause and mute buttons right next to each other.
Reporter | ||
Comment 46•11 years ago
|
||
Comment on attachment 759349 [details] [diff] [review]
Patch v1.1
Re-requesting review. Please see my response in comment #45.
Attachment #759349 -
Flags: review- → review?(dolske)
Reporter | ||
Comment 47•11 years ago
|
||
Review ping?
Comment 48•11 years ago
|
||
Something's still not right here. (Window on top is with patch, background is Nightly, video is 70 pixels wide)
Comment 49•11 years ago
|
||
Comment on attachment 759349 [details] [diff] [review]
Patch v1.1
I think I'm ok with previous explanations. But the visual appearance is still goofy, so let's just get it sane.
Better testcase: http://dolske.net/mozilla/tests/video/sizes.html
Attachment #759349 -
Flags: review?(dolske) → review-
Comment 50•11 years ago
|
||
Updated:
http://dolske.net/mozilla/tests/video/sizes_audio.html
http://dolske.net/mozilla/tests/video/sizes_video.html
Also just noticed http://panuhorsmalahti.fi/audiodimensions.html was already listed here, that's useful too.
I'm now getting empty/tiny audio elements though. O_o
Assignee | ||
Updated•10 years ago
|
Mentor: jaws
Whiteboard: [mentor=jaws][lang=js] → [lang=js]
Reporter | ||
Updated•7 years ago
|
Assignee: bduong → nobody
Status: ASSIGNED → NEW
Comment 51•6 years ago
|
||
Hello everyone! I am new to Bugzilla and this would be my first mentored bug. I have little knowledge of python, HTML and CSS. In case, no one is working on this bug, may I please pick this up?
It would also be great if someone please explains me the working procedure in case this bug is assigned to me.
Thanks in advance!
Reporter | ||
Comment 52•6 years ago
|
||
Thanks for your interest Preeti! Looking at the links in comment 50, this bug appears to have been fixed in the past five years.
I did some searching and it appears that it was fixed by these two bugs:
The first part is https://bugzilla.mozilla.org/show_bug.cgi?id=1271765 and the second part is a patch within this range, https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=9af23c413a1f8d337b19b4f8450e241e91b71136&tochange=587daa4bdc4b40b7053f4ca3b74723ca747f3b52
Bug 1271765 mainly fixed this, though without the second part audio elements that were very narrow weren't getting rendered.
Reporter | ||
Updated•6 years ago
|
Attachment #759349 -
Attachment is obsolete: true
Reporter | ||
Updated•6 years ago
|
Attachment #770500 -
Attachment is obsolete: true
Comment 53•6 years ago
|
||
(In reply to Jared Wein [:jaws] (please needinfo? me) from comment #52)
> Thanks for your interest Preeti! Looking at the links in comment 50, this
> bug appears to have been fixed in the past five years.
>
> I did some searching and it appears that it was fixed by these two bugs:
>
> The first part is https://bugzilla.mozilla.org/show_bug.cgi?id=1271765 and
> the second part is a patch within this range,
> https://hg.mozilla.org/mozilla-central/
> pushloghtml?fromchange=9af23c413a1f8d337b19b4f8450e241e91b71136&tochange=587d
> aa4bdc4b40b7053f4ca3b74723ca747f3b52
>
> Bug 1271765 mainly fixed this, though without the second part audio elements
> that were very narrow weren't getting rendered.
Ok, Thank you!
You need to log in
before you can comment on or make changes to this bug.
Description
•