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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1580733002: [Android cast] Make the local player exit seeking mode on cast start (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed by changing the state in the local player instead, which avoids IPCs Created 4 years, 11 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 // paused while fullscreen then fullscreen state was left. 1019 // paused while fullscreen then fullscreen state was left.
1020 TryCreateStreamTextureProxyIfNeeded(); 1020 TryCreateStreamTextureProxyIfNeeded();
1021 if (needs_establish_peer_) 1021 if (needs_establish_peer_)
1022 EstablishSurfaceTexturePeer(); 1022 EstablishSurfaceTexturePeer();
1023 1023
1024 UpdatePlayingState(true); 1024 UpdatePlayingState(true);
1025 client_->playbackStateChanged(); 1025 client_->playbackStateChanged();
1026 } 1026 }
1027 1027
1028 void WebMediaPlayerAndroid::OnMediaPlayerPause() { 1028 void WebMediaPlayerAndroid::OnMediaPlayerPause() {
1029 // Complete a seek operation upon entering pause state. Pause is called as
1030 // part of remote media player preparation. There might be a seek operation
1031 // initiated locally while the media is not playing, and it needs to be
1032 // completed before the remote player starts playing.
1033 // (see crbug.com/568161)
1034 if (seeking())
1035 OnSeekComplete(seek_time_);
aberent 2016/01/12 15:54:56 What effect does this have on local playback, e.g.
dgn 2016/01/13 12:25:54 Removed that line. Tried first to do that when swi
1036
1029 UpdatePlayingState(false); 1037 UpdatePlayingState(false);
1030 client_->playbackStateChanged(); 1038 client_->playbackStateChanged();
1031 } 1039 }
1032 1040
1033 void WebMediaPlayerAndroid::OnRemoteRouteAvailabilityChanged( 1041 void WebMediaPlayerAndroid::OnRemoteRouteAvailabilityChanged(
1034 bool routes_available) { 1042 bool routes_available) {
1035 client_->remoteRouteAvailabilityChanged(routes_available); 1043 client_->remoteRouteAvailabilityChanged(routes_available);
1036 } 1044 }
1037 1045
1038 void WebMediaPlayerAndroid::OnDurationChanged(const base::TimeDelta& duration) { 1046 void WebMediaPlayerAndroid::OnDurationChanged(const base::TimeDelta& duration) {
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1961 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1954 } else if (is_hls_url == is_hls) { 1962 } else if (is_hls_url == is_hls) {
1955 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1963 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1956 } 1964 }
1957 UMA_HISTOGRAM_ENUMERATION( 1965 UMA_HISTOGRAM_ENUMERATION(
1958 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1966 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1959 result, PREDICTION_RESULT_MAX); 1967 result, PREDICTION_RESULT_MAX);
1960 } 1968 }
1961 1969
1962 } // namespace content 1970 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698