Autoplay videos does not honor silence mode on the phone

RESOLVED WONTFIX

Status

()

Firefox for Android
Audio/Video
RESOLVED WONTFIX
a year ago
a year ago

People

(Reporter: Phyks, Assigned: chunmin, NeedInfo)

Tracking

47 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Build ID: 20160614130443

Steps to reproduce:

Hi,

When browsing a website with an autoplay video, the video will start and sound will be emitted *even* if the phone is in silence mode.

Sound is also emitted even if the phone is locked.

A typical website presenting such annoying videos is http://www.journaldugeek.com/2016/07/30/finalement-il-ny-aura-quun-seul-film-avengers-infinity-war/.



Expected results:

As phone is in silence mode, no sound should be emitted unless the user explicitly requested it via a user interaction.
Component: General → Audio/Video
Chunmin,
Please check this bug.  
This should not be hard and if you need any help, just talk with Alastor. :-)
Flags: needinfo?(cchang)
(Assignee)

Comment 2

a year ago
Hi Lucas,
Just need to clarify a few things to make sure I am in the right path. There are three volume settings in Android, Media , Alarm and Ring. The "silence mode" mentioned here is to turn-off ring sound only? Or the media sound is turned-off too?

I currently can't reproduce this when I set media volume to zero. Could you please check you volume settings in Settings App and give me more detail about the "silence mode"? 

From my tests, the sound will be played when media volume > 0 and ring volume <= 0, whenever chrome or firefox is used.
Flags: needinfo?(cchang)
(Reporter)

Comment 3

a year ago
Sorry, I should indeed clarify a few things. First of all I am running Android 4.4.2.

I am aware of the different volumes settings in Android, but I cannot find a way to configure them separately. I mean, the global volume control (physical buttons) control whatever volume control is currently active (ring by default, media only when some media is played, which is often too late). And the only other options I could find on my Android device are for ring volume control, no direct access to media volume control (or I missed it).

I can confirm your behavior. My issue is that on my phone I seem to have only access to ring volume control, unless a media is played. I guess this is the case for most users.

So when you are in "silent" or "vibrate" ring mode, you don't have any idea of your current setting for media volume, as they seem to be completely decoupled.

That audio is played back without user interaction when I am in silence ring mode is very disturbing, as very often when you are in silence mode, you cannot afford having any sound emitted by your device and this could lead to very awkwards situations.

I am not sure this is the right way (or easiest way) to deal with it, but personally I would:
* Keep the actual behavior for regular videos which requires a user interaction to start playing.
* Check if the phone is in silence mode before running any autoplay video and starting playing it with sound muted by default, requiring a user interaction to toggle sound.

My current workaround is to simply disable autoplay everywhere, everytime.

Thanks
(Assignee)

Comment 4

a year ago
Created attachment 8778511 [details] [diff] [review]
POC: Mute the autoplay medias in silent mode

A simple hack to mute the autoplay medias in silent mode. Here is the demo: https://youtu.be/c5hC5etp_Ws

Hi Sebastian,
This is the feature I mentioned! To address Lucas's pain point, I would like to add a setting to allow user to mute the autoplay medias in silent mode on Fennec. Could you give me some suggestions?
Flags: needinfo?(s.kaspari)
(Reporter)

Comment 5

a year ago
This looks really cool and to match what I was suggesting! Thanks Chun-Min!
I think we need UX's feedback here because I don't think mute all autoplay media by default when we're in "silent/vibration” mode is good idea for everyone. Eg. I often watch video in vibration mode and expect to hear the sound.

Except the hack on comment4, we could also consider other available solutions, such like,
(1) change fennec's volume type to allow user control media volume
(2) add addition mode "muted mode" to mute any media by default (user can switch it on setting menu)
(3) fixed it like comment4, but jump out notification to notify user we mute this media intendedly whenever the autoplay media starts.
(4) any good ideas ;)?
Flags: needinfo?(alam)
I like Chunmin's idea and I have the same problem as Lucas does. It seems some people like Alastor does not expect that behavior :-), so we need to hear more thoughts to come out a solution for all the people as possible as we can. I think we could have a setting to let user choose media volume or phone volume on Fennec.
It's nice to have the solution for this issue, but I think it should be presented as a special mode or something user can *SUPER* easily know how to enable/disable this feature (I think the "about:config" still too heavy for the common users) instead of changing the default HTML behavior.

Compare to other browsers, Android Chrome/Opera seems not to autoplay *ANY* media, that means the keyword "autoplay" doesn't work in Android. We can also take that as a reference, but I don't know whether it's good solution because it also changes the HTML behavior.
I agree it's a good idea to loop in antlam / UX here.

Android has the separate volume channels and if we suddenly use the ringer channel setting to determine whether we play audio or not then we are actively fighting the system; solving one use case but making it more confusing for users how actually manage separate volume settings. On modern Android versions it is much easier to change the volume of specific channels:
https://lh4.ggpht.com/5nAlUQ_tcHwnAGwRN3QEfRo0zaRbldQBnZ_M9r7l_dwfYhdjJYj0izOuzg5cXtzIfRo=h900

(In reply to Alastor Wu [:alwu] from comment #6)
> Eg. I often watch video in vibration mode and expect to hear the
> sound.

Yeah, me too. I'm constantly in "Alarms only" mode (no ringer, no vibration) but I still want to listen to music / videos when I play them.


(In reply to Alastor Wu [:alwu] from comment #6)
> (1) change fennec's volume type to allow user control media volume

This sounds like a good idea too. While you are in Fennec you probably want to change the media volume and not the ringer. Let's see what Anthony thinks about that.
Flags: needinfo?(s.kaspari)
Assignee: nobody → cchang
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(In reply to Alastor Wu [:alwu] from comment #8) 
> Compare to other browsers, Android Chrome/Opera seems not to autoplay *ANY*
> media, that means the keyword "autoplay" doesn't work in Android. We can
> also take that as a reference, but I don't know whether it's good solution
> because it also changes the HTML behavior.
Good point! Since Fennec allows media to be played in the background and auto play media could cause awkward situations (audio plays suddenly) and may waste mobile data (like bug 1273552), we should avoid auto play on Fennec.
(In reply to Blake Wu [:bwu][:blakewu] from comment #10)
> (In reply to Alastor Wu [:alwu] from comment #8) 
> > Compare to other browsers, Android Chrome/Opera seems not to autoplay *ANY*
> > media, that means the keyword "autoplay" doesn't work in Android. We can
> > also take that as a reference, but I don't know whether it's good solution
> > because it also changes the HTML behavior.
> Good point! Since Fennec allows media to be played in the background and
> auto play media could cause awkward situations (audio plays suddenly) and
> may waste mobile data (like bug 1273552), we should avoid auto play on
> Fennec.
One way to disable autoplay is via "Setting", but it looks like it is default on. It would be better to be default off...
(Reporter)

Comment 12

a year ago
(In reply to Blake Wu [:bwu][:blakewu] from comment #11)
> (In reply to Blake Wu [:bwu][:blakewu] from comment #10)
> > (In reply to Alastor Wu [:alwu] from comment #8) 
> > > Compare to other browsers, Android Chrome/Opera seems not to autoplay *ANY*
> > > media, that means the keyword "autoplay" doesn't work in Android. We can
> > > also take that as a reference, but I don't know whether it's good solution
> > > because it also changes the HTML behavior.
> > Good point! Since Fennec allows media to be played in the background and
> > auto play media could cause awkward situations (audio plays suddenly) and
> > may waste mobile data (like bug 1273552), we should avoid auto play on
> > Fennec.
> One way to disable autoplay is via "Setting", but it looks like it is
> default on. It would be better to be default off...

+1

By the way, there was also a discussion a few messages above about
> This sounds like a good idea too. While you are in Fennec you probably want to change the media volume and not the ringer. Let's see what Anthony thinks about that.

I think this could be a good UX as well (but I may not have a full overview of potential issues arising).

Disabling autoplay will prevent the awkward situation from happening, and data plan will be savegarded. But when the user will click on the video (can even happen accidentally), the video will play, with the current media sound level. I am not sure about latest Android versions (I am stuck with 4.4.2), but I cannot find an easy way to set media volume in 4.4.2 (apart from going to a media app such as music player). Being able to set it directly in Firefox would definitely be a major plus.
I think we should take a step back here and look at the problem we're trying to solve. The scope of this bug is to honour the silence mode of phones and I think that's important to fix first.

(In reply to Alastor Wu [:alwu] from comment #6)
> I think we need UX's feedback here because I don't think mute all autoplay
> media by default when we're in "silent/vibration” mode is good idea for
> everyone. Eg. I often watch video in vibration mode and expect to hear the
> sound.

Thanks for looping me in here :) I often do this myself as well, but I think the current system behaviour is easy to understand. I'll elaborate more later in this post.

(In reply to Sebastian Kaspari (:sebastian) from comment #9)
> I agree it's a good idea to loop in antlam / UX here.
> 
> Android has the separate volume channels and if we suddenly use the ringer
> channel setting to determine whether we play audio or not then we are
> actively fighting the system; solving one use case but making it more
> confusing for users how actually manage separate volume settings. On modern
> Android versions it is much easier to change the volume of specific channels:
> https://lh4.ggpht.com/
> 5nAlUQ_tcHwnAGwRN3QEfRo0zaRbldQBnZ_M9r7l_dwfYhdjJYj0izOuzg5cXtzIfRo=h900

I strongly agree with Sebastian here. This is channel separation is the system behaviour that I mentioned earlier. We should stay consistent with the system here.

I.e. we should not use the ringer channel.

> (In reply to Alastor Wu [:alwu] from comment #6)
> > Eg. I often watch video in vibration mode and expect to hear the
> > sound.
> 
> Yeah, me too. I'm constantly in "Alarms only" mode (no ringer, no vibration)
> but I still want to listen to music / videos when I play them.

In this example, as soon as the audio starts playing, pressing "Volume Up" on the side of the phone starts controlling the volume of the audio for me. I think this is the UX we should follow. Rather than surprising the user with sudden audio and assuming that's what they want.
 
> (In reply to Alastor Wu [:alwu] from comment #6)
> > (1) change fennec's volume type to allow user control media volume
> 
> This sounds like a good idea too. While you are in Fennec you probably want
> to change the media volume and not the ringer. Let's see what Anthony thinks
> about that.

I'm not convinced that a user will make this connection actually. That is, as a user, I could be reading an article, and I just want to mute my phone before classes/meetings start. So I'll just press the hardware volume buttons to mute my phone (while Firefox is open). IIRC, this is currently how it works in Chrome. So, we would be fighting against system conventions here.

If we make this change, the user would not be muting their phone, instead, they would be muting "media volume". This could potentially be dangerous. I can see how this might be valuable for some use cases but I think we need to really think it through.

For the purposes of this bug, I think we should avoid using the ringer channel and just use the "media" channel. That is, honour silence mode on the phone first. And have the user go through the necessary steps to turn audio back on.
Flags: needinfo?(alam)
NI-ing Barbara here so she's aware.
Flags: needinfo?(bbermes)
Hi, Anthony,
Sorry I didn't understand your comment very well.
Could you help me explain it again?

(In reply to Anthony Lam (:antlam) from comment #13)
> For the purposes of this bug, I think we should avoid using the ringer channel and just use the "media"
> channel. That is, honour silence mode on the phone first. And have the user go through the necessary
> steps to turn audio back on.

The issue here is the media channel volume in the silence mode doesn't be zero, so the audio would be hear by users.

In this situation, 
(1) you think we should mute these kinds of media by default? 
(2) and what's the "necessary steps to turn audio back on"?

The method in comment 4 is to mute the volume of the autoplay media element by default. If we do so, the user can't unmute it by pressing the volume button, because the muting is to change the volume of the media element instead of changing the Android media volume. The only way user can unmute the media is to press the unmuted-icon in the control interface (if the media element has exposed the control interface).

Thanks!
Flags: needinfo?(alam)
Chunmin,
BTW, could you check if autoplay is enabled in default or not?
If yes, we may need to fire a bug to make it disable in default.
Flags: needinfo?(cchang)
(Assignee)

Updated

a year ago
See Also: → bug 1295064
(Assignee)

Comment 17

a year ago
(In reply to Blake Wu [:bwu][:blakewu] from comment #16)
> Chunmin,
> BTW, could you check if autoplay is enabled in default or not?
> If yes, we may need to fire a bug to make it disable in default.
Hi Blake, bug 1295064 is open to track this issue now.
Flags: needinfo?(cchang)
(In reply to Alastor Wu [:alwu] from comment #15)
> Hi, Anthony,
> Sorry I didn't understand your comment very well.
> Could you help me explain it again?

Yes! definitely :) let me try again.

> (In reply to Anthony Lam (:antlam) from comment #13)
> > For the purposes of this bug, I think we should avoid using the ringer channel and just use the "media"
> > channel. That is, honour silence mode on the phone first. And have the user go through the necessary
> > steps to turn audio back on.
> 
> The issue here is the media channel volume in the silence mode doesn't be
> zero, so the audio would be hear by users.

IF the media channel volume (in silent mode or not) is NOT set at 0, then we should play the media audio file.

I don't want to do anything special here unless we have some research that suggests we should be making this change for our users specifically. Maybe Barbara has more insight though?

> The method in comment 4 is to mute the volume of the autoplay media element
> by default. If we do so, the user can't unmute it by pressing the volume
> button, because the muting is to change the volume of the media element
> instead of changing the Android media volume. The only way user can unmute
> the media is to press the unmuted-icon in the control interface (if the
> media element has exposed the control interface).
> 
> Thanks!

I see that the suggestion in comment 4 is to add a Settings preference. But again, I don't think we need to do this. There are always disadvantages to adding more preferences. We should be careful and deliberate before we add another one.

Hope that helps!
Flags: needinfo?(alam)
(In reply to Anthony Lam (:antlam) from comment #18)
> I see that the suggestion in comment 4 is to add a Settings preference. But
> again, I don't think we need to do this. There are always disadvantages to
> adding more preferences. We should be careful and deliberate before we add
> another one.
> 
> Hope that helps!

Thanks for the explanation :)

According to Anthony's suggestion, maybe we should close this bug because we don't have enough research indicates that muting the autoplay media is good for every users.

I think we can focus on whether need to disable the autoplay on mobile (bug1295064) and close this bug?
Flags: needinfo?(cchang)
(Assignee)

Comment 20

a year ago
Right. If the newest android can easily set the volumes of different channels like: https://lh4.ggpht.com/5nAlUQ_tcHwnAGwRN3QEfRo0zaRbldQBnZ_M9r7l_dwfYhdjJYj0izOuzg5cXtzIfRo=h900, we should use it directly.
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Flags: needinfo?(cchang)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.