Closed Bug 1391666 Opened 7 years ago Closed 7 years ago

[EME] media elements with autoplay attribute set will never start with EME

Categories

(Core :: Audio/Video: Playback, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox-esr52 --- affected
firefox55 --- wontfix
firefox56 ? fixed
firefox57 --- fixed

People

(Reporter: jya, Assigned: jya)

References

(Blocks 1 open bug, )

Details

Attachments

(4 files)

Bug 1389844 didn't fully fixed the issue. The issue appears to be related to the dispatch of the waitingforkey event. We enter the case: http://searchfox.org/mozilla-central/rev/e8c36327cd8c9432c69e5e1383156a74330f11f2/dom/html/HTMLMediaElement.cpp#5857 mWaitingForKey is WAITING_FOR_KEY_DISPATCHED. mWaitingForKey appears to not be reset, even after we've got the key until play() is called. mWaitingForKey isn't reset.
Something is a miss there: http://searchfox.org/mozilla-central/rev/e8c36327cd8c9432c69e5e1383156a74330f11f2/dom/html/HTMLMediaElement.cpp#5857 mWaitingForKey will only ever go back to NOT_WAITING_FOR_KEY there: http://searchfox.org/mozilla-central/rev/e8c36327cd8c9432c69e5e1383156a74330f11f2/dom/html/HTMLMediaElement.cpp#5921 But this only occurs of mPaused is false. mPaused will only go to true later in http://searchfox.org/mozilla-central/rev/e8c36327cd8c9432c69e5e1383156a74330f11f2/dom/html/HTMLMediaElement.cpp#5927 By this time readyState is HAVE_FUTURE_DATA. We will never enter again the condition: if (oldState < nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA && mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA) { And so mWaitingForKey is stuck on WAITING_FOR_KEY_DISPATCHED
Blocks: EME
The core issue actually here is: http://searchfox.org/mozilla-central/rev/e8c36327cd8c9432c69e5e1383156a74330f11f2/dom/html/HTMLMediaElement.cpp#5921 if (!mPaused) { mWaitingForKey = NOT_WAITING_FOR_KEY; NotifyAboutPlaying(); } mWaitingForKey will only be reset following a change of readyState, if the element isn't paused. But this isn't the case here, playback never started, mPaused is always true
Summary: [MSE] Shaka Player autoplay no longer works on ifinitytv.it and mediasetpremium.it streaming services in Firefox 55 (Part2) → [EME] media elements with autoplay attribute set will never start with EME
[why tracking] This will cause a regression with any sites using EME and expecting to automatically start.
Attachment #8899092 - Flags: review?(gsquelart) → review+
Attachment #8899095 - Flags: review?(gsquelart) → review+
Comment on attachment 8899093 [details] Bug 1391666 - P2. Reset mWaitingForKey when we have data and autoplay attribute is set https://reviewboard.mozilla.org/r/170420/#review175600 It looks like I am addressing the same issue in Bug 1390443. P3.
Comment on attachment 8899093 [details] Bug 1391666 - P2. Reset mWaitingForKey when we have data and autoplay attribute is set https://reviewboard.mozilla.org/r/170420/#review175646
Attachment #8899093 - Flags: review?(cpearce) → review+
Comment on attachment 8899094 [details] Bug 1391666 - P3. Change to HAVE_ENOUGH_DATA when possible. https://reviewboard.mozilla.org/r/170422/#review175648
Attachment #8899094 - Flags: review?(cpearce) → review+
Pushed by jyavenard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2031042cb44d P1. Mochitest to verify correct behavior. r=gerald https://hg.mozilla.org/integration/autoland/rev/4c7241cf8a4f P2. Reset mWaitingForKey when we have data and autoplay attribute is set r=cpearce https://hg.mozilla.org/integration/autoland/rev/109370151602 P3. Change to HAVE_ENOUGH_DATA when possible. r=cpearce https://hg.mozilla.org/integration/autoland/rev/fc9fa66d198c P4. Remove unecessary code. r=gerald
Want to request uplift? Does this need manual testing/verification?
Flags: needinfo?(jyavenard)
I've already indirectly asked for uplift in bug 1389844. No need for manual testing. I've written mochi test for it, and the original person who reported the bug confirmed that the issue was fixed. Do I need to separately ask for uplift here too?
Flags: needinfo?(jyavenard)
Yes please, it is too easy for the sheriffs (or relman) to miss that kind of indirect request.
Flags: needinfo?(jyavenard)
Comment on attachment 8899092 [details] Bug 1391666 - P1. Mochitest to verify correct behavior. Comment on attachment 8897938 [details] Bug 1389844 - P1. Add mochitest. Approval Request Comment [Feature/Bug causing the regression]: bug 1382303 [User impact if declined]: Playback of some video sites will never start. [Is this code covered by automated tests?]: Yes, mochitest were written to verify coverage [Has the fix been verified in Nightly?]: Yes, original reporter communicated to me that the issue was fixed [Needs manual test from QE? If yes, steps to reproduce]: no, as there's mochitests in place [List of other uplifts needed for the feature/fix]: all patches of bug 1391666 [Is the change risky?]: no [Why is the change risky/not risky?]: We relax the behaviour for some streams whose content doesn't start exactly at 0 (which is unfortunately rather common). In the worse case we more losely say we are ready to play something when we may not, but this condition isn't fatal and will always recover. [String changes made/needed]: none [Approval Request Comment] If this is not a sec:{high,crit} bug, please state case for ESR consideration: User impact if declined: see above Fix Landed on Version: 57 Risk to taking this patch (and alternatives if risky): There are alternatives to make on the JS video player, but people are unlikely to do those. String or UUID changes made by this patch: none For a full fix of the problem reported, bug 1389844 is required.
Flags: needinfo?(jyavenard)
Attachment #8899092 - Flags: approval-mozilla-esr52?
Attachment #8899092 - Flags: approval-mozilla-beta?
Comment on attachment 8899092 [details] Bug 1391666 - P1. Mochitest to verify correct behavior. Let's try these patches on beta 6. Missed the build for today's beta though. It seems a bit risky for ESR and doesn't fit the criteria for mid-ESR uplift.
Attachment #8899092 - Flags: approval-mozilla-esr52?
Attachment #8899092 - Flags: approval-mozilla-esr52-
Attachment #8899092 - Flags: approval-mozilla-beta?
Attachment #8899092 - Flags: approval-mozilla-beta+
(In reply to Jean-Yves Avenard [:jya] from comment #18) > [Is this code covered by automated tests?]: Yes, mochitest were written to > verify coverage > [Has the fix been verified in Nightly?]: Yes, original reporter communicated > to me that the issue was fixed > [Needs manual test from QE? If yes, steps to reproduce]: no, as there's > mochitests in place Setting qe-verify- based on jya's assessment on manual testing needs and the fact that this fix has automated coverage.
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: