Changeset 171299 in webkit


Ignore:
Timestamp:
Jul 21, 2014 8:03:11 AM (10 years ago)
Author:
eric.carlson@apple.com
Message:

[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.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r171294 r171299  
     12014-07-21  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [iOS] a Paused media session is not active
     4        https://bugs.webkit.org/show_bug.cgi?id=135108
     5
     6        Reviewed by Darin Adler.
     7
     8        Activating the shared AudioSession will pause audio playing in another application,
     9        so only report a Playing media sessions as active.
     10
     11        * platform/audio/MediaSessionManager.cpp:
     12        * platform/audio/MediaSessionManager.h:
     13        (WebCore::MediaSessionManager::activeAudioSessionRequired): Renamed from hasActive to make
     14        clear what it does. Only return true for a session that is Playing.
     15
     16        * platform/audio/mac/MediaSessionManagerMac.cpp:
     17        (MediaSessionManager::updateSessionState): hasActive renamed to activeAudioSessionRequired.
     18
    1192014-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp

    r171081 r171299  
    6969}
    7070
    71 bool MediaSessionManager::hasActive() const
     71bool MediaSessionManager::activeAudioSessionRequired() const
    7272{
    7373    for (auto* session : m_sessions) {
    74         if (session->mediaType() != MediaSession::None && (session->state() == MediaSession::State::Playing || session->state() == MediaSession::State::Paused))
     74        if (session->mediaType() != MediaSession::None && session->state() == MediaSession::State::Playing)
    7575            return true;
    7676    }
  • trunk/Source/WebCore/platform/audio/MediaSessionManager.h

    r171071 r171299  
    6060
    6161    bool has(MediaSession::MediaType) const;
    62     bool hasActive() const;
    6362    int count(MediaSession::MediaType) const;
     63    bool activeAudioSessionRequired() const;
    6464
    6565    void beginInterruption(MediaSession::InterruptionType);
  • trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp

    r171069 r171299  
    6363
    6464#if PLATFORM(IOS)
    65     if (hasActive())
     65    if (activeAudioSessionRequired())
    6666        AudioSession::sharedSession().setActive(true);
    6767
Note: See TracChangeset for help on using the changeset viewer.