If the first tab is pinned and muted - media is not blocked after browser restart

VERIFIED FIXED in Firefox 54

Status

()

Core
Audio/Video: Playback
P1
normal
VERIFIED FIXED
a year ago
a year ago

People

(Reporter: alindeac, Assigned: alwu)

Tracking

54 Branch
mozilla54
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 disabled, firefox52 disabled, firefox53 disabled, firefox54 verified)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(4 attachments)

Created attachment 8835487 [details]
MuteTabNotBlocked.mp4

[Affected versions]:
- Nightly 54.0a1

[Affected platforms]:
- Windows 10 x64, Ubuntu 64, Mac OS X 10.11

[Steps to reproduce]:
1. Launch Firefox
2. Navigate to YouTube and open 3 videos in the background
3. Pin all the YouTube videos
4. Focus the first pinned tab and click on the Sound indicator to set the video on mute
5. Focus the second pinned tab, click on Sound indicator to set the video on mute
6. Open a new tab and navigate to any site of your choice
7. Restart Firefox

[Expected result]:
-  Firefox is restarted having media blocked for all the pinned tabs (Play tab indicator is displayed on all the tabs)

[Actual result]:
- Firefox is restarted but the media in the first tab is not blocked. Please see the screen cast for more details.
Assignee: nobody → alwu
Hi, Simona,
Can you still reproduce this issue with latest Nightly on all platforms?
Could you help me test it again?
Thanks!

---

I think this issue is like bug1319771, caused by the mechanism of tab restore [1]. But it should be fixed by bug1319771, I don't know why it happened again.

In addition, I can't reproduce this bug on OSX. On Windows, it's very wired, I can reproduce this issue on Nightly downloaded from website, but can't reproduce it on Nightly built by myself.

[1] https://goo.gl/9JB4QP

---

Now I'm trying to reproduce this issue on my build to figure out the root cause, but if it's caused by tab restoring mechanism again, I don't know whether I can find another way to fix it.
Flags: needinfo?(simona.marcu)
(In reply to Alastor Wu [:alwu] from comment #1)
> Hi, Simona,
> Can you still reproduce this issue with latest Nightly on all platforms?
> Could you help me test it again?
> Thanks!
> 
Hi Alastor,

I can still reproduce this issue (video is not blocked in the first pinned tab) on Windows 10 x 64 and on Ubuntu 16.04 (followed the steps from the Description). But, the video in the first pinned tab is blocked on Mac OS X 10.11.

Another issue that I'm seeing now is that, after restart (step 7 from the Description) the second pinned tab won't be updated with the Play Tab indicator (the Mute indicator is displayed instead). Should I file a new bug for this? I reproduce this issue on all platforms.
Flags: needinfo?(simona.marcu)
Flags: needinfo?(alwu)
OK, Let me check what's happened.
I filed bug1343465 for the issue in comment2.
Flags: needinfo?(alwu)
Hi, Baku,
I think this issue is related with AudioChannelService::IsServiceStarted(), as you said, the AudioChannelService starts for many reasons so that we might resume the tab in wrong situation.
I would like to modify that function in this bug and also handle the issue mentioned in bug1338466 comment5.
How do you think?
Thanks!
Flags: needinfo?(amarchesini)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Attachment #8842780 - Flags: review?(amarchesini)
Attachment #8842781 - Flags: review?(amarchesini)
Attachment #8842817 - Flags: review?(amarchesini)
> I think this issue is related with AudioChannelService::IsServiceStarted(),

Yes, it could be. Do you mind to work on it? Thanks!
Flags: needinfo?(amarchesini)

Comment 14

a year ago
mozreview-review
Comment on attachment 8842781 [details]
Bug 1338137 - part2 : remove function IsServiceStarted().

https://reviewboard.mozilla.org/r/116560/#review118666
Attachment #8842781 - Flags: review?(amarchesini) → review+

Comment 15

a year ago
mozreview-review
Comment on attachment 8842817 [details]
Bug 1338137 - part3 : add test.

https://reviewboard.mozilla.org/r/116578/#review118668
Attachment #8842817 - Flags: review?(amarchesini) → review+

Comment 16

a year ago
mozreview-review
Comment on attachment 8842780 [details]
Bug 1338137 - part1 : ref media content when the media element bind to tree.

https://reviewboard.mozilla.org/r/116558/#review118664

lgtm! Thanks for these 2 patches.

::: dom/base/nsDocument.h:1569
(Diff revision 2)
>  
>    // A set of responsive images keyed by address pointer.
>    nsTHashtable< nsPtrHashKey<nsIContent> > mResponsiveContent;
>  
> +  // A set of media elements keyed by address pointer.
> +  nsTHashtable< nsPtrHashKey<nsIContent> > mMediaContent;

no extra spaces after < and before >
Attachment #8842780 - Flags: review?(amarchesini) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Duplicate of this bug: 1338466

Comment 21

a year ago
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/193319b673f2
part1 : ref media content when the media element bind to tree. r=baku
https://hg.mozilla.org/integration/autoland/rev/422571b302da
part2 : remove function IsServiceStarted(). r=baku
https://hg.mozilla.org/integration/autoland/rev/7f8d8f0964ff
part3 : add test. r=baku
Priority: -- → P1

Comment 22

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/193319b673f2
https://hg.mozilla.org/mozilla-central/rev/422571b302da
https://hg.mozilla.org/mozilla-central/rev/7f8d8f0964ff
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox54: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Depends on: 1348859
Flags: qe-verify+
QA Contact: emil.ghitta
Hi,
I have tested this issue after flipping the "media.block-autoplay-until-in-foreground" preff in Firefox Beta 54.0b1 and can confirm that the issue is fixed. No video starts playing after the restart if it is not in focus.
Status: RESOLVED → VERIFIED
status-firefox54: fixed → verified
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.