Intermittent dom/media/test/test_streams_element_capture_reset.html | checking vout has not ended - got true, expected false

RESOLVED FIXED in Firefox 52

Status

()

defect
P2
normal
Rank:
25
RESOLVED FIXED
3 years ago
5 months ago

People

(Reporter: intermittent-bug-filer, Assigned: pehrsons)

Tracking

({intermittent-failure})

unspecified
mozilla53
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox-esr45 unaffected, firefox51 unaffected, firefox52 fixed, firefox53 fixed)

Details

Attachments

(1 attachment)

Component: Audio/Video → Audio/Video: Recording
Rank: 35
Priority: -- → P3
Raising prio here given the frequency. It might just be fallout from MediaStream.active, that changed how media elements end when playing MediaStreams.
Assignee: nobody → pehrson
Rank: 35 → 25
Component: Audio/Video: Recording → Audio/Video: MediaStreamGraph
Priority: P3 → P2
Looking at Orangefactor it's clearly fallout from bug 1208316, but I'm not sure how yet.
Blocks: 1208316
I think this happens if the srcObject doesn't see any tracks asynchronously before v ends. We call mozCaptureStream before metadata has loaded so we rely on tracks appearing from MediaStreamGraph. That is an async operation and with the src of v being so short there might be timing issues.

Really I think the underlying problem is that HTMLMediaElement.ended is somewhat naively implemented as !MediaStream.active. This would mean that the media element is ended directly after play() if there were no tracks in the source.
Status: NEW → ASSIGNED
Issues in the Try
Flags: needinfo?(pehrson)
Actually there's language in mediacapture-main about ending on inactive that doesn't care for readyState.
It's in conflict with the html spec but the html spec has not been updated for MediaStreams yet. I'll stick with mediacapture-main then, and update this intermittent test to just have better guarantees on when the tracks are created.
Flags: needinfo?(pehrson)
Comment on attachment 8819525 [details]
Bug 1314886 - Call mozCaptureStream() after "loadedmetadata" in test_streams_element_capture_reset.

https://reviewboard.mozilla.org/r/99268/#review102130

::: dom/media/test/test_streams_element_capture_reset.html:124
(Diff revision 2)
> -  vout_untilended.play();
> +    vout_untilended.play();
> +
> +    v.play();
> +  };
> +
> +  v.addEventListener("loadedmetadata", loadedmetadata, false);

You can do:
v.addEventListener('someEvent', handler_once, {once: true});
Attachment #8819525 - Flags: review?(jwwang) → review+
Comment on attachment 8819525 [details]
Bug 1314886 - Call mozCaptureStream() after "loadedmetadata" in test_streams_element_capture_reset.

https://reviewboard.mozilla.org/r/99268/#review102130

> You can do:
> v.addEventListener('someEvent', handler_once, {once: true});

Such modern! Thanks.
Pushed by pehrsons@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/bafb20dd3221
Call mozCaptureStream() after "loadedmetadata" in test_streams_element_capture_reset. r=jwwang
https://hg.mozilla.org/mozilla-central/rev/bafb20dd3221
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.