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

Side by Side Diff: media/base/android/media_player_bridge.h

Issue 1234483003: Prevent seeking when Android MediaPlayer reports that it's not possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from qinmin. Created 5 years, 5 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
« no previous file with comments | « AUTHORS ('k') | media/base/android/media_player_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 void OnMediaInterrupted() override; 92 void OnMediaInterrupted() override;
93 void OnMediaPrepared() override; 93 void OnMediaPrepared() override;
94 94
95 // Create the corresponding Java class instance. 95 // Create the corresponding Java class instance.
96 virtual void CreateJavaMediaPlayerBridge(); 96 virtual void CreateJavaMediaPlayerBridge();
97 97
98 // Get allowed operations from the player. 98 // Get allowed operations from the player.
99 virtual base::android::ScopedJavaLocalRef<jobject> GetAllowedOperations(); 99 virtual base::android::ScopedJavaLocalRef<jobject> GetAllowedOperations();
100 100
101 private: 101 private:
102 friend class MediaPlayerBridgeTest;
103
102 // Set the data source for the media player. 104 // Set the data source for the media player.
103 void SetDataSource(const std::string& url); 105 void SetDataSource(const std::string& url);
104 106
105 // Functions that implements media player control. 107 // Functions that implements media player control.
106 void StartInternal(); 108 void StartInternal();
107 void PauseInternal(); 109 void PauseInternal();
108 void SeekInternal(base::TimeDelta time); 110
111 // Returns true if the Java MediaPlayerBridge's seekTo method is called
112 bool SeekInternal(base::TimeDelta current_time, base::TimeDelta time);
109 113
110 // Called when |time_update_timer_| fires. 114 // Called when |time_update_timer_| fires.
111 void OnTimeUpdateTimerFired(); 115 void OnTimeUpdateTimerFired();
112 116
113 // Update allowed operations from the player. 117 // Update allowed operations from the player.
114 void UpdateAllowedOperations(); 118 void UpdateAllowedOperations();
115 119
116 // Callback function passed to |resource_getter_|. Called when the cookies 120 // Callback function passed to |resource_getter_|. Called when the cookies
117 // are retrieved. 121 // are retrieved.
118 void OnCookiesRetrieved(const std::string& cookies); 122 void OnCookiesRetrieved(const std::string& cookies);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 187
184 // NOTE: Weak pointers must be invalidated before all other member variables. 188 // NOTE: Weak pointers must be invalidated before all other member variables.
185 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_; 189 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_;
186 190
187 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); 191 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge);
188 }; 192 };
189 193
190 } // namespace media 194 } // namespace media
191 195
192 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ 196 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_
OLDNEW
« no previous file with comments | « AUTHORS ('k') | media/base/android/media_player_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698