Closed Bug 1483397 Opened 7 years ago Closed 6 years ago

Add media control API so apps can control when media is paused (e.g. when the app is backgrounded)

Categories

(GeckoView :: Media, defect, P3)

defect

Tracking

(geckoview62 fixed, firefox-esr52 wontfix, firefox-esr60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
geckoview62 --- fixed
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- fixed

People

(Reporter: ekager, Assigned: mortimergoro)

Details

Attachments

(1 file)

I think this previously worked; possibly a regression? In GeckoViewActivity you do this in onPause/onResume: https://dxr.mozilla.org/mozilla-central/source/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#198 I put it in Focus also to solve a bug where videos continued to play when the app was backgrounded and I could have sworn the bug was fixed, but now it doesn't seem to work anymore.
Patches in bug 1330257 are making the onPause/onResume calls unnecessary, so maybe this bug will be fixed as well.
Hi Emily, is pausing the video a Focus blocker? This is working as designed in Fennec. Users wanted videos to keep playing in the background. setActive(boolean) is a bad API because the app can't control what to pause. Randall suggests we add a media control API.
Flags: needinfo?(ekager)
Hm okay. Let's close this then and I'll call it working as intended for Focus for now but open for further discussion
Flags: needinfo?(ekager)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
I'll reopen this bug to track Randall's suggestion to add a media control API. Emily's comment 0 provides a good user story for what a GV-powered app might want to do differently than Fennec. FWIW, Fennec users like video to continue playing so they could listen to YouTube from a backgrounded Fennec. YouTube's native app only allows background playback if you pay for YouTube Red.
Status: RESOLVED → REOPENED
Priority: -- → P3
Resolution: INVALID → ---
Summary: GeckoSession setActive(boolean) doesn't seem to work → Add media control API so apps can control when media is paused (e.g. when the app is backgrounded)
Fennec users can install an extension like Video Background Play Fix but Focus users have no such luxury. YouTube Red requires the user to log in which is inconvenient in a memoryless browser like Focus and compromises privacy.
Assignee: nobody → imanol
Add a GeckoSession property too specify if media should be suspended when the session is inactive.
Comment on attachment 9004645 [details] Bug 1483397 - Add media control API so apps can control when media is paused Randall Barker [:rbarker] has approved the revision.
Attachment #9004645 - Flags: review+
Comment on attachment 9004645 [details] Bug 1483397 - Add media control API so apps can control when media is paused Jim Chen [:jchen] [:darchons] has approved the revision.
Attachment #9004645 - Flags: review+
Comment on attachment 9004645 [details] Bug 1483397 - Add media control API so apps can control when media is paused James Willcox (:snorp) (jwillcox@mozilla.com) has approved the revision.
Attachment #9004645 - Flags: review+
Pushed by rbarker@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/33c06c934068 Add media control API so apps can control when media is paused r=snorp,rbarker,jchen
Status: REOPENED → RESOLVED
Closed: 7 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Could we also uplift this to the new 62 branch?
Sounds good. We're not yet using the tracking flag.
Comment on attachment 9004645 [details] Bug 1483397 - Add media control API so apps can control when media is paused [Approval Request Comment] If this is not a sec:{high,crit} bug, please state case for consideration: User impact if declined: User annoyance because media will play in background tabs, e.g. bug 1486523. Fix Landed on Version: GV 63 Nightly Risk to taking this patch (and alternatives if risky): Low risk. This is a pretty simple patch and landing it on the GECKOVIEW_62_RELBRANCH release branch will not risk destabilizing Firefox or Fennec 62. String or UUID changes made by this patch: None See https://wiki.mozilla.org/Release_Management/Uplift_rules for more info.
Attachment #9004645 - Flags: approval-mozilla-geckoview62?
Comment on attachment 9004645 [details] Bug 1483397 - Add media control API so apps can control when media is paused blocking media when app is in the background, GV62+
Attachment #9004645 - Flags: approval-mozilla-geckoview62? → approval-mozilla-geckoview62+
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 63 → mozilla63

Moving some media bugs to the new GeckoView::Media component.

Component: General → Media
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: