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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 23797004: Sets the media element network state to idle until playback is requested. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new flag playing_started_ Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 3520bd2c6d37a2c819f64a34eb1e62eb8e80bac5..dbe2ef5196e549406c84bded00a61a84ba725533 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -79,6 +79,7 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
texture_mailbox_sync_point_(0),
stream_id_(0),
is_playing_(false),
+ playing_started_(false),
needs_establish_peer_(true),
stream_texture_proxy_initialized_(false),
has_size_info_(false),
@@ -235,6 +236,11 @@ void WebMediaPlayerAndroid::DidLoadMediaInfo(
UpdateReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
UpdateReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
}
+ // Android doesn't start fetching resources until an implementation-defined
+ // event (e.g. playback request) occurs. Sets to the network state to IDLE
qinmin 2013/10/01 03:34:28 nit: s/Sets to/Sets/
Jinsuk Kim 2013/10/01 04:14:48 Done.
+ // if play is not requested yet.
+ if (!playing_started_)
+ UpdateNetworkState(WebMediaPlayer::NetworkStateIdle);
}
void WebMediaPlayerAndroid::play() {
@@ -244,6 +250,8 @@ void WebMediaPlayerAndroid::play() {
if (paused())
proxy_->Start(player_id_);
UpdatePlayingState(true);
+ UpdateNetworkState(WebMediaPlayer::NetworkStateLoading);
+ playing_started_ = true;
}
void WebMediaPlayerAndroid::pause() {
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698