Title: [248952] trunk/Source/WebCore
Revision
248952
Author
jer.no...@apple.com
Date
2019-08-21 11:19:23 -0700 (Wed, 21 Aug 2019)

Log Message

[iOS] HLS streams disappear from Now Playing when paused on the lock screen
https://bugs.webkit.org/show_bug.cgi?id=200951
<rdar://problem/54534301>

Reviewed by Eric Carlson.

The AVPlayerItemTracks will get recreated on occasion (during seeks, and when
changing buffering policy) which can result in a player which no longer reports
that it has audio, which in turn results in Now Playing no longer considering
the web page to be an eligable now playing application. Bridge this gap by also
taking AVPlayerItem.hasEnabledAudio into account when determining whether the
player has audio.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (248951 => 248952)


--- trunk/Source/WebCore/ChangeLog	2019-08-21 18:08:48 UTC (rev 248951)
+++ trunk/Source/WebCore/ChangeLog	2019-08-21 18:19:23 UTC (rev 248952)
@@ -1,3 +1,21 @@
+2019-08-21  Jer Noble  <jer.no...@apple.com>
+
+        [iOS] HLS streams disappear from Now Playing when paused on the lock screen
+        https://bugs.webkit.org/show_bug.cgi?id=200951
+        <rdar://problem/54534301>
+
+        Reviewed by Eric Carlson.
+
+        The AVPlayerItemTracks will get recreated on occasion (during seeks, and when
+        changing buffering policy) which can result in a player which no longer reports
+        that it has audio, which in turn results in Now Playing no longer considering
+        the web page to be an eligable now playing application. Bridge this gap by also
+        taking AVPlayerItem.hasEnabledAudio into account when determining whether the 
+        player has audio.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
+
 2019-08-21  Adrian Perez de Castro  <ape...@igalia.com>
 
         [GStreamer] Clang warns about mismatched type tag in declarations for ImageOrientation

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (248951 => 248952)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2019-08-21 18:08:48 UTC (rev 248951)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2019-08-21 18:19:23 UTC (rev 248952)
@@ -1836,6 +1836,12 @@
         hasAudio |= (m_audibleGroup && m_audibleGroup->selectedOption());
         hasVideo |= (m_visualGroup && m_visualGroup->selectedOption());
 
+        // HLS streams will occasionally recreate all their tracks; during seek and after
+        // buffering policy changes. "debounce" notifications which result in no enabled
+        // audio tracks by also taking AVPlayerItem.hasEnabledAudio into account when determining
+        // whethere there is any audio present.
+        hasAudio |= m_cachedHasEnabledAudio;
+
         // Always says we have video if the AVPlayerLayer is ready for diaplay to work around
         // an AVFoundation bug which causes it to sometimes claim a track is disabled even
         // when it is not.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to