Open Bug 1284377 Opened 8 years ago Updated 2 years ago

Make media.default_volume apply to all native audio

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

People

(Reporter: caspy77, Unassigned)

References

Details

Attachments

(1 file)

The media.default_volume setting does not affect sites like Sound Cloud which limits the setting's utility.
P3 is the new P2
Priority: P2 → P3
Using media.default_volume value as a default volume in MediaSink::PlaybackParams. The same setting is still used in HTMLMediaElement constructor, to update visual volume meter in HTML media element.
Attachment #8771712 - Flags: review?(ajones)
Proposed patch changes initial volume on Soundcloud, even if I open page in private mode. But even if actual volume is lower than 100%, Soundcloud shows it as 100%, which is a bit confusing.

I don't know if there any way to report to a web application that volume is not full, as it was for HTML media elements. There were "volumechanged" event. But I didn't find equivalent for Web Audio API. Is there any?
Comment on attachment 8771712 [details] [diff] [review]
apply-default-volume-to-mediasink.patch

Sorry for the delay in getting to this. Matthew is the right reviewer for this.
Attachment #8771712 - Flags: review?(ajones) → review?(kinetik)
Comment on attachment 8771712 [details] [diff] [review]
apply-default-volume-to-mediasink.patch

Sorry to bounce this around, but being Web Audio it's more of a Paul or Karl thing.  Since there's no equivalent (that I can see) to a global "volume" (with associated events) on an AudioContext/in a Web Audio graph, I'm not sure what the right way to make this feature work is.
Attachment #8771712 - Flags: review?(kinetik) → review?(karlt)
Comment on attachment 8771712 [details] [diff] [review]
apply-default-volume-to-mediasink.patch

pref_HashTableLookup() asserts that it is used only on the main thread, but
MediaSink::PlaybackParams may be constructed on another thread, so I don't
think this will work out.

However, I don't really understand what this bug report is about.
Comment 3 talks about Web Audio and Comment 0 talks about Sound Cloud.

I don't see Sound Cloud using Web Audio.  Do you?

Note that default_volume is only going to change the media element's default
volume.  If a site sets the volume explicitly, then it will override the
default volume, and that will be necessary for a site to implement its own
volume control.

In Web Audio, there is no master volume control, and setting a
default volume on every gain node would not be appropriate.  I don't think
something equivalent to media.default_volume from HTML media element is
possible with Web Audio.

The best that could be done would be the equivalent of media.volume_scale, but
that already exists.  Is that equivalent to what this patch is aiming to do?
Attachment #8771712 - Flags: review?(karlt) → review-
(In reply to Karl Tomlinson (:karlt) from comment #6)
> I don't see Sound Cloud using Web Audio.  Do you?

I was searching for <audio> tag on Sound Cloud page, but didn't find
it, and decided the only other way left is Web Audio. But there are
no Web Audio contexts shown in Inspector, so most probably, that site
just creates Audio element, but doesn't insert it into the document.
(There are large amounts of Javascript code on the page, so I'm
not sure.)

> 
> In Web Audio, there is no master volume control, and setting a
> default volume on every gain node would not be appropriate.  I don't think
> something equivalent to media.default_volume from HTML media element is
> possible with Web Audio.
> 
> The best that could be done would be the equivalent of media.volume_scale,
> but
> that already exists.  Is that equivalent to what this patch is aiming to do?

Not exactly. The idea was to make some non-100% value as default, but to allow
increasing it. At least for HTML media elements. There is nothing can be done
in case of Web Audio, indeed.

I now see that my assumption was not good enough. I need some time to
understand the code better.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: