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

Changeset 287050 in webkit


Ignore:
Timestamp:
Dec 14, 2021, 2:36:14 PM (5 years ago)
Author:
jer.noble@apple.com
Message:

Safari intermittently stopping playing Spotify Web Player (currentTime goes backwards)
https://bugs.webkit.org/show_bug.cgi?id=233257
<rdar://problem/85504967>

Reviewed by Eric Carlson.

Source/WebKit:

Test: media/video-currentTime-duration.html

Clamp currentMediaTime() to [0, durationMediaTime()].

  • WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:

(WebKit::MediaPlayerPrivateRemote::currentMediaTime const):

LayoutTests:

  • media/video-currentTime-duration-expected.txt: Added.
  • media/video-currentTime-duration.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r287038 r287050  
     12021-12-14  Jer Noble  <jer.noble@apple.com>
     2
     3        Safari intermittently stopping playing Spotify Web Player (currentTime goes backwards)
     4        https://bugs.webkit.org/show_bug.cgi?id=233257
     5        <rdar://problem/85504967>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * media/video-currentTime-duration-expected.txt: Added.
     10        * media/video-currentTime-duration.html: Added.
     11
    1122021-12-14  Tyler Wilcock  <tyler_w@apple.com>
    213
  • trunk/Source/WebKit/ChangeLog

    r287049 r287050  
     12021-12-14  Jer Noble  <jer.noble@apple.com>
     2
     3        Safari intermittently stopping playing Spotify Web Player (currentTime goes backwards)
     4        https://bugs.webkit.org/show_bug.cgi?id=233257
     5        <rdar://problem/85504967>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Test: media/video-currentTime-duration.html
     10
     11        Clamp currentMediaTime() to [0, durationMediaTime()].
     12
     13        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
     14        (WebKit::MediaPlayerPrivateRemote::currentMediaTime const):
     15
    1162021-12-14  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

    r285993 r287050  
    286286        return m_cachedMediaTime;
    287287
    288     return m_cachedMediaTime + MediaTime::createWithDouble(m_rate * (MonotonicTime::now() - m_cachedMediaTimeQueryTime).seconds());
     288    auto calculatedCurrentTime = m_cachedMediaTime + MediaTime::createWithDouble(m_rate * (MonotonicTime::now() - m_cachedMediaTimeQueryTime).seconds());
     289    return std::min(std::max(calculatedCurrentTime, MediaTime::zeroTime()), durationMediaTime());
    289290}
    290291
Note: See TracChangeset for help on using the changeset viewer.