⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 274559 in webkit


Ignore:
Timestamp:
Mar 17, 2021, 8:20:55 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Set media elements' networkState to NETWORK_IDLE if the connection is interrupted
https://bugs.webkit.org/show_bug.cgi?id=223242

Patch by Souju TANAKA <soujyu.tanaka@access-company.com> on 2021-03-17
Reviewed by Eric Carlson.

Media elements' networkState was set to NETWORK_EMPTY if the connection is interrupted after some
media data has been received. This fix changes the state to NETWORK_IDLE, according to recent spec.

No new tests since there seems no way to disconnect network connection during tests.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::mediaLoadingFailedFatally):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r274557 r274559  
     12021-03-17  Souju TANAKA  <soujyu.tanaka@access-company.com>
     2
     3        Set media elements' networkState to NETWORK_IDLE if the connection is interrupted
     4        https://bugs.webkit.org/show_bug.cgi?id=223242
     5
     6        Reviewed by Eric Carlson.
     7
     8        Media elements' networkState was set to NETWORK_EMPTY if the connection is interrupted after some
     9        media data has been received. This fix changes the state to NETWORK_IDLE, according to recent spec.
     10
     11        No new tests since there seems no way to disconnect network connection during tests.
     12
     13        * html/HTMLMediaElement.cpp:
     14        (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
     15
    1162021-03-17  Kimmo Kinnunen  <kkinnunen@apple.com>
    217
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r274324 r274559  
    20892089void HTMLMediaElement::mediaLoadingFailedFatally(MediaPlayer::NetworkState error)
    20902090{
     2091    // https://html.spec.whatwg.org/#loading-the-media-resource:dom-media-have_nothing-2
     2092    // 17 March 2021
     2093
    20912094    // 1 - The user agent should cancel the fetching process.
    20922095    stopPeriodicTimers();
     
    21022105        ASSERT_NOT_REACHED();
    21032106
    2104     // 3 - Queue a task to fire a simple event named error at the media element.
    2105     scheduleEvent(eventNames().errorEvent);
    2106 
    21072107#if ENABLE(MEDIA_SOURCE)
    21082108    detachMediaSource();
    21092109#endif
    21102110
    2111     // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value and queue a
    2112     // task to fire a simple event called emptied at the element.
    2113     m_networkState = NETWORK_EMPTY;
    2114     scheduleEvent(eventNames().emptiedEvent);
    2115 
    2116     // 5 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
     2111    // 3 - Set the element's networkState attribute to the NETWORK_IDLE value.
     2112    m_networkState = NETWORK_IDLE;
     2113
     2114    // 4 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
    21172115    setShouldDelayLoadEvent(false);
     2116
     2117    // 5 - Fire an event named error at the media element.
     2118    dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
    21182119
    21192120    // 6 - Abort the overall resource selection algorithm.
Note: See TracChangeset for help on using the changeset viewer.