Media Session: add support for ducking media elements https://bugs.webkit.org/show_bu...
authormrajca@apple.com <mrajca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jul 2015 22:06:56 +0000 (22:06 +0000)
committermrajca@apple.com <mrajca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jul 2015 22:06:56 +0000 (22:06 +0000)
commitd876824e83b72a404c8a0f595a4881f6361e23b0
tree2ea3010341270fea528fb4fc545d82e28d433a69
parentf2e1bfa4c841214b862123ccea518d97f897e453
Media Session: add support for ducking media elements https://bugs.webkit.org/show_bug.cgi?id=147089

Reviewed by Eric Carlson.

Test: media/session/transient-interruptions.html

* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::handleDuckInterruption): Duck the active media elements.
(WebCore::MediaSession::handleUnduckInterruption): Unduck the active media elements.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume): Lower the volume of media elements to 25% when ducked (constant determined empirically).
(WebCore::HTMLMediaElement::setShouldDuck): Call updateVolume to change the volume of the underlying media player.
* html/HTMLMediaElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/session/transient-interruptions-expected.txt [new file with mode: 0644]
LayoutTests/media/session/transient-interruptions.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasession/MediaSession.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h