The visibility of the airplay menu also depends on whether there's a custom menu...
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2016 18:27:04 +0000 (18:27 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2016 18:27:04 +0000 (18:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154987

Reviewed by Darin Adler.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp

index d13f8bf..a7869ea 100644 (file)
@@ -1,3 +1,13 @@
+2016-03-03  Ada Chan  <adachan@apple.com>
+
+        The visibility of the airplay menu also depends on whether there's a custom menu item.
+        https://bugs.webkit.org/show_bug.cgi?id=154987
+
+        Reviewed by Darin Adler.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
+
 2016-03-04  Timothy Hatcher  <timothy@apple.com>
 
         Inform WebKit and WebCore if a page is controlled by automation.
index fc77e17..d558c7a 100644 (file)
@@ -5173,7 +5173,7 @@ bool HTMLMediaElement::removeEventListener(const AtomicString& eventType, EventL
 
 void HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent()
 {
-    bool hasTargets = m_mediaSession->hasWirelessPlaybackTargets(*this);
+    bool hasTargets = m_mediaSession->hasWirelessPlaybackTargets(*this) || !playbackTargetPickerCustomActionName().isEmpty();
     LOG(Media, "HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent(%p) - hasTargets = %s", this, boolString(hasTargets));
     RefPtr<Event> event = WebKitPlaybackTargetAvailabilityEvent::create(eventNames().webkitplaybacktargetavailabilitychangedEvent, hasTargets);
     event->setTarget(this);