Title: [188922] trunk/Source/WebCore
Revision
188922
Author
[email protected]
Date
2015-08-25 11:10:19 -0700 (Tue, 25 Aug 2015)

Log Message

[iOS] Don't clear AVPlayerItem when pausing if AirPlay is active
https://bugs.webkit.org/show_bug.cgi?id=148319

Reviewed by Jer Noble.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Do nothing if the session
  is allowed to load data when in the background and we are not under memory pressure.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::sessionCanLoadMedia): Call base class.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (188921 => 188922)


--- trunk/Source/WebCore/ChangeLog	2015-08-25 18:04:10 UTC (rev 188921)
+++ trunk/Source/WebCore/ChangeLog	2015-08-25 18:10:19 UTC (rev 188922)
@@ -1,3 +1,17 @@
+2015-08-25  Eric Carlson  <[email protected]>
+
+        [iOS] Don't clear AVPlayerItem when pausing if AirPlay is active
+        https://bugs.webkit.org/show_bug.cgi?id=148319
+
+        Reviewed by Jer Noble.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Do nothing if the session
+          is allowed to load data when in the background and we are not under memory pressure.
+
+        * platform/audio/ios/MediaSessionManagerIOS.mm:
+        (WebCore::MediaSessionManageriOS::sessionCanLoadMedia): Call base class.
+
 2015-08-25  Csaba Osztrogonác  <[email protected]>
 
         Fix the !ENABLE(CSS_REGIONS) build after r188663

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (188921 => 188922)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-08-25 18:04:10 UTC (rev 188921)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-08-25 18:10:19 UTC (rev 188922)
@@ -6481,6 +6481,9 @@
 void HTMLMediaElement::purgeBufferedDataIfPossible()
 {
 #if PLATFORM(IOS)
+    if (!MemoryPressureHandler::singleton().isUnderMemoryPressure() && PlatformMediaSessionManager::sharedManager().sessionCanLoadMedia(*m_mediaSession))
+        return;
+
     // This is called to relieve memory pressure. Turning off buffering causes the media playback
     // daemon to release memory associated with queued-up video frames.
     // We turn it back on right away, but new frames won't get loaded unless playback is resumed.

Modified: trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm (188921 => 188922)


--- trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm	2015-08-25 18:04:10 UTC (rev 188921)
+++ trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm	2015-08-25 18:10:19 UTC (rev 188922)
@@ -245,7 +245,10 @@
 
 bool MediaSessionManageriOS::sessionCanLoadMedia(const PlatformMediaSession& session) const
 {
-    return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.displayType() == PlatformMediaSession::Optimized;
+    if (session.displayType() == PlatformMediaSession::Optimized)
+        return true;
+
+    return PlatformMediaSessionManager::sessionCanLoadMedia(session);
 }
 
 void MediaSessionManageriOS::externalOutputDeviceAvailableDidChange()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to