mozilla-mobile / focus-android

⚠️ Firefox Focus (Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
2.11k stars 711 forks source link

No way to disable autoplay videos on Firefox Focus Android #2003

Closed I-Campbell closed 2 years ago

I-Campbell commented 6 years ago

Device : Moto C Android: lollipop Example website: Facebook newsfeed videos Issue: on Firefox, you can turn off auto play of videos to save data and battery, and sometimes you just don't want to see a video. This is not available in Firefox Focus. I think disable autoplay should be hardcoded, that is to say it doesn't add an option to the settings menu to turn it back on. This will mean there will be less clutter, and this feature ties in with the Focus philosophy of being fast and saving data.

mcomella commented 6 years ago

I'm not sure how feasible it is to display autoplay, but we agree that it'd be a great feature (and I think autoplay defaults to false on Firefox for Android).

siddware commented 6 years ago

@mcomella I looked into this, and here are some observations: URL used: http://demos.flowplayer.org/basics/autoplay.html Firefox doesn't play the video automatically, but Chrome and Firefox Focus (and I assume by extension any browser that leverages WebView) play the videos This setting governs the media consumption and it is never set to false within Focus But I think the websites are still able to play the videos because of some factors like their audio being muted and the Media Engagement Index I am not sure how feasible it is to disable autoplay for WebView at this point, Thoughts?

mcomella commented 6 years ago

@pocmo ^

Sorry to redirect, siddware – I'm not actively working on Focus at the moment.

pocmo commented 6 years ago

I am not sure how feasible it is to disable autoplay for WebView at this point, Thoughts?

Did you find any way to do that at all?

We are currently working on a Klar build with GeckoView (to be released later this year). With GeckoView we are able to get more control about things like this.

brampitoyo commented 6 years ago

Android WebView seems to have a boolean settings for requiring video and audio to be interacted with before they will play.

Big caveat: this may be the wrong setting, invalidating my whole comment.

https://developer.android.com/reference/android/webkit/WebSettings.html#setMediaPlaybackRequiresUserGesture(boolean)

Unfortunately, requiring user interaction may not automatically mean that the video will be stopped from loading. It’s possible that the video will be loaded and waiting.

siddware commented 6 years ago

@pocmo Unfortunately not, I posted regarding this in the Google Issue tracker, seems it's not possible at the moment(although might be in the future since they were working on it already and they've kindly taken this as a feature request). https://issuetracker.google.com/issues/74483530

brampitoyo commented 6 years ago

@siddware WIthout WebView support, I’m afraid that our hands are a bit tied. We will definitely think about this feature (which carries a lot of privacy benefits) when GeckoView is released, so please keep it in mind.

ashtrisk commented 6 years ago

Hey Guys, did you find any solution to this issue?

brampitoyo commented 6 years ago

@bbinto @Sdaswani I want to resurface this issue for consideration in v8.0, because blocking autoplay may be possible on GeckoView?

There is a very strong evidence that in-line videos that automatically play with sound – whether for advertising or content purposes – is a source of significant user annoyance. In fact, autoplay is only necessary when video or audio is the main purpose of the page (e.g. YouTube). So, in most cases, blocking autoplay will make Focus even more “focused” on the content than ever before.

In an ideal world, Focus would be able to smartly detect whether the video or audio constitutes the primary content of the page, and only let them autoplay when that is the case. However, what we will most likely ship in v1 may be a fairly draconian policy: every video and audio on the web needs to be tapped in order to load.

Even if this is the case, it will still result in a net win for us.

The inconvenience of tapping on videos that users want to play is fairly minor, when compared to the disruption, nuisance and embarrassment of hearing sounds that catches users off guard and forces them to close tab or hunt for the ‘misbehaving’ element, in order to stop them.

Sdaswani commented 6 years ago

Thanks for your thoughtful comment @brampitoyo . This is @bbinto's call. I would like us to just have a consistent experience across our two browser engines and don't want to regress on any functionality a significant amount of our users count on (so we can A/B test any major changes).

bbinto commented 6 years ago

While I believe it would be a great asset for users, I agree with @Sdaswani re: regression.

brampitoyo commented 6 years ago

@bbinto @Sdaswani I didn’t realise that this will cause browser engine inconsistency.

Does it make sense, then, to avoid blocking autoplay in our initial release of GeckoView, and only consider a separate blocking control later on?

Sdaswani commented 6 years ago

@bbinto's call. I just suggest consistency and/or looking at data to see if user's will be confused / surprised.

bbinto commented 6 years ago

I'd love to get @vesta0 take on this.

vesta0 commented 6 years ago

@brampitoyo I think we talked about this briefly when discussing the new privacy settings menu as you had "disable autoplay" as an option (for future consideration). This is definitely something I'd like to consider for 9.0 if we can build the control in GeckoView. It aligns with product vision and it's also frequently requested by our users. @cpeterso I've added this to the list of GeckoView features to be discussed with the team: https://github.com/mozilla-mobile/focus-android/milestone/35

cpeterso commented 6 years ago

Sounds good like a good feature. I think Focus might be able to control media autoplay, either per-site or globally, using a new PERMISSION_AUTOPLAY_MEDIA flag added in GV 63:

https://bugzilla.mozilla.org/show_bug.cgi?id=1484374

vesta0 commented 6 years ago

@brampitoyo do you have a mockup for this future setting by any chance?

brampitoyo commented 6 years ago

Sure thing!

This setting looks and behaves similarly to “Cookies & site data” content blocking.

Having an “Always ask” setting would introduce some permission trickiness. Namely, it will require us to have a permissions infrastructure that’s completely different and more complex compared to our simple, on-or-off Content Blocking. As a simple, privacy-first browser, our stance is to block potentially risky things by default, not to “Always ask” like Firefox.

So, I would recommend having three different levels of blocking:

  1. Allow all autoplay
  2. Block playing media with sound (recommended) ← this should be our new default. It helps block video with sounds in sidebar ads, and video with sounds that like to hide itself in the corner of the page
  3. Block all autoplay

Like any other blocking settings on this page, when you turn Content Blocking OFF, we switch this option to “Allow all autoplay”.

Needs discussion

There are sites which primary purpose is to play videos, and sites that doesn’t abuse autoplaying videos: YouTube, Netflix, Facebook, Twitch, Vimeo, Hulu, DailyMotion, to name a few.

On the other hand, there are sites where video is a secondary content. Sometimes, they abuse video by autoplaying it in sidebar ads, or hiding it in the corner of the page: news websites, for example.

When we say that we “Block playing media with sound”, what we really mean is:

On sites where video is a secondary content, we will block playing media with sounds. On sites where video is a primary content, we will allow autoplay.

So this is a bit tricky. Can we selectively set certain websites to “Allow all autoplay”? Having the user tap on a YouTube video every single time they want to play it would be annoying, and it’s certainly not faster than the experience of playing YouTube in the app, or in another browser.

lobontiumira commented 2 years ago

I was not able to reproduce this issue on the Focus Nightly build 99.0 from 2/21 using an Oppo Find X3 Lite (Android 11) device. In Settings - Privacy & Security - Cookies and Site Data - Site permissions - Autoplay, I've selected the "Block audio and video" and the videos from different pages (facebook.com, cnn.com, cnn.videos.com etc) are no longer starting playing automatically.