Closed Bug 1607883 Opened 6 years ago Closed 6 years ago

Autoplay content permissions not triggered when e10s are disabled

Categories

(Core :: Audio/Video, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: mortimergoro, Assigned: bryce)

References

Details

Attachments

(1 file)

PERMISSION_AUTOPLAY_AUDIBLE and PERMISSION_AUTOPLAY_INAUDIBLE are not triggered in onContentPermissionRequest delegate in Oculus Quest in Firefox Reality. The same code run in the Android emulator is correctly requesting the permissions (only if mRuntime.getSettings().setAutoplayDefault is not called).

We saw those warnings in the console of Oculus Quest:

01-08 10:33:20.110  4412  4451 W GeckoConsole: [JavaScript Warning: "Feature Policy: Skipping unsupported feature name “autoplay”." {file: "https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl497i6p/www-widgetapi.js" line: 114}]
01-08 10:33:20.112  4412  4451 W GeckoConsole: [JavaScript Warning: "Feature Policy: Skipping unsupported feature name “autoplay”." {file: "https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl497i6p/www-widgetapi.js" line: 117}]
01-08 10:33:20.112  4412  4451 W GeckoConsole: [JavaScript Warning: "Feature Policy: Skipping unsupported feature name “autoplay”." {file: "https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl497i6p/www-widgetapi.js" line: 102}]

Hi, Imanol,

Do you mind to try MOZ_LOG=GVAutoplay:5 and provide the log to us? The error you saw is unrelated with GV autoplay permission, that is just about the feature policy is no longer supporting autoplay keyword.

The same code run in the Android emulator is correctly requesting the permissions (only if mRuntime.getSettings().setAutoplayDefault is not called).

I'm not sure I understand the relationship between calling setAutoplayDefault() and onContentPermissionRequest, because the permission request would be sent no matter what autoplay setting you're using. We allow the user of GeckoView to check the autoplay pref and other conditions to decide the final result.

In addition, you have to make sure the pref media.geckoview.autoplay.request is true in order to enable the autoplay request on GeckoView.

Thank you.

Flags: needinfo?(imanol)

The only log shown is Requestor, AskForPermissionIfNeeded

After adding some extra logs in GVAutoplayPermissionRequestor::AskForPermissionIfNeeded I found that it's doing a bailout in the XRE_IsParentProcess check. I confirmed that after enabling multiprocess in FxR the permission prompts are triggered and autoplay works as expected.

I'm renaming this bug

Flags: needinfo?(imanol)
Summary: Autoplay content permissions not triggered in Oculus Quest → Autoplay content permissions not triggered when e10s are disabled

(In reply to Imanol Fernandez from comment #2)

The only log shown is Requestor, AskForPermissionIfNeeded

After adding some extra logs in GVAutoplayPermissionRequestor::AskForPermissionIfNeeded I found that it's doing a bailout in the XRE_IsParentProcess check. I confirmed that after enabling multiprocess in FxR the permission prompts are triggered and autoplay works as expected.

I'm renaming this bug

Would that be this check?

Do we need a broader handling here where if we're !e10s we don't do this check? My understanding is that in the e10s case this check makes sense as requests should always come from a content process, but in the case of e10s we're always in the parent process (as there is only one process) so it will always fail.

yes, that check. I think we just need to return in that check if e10s are enabled, and continue the code if e10s are disabled.

Prior to this patch we prevented permission requests firing if the code was
executed in a parent process. This makes sense for e10s, as only content
processes should do so. However, if we're in non-e10s mode then the single
process we run the code in is considered a parent process for the purpose of our
check and we don't fire the request.

This patch changes the check to not send the request if we're specifically in an
e10s parent process.

Assignee: nobody → bvandyk
Status: NEW → ASSIGNED

Moving to Media component.

Component: General → Audio/Video
Product: GeckoView → Core
Pushed by bvandyk@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fbd48f9ff2d3 Allow GeckoView autoplay permission prompt in non-e10s. r=alwu

Landing is queued. Imanol, if you could verify this once it lands that would be appreciated.

Flags: needinfo?(imanol)
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

I have verified and it works well now, thanks!

Flags: needinfo?(imanol)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: