GeckoRuntimeSettings autoplayDefault not working
Categories
(GeckoView :: General, defect, P1)
Tracking
(firefox75 fixed)
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}]
Assignee | ||
Comment 1•1 year ago
|
||
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
Assignee | ||
Comment 2•1 year ago
|
||
The pref does not make a lot more sense now that we check autoplay on every
session.
Updated•1 year ago
|
Reporter | ||
Comment 3•1 year ago
|
||
Well that works, thanks for that.
But shouldn't GeckoRuntimeSettings.autoplayDefault() get deprecated if it has no effect at all?
Assignee | ||
Comment 4•1 year ago
|
||
Correct. We're removing the setting in the patch assigned in this bug :)
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/245c4d1fe36f Remove autoplayDefault. r=snorp,esawin,droeh
![]() |
||
Comment 6•1 year ago
|
||
bugherder |
Updated•1 year ago
|
Comment 7•19 days ago
|
||
(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
fortype=PERMISSION_AUTOPLAY_INAUDIBLE
andPERMISSION_AUTOPLAY_AUDIBLE
. You can see an example here (returningcallback.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
Description
•