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

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: addressing comments 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 seeking_ = true; 158 seeking_ = true;
159 159
160 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds); 160 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds);
161 #if defined(GOOGLE_TV)
acolwell GONE FROM CHROMIUM 2013/05/23 18:21:30 At a minimum, this code MUST arrange for chunk_dem
qinmin 2013/05/23 20:07:21 Done. MediaSourceDelegate::Seek() already packs in
162 // TODO(qinmin): check if GTV can also defer the seek until the browser side
163 // player is ready.
161 if (media_source_delegate_) 164 if (media_source_delegate_)
162 media_source_delegate_->Seek(seek_time); 165 media_source_delegate_->Seek(seek_time);
166 #endif
163 if (proxy_) 167 if (proxy_)
164 proxy_->Seek(player_id_, seek_time); 168 proxy_->Seek(player_id_, seek_time);
165 } 169 }
166 170
167 bool WebMediaPlayerAndroid::supportsFullscreen() const { 171 bool WebMediaPlayerAndroid::supportsFullscreen() const {
168 return true; 172 return true;
169 } 173 }
170 174
171 bool WebMediaPlayerAndroid::supportsSave() const { 175 bool WebMediaPlayerAndroid::supportsSave() const {
172 return false; 176 return false;
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 void WebMediaPlayerAndroid::OnMediaPlayerPlay() { 496 void WebMediaPlayerAndroid::OnMediaPlayerPlay() {
493 UpdatePlayingState(true); 497 UpdatePlayingState(true);
494 client_->playbackStateChanged(); 498 client_->playbackStateChanged();
495 } 499 }
496 500
497 void WebMediaPlayerAndroid::OnMediaPlayerPause() { 501 void WebMediaPlayerAndroid::OnMediaPlayerPause() {
498 UpdatePlayingState(false); 502 UpdatePlayingState(false);
499 client_->playbackStateChanged(); 503 client_->playbackStateChanged();
500 } 504 }
501 505
506 void WebMediaPlayerAndroid::OnMediaSeekRequest(base::TimeDelta time_to_seek) {
507 if (media_source_delegate_) {
508 media_source_delegate_->Seek(time_to_seek);
509 OnTimeUpdate(time_to_seek);
510 }
511 }
512
502 void WebMediaPlayerAndroid::UpdateNetworkState( 513 void WebMediaPlayerAndroid::UpdateNetworkState(
503 WebMediaPlayer::NetworkState state) { 514 WebMediaPlayer::NetworkState state) {
504 network_state_ = state; 515 network_state_ = state;
505 client_->networkStateChanged(); 516 client_->networkStateChanged();
506 } 517 }
507 518
508 void WebMediaPlayerAndroid::UpdateReadyState( 519 void WebMediaPlayerAndroid::UpdateReadyState(
509 WebMediaPlayer::ReadyState state) { 520 WebMediaPlayer::ReadyState state) {
510 ready_state_ = state; 521 ready_state_ = state;
511 client_->readyStateChanged(); 522 client_->readyStateChanged();
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 void WebMediaPlayerAndroid::exitFullscreen() { 701 void WebMediaPlayerAndroid::exitFullscreen() {
691 if (proxy_) 702 if (proxy_)
692 proxy_->ExitFullscreen(player_id_); 703 proxy_->ExitFullscreen(player_id_);
693 } 704 }
694 705
695 bool WebMediaPlayerAndroid::canEnterFullscreen() const { 706 bool WebMediaPlayerAndroid::canEnterFullscreen() const {
696 return manager_->CanEnterFullscreen(frame_); 707 return manager_->CanEnterFullscreen(frame_);
697 } 708 }
698 709
699 } // namespace webkit_media 710 } // 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