diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-20 05:41:27 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-20 05:41:27 +0000 |
commit | 65bdef09c159f87070fa634d448d2944734206c1 (patch) | |
tree | b2aea52db478701cb5aa267d0c1c66a43a1178ce /webkit/glue/webmediaplayer_impl.cc | |
parent | 858b36d38d26b2fe21c5ae25c2beb81b1a09f305 (diff) | |
download | chromium_src-65bdef09c159f87070fa634d448d2944734206c1.zip chromium_src-65bdef09c159f87070fa634d448d2944734206c1.tar.gz chromium_src-65bdef09c159f87070fa634d448d2944734206c1.tar.bz2 |
Set our network state before setting our ready state after the media engine has initialized.
This makes us consistent with other WebKit ports by ensuring we fire at least one progress event before advancing the ready state to canplay/canplaythrough.
BUG=59675
TEST=media/event-attributes.html
Review URL: http://codereview.chromium.org/7033041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_impl.cc')
-rw-r--r-- | webkit/glue/webmediaplayer_impl.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index e204be6..8b83468 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -780,14 +780,15 @@ void WebMediaPlayerImpl::OnPipelineInitialize(PipelineStatus status) { static_cast<float>(pipeline_->GetMediaDuration().InSecondsF()); buffered_.swap(new_buffered); + if (pipeline_->IsLoaded()) { + SetNetworkState(WebKit::WebMediaPlayer::Loaded); + } + // Since we have initialized the pipeline, say we have everything otherwise // we'll remain either loading/idle. // TODO(hclam): change this to report the correct status. SetReadyState(WebKit::WebMediaPlayer::HaveMetadata); SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData); - if (pipeline_->IsLoaded()) { - SetNetworkState(WebKit::WebMediaPlayer::Loaded); - } } else { // TODO(hclam): should use |status| to determine the state // properly and reports error using MediaError. |