Changeset 282374 in webkit
- Timestamp:
- Sep 13, 2021 6:17:25 PM (10 months ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
html/HTMLMediaElement.cpp (modified) (1 diff)
-
platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r282370 r282374 1 2021-09-13 Jean-Yves Avenard <jya@apple.com> 2 3 Playback stops although the progress bar moves 4 https://bugs.webkit.org/show_bug.cgi?id=230210 5 rdar://81123838 6 7 Reviewed by Eric Carlson. 8 9 When playback has stalled due to insufficient data being buffered, the effective rate 10 should be 0 as time is no longer progressing. 11 While the GPU process would indicate that the rate has changed once the player has 12 stalled, the effective rate reported would remain the same causing the current time 13 position to continue moving as it's estimated based on the effective rate. 14 This is also workaround rdar://83048005 which can report that the buffer is both 15 full and empty at the same time. 16 17 Fly-By fix: set the new rate in HTMLMediaElement if previously the requested rate 18 is different. 19 20 The buffering is handled by the AVPlayer and is dependent on network conditions making 21 it difficult to test. 22 23 * html/HTMLMediaElement.cpp: 24 (WebCore::HTMLMediaElement::updatePlaybackRate): 25 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 26 (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatus const): 27 (WebCore::MediaPlayerPrivateAVFoundationObjC::effectiveRate const): 28 (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange): 29 1 30 2021-09-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 31 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r282220 r282374 3501 3501 { 3502 3502 double requestedRate = requestedPlaybackRate(); 3503 if (m_player && potentiallyPlaying() && m_player-> effectiveRate() != requestedRate)3503 if (m_player && potentiallyPlaying() && m_player->rate() != requestedRate) 3504 3504 m_player->setRate(requestedRate); 3505 3505 } -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r282242 r282374 1230 1230 if (m_cachedLikelyToKeepUp) 1231 1231 return MediaPlayerPrivateAVFoundation::MediaPlayerAVPlayerItemStatusPlaybackLikelyToKeepUp; 1232 // From AVPlayer.h: 1233 // AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate 1234 // This state is entered when 1235 // 1) the playback buffer becomes empty and playback stalls in AVPlayerTimeControlStatusPlaying, 1236 // 2) when rate is set from zero to non-zero in AVPlayerTimeControlStatusPaused and insufficient media data has been buffered for playback to occur, or 1237 // 3) when the player has no item to play, i.e. when the receiver's currentItem is nil. 1238 // In this state, the value of the rate property is not currently effective but instead indicates the rate at which playback will start or resume. 1239 // We can't rely on just m_cachedBufferFull and m_cachedBufferEmpty due to rdar://83048005. 1240 if (m_cachedTimeControlStatus == AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate || m_cachedBufferEmpty) 1241 return MediaPlayerAVPlayerItemStatusPlaybackBufferEmpty; 1232 1242 if (m_cachedBufferFull) 1233 1243 return MediaPlayerPrivateAVFoundation::MediaPlayerAVPlayerItemStatusPlaybackBufferFull; 1234 if (m_cachedBufferEmpty)1235 return MediaPlayerPrivateAVFoundation::MediaPlayerAVPlayerItemStatusPlaybackBufferEmpty;1236 1244 1237 1245 return MediaPlayerPrivateAVFoundation::MediaPlayerAVPlayerItemStatusReadyToPlay; … … 1601 1609 return 0; 1602 1610 1603 return m_cached Rate;1611 return m_cachedTimeControlStatus == AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate ? 0.0 : m_cachedRate; 1604 1612 } 1605 1613 … … 3452 3460 3453 3461 m_cachedTimeControlStatus = timeControlStatus; 3462 updateStates(); 3454 3463 rateChanged(); 3455 3464 m_wallClockAtCachedCurrentTime = std::nullopt;
Note: See TracChangeset
for help on using the changeset viewer.