Changeset 223144 in webkit
- Timestamp:
- Oct 10, 2017 2:26:03 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r223140 r223144 1 2017-10-10 Matt Rajca <mrajca@apple.com> 2 3 Respect audio rate change restrictions in HTMLMediaElement::setVolume. 4 https://bugs.webkit.org/show_bug.cgi?id=178140 5 6 Reviewed by Eric Carlson. 7 8 * media/audio-playback-volume-changes-with-restrictions-and-user-gestures-expected.txt: Added. 9 * media/audio-playback-volume-changes-with-restrictions-and-user-gestures.html: Added. 10 * media/audio-playback-volume-changes-with-restrictions-expected.txt: Added. 11 * media/audio-playback-volume-changes-with-restrictions.html: Added. 12 * platform/ios/TestExpectations: 13 1 14 2017-10-10 Ryosuke Niwa <rniwa@webkit.org> 2 15 -
trunk/LayoutTests/platform/ios/TestExpectations
r223140 r223144 382 382 media/restricted-audio-playback-with-document-gesture.html [ Skip ] 383 383 media/restricted-audio-playback-with-multiple-settimeouts.html [ Skip ] 384 media/audio-playback-volume-changes-with-restrictions.html [ Skip ] 385 media/audio-playback-volume-changes-with-restrictions-and-user-gestures.html [ Skip ] 384 386 storage/domstorage/sessionstorage/set-item-synchronous-keydown.html [ Skip ] 385 387 -
trunk/Source/WebCore/ChangeLog
r223140 r223144 1 2017-10-10 Matt Rajca <mrajca@apple.com> 2 3 Respect audio rate change restrictions in HTMLMediaElement::setVolume. 4 https://bugs.webkit.org/show_bug.cgi?id=178140 5 6 Reviewed by Eric Carlson. 7 8 Tests: media/audio-playback-volume-changes-with-restrictions-and-user-gestures.html 9 media/audio-playback-volume-changes-with-restrictions.html 10 11 It's currently possible for a website to start auto-playing media with a zero volume and then 12 programmatically set the volume to a non-zero value without a user gesture. This code path didn't 13 have to be considered previously because volume changes are not supported on iOS. 14 15 We currently pause media when an audio track comes in after an element has already started playing silently 16 in mediaPlayerDidAddAudioTrack. This patch does the same when a non-zero volume is set after a media 17 element already began playing silently and there is an audio rate change restriction. 18 19 * html/HTMLMediaElement.cpp: 20 (WebCore::HTMLMediaElement::setVolume): 21 1 22 2017-10-10 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r222473 r223144 3568 3568 return { }; 3569 3569 3570 if (volume && processingUserGestureForMedia()) 3571 removeBehaviorsRestrictionsAfterFirstUserGesture(MediaElementSession::AllRestrictions & ~MediaElementSession::RequireUserGestureToControlControlsManager); 3572 3570 3573 m_volume = volume; 3571 3574 m_volumeInitialized = true; 3572 3575 updateVolume(); 3573 3576 scheduleEvent(eventNames().volumechangeEvent); 3577 3578 if (isPlaying() && !m_mediaSession->playbackPermitted(*this)) { 3579 pauseInternal(); 3580 setPlaybackWithoutUserGesture(PlaybackWithoutUserGesture::Prevented); 3581 } 3574 3582 #endif 3575 3583 return { };
Note: See TracChangeset
for help on using the changeset viewer.