If previous media session interruptions were prevented, still allow subsequent interr...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jul 2016 00:47:40 +0000 (00:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jul 2016 00:47:40 +0000 (00:47 +0000)
commit995bcb03c0ed08cc364ca900e200e1bf4b72fc69
tree3df03db4fd1faf0f970459087c7355a2c712f66a
parent58d77b3a8f1945291c4c1de347300fc455bc48d5
If previous media session interruptions were prevented, still allow subsequent interruptions to try.
https://bugs.webkit.org/show_bug.cgi?id=157553
rdar://problem/25740804

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-07-18
Reviewed by Eric Carlson.

Source/WebCore:

Test: platform/ios-simulator/media/video-interruption-suspendunderlock.html

When suspending under lock on iOS, there is first a resign active event, then a
suspend under lock. PiP prevents resign active from interrupting playback. But it should allow the
suspend under lock to interrupt playback.

Currently if there are nested interruptions only the first one is acted upon.

This change allows subsequent, nested interruptions to have a chance to interrupt playback if the
previous interruptions were ignored.

This test is for iPad only, so it must be run manually.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::beginInterruption):
* testing/Internals.cpp:
(WebCore::Internals::beginMediaSessionInterruption):

LayoutTests:

When suspending under lock on iOS, there is first a resign active event, then a
suspend under lock. PiP prevents resign active from interrupting playback. But it should allow the
suspend under lock to interrupt playback.

Currently if there are nested interruptions only the first one is acted upon.

This change allows subsequent, nested interruptions to have a chance to interrupt playback if the
previous interruptions were ignored.

This test is for iPad only, so it must be run manually.

* platform/ios-simulator/TestExpectations:
* platform/ios-simulator/media/video-interruption-suspendunderlock-expcted.txt: Added.
* platform/ios-simulator/media/video-interruption-suspendunderlock.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/ios-simulator/media/video-interruption-suspendunderlock-expcted.txt [new file with mode: 0644]
LayoutTests/platform/ios-simulator/media/video-interruption-suspendunderlock.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/platform/audio/PlatformMediaSession.cpp
Source/WebCore/testing/Internals.cpp