Changeset 261342 in webkit


Ignore:
Timestamp:
May 7, 2020 4:08:44 PM (4 years ago)
Author:
eric.carlson@apple.com
Message:

[macOS] Playhead in Touch Bar continues when loading stalls
https://bugs.webkit.org/show_bug.cgi?id=211585
<rdar://problem/33893306>

Reviewed by Darin Adler.

  • platform/cocoa/PlaybackSessionModelMediaElement.h:
  • platform/cocoa/PlaybackSessionModelMediaElement.mm:

(WebCore::PlaybackSessionModelMediaElement::updateForEventName): Listen for waitingEvent
and canplay events. Don't claim to be playing when stalled.
(WebCore::PlaybackSessionModelMediaElement::isStalled const): New.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r261341 r261342  
     12020-05-07  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [macOS] Playhead in Touch Bar continues when loading stalls
     4        https://bugs.webkit.org/show_bug.cgi?id=211585
     5        <rdar://problem/33893306>
     6
     7        Reviewed by Darin Adler.
     8
     9        * platform/cocoa/PlaybackSessionModelMediaElement.h:
     10        * platform/cocoa/PlaybackSessionModelMediaElement.mm:
     11        (WebCore::PlaybackSessionModelMediaElement::updateForEventName): Listen for `waitingEvent`
     12        and `canplay` events. Don't claim to be playing when stalled.
     13        (WebCore::PlaybackSessionModelMediaElement::isStalled const): New.
     14
    1152020-05-07  Eric Carlson  <eric.carlson@apple.com>
    216
  • trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h

    r260729 r261342  
    104104    static const Vector<WTF::AtomString>& observedEventNames();
    105105    const WTF::AtomString& eventNameAll();
     106    bool isStalled() const;
    106107
    107108    RefPtr<HTMLMediaElement> m_mediaElement;
  • trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm

    r261013 r261342  
    141141        || eventName == eventNames().pauseEvent
    142142        || eventName == eventNames().playEvent
    143         || eventName == eventNames().ratechangeEvent) {
    144         bool isPlaying = this->isPlaying();
     143        || eventName == eventNames().ratechangeEvent
     144        || eventName == eventNames().waitingEvent
     145        || eventName == eventNames().canplayEvent) {
     146        bool isPlaying = this->isPlaying() && !isStalled();
    145147        float playbackRate = this->playbackRate();
    146148        for (auto client : m_clients)
     
    430432}
    431433
     434bool PlaybackSessionModelMediaElement::isStalled() const
     435{
     436    return m_mediaElement && m_mediaElement->readyState() <= HTMLMediaElement::HAVE_CURRENT_DATA;
     437}
     438
    432439float PlaybackSessionModelMediaElement::playbackRate() const
    433440{
Note: See TracChangeset for help on using the changeset viewer.