Closed Bug 1524092 Opened 7 years ago Closed 5 years ago

MediaElement.play() should not be affected by autoplay blocking.

Categories

(Core :: Audio/Video: Playback, enhancement, P2)

77 Branch
Unspecified
Android
enhancement

Tracking

()

RESOLVED WONTFIX
Future

People

(Reporter: rbarker, Unassigned)

Details

(Whiteboard: [fxr:p1][geckoview:p1][fenix:p1])

If a video element specifies autoplay, it is not possible to play the video by calling MediaElement.play() if autoplay blocking is enabled. The GeckoView MediaElement API should not be affected by autoplay blocking.

OS: All → Android
Priority: -- → P1
Assignee: nobody → rbarker

I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:

e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9

Priority: P1 → P2
Rank: 30

I think we need support at the Gecko media layer in order to support this.

maybe the first MediaElement.play() only works if it comes from a user gesture? Is there a way to simulate user gesture in the GeckoView JS modules?

Assignee: rbarker → nobody
Whiteboard: [fxr:p1]
Rank: 30 → 7
Whiteboard: [fxr:p1] → [fxr:p1][geckoview:m76]

The code that calls play is here: https://searchfox.org/mozilla-central/rev/c79c0d65a183d9d38676855f455a5c6a7f7dadd3/mobile/android/chrome/geckoview/GeckoViewMediaChild.js#108

The GeckoView API is here: https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/MediaElement.java

This API is used to create an external media UI. It is used in several places in FxR. A few uses are:

  1. Putting a play/pause button under windows that do not have focus but have media playing in them.
  2. Providing a UI for users when in immersive video mode so they can pause/play and control volume with out dropping out of immersive mode.

Currently in FxR if the user does not start the video from the page but instead tries to start the video playing with the external UI after entering immersive mode, it has no effect. Autoplay blocking should not apply to GV calls but there does not seem to be a way to bypass autoplay blocking that GeckoView may utilize.

This is used in Fenix for the media notifications too.

Whiteboard: [fxr:p1][geckoview:m76] → [fxr:p1][geckoview:p1]
Whiteboard: [fxr:p1][geckoview:p1] → [fxr:p1][geckoview:p1][fenix:p1]
Whiteboard: [fxr:p1][geckoview:p1][fenix:p1] → [fxr:p1][geckoview:m78][fenix:p1]
Component: General → Audio/Video: Playback
Product: GeckoView → Core
Whiteboard: [fxr:p1][geckoview:m78][fenix:p1] → [fxr:p1][geckoview:p1][fenix:p1]
Target Milestone: --- → Future
Version: unspecified → 77 Branch

Alastor, could you help me figure out where we are with this? I know you've done some work is this area to accommodate more flexibility in GV around autoplay and wonder if you've already touched on this elsewhere.

Flags: needinfo?(alwu)

This seems not an issue right now, the goal of this bug is to allow FxR to start media, as our past discussion, those requests have already been considered in new GV Media Session API as well. For FxR's scenario, they would like to start media when it's in the fullscreen (immersing mode), and that can be done by new API.

Please reopen it if this request is still needed.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(alwu)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.