Closed Bug 1614894 Opened 1 year ago Closed 1 year ago

GeckoRuntimeSettings autoplayDefault not working

Categories

(GeckoView :: General, defect, P1)

74 Branch
Unspecified
All
defect

Tracking

(firefox75 fixed)

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: mario.diebold, Assigned: agi)

References

Details

(Whiteboard: [geckoview:m75])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36

Steps to reproduce:

In 72.0.20200107212822 to get Videos to autoplay without beeing muted by setting GeckoRuntimeSettings.autoplayDefault(GeckoRuntimeSettings.AUTOPLAY_DEFAULT_ALLOWED)

This is not working anymore in 74.0.x, tried multiple nightly Builds.

Actual results:

Log returns:
W/Web Content: [JavaScript Warning: "Autoplay is only allowed when approved by the user, the site is activated by the user, or media is muted." {file: "xxx" line: 0}]

Priority: -- → P1
Whiteboard: [geckoview:m75]

Mario, thanks for the bug report. You need to respond to onContentPermissionRequest for type=PERMISSION_AUTOPLAY_INAUDIBLE and PERMISSION_AUTOPLAY_AUDIBLE. You can see an example here (returning callback.grant() instead): https://searchfox.org/mozilla-central/rev/df94cd5ba431234bc220ac081def0801fe44b89e/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#1306-1309

The pref does not make a lot more sense now that we check autoplay on every
session.

Assignee: nobody → agi

Well that works, thanks for that.
But shouldn't GeckoRuntimeSettings.autoplayDefault() get deprecated if it has no effect at all?

Correct. We're removing the setting in the patch assigned in this bug :)

Status: UNCONFIRMED → NEW
Ever confirmed: true
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/245c4d1fe36f
Remove autoplayDefault. r=snorp,esawin,droeh
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75

(In reply to Agi Sferro | :agi | ni? for questions | ⏰ PST | he/him from comment #1)

Mario, thanks for the bug report. You need to respond to onContentPermissionRequest for type=PERMISSION_AUTOPLAY_INAUDIBLE and PERMISSION_AUTOPLAY_AUDIBLE. You can see an example here (returning callback.grant() instead): https://searchfox.org/mozilla-central/rev/df94cd5ba431234bc220ac081def0801fe44b89e/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#1306-1309

Can you please explain more with more simple code like before....
i have a small webapp with GeckoView it works like dream with one ligne code :
GeckoRuntimeSettings.autoplayDefault(GeckoRuntimeSettings.AUTOPLAY_DEFAULT_ALLOWED)

Can you please explain simple way to get onContentPermissionRequest as PERMISSION_AUTOPLAY_AUDIBLE grant()....
thanks you

You need to log in before you can comment on or make changes to this bug.