@@ -3747,10 +3747,6 @@ void HTMLMediaElement::seekWithTolerance(const SeekTarget& target, bool fromDOM)
37473747 refreshCachedTime ();
37483748 MediaTime now = currentMediaTime ();
37493749
3750- // Needed to detect a special case in updatePlayState().
3751- if (now >= durationMediaTime ())
3752- m_seekAfterPlaybackEnded = true ;
3753-
37543750 // 3 - If the element's seeking IDL attribute is true, then another instance of this algorithm is
37553751 // already running. Abort that other instance of the algorithm without waiting for the step that
37563752 // it is running to complete.
@@ -3938,8 +3934,6 @@ void HTMLMediaElement::finishSeek()
39383934#endif
39393935 if (wasPlayingBeforeSeeking)
39403936 playInternal ();
3941-
3942- m_seekAfterPlaybackEnded = false ;
39433937}
39443938
39453939HTMLMediaElement::ReadyState HTMLMediaElement::readyState () const
@@ -4377,10 +4371,8 @@ void HTMLMediaElement::playInternal()
43774371 if (!m_player || m_networkState == NETWORK_EMPTY)
43784372 selectMediaResource ();
43794373
4380- if (endedPlayback ()) {
4381- m_seekAfterPlaybackEnded = true ;
4374+ if (endedPlayback ())
43824375 seekInternal (MediaTime::zeroTime ());
4383- }
43844376
43854377 if (RefPtr mediaController = m_mediaController)
43864378 mediaController->bringElementUpToSpeed (*this );
@@ -6366,17 +6358,7 @@ void HTMLMediaElement::updatePlayState()
63666358 if (shouldBePlaying) {
63676359 invalidateCachedTime ();
63686360
6369- // Play is always allowed, except when seeking (to avoid unpausing the video by mistake until the
6370- // target time is reached). However, there are some exceptional situations when we allow playback
6371- // during seek. This is because GStreamer-based implementation have a design limitation that doesn't
6372- // allow initial seeks (seeking before going to playing state), and these exceptions make things
6373- // work for those platforms.
6374- bool isLooping = loop () && m_lastSeekTime == MediaTime::zeroTime ();
6375- bool playExceptionsWhenSeeking = m_seeking && (m_firstTimePlaying
6376- || isLooping || m_isResumingPlayback || m_seekAfterPlaybackEnded);
6377- bool allowPlay = !m_seeking || playExceptionsWhenSeeking;
6378-
6379- if (playerPaused && allowPlay) {
6361+ if (playerPaused) {
63806362 mediaSession ().clientWillBeginPlayback ();
63816363
63826364 // Set rate, muted and volume before calling play in case they were set before the media engine was set up.
@@ -8927,11 +8909,8 @@ void HTMLMediaElement::resumeAutoplaying()
89278909void HTMLMediaElement::mayResumePlayback (bool shouldResume)
89288910{
89298911 ALWAYS_LOG (LOGIDENTIFIER, " paused = " , paused ());
8930- if (!ended () && paused () && shouldResume) {
8931- m_isResumingPlayback = true ;
8912+ if (!ended () && paused () && shouldResume)
89328913 play ();
8933- m_isResumingPlayback = false ;
8934- }
89358914}
89368915
89378916String HTMLMediaElement::mediaSessionTitle () const
0 commit comments