⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245199 in webkit


Ignore:
Timestamp:
May 10, 2019, 4:29:56 PM (7 years ago)
Author:
eric.carlson@apple.com
Message:

[iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
https://bugs.webkit.org/show_bug.cgi?id=197793
<rdar://problem/46429187>

Reviewed by Jer Noble.

  • html/MediaElementSession.cpp:

(WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.

  • platform/audio/ios/MediaSessionManagerIOS.mm:

(WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
target availability.
(-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client
externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245197 r245199  
     12019-05-10  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
     4        https://bugs.webkit.org/show_bug.cgi?id=197793
     5        <rdar://problem/46429187>
     6
     7        Reviewed by Jer Noble.
     8
     9        * html/MediaElementSession.cpp:
     10        (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.
     11
     12        * platform/audio/ios/MediaSessionManagerIOS.mm:
     13        (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
     14        target availability.
     15        (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client
     16        externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.
     17
    1182019-05-09  Geoffrey Garen  <ggaren@apple.com>
    219
  • trunk/Source/WebCore/html/MediaElementSession.cpp

    r245039 r245199  
    111111#if ENABLE(WIRELESS_PLAYBACK_TARGET)
    112112    , m_targetAvailabilityChangedTimer(*this, &MediaElementSession::targetAvailabilityChangedTimerFired)
     113    , m_hasPlaybackTargets(PlatformMediaSessionManager::sharedManager().hasWirelessTargetsAvailable())
    113114#endif
    114115    , m_mainContentCheckTimer(*this, &MediaElementSession::mainContentCheckTimerFired)
  • trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h

    r243958 r245199  
    122122#if PLATFORM(IOS_FAMILY)
    123123    virtual void configureWireLessTargetMonitoring() { }
     124#endif
    124125    virtual bool hasWirelessTargetsAvailable() { return false; }
    125 #endif
    126126
    127127    void setCurrentSession(PlatformMediaSession&);
  • trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm

    r244704 r245199  
    184184{
    185185    BEGIN_BLOCK_OBJC_EXCEPTIONS
    186     forEachSession([haveTargets = [m_objcObserver hasWirelessTargetsAvailable]] (PlatformMediaSession& session, size_t) {
     186
     187    auto haveTargets = [m_objcObserver hasWirelessTargetsAvailable];
     188    ALWAYS_LOG(LOGIDENTIFIER, haveTargets);
     189
     190    forEachSession([haveTargets] (PlatformMediaSession& session, size_t) {
    187191        session.externalOutputDeviceAvailableDidChange(haveTargets);
    188192    });
     193
    189194    END_BLOCK_OBJC_EXCEPTIONS
    190195}
     
    290295            protectedSelf->_routeDetector.get().routeDetectionEnabled = protectedSelf->_monitoringAirPlayRoutes;
    291296            [[NSNotificationCenter defaultCenter] addObserver:protectedSelf selector:@selector(wirelessRoutesAvailableDidChange:) name:AVRouteDetectorMultipleRoutesDetectedDidChangeNotification object:protectedSelf->_routeDetector.get()];
     297
     298            protectedSelf->_callback->externalOutputDeviceAvailableDidChange();
    292299            END_BLOCK_OBJC_EXCEPTIONS
    293300        }
Note: See TracChangeset for help on using the changeset viewer.