Bug 223242 - Set media elements' networkState to NETWORK_IDLE if the connection is interrupted
Summary: Set media elements' networkState to NETWORK_IDLE if the connection is interru...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-16 00:46 PDT by Souju TANAKA
Modified: 2021-03-17 08:22 PDT (History)
13 users (show)

See Also:


Attachments
Patch (2.36 KB, patch)
2021-03-16 02:08 PDT, Souju TANAKA
no flags Details | Formatted Diff | Diff
Patch (2.74 KB, patch)
2021-03-16 20:43 PDT, Souju TANAKA
no flags Details | Formatted Diff | Diff
Patch (2.74 KB, patch)
2021-03-16 22:05 PDT, Souju TANAKA
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Souju TANAKA 2021-03-16 00:46:10 PDT
Media elements' networkState should be NETWORK_IDLE if the connection is interrupted after some media data has been received, according to spec: https://html.spec.whatwg.org/#loading-the-media-resource

The actual state is NETWORK_EMPTY. I confirmed it on GTK MiniBrowser by opening a test page and disable network interface after the media element starts loading.
https://codepen.io/souju/pen/oNgmGRq

I guess the code was based on W3C editor's draft and has been left unchanged.
https://dev.w3.org/html5/pf-summary/video.html
Comment 1 Souju TANAKA 2021-03-16 02:08:09 PDT
Created attachment 423309 [details]
Patch
Comment 2 Eric Carlson 2021-03-16 08:53:21 PDT
Comment on attachment 423309 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=423309&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:2108
> +    // 3 - Set the element's networkState attribute to the NETWORK_IDLE value.

Please include a link to the spec section these comments are taken from (https://html.spec.whatwg.org/#loading-the-media-resource:dom-media-have_nothing-2) to make it easier to see when something changes in the future.
Comment 3 Souju TANAKA 2021-03-16 20:43:23 PDT
Created attachment 423428 [details]
Patch
Comment 4 Souju TANAKA 2021-03-16 22:05:03 PDT
Created attachment 423434 [details]
Patch
Comment 5 EWS 2021-03-17 08:20:59 PDT
Committed r274559: <https://commits.webkit.org/r274559>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423434 [details].
Comment 6 Radar WebKit Bug Importer 2021-03-17 08:22:14 PDT
<rdar://problem/75527057>