Title: [183587] trunk/Source/WebCore
Revision
183587
Author
[email protected]
Date
2015-04-29 16:03:40 -0700 (Wed, 29 Apr 2015)

Log Message

[Mac] Register with device picker whenever a page has <video>
https://bugs.webkit.org/show_bug.cgi?id=144408

Reviewed by Jer Noble.

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::setPlaybackTarget): Drive-by fix: don't tell a client to play
to the target when it has not routes.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaState): Set RequiresPlaybackTargetMonitoring whenever the
element is <video> with a video track that does not block wireless playback.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183586 => 183587)


--- trunk/Source/WebCore/ChangeLog	2015-04-29 23:02:11 UTC (rev 183586)
+++ trunk/Source/WebCore/ChangeLog	2015-04-29 23:03:40 UTC (rev 183587)
@@ -1,3 +1,18 @@
+2015-04-29  Eric Carlson  <[email protected]>
+
+        [Mac] Register with device picker whenever a page has <video>
+        https://bugs.webkit.org/show_bug.cgi?id=144408
+
+        Reviewed by Jer Noble.
+
+        * Modules/mediasession/WebMediaSessionManager.cpp:
+        (WebCore::WebMediaSessionManager::setPlaybackTarget): Drive-by fix: don't tell a client to play
+        to the target when it has not routes.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaState): Set RequiresPlaybackTargetMonitoring whenever the 
+        element is <video> with a video track that does not block wireless playback.
+
 2015-04-29  Martin Robinson  <[email protected]>
 
         [GTK] Add support for automatic hyphenation

Modified: trunk/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp (183586 => 183587)


--- trunk/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp	2015-04-29 23:02:11 UTC (rev 183586)
+++ trunk/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp	2015-04-29 23:03:40 UTC (rev 183587)
@@ -191,7 +191,7 @@
         return;
 
     auto& state = m_clientState[indexThatRequestedPicker];
-    state->client->setShouldPlayToPlaybackTarget(state->contextId, true);
+    state->client->setShouldPlayToPlaybackTarget(state->contextId, m_playbackTarget && m_playbackTarget->hasActiveRoute());
     state->requestedPicker = false;
 }
 

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (183586 => 183587)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-04-29 23:02:11 UTC (rev 183586)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-04-29 23:03:40 UTC (rev 183587)
@@ -6188,12 +6188,15 @@
 
     MediaStateFlags state = IsNotPlaying;
 
+    bool hasActiveVideo = isVideo() && hasVideo();
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     if (isPlayingToWirelessPlaybackTarget())
         state |= IsPlayingToExternalDevice;
 
-    if (m_hasPlaybackTargetAvailabilityListeners)
-        state |= RequiresPlaybackTargetMonitoring;
+    if (!m_mediaSession->wirelessVideoPlaybackDisabled(*this)) {
+        if ((m_hasPlaybackTargetAvailabilityListeners || hasActiveVideo) && m_player->canPlayToWirelessPlaybackTarget())
+            state |= RequiresPlaybackTargetMonitoring;
+    }
 #endif
 
     if (!isPlaying())
@@ -6202,7 +6205,7 @@
     if (hasAudio() && !muted())
         state |= IsPlayingAudio;
 
-    if (hasVideo())
+    if (hasActiveVideo)
         state |= IsPlayingVideo;
 
     return state;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to