Closed Bug 1302453 Opened 8 years ago Closed 8 years ago

Media notification is out of sync

Categories

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

51 Branch
ARM
Android
defect

Tracking

(firefox51 affected, firefox52 verified)

RESOLVED FIXED
Firefox 52
Tracking Status
firefox51 --- affected
firefox52 --- verified

People

(Reporter: sflorean, Assigned: alwu)

References

Details

Attachments

(2 files)

Environment: 
Device: Nexus 5 (Android 6.0.1);
Build: Nightly 51.0a1 (2016-09-12);

Steps to reproduce:
1. Open Firefox and play a video;
2. Tap on notification bar and from media control pause the video;
3. Go on tab and play video again;
4. Open notification bar and see the media control.

Expected result:
Media control is synced with the play/pause state of video

Actual result:
Media notification is out of sync.

Notes:
This is reproducible on Android 5.1 as well.
Please see the video https://www.youtube.com/watch?v=WdVEFSaWkbY
Blocks: 1290836
Priority: -- → P1
Assignee: nobody → alwu
I found today two issues while testing:

1. https://www.youtube.com/watch?v=So3KKAM6yh8&feature=youtu.be on imdb.
2. - Play a video on Firefox;
   - Pause video from notification
   - Play video from tab
   - Go to Chrome or another media app and play a video
   Actual results: both video from FF and Chrome are playing.
   Expected: video from FF is paused.

Should I file a new bug for 1 and/or 2 or the issues will be fixed with patches from this bug? Thanks!
Flags: needinfo?(alwu)
So, you mean the problem is that the video was paused after we start playing media from other apps?
If so, that's correct behavior if the app requests audio focus from Android system.
Flags: needinfo?(alwu)
For 1, the play/pause button from tab is not synced with the action done by media control from notification bar.

And for 2, the video played by Firefox is not paused while another video/audio is played by different media app. This behavior is happening only if I follow the steps: pause video from media notification and play from tab (for Firefox). But the issue is that both media/audio content are playing in the same time.
The solution can also solve the problem2, but I can't reproduce the problem1, could you give me the video url?
Flags: needinfo?(sorina.florean)
I can reproduce this following the steps: 
1. Go to imdb and tap on first trailer (http://m.imdb.com/video/imdb/vi1857009177/imdb/mobile?playlistId=ls063929852&ref_=m_hm_hp_i_1);
2. From media notification, pause the video.
  In tab, the "pause" button from video didn't change in "play" button, like the button from media notification.
Flags: needinfo?(sorina.florean)
BTW, the case1 you mentioned is the website JS player issue (like bug1306009 and bug1302084).
Depends on: 1308119
Attachment #8797943 - Flags: review?(amarchesini)
Attachment #8797944 - Flags: review?(s.kaspari)
Comment on attachment 8797944 [details]
Bug 1302453 - part2 : notify MediaControlService when the media is resumed.

https://reviewboard.mozilla.org/r/83530/#review82808
Attachment #8797944 - Flags: review?(s.kaspari) → review+
Blocks: 1303554
review ping?
Flags: needinfo?(amarchesini)
Comment on attachment 8797943 [details]
Bug 1302453 - part1 : send new gecko event when media is resumed.

https://reviewboard.mozilla.org/r/83528/#review87592

::: dom/html/HTMLMediaElement.h:1273
(Diff revision 2)
>  
>    void OpenUnsupportedMediaWithExtenalAppIfNeeded();
>  
> +  // It's used for fennec only, send the notification when the user resumes the
> +  // media which was paused by media control.
> +  void NotifyMediaResumedIfNeeded(SuspendTypes aSuspend);

MaybeNotifyMediaResumed(...)

::: dom/html/HTMLMediaElement.cpp:6472
(Diff revision 2)
> +
> +    wrapper->SetData(windowID);
> +    observerService->NotifyObservers(wrapper,
> +                                     "media-playback-resumed",
> +                                     u"active");
> +    return;

remove this return;
Attachment #8797943 - Flags: review?(amarchesini) → review+
Flags: needinfo?(amarchesini)
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bd09862def55
part1 : send new gecko event when media is resumed. r=baku
https://hg.mozilla.org/integration/autoland/rev/058d1217b0d0
part2 : notify MediaControlService when the media is resumed. r=sebastian
https://hg.mozilla.org/mozilla-central/rev/bd09862def55
https://hg.mozilla.org/mozilla-central/rev/058d1217b0d0
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Tested on latest Nightly (en-US build from 10-31) with:
- LG G4 (Android 5.1)
- Nexus 9 (Android 6.0.1) 
On youtube.com, the media notification is synced with the media that is playing in tab.
On imdb and cnn, if I pause the video from notification, in tab the pause button is not synced. Check the screenshot: https://i.imgur.com/rJaezQu.png
IMDB issue is website problem, we can't fix that. Please see the comment8.
Flags: needinfo?(sorina.florean)
(In reply to Alastor Wu [:alwu] from comment #19)
> IMDB issue is website problem, we can't fix that. Please see the comment8.

In this case, for cnn.com is the same problem. I will set the flag for 52 as verified, since for the other media content the play/pause button is synced.
Flags: needinfo?(sorina.florean)
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: