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

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

Issue 15927003: Fix MediaPlayerDelegate error handling so it passes the webkitmediasource-errors.html LayoutTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 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
« no previous file with comments | « webkit/media/android/media_source_delegate.cc ('k') | webkit/media/webmediaplayer_impl.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 #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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 if (!seeking_) 513 if (!seeking_)
514 media_source_delegate_->CancelPendingSeek(); 514 media_source_delegate_->CancelPendingSeek();
515 media_source_delegate_->Seek(time_to_seek); 515 media_source_delegate_->Seek(time_to_seek);
516 OnTimeUpdate(time_to_seek); 516 OnTimeUpdate(time_to_seek);
517 if (request_texture_peer) 517 if (request_texture_peer)
518 EstablishSurfaceTexturePeer(); 518 EstablishSurfaceTexturePeer();
519 } 519 }
520 520
521 void WebMediaPlayerAndroid::UpdateNetworkState( 521 void WebMediaPlayerAndroid::UpdateNetworkState(
522 WebMediaPlayer::NetworkState state) { 522 WebMediaPlayer::NetworkState state) {
523 network_state_ = state; 523 if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing &&
524 (state == WebMediaPlayer::NetworkStateNetworkError ||
525 state == WebMediaPlayer::NetworkStateDecodeError)) {
526 // Any error that occurs before reaching ReadyStateHaveMetadata should
527 // be considered a format error.
528 network_state_ = WebMediaPlayer::NetworkStateFormatError;
529 } else {
530 network_state_ = state;
531 }
524 client_->networkStateChanged(); 532 client_->networkStateChanged();
525 } 533 }
526 534
527 void WebMediaPlayerAndroid::UpdateReadyState( 535 void WebMediaPlayerAndroid::UpdateReadyState(
528 WebMediaPlayer::ReadyState state) { 536 WebMediaPlayer::ReadyState state) {
529 ready_state_ = state; 537 ready_state_ = state;
530 client_->readyStateChanged(); 538 client_->readyStateChanged();
531 } 539 }
532 540
533 void WebMediaPlayerAndroid::OnPlayerReleased() { 541 void WebMediaPlayerAndroid::OnPlayerReleased() {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 void WebMediaPlayerAndroid::exitFullscreen() { 729 void WebMediaPlayerAndroid::exitFullscreen() {
722 if (proxy_) 730 if (proxy_)
723 proxy_->ExitFullscreen(player_id_); 731 proxy_->ExitFullscreen(player_id_);
724 } 732 }
725 733
726 bool WebMediaPlayerAndroid::canEnterFullscreen() const { 734 bool WebMediaPlayerAndroid::canEnterFullscreen() const {
727 return manager_->CanEnterFullscreen(frame_); 735 return manager_->CanEnterFullscreen(frame_);
728 } 736 }
729 737
730 } // namespace webkit_media 738 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/android/media_source_delegate.cc ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698