Changeset 226150 in webkit
- Timestamp:
- Dec 19, 2017 3:16:09 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r226141 r226150 1 2017-12-19 Jer Noble <jer.noble@apple.com> 2 3 Playing media elements which call "pause(); play()" will have the play promise rejected. 4 https://bugs.webkit.org/show_bug.cgi?id=180781 5 <rdar://problem/33191377> 6 7 Reviewed by Eric Carlson. 8 9 * media/video-load-require-user-gesture.html: 10 1 11 2017-12-19 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/LayoutTests/media/video-load-require-user-gesture.html
r197953 r226150 7 7 var userGestureInitiated = 0; 8 8 9 if (window.internals) 9 if (window.internals) { 10 10 window.internals.settings.setVideoPlaybackRequiresUserGesture(true); 11 window.internals.settings.setRequiresUserGestureToLoadVideo(true); 12 } 11 13 12 14 function finishTest(success) -
trunk/Source/WebCore/ChangeLog
r226142 r226150 1 2017-12-19 Jer Noble <jer.noble@apple.com> 2 3 Playing media elements which call "pause(); play()" will have the play promise rejected. 4 https://bugs.webkit.org/show_bug.cgi?id=180781 5 <rdar://problem/33191377> 6 7 Reviewed by Eric Carlson. 8 9 Follow-up to address failing iOS API tests. Rather than skipping the call to 10 prepareForLoad() in the case where media elements are not allowed to load data, 11 unconditionally call prepareForLoad(), but conditionally call selectMediaResource() inside 12 that function only if the media elemnet is allowed to load. This ensures that the 13 MediaPlayer is created when play(), pause(), or load() are called during a user gesture 14 later, and selectMediaResource() (which depends on having a non-null m_player) is called. 15 16 * html/HTMLMediaElement.cpp: 17 (WebCore::HTMLMediaElement::parseAttribute): 18 (WebCore::HTMLMediaElement::insertedIntoAncestor): 19 (WebCore::HTMLMediaElement::load): 20 (WebCore::HTMLMediaElement::prepareForLoad): 21 (WebCore::HTMLMediaElement::playInternal): 22 1 23 2017-12-19 Timothy Hatcher <timothy@hatcher.name> 2 24 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r226059 r226150 836 836 // If a src attribute of a media element is set or changed, the user 837 837 // agent must invoke the media element's media element load algorithm. 838 #if PLATFORM(IOS)839 // Note, unless the restriction on requiring user action has been removed,840 // do not begin downloading data on iOS.841 if (!value.isNull() && m_mediaSession->dataLoadingPermitted(*this))842 #else843 838 if (!value.isNull()) 844 #endif845 839 prepareForLoad(); 846 840 } else if (name == controlsAttr) … … 919 913 m_inActiveDocument = true; 920 914 921 #if PLATFORM(IOS)922 if (m_networkState == NETWORK_EMPTY && !attributeWithoutSynchronization(srcAttr).isEmpty() && m_mediaSession->dataLoadingPermitted(*this))923 #else924 915 if (m_networkState == NETWORK_EMPTY && !attributeWithoutSynchronization(srcAttr).isEmpty()) 925 #endif926 916 prepareForLoad(); 927 917 } … … 1233 1223 INFO_LOG(LOGIDENTIFIER); 1234 1224 1235 if (!m_mediaSession->dataLoadingPermitted(*this))1236 return;1237 1225 if (processingUserGestureForMedia()) 1238 1226 removeBehaviorsRestrictionsAfterFirstUserGesture(); … … 1343 1331 1344 1332 // 9 - Invoke the media element's resource selection algorithm. 1345 selectMediaResource(); 1333 // Note, unless the restriction on requiring user action has been removed, 1334 // do not begin downloading data. 1335 if (m_mediaSession->dataLoadingPermitted(*this)) 1336 selectMediaResource(); 1346 1337 1347 1338 // 10 - Note: Playback of any previously playing media resource for this element stops. … … 3452 3443 if (!m_mediaSession->clientWillBeginPlayback()) { 3453 3444 ALWAYS_LOG(LOGIDENTIFIER, " returning because of interruption"); 3454 return; // Treat as success because we will begin playback on cessation of the interruption.3445 return; 3455 3446 } 3456 3447 -
trunk/Source/WebCore/page/SettingsDefaultValues.h
r223432 r226150 71 71 static const bool defaultMediaControlsScaleWithPageZoom = true; 72 72 static const bool defaultQuickTimePluginReplacementEnabled = true; 73 static const bool defaultRequiresUserGestureToLoadVideo = true; 73 74 #else 74 75 static const bool defaultFixedBackgroundsPaintRelativeToDocument = false; … … 84 85 static const bool defaultMediaControlsScaleWithPageZoom = true; 85 86 static const bool defaultQuickTimePluginReplacementEnabled = false; 87 static const bool defaultRequiresUserGestureToLoadVideo = false; 86 88 #endif 87 89 88 static const bool defaultRequiresUserGestureToLoadVideo = true;89 90 static const bool defaultAllowsPictureInPictureMediaPlayback = true; 90 91 -
trunk/Source/WebKit/ChangeLog
r226136 r226150 1 2017-12-19 Jer Noble <jer.noble@apple.com> 2 3 Playing media elements which call "pause(); play()" will have the play promise rejected. 4 https://bugs.webkit.org/show_bug.cgi?id=180781 5 <rdar://problem/33191377> 6 7 Reviewed by Eric Carlson. 8 9 shouldRequireUserGestureToLoadVideo() should default to false on Mac. 10 11 * UIProcess/API/Cocoa/WKWebView.mm: 12 (shouldRequireUserGestureToLoadVideo): 13 1 14 2017-12-19 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r226008 r226150 431 431 return shouldRequireUserGestureToLoadVideo; 432 432 #else 433 return true;433 return false; 434 434 #endif 435 435 } -
trunk/Source/WebKitLegacy/mac/ChangeLog
r226148 r226150 1 2017-12-19 Jer Noble <jer.noble@apple.com> 2 3 Playing media elements which call "pause(); play()" will have the play promise rejected. 4 https://bugs.webkit.org/show_bug.cgi?id=180781 5 <rdar://problem/33191377> 6 7 Reviewed by Eric Carlson. 8 9 shouldRequireUserGestureToLoadVideo() should default to false on Mac. 10 11 * WebView/WebView.mm: 12 (shouldRequireUserGestureToLoadVideo): 13 1 14 2017-12-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 15 -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r225669 r226150 1311 1311 return shouldRequireUserGestureToLoadVideo; 1312 1312 #else 1313 return true;1313 return false; 1314 1314 #endif 1315 1315 }
Note: See TracChangeset
for help on using the changeset viewer.