Skip to content
Permalink
Browse files
[iOS] a Paused media session is not active
https://bugs.webkit.org/show_bug.cgi?id=135108

Reviewed by Darin Adler.

Activating the shared AudioSession will pause audio playing in another application,
so only report a Playing media sessions as active.

* platform/audio/MediaSessionManager.cpp:
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::activeAudioSessionRequired): Renamed from hasActive to make
clear what it does. Only return true for a session that is Playing.

* platform/audio/mac/MediaSessionManagerMac.cpp:
(MediaSessionManager::updateSessionState): hasActive renamed to activeAudioSessionRequired.


Canonical link: https://commits.webkit.org/153017@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eric-carlson committed Jul 21, 2014
1 parent d470a14 commit 5c6ba9a23e634d3aefff0bc97e2c4dc090c9eba8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
@@ -1,3 +1,21 @@
2014-07-21 Eric Carlson <eric.carlson@apple.com>

[iOS] a Paused media session is not active
https://bugs.webkit.org/show_bug.cgi?id=135108

Reviewed by Darin Adler.

Activating the shared AudioSession will pause audio playing in another application,
so only report a Playing media sessions as active.

* platform/audio/MediaSessionManager.cpp:
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::activeAudioSessionRequired): Renamed from hasActive to make
clear what it does. Only return true for a session that is Playing.

* platform/audio/mac/MediaSessionManagerMac.cpp:
(MediaSessionManager::updateSessionState): hasActive renamed to activeAudioSessionRequired.

2014-07-21 Carlos Garcia Campos <cgarcia@igalia.com>

Unreviewed. Update GObject DOM bindings test results after r171285.
@@ -68,10 +68,10 @@ bool MediaSessionManager::has(MediaSession::MediaType type) const
return false;
}

bool MediaSessionManager::hasActive() const
bool MediaSessionManager::activeAudioSessionRequired() const
{
for (auto* session : m_sessions) {
if (session->mediaType() != MediaSession::None && (session->state() == MediaSession::State::Playing || session->state() == MediaSession::State::Paused))
if (session->mediaType() != MediaSession::None && session->state() == MediaSession::State::Playing)
return true;
}

@@ -59,8 +59,8 @@ class MediaSessionManager : private RemoteCommandListenerClient, private SystemS
virtual ~MediaSessionManager() { }

bool has(MediaSession::MediaType) const;
bool hasActive() const;
int count(MediaSession::MediaType) const;
bool activeAudioSessionRequired() const;

void beginInterruption(MediaSession::InterruptionType);
void endInterruption(MediaSession::EndInterruptionFlags);
@@ -62,7 +62,7 @@ void MediaSessionManager::updateSessionState()
#endif

#if PLATFORM(IOS)
if (hasActive())
if (activeAudioSessionRequired())
AudioSession::sharedSession().setActive(true);

if (!Settings::shouldManageAudioSessionCategory())

0 comments on commit 5c6ba9a

Please sign in to comment.