Changeset 187257 in webkit
- Timestamp:
- Jul 23, 2015 3:06:56 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r187249 r187257 1 2015-07-19 Matt Rajca <mrajca@apple.com> 2 3 Media Session: add support for ducking media elements 4 https://bugs.webkit.org/show_bug.cgi?id=147089 5 6 Reviewed by Eric Carlson. 7 8 * media/session/transient-interruptions-expected.txt: Added. 9 * media/session/transient-interruptions.html: Added. 10 * platform/mac/TestExpectations: Media Session support is disabled by default. 11 1 12 2015-07-23 Devin Rousso <drousso@apple.com> 2 13 -
trunk/LayoutTests/platform/mac/TestExpectations
r187006 r187257 997 997 media/session/controls-existence.html 998 998 media/session/default-session.html 999 media/session/transient-interruptions.html 999 1000 1000 1001 # This test requires generation of progress events during loading -
trunk/Source/WebCore/ChangeLog
r187256 r187257 1 2015-07-19 Matt Rajca <mrajca@apple.com> 2 3 Media Session: add support for ducking media elements 4 https://bugs.webkit.org/show_bug.cgi?id=147089 5 6 Reviewed by Eric Carlson. 7 8 Test: media/session/transient-interruptions.html 9 10 * Modules/mediasession/MediaSession.cpp: 11 (WebCore::MediaSession::handleDuckInterruption): Duck the active media elements. 12 (WebCore::MediaSession::handleUnduckInterruption): Unduck the active media elements. 13 * html/HTMLMediaElement.cpp: 14 (WebCore::HTMLMediaElement::updateVolume): Lower the volume of media elements to 25% when ducked (constant determined empirically). 15 (WebCore::HTMLMediaElement::setShouldDuck): Call updateVolume to change the volume of the underlying media player. 16 * html/HTMLMediaElement.h: 17 1 18 2015-07-23 Matt Rajca <mrajca@apple.com> 2 19 -
trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp
r187006 r187257 241 241 void MediaSession::handleDuckInterruption() 242 242 { 243 // FIXME: Duck media elements. 243 for (auto* element : m_activeParticipatingElements) 244 element->setShouldDuck(true); 244 245 245 246 m_currentState = State::Interrupted; … … 248 249 void MediaSession::handleUnduckInterruption() 249 250 { 250 // FIXME: Unduck media elements. 251 for (auto* element : m_activeParticipatingElements) 252 element->setShouldDuck(false); 251 253 252 254 m_currentState = State::Active; -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r187256 r187257 4653 4653 } 4654 4654 4655 #if ENABLE(MEDIA_SESSION) 4656 if (m_shouldDuck) 4657 volumeMultiplier *= 0.25; 4658 #endif 4659 4655 4660 m_player->setMuted(shouldMute); 4656 4661 m_player->setVolume(m_volume * volumeMultiplier); … … 6535 6540 } 6536 6541 6542 void HTMLMediaElement::setShouldDuck(bool duck) 6543 { 6544 if (m_shouldDuck == duck) 6545 return; 6546 6547 m_shouldDuck = duck; 6548 updateVolume(); 6549 } 6550 6537 6551 #endif 6538 6552 -
trunk/Source/WebCore/html/HTMLMediaElement.h
r187256 r187257 428 428 MediaSession* session() const; 429 429 void setSession(MediaSession*); 430 431 void setShouldDuck(bool); 430 432 #endif 431 433 … … 823 825 String m_kind; 824 826 RefPtr<MediaSession> m_session; 827 bool m_shouldDuck { false }; 825 828 #endif 826 829
Note: See TracChangeset
for help on using the changeset viewer.