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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2890633003: [Blink,RemotePlayback] Use PresentationController for availability (Closed)
Patch Set: Limited to Blink only, rebased Created 3 years, 6 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 // The resource fetch algorithm 1125 // The resource fetch algorithm
1126 SetNetworkState(kNetworkLoading); 1126 SetNetworkState(kNetworkLoading);
1127 1127
1128 // Set current_src_ *before* changing to the cache url, the fact that we are 1128 // Set current_src_ *before* changing to the cache url, the fact that we are
1129 // loading from the app cache is an internal detail not exposed through the 1129 // loading from the app cache is an internal detail not exposed through the
1130 // media element API. 1130 // media element API.
1131 current_src_ = url; 1131 current_src_ = url;
1132 1132
1133 if (audio_source_node_) 1133 if (audio_source_node_)
1134 audio_source_node_->OnCurrentSrcChanged(current_src_); 1134 audio_source_node_->OnCurrentSrcChanged(current_src_);
1135 if (RuntimeEnabledFeatures::newRemotePlaybackPipelineEnabled() &&
1136 RemotePlaybackClient()) {
1137 RemotePlaybackClient()->SourceChanged(current_src_);
mark a. foltz 2017/05/31 21:16:41 Is the goal to track the currently playing source
1138 }
1135 1139
1136 BLINK_MEDIA_LOG << "loadResource(" << (void*)this << ") - current_src_ -> " 1140 BLINK_MEDIA_LOG << "loadResource(" << (void*)this << ") - current_src_ -> "
1137 << UrlForLoggingMedia(current_src_); 1141 << UrlForLoggingMedia(current_src_);
1138 1142
1139 StartProgressEventTimer(); 1143 StartProgressEventTimer();
1140 1144
1141 // Reset display mode to force a recalculation of what to show because we are 1145 // Reset display mode to force a recalculation of what to show because we are
1142 // resetting the player. 1146 // resetting the player.
1143 SetDisplayMode(kUnknown); 1147 SetDisplayMode(kUnknown);
1144 1148
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after
3139 PlayInternal(); 3143 PlayInternal();
3140 } 3144 }
3141 3145
3142 void HTMLMediaElement::RequestSeek(double time) { 3146 void HTMLMediaElement::RequestSeek(double time) {
3143 // The player is the source of this seek request. 3147 // The player is the source of this seek request.
3144 setCurrentTime(time); 3148 setCurrentTime(time);
3145 } 3149 }
3146 3150
3147 void HTMLMediaElement::RemoteRouteAvailabilityChanged( 3151 void HTMLMediaElement::RemoteRouteAvailabilityChanged(
3148 WebRemotePlaybackAvailability availability) { 3152 WebRemotePlaybackAvailability availability) {
3149 if (RemotePlaybackClient()) 3153 if (RemotePlaybackClient() &&
3154 !RuntimeEnabledFeatures::newRemotePlaybackPipelineEnabled()) {
3150 RemotePlaybackClient()->AvailabilityChanged(availability); 3155 RemotePlaybackClient()->AvailabilityChanged(availability);
3156 }
3151 } 3157 }
3152 3158
3153 bool HTMLMediaElement::HasRemoteRoutes() const { 3159 bool HTMLMediaElement::HasRemoteRoutes() const {
3154 // TODO(mlamouri): used by MediaControlsPainter; should be refactored out. 3160 // TODO(mlamouri): used by MediaControlsPainter; should be refactored out.
3155 return RemotePlaybackClient() && 3161 return RemotePlaybackClient() &&
3156 RemotePlaybackClient()->RemotePlaybackAvailable(); 3162 RemotePlaybackClient()->RemotePlaybackAvailable();
3157 } 3163 }
3158 3164
3159 void HTMLMediaElement::ConnectedToRemoteDevice() { 3165 void HTMLMediaElement::ConnectedToRemoteDevice() {
3160 playing_remotely_ = true; 3166 playing_remotely_ = true;
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
4076 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4082 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4077 } 4083 }
4078 4084
4079 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) { 4085 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) {
4080 mostly_filling_viewport_ = true; 4086 mostly_filling_viewport_ = true;
4081 if (web_media_player_) 4087 if (web_media_player_)
4082 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_); 4088 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_);
4083 } 4089 }
4084 4090
4085 } // namespace blink 4091 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698