Closed Bug 1357633 Opened 4 years ago Closed 4 years ago

Fennec doesn't request audio focus correctly when user resume media from page, not from media control

Categories

(Firefox for Android Graveyard :: Audio/Video, defect, P1)

defect

Tracking

(firefox55 fixed)

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(2 files)

Fork from bug1348085 comment6.

---

STR:
 1. Load YouTube and play any video;
 2. Open the YouTube app and play a video.
 3. Open Nightly again and resume video playback.
 4. Open the YouTube app and resume the video.

Results:
 After the 4th step video playback on Nightly does not pause. Is this to be expected? If yes the issue is fixed then.
Depends on: 1357639
Comment on attachment 8862355 [details]
Bug 1357633 - part2 : add tests.

https://reviewboard.mozilla.org/r/134282/#review139110

::: mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/MediaPlaybackTest.java:238
(Diff revision 3)
> +     * Can communicte with JS bey getJS(), but caller should create and destroy
> +     * JSBridge manually.
> +     */
> +    protected JavascriptBridge getJS() {
> +        if (mJs == null) {
> +            mAsserter.ok(false,

How about "mAsserter.ok(mJs != null)"?
Attachment #8862355 - Flags: review?(s.kaspari) → review+
Comment on attachment 8861848 [details]
Bug 1357633 - part1 : request audio focus again when resume media from page.

https://reviewboard.mozilla.org/r/133868/#review139634
Attachment #8861848 - Flags: review?(amarchesini) → review+
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c9d8ee77aca
part1 : request audio focus again when resume media from page. r=baku
https://hg.mozilla.org/integration/autoland/rev/152a4024af04
part2 : add tests. r=sebastian
https://hg.mozilla.org/mozilla-central/rev/1c9d8ee77aca
https://hg.mozilla.org/mozilla-central/rev/152a4024af04
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Device: 
 - Nexus 5 (Android 6.0.1);

Build:
 - Nightly 55.0a1 (2017-05-17);

Hello,

 I've verified this and audio/video playback pauses when the user switches to the YouTube app. But if the user goes and plays a video from the Photos app the playback is not paused.
 Based on this I am reopening the issue since the fix only works with the YouTube app and ignores other audio/video apps.

Precondition:
 - make sure you have a video saved on your device.

STR:
 1. Go to https://goo.gl/odcAeP and play the video;
 2. Open the Photos app, find and play your video;

After step 2 the video/audio playback in Fennec should stop.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Priority: -- → P1
It's Photos app's bug, it doesn't request system level audio focus properly. You can try to use other music apps, and they also won't be paused when starting video via Photo apps. 

The system audio focus is requested by app, so if the app doesn't implement that, it won't affect any other apps, and vice versa.

---

Please see the following video, you can notice that when video starts playing via Photo app, it doesn't pause the background music from Music app.

https://goo.gl/cLlBl1
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Hello,

 I have tried it with different audio apps and it would seem that the photos app does not properly request audio focus. Thank you Alastor for clearing that up.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.