Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2480003002: [RemotePlayback] Keep track of source compatibility and reject prompt() correspondingly (Closed)
Patch Set: Removed unnecessary forward declaration. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 8da456fa48e3c9d72688c3ec15b23a0fa74c0947..07b9b88ff980b3505a3cf8430942e166e1061237 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -89,6 +89,7 @@
#include "public/platform/WebInbandTextTrack.h"
#include "public/platform/WebMediaPlayerSource.h"
#include "public/platform/WebMediaStream.h"
+#include "public/platform/modules/remoteplayback/WebRemotePlaybackAvailability.h"
#include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h"
#include "public/platform/modules/remoteplayback/WebRemotePlaybackState.h"
#include "wtf/CurrentTime.h"
@@ -444,7 +445,6 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName,
m_shouldPerformAutomaticTrackSelection(true),
m_tracksAreReady(true),
m_processingPreferenceChange(false),
- m_remoteRoutesAvailable(false),
m_playingRemotely(false),
m_inOverlayFullscreenVideo(false),
m_audioTracks(this, AudioTrackList::create(*this)),
@@ -3161,12 +3161,17 @@ void HTMLMediaElement::requestSeek(double time) {
setCurrentTime(time);
}
-void HTMLMediaElement::remoteRouteAvailabilityChanged(bool routesAvailable) {
- m_remoteRoutesAvailable = routesAvailable;
+void HTMLMediaElement::remoteRouteAvailabilityChanged(
+ WebRemotePlaybackAvailability availability) {
+ if (remotePlaybackClient())
+ remotePlaybackClient()->availabilityChanged(availability);
if (mediaControls())
mediaControls()->refreshCastButtonVisibility();
- if (remotePlaybackClient())
- remotePlaybackClient()->availabilityChanged(routesAvailable);
+}
+
+bool HTMLMediaElement::hasRemoteRoutes() const {
+ return remotePlaybackClient() &&
+ remotePlaybackClient()->remotePlaybackAvailable();
}
void HTMLMediaElement::connectedToRemoteDevice() {
@@ -3396,10 +3401,8 @@ void HTMLMediaElement::clearMediaPlayer() {
m_loadState = WaitingForSource;
// We can't cast if we don't have a media player.
- m_remoteRoutesAvailable = false;
m_playingRemotely = false;
- if (mediaControls())
- mediaControls()->refreshCastButtonVisibilityWithoutUpdate();
+ remoteRouteAvailabilityChanged(WebRemotePlaybackAvailability::Unknown);
if (layoutObject())
layoutObject()->setShouldDoFullPaintInvalidation();
@@ -3757,8 +3760,8 @@ void HTMLMediaElement::resetMediaPlayerAndMediaSource() {
}
// We haven't yet found out if any remote routes are available.
- m_remoteRoutesAvailable = false;
m_playingRemotely = false;
+ remoteRouteAvailabilityChanged(WebRemotePlaybackAvailability::Unknown);
if (m_audioSourceNode)
getAudioSourceProvider().setClient(m_audioSourceNode);

Powered by Google App Engine
This is Rietveld 408576698