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

Side by Side Diff: webkit/media/android/webmediaplayer_android.cc

Issue 15499006: Enable seek in fullscreen mode for MSE impl on android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add CancelPendingSeek() Created 7 years, 7 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 | Annotate | Revision Log
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 #include "webkit/media/android/webmediaplayer_android.h" 5 #include "webkit/media/android/webmediaplayer_android.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 void WebMediaPlayerAndroid::pause() { 150 void WebMediaPlayerAndroid::pause() {
151 if (proxy_) 151 if (proxy_)
152 proxy_->Pause(player_id_); 152 proxy_->Pause(player_id_);
153 is_playing_ = false; 153 is_playing_ = false;
154 } 154 }
155 155
156 void WebMediaPlayerAndroid::seek(double seconds) { 156 void WebMediaPlayerAndroid::seek(double seconds) {
157 pending_seek_ = seconds; 157 pending_seek_ = seconds;
158 if (seeking_ && media_source_delegate_)
159 media_source_delegate_->CancelPendingSeek();
158 seeking_ = true; 160 seeking_ = true;
159 161
160 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds); 162 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds);
163 #if defined(GOOGLE_TV)
164 // TODO(qinmin): check if GTV can also defer the seek until the browser side
165 // player is ready.
161 if (media_source_delegate_) 166 if (media_source_delegate_)
162 media_source_delegate_->Seek(seek_time); 167 media_source_delegate_->Seek(seek_time);
168 #endif
163 if (proxy_) 169 if (proxy_)
164 proxy_->Seek(player_id_, seek_time); 170 proxy_->Seek(player_id_, seek_time);
165 } 171 }
166 172
167 bool WebMediaPlayerAndroid::supportsFullscreen() const { 173 bool WebMediaPlayerAndroid::supportsFullscreen() const {
168 return true; 174 return true;
169 } 175 }
170 176
171 bool WebMediaPlayerAndroid::supportsSave() const { 177 bool WebMediaPlayerAndroid::supportsSave() const {
172 return false; 178 return false;
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 void WebMediaPlayerAndroid::OnMediaPlayerPlay() { 498 void WebMediaPlayerAndroid::OnMediaPlayerPlay() {
493 UpdatePlayingState(true); 499 UpdatePlayingState(true);
494 client_->playbackStateChanged(); 500 client_->playbackStateChanged();
495 } 501 }
496 502
497 void WebMediaPlayerAndroid::OnMediaPlayerPause() { 503 void WebMediaPlayerAndroid::OnMediaPlayerPause() {
498 UpdatePlayingState(false); 504 UpdatePlayingState(false);
499 client_->playbackStateChanged(); 505 client_->playbackStateChanged();
500 } 506 }
501 507
508 void WebMediaPlayerAndroid::OnMediaSeekRequest(base::TimeDelta time_to_seek,
509 bool request_texture_peer) {
510 if (!media_source_delegate_)
511 return;
512
513 if (seeking_)
514 media_source_delegate_->CancelPendingSeek();
acolwell GONE FROM CHROMIUM 2013/05/23 20:58:27 It's not clear to me why this is needed. It seems
qinmin 2013/05/23 22:03:36 changed the if statement to (!seeking_). If the se
515 seeking_ = true;
516 media_source_delegate_->Seek(time_to_seek);
517 OnTimeUpdate(time_to_seek);
518 if (request_texture_peer)
519 EstablishSurfaceTexturePeer();
520 }
521
502 void WebMediaPlayerAndroid::UpdateNetworkState( 522 void WebMediaPlayerAndroid::UpdateNetworkState(
503 WebMediaPlayer::NetworkState state) { 523 WebMediaPlayer::NetworkState state) {
504 network_state_ = state; 524 network_state_ = state;
505 client_->networkStateChanged(); 525 client_->networkStateChanged();
506 } 526 }
507 527
508 void WebMediaPlayerAndroid::UpdateReadyState( 528 void WebMediaPlayerAndroid::UpdateReadyState(
509 WebMediaPlayer::ReadyState state) { 529 WebMediaPlayer::ReadyState state) {
510 ready_state_ = state; 530 ready_state_ = state;
511 client_->readyStateChanged(); 531 client_->readyStateChanged();
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 void WebMediaPlayerAndroid::exitFullscreen() { 710 void WebMediaPlayerAndroid::exitFullscreen() {
691 if (proxy_) 711 if (proxy_)
692 proxy_->ExitFullscreen(player_id_); 712 proxy_->ExitFullscreen(player_id_);
693 } 713 }
694 714
695 bool WebMediaPlayerAndroid::canEnterFullscreen() const { 715 bool WebMediaPlayerAndroid::canEnterFullscreen() const {
696 return manager_->CanEnterFullscreen(frame_); 716 return manager_->CanEnterFullscreen(frame_);
697 } 717 }
698 718
699 } // namespace webkit_media 719 } // namespace webkit_media
OLDNEW
« media/base/android/media_source_player.cc ('K') | « webkit/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698