diff options
-rw-r--r-- | webkit/api/public/WebMediaPlayer.h | 3 | ||||
-rw-r--r-- | webkit/api/src/WebMediaPlayerClientImpl.cpp | 7 | ||||
-rw-r--r-- | webkit/api/src/WebMediaPlayerClientImpl.h | 1 | ||||
-rw-r--r-- | webkit/glue/webmediaplayer_impl.cc | 3 | ||||
-rw-r--r-- | webkit/glue/webmediaplayer_impl.h | 2 |
5 files changed, 14 insertions, 2 deletions
diff --git a/webkit/api/public/WebMediaPlayer.h b/webkit/api/public/WebMediaPlayer.h index 56bc967..ddd88e4 100644 --- a/webkit/api/public/WebMediaPlayer.h +++ b/webkit/api/public/WebMediaPlayer.h @@ -90,8 +90,9 @@ namespace WebKit { virtual void paint(WebCanvas*, const WebRect&) = 0; - // True if a video is loaded. + // True if the loaded media has a playable video/audio track. virtual bool hasVideo() const = 0; + virtual bool hasAudio() const = 0; // Dimension of the video. virtual WebSize naturalSize() const = 0; diff --git a/webkit/api/src/WebMediaPlayerClientImpl.cpp b/webkit/api/src/WebMediaPlayerClientImpl.cpp index 54cbce8..e9d5220 100644 --- a/webkit/api/src/WebMediaPlayerClientImpl.cpp +++ b/webkit/api/src/WebMediaPlayerClientImpl.cpp @@ -150,6 +150,13 @@ bool WebMediaPlayerClientImpl::hasVideo() const return false; } +bool WebMediaPlayerClientImpl::hasAudio() const +{ + if (m_webMediaPlayer.get()) + return m_webMediaPlayer->hasAudio(); + return false; +} + void WebMediaPlayerClientImpl::setVisible(bool visible) { if (m_webMediaPlayer.get()) diff --git a/webkit/api/src/WebMediaPlayerClientImpl.h b/webkit/api/src/WebMediaPlayerClientImpl.h index 721073c..c4d8063 100644 --- a/webkit/api/src/WebMediaPlayerClientImpl.h +++ b/webkit/api/src/WebMediaPlayerClientImpl.h @@ -70,6 +70,7 @@ namespace WebKit { virtual bool supportsSave() const; virtual WebCore::IntSize naturalSize() const; virtual bool hasVideo() const; + virtual bool hasAudio() const; virtual void setVisible(bool); virtual float duration() const; virtual float currentTime() const; diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index 00c6834..9eae37b 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -471,6 +471,9 @@ void WebMediaPlayerImpl::OnPipelineInitialize() { // as format error. Should post a task to call to |webmediaplayer_|. SetNetworkState(WebKit::WebMediaPlayer::FormatError); } + + // Repaint to trigger UI update. + Repaint(); } void WebMediaPlayerImpl::OnPipelineSeek() { diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h index bd4a6e8..f6d7fd3 100644 --- a/webkit/glue/webmediaplayer_impl.h +++ b/webkit/glue/webmediaplayer_impl.h @@ -181,7 +181,7 @@ class WebMediaPlayerImpl : public WebKit::WebMediaPlayer, virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); - // True if a video is loaded. + // True if the loaded media has a playable video/audio track. virtual bool hasVideo() const; virtual bool hasAudio() const; |