Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider relaxing timing of initial HAVE_METADATA transitioning #275

Open
wolenetz opened this issue May 22, 2021 · 5 comments
Open

Consider relaxing timing of initial HAVE_METADATA transitioning #275

wolenetz opened this issue May 22, 2021 · 5 comments
Assignees
Labels
TPAC-2022-discussion Marked for discussion at TPAC 2022 Media WG meeting Sep 16
Milestone

Comments

@wolenetz
Copy link
Member

wolenetz commented May 22, 2021

Some implementations, including Chromium, have a media pipeline on distinct thread(s)/process(es) versus the web apps' thread(s). Delaying the relevant updateend associated with the appendBuffer() whose parsing reaches the "set the HTMLMediaElement.readyState attribute to HAVE_METADATA part of step 7 of https://www.w3.org/TR/media-source/#sourcebuffer-init-segment-received until that step is fully completed is not done in some implementations, so the application can buffer more media faster while the pipeline is still transitioning in parallel.

This issue tracks standardizing some allowance for this behavior, as allowing improved application buffering agility is probably a good idea.

-editted: The delay in Chromium is slightly less than I had thought (decoder setup doesn't necessarily block initial transition to HAVE_METADATA, but the metadata notification from MSE to the media element still hops threads through the pipeline.)

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 22, 2021
Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 25, 2021
Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 25, 2021
Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}
blueboxd pushed a commit to blueboxd/chromium-legacy that referenced this issue May 25, 2021
Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}
@wolenetz
Copy link
Member Author

Note that with MSE-in-Workers (#175), information like duration and track metadata may propagate to the HTMLMediaElement at slower rate than atomically during initialization segment received algorithm (running in a MediaSource Worker), by nature of the algorithm running in a different context than the main window. So this relaxation of legacy main thread element duration == main thread mediasource duration requirement wouldn't conflict with MSE-in-Workers specification/expectations of delay in main thread media element duration eventually matching what worker-thread mediasource duration was.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 27, 2021
…ilures, a=testonly

Automatic update from web-platform-tests
MSE: Fix rare flaky changeType-play-* failures

Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}

--

wpt-commits: 04c1391243b470ae1e0a0b9a7a53280c9fa66e57
wpt-pr: 29052
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 27, 2021
…ilures, a=testonly

Automatic update from web-platform-tests
MSE: Fix rare flaky changeType-play-* failures

Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}

--

wpt-commits: 04c1391243b470ae1e0a0b9a7a53280c9fa66e57
wpt-pr: 29052
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 29, 2021
…ilures, a=testonly

Automatic update from web-platform-tests
MSE: Fix rare flaky changeType-play-* failures

Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}

--

wpt-commits: 04c1391243b470ae1e0a0b9a7a53280c9fa66e57
wpt-pr: 29052
@wolenetz wolenetz self-assigned this Sep 3, 2021
@wolenetz wolenetz added this to the V2 milestone Sep 3, 2021
@wolenetz wolenetz added the agenda Topic should be discussed in a group call label Sep 3, 2021
@wolenetz
Copy link
Member Author

wolenetz commented Sep 3, 2021

Requesting this be discussed at Sept 14 Media WG meeting.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 9, 2022
This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 9, 2022
This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}
aarongable pushed a commit to chromium/chromium that referenced this issue Feb 9, 2022
This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 9, 2022
This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}
mattwoodrow pushed a commit to mattwoodrow/wpt that referenced this issue Feb 15, 2022
This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Feb 26, 2022
…es, a=testonly

Automatic update from web-platform-tests
MSE: Fix flaky mediasource-detach failures

This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}

--

wpt-commits: 6fa7cbfe3d493a6d6799da8d2af91ab71c489f84
wpt-pr: 32780
DanielRyanSmith pushed a commit to DanielRyanSmith/wpt that referenced this issue Feb 28, 2022
This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Mar 1, 2022
…es, a=testonly

Automatic update from web-platform-tests
MSE: Fix flaky mediasource-detach failures

This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}

--

wpt-commits: 6fa7cbfe3d493a6d6799da8d2af91ab71c489f84
wpt-pr: 32780
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 8, 2022
…es, a=testonly

Automatic update from web-platform-tests
MSE: Fix flaky mediasource-detach failures

This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}

--

wpt-commits: 6fa7cbfe3d493a6d6799da8d2af91ab71c489f84
wpt-pr: 32780
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Mar 8, 2022
…es, a=testonly

Automatic update from web-platform-tests
MSE: Fix flaky mediasource-detach failures

This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}

--

wpt-commits: 6fa7cbfe3d493a6d6799da8d2af91ab71c489f84
wpt-pr: 32780
@wolenetz
Copy link
Member Author

See also #215

@wolenetz wolenetz added the TPAC-2022-discussion Marked for discussion at TPAC 2022 Media WG meeting Sep 16 label Sep 16, 2022
aarongable pushed a commit to chromium/chromium that referenced this issue Oct 6, 2022
This test was flaking because the assertion was blocked on
sourcebuffer.onupdateend instead of onloadedmetadata, which race each
other (see w3c/media-source#275)

Bug: 1348591
Change-Id: I733345d296ecc0557584088b24d5a1e3ef6898ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3936305
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Auto-Submit: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1055571}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
Unless the app explicitly sets `mediaSource.duration`,
`HTMLMediaElement.duration` remains NaN until initial HAVE_METADATA is
reached, even if the attached mediaSource has already buffered media
well beyond the initialization segment(s) necessary to begin transition
to HAVE_METADATA. In Chromium, that transition is begun asynchronously,
letting thread hop through the pipeline thread complete while letting
the app continue. Eventually, the media element transitions, but in the
interim, its value for duration could still be NaN, even if mediaSource
has a duration value.

This change relaxes the changeType-play-* utility's reliance on strict
matching of mediaElement.duration and mediaSource.duration, instead
relying on the latter for use in trimming the buffered duration.

I've filed MSE spec issue #275 to discuss this behavior:
w3c/media-source#275

This change also reports more details in changeType web-test assertion
failures, which also enabled finding the suspected root cause of the
tests' flakiness.

Bug: 1184745

Change-Id: I208cbfbbc60776366a16b6a3e79f52480df5be37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2906776
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886148}
NOKEYCHECK=True
GitOrigin-RevId: 7262398dd1ec4d42dfff3b8dab8135ba6a33acd7
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
This change relaxes the timing expectation for 'updateend' of an
appended initialization segment meaning the media element
must already have reached HAVE_METADATA. In Chrome, the transition
to media element readyState hops threads and may occur after the
SourceBuffer's 'updateend' has been dispatched.

See the following MSE spec issue for discussion of this behavior:
w3c/media-source#275

The test now awaits both 'updateend' and 'loadedmetadata' receipts
before issuing a load() that is expected to close the MediaSource.

This change also removes an older copy of the same test, updating
the wpt version and related test expectations.

BUG=1143720,641121

Change-Id: I87df990e3a032c6f7dadf25829093c35913c7855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3450339
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969124}
NOKEYCHECK=True
GitOrigin-RevId: e4c9123bf8673d7f18cf81434df6202ac091b576
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
This test was flaking because the assertion was blocked on
sourcebuffer.onupdateend instead of onloadedmetadata, which race each
other (see w3c/media-source#275)

Bug: 1348591
Change-Id: I733345d296ecc0557584088b24d5a1e3ef6898ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3936305
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Auto-Submit: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1055571}
NOKEYCHECK=True
GitOrigin-RevId: a921f14e764bd13a70f6ea9dd471225e0928db41
@chrisn
Copy link
Member

chrisn commented Nov 8, 2022

Minutes from Sept 14 2021 discussion: https://www.w3.org/2021/09/14-mediawg-minutes.html#t06

@chrisn
Copy link
Member

chrisn commented Dec 7, 2022

Minutes from 8 Nov 2022 discussion: https://www.w3.org/2022/11/08-mediawg-minutes.html#t04. Next step was to create a PR to relax the timing for HAVE_METADATA and HAVE_CURRENT_DATA.

@chrisn chrisn removed the agenda Topic should be discussed in a group call label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TPAC-2022-discussion Marked for discussion at TPAC 2022 Media WG meeting Sep 16
Projects
None yet
Development

No branches or pull requests

2 participants