[iOS] Video occasionally mixes with other system audio instead of interrupting
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jun 2017 17:57:06 +0000 (17:57 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jun 2017 17:57:06 +0000 (17:57 +0000)
commited29e866ba6379a634c86968b5cf01a7a2d90ffe
tree2bf73fd5d360c969ceaef08ee9c1e88f841ebc83
parentf4e323f152ab337f0fdfdc1bcbb9887e156467df
[iOS] Video occasionally mixes with other system audio instead of interrupting
https://bugs.webkit.org/show_bug.cgi?id=173127

Reviewed by Eric Carlson.

Source/WebCore:

Tests: platform/mac/audio-session-category-video-track-change.html

When an HTMLMediaElement's tracks change their enabled state, make sure to update
the PlatformMediaElement, for canProduceAudio() may have changed.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):

The rest of the changes in this revision are to allow the above to be testable.

* page/Settings.cpp:
* page/Settings.h:
* platform/audio/AudioSession.h:
* platform/audio/mac/AudioSessionMac.cpp:
(WebCore::AudioSession::category):
(WebCore::AudioSession::setCategory):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldManageAudioSessionCategory):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::audioSessionCategory):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac/media/audio-session-category-video-track-change-expected.txt: Added.
* platform/mac/media/audio-session-category-video-track-change.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/media/audio-session-category-video-track-change-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/media/audio-session-category-video-track-change.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/platform/audio/AudioSession.h
Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp
Source/WebCore/platform/audio/mac/AudioSessionMac.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl