OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_GLUE_WEBMEDIAPLAYERCLIENT_IMPL_H_ | |
6 #define WEBKIT_GLUE_WEBMEDIAPLAYERCLIENT_IMPL_H_ | |
7 | |
8 #if ENABLE(VIDEO) | |
9 | |
10 #include "webkit/api/public/WebMediaPlayerClient.h" | |
11 | |
12 #include "MediaPlayerPrivate.h" | |
13 | |
14 namespace WebCore { | |
15 class MediaPlayerPrivate; | |
16 } // namespace WebCore | |
17 | |
18 namespace WebKit { | |
19 class WebMediaPlayer; | |
20 } // namespace WebKit | |
21 | |
22 class WebMediaPlayerClientImpl : public WebKit::WebMediaPlayerClient, | |
23 public WebCore::MediaPlayerPrivateInterface { | |
24 public: | |
25 virtual ~WebMediaPlayerClientImpl(); | |
26 | |
27 //////////////////////////////////////////////////////////////////////////// | |
28 // WebMediaPlayerPlayerClient methods | |
29 virtual void networkStateChanged(); | |
30 virtual void readyStateChanged(); | |
31 virtual void volumeChanged(); | |
32 virtual void timeChanged(); | |
33 virtual void repaint(); | |
34 virtual void durationChanged(); | |
35 virtual void rateChanged(); | |
36 virtual void sizeChanged(); | |
37 virtual void sawUnsupportedTracks(); | |
38 | |
39 //////////////////////////////////////////////////////////////////////////// | |
40 // MediaPlayerPrivateInterface methods | |
41 virtual void load(const WebCore::String& url); | |
42 virtual void cancelLoad(); | |
43 | |
44 virtual void play(); | |
45 virtual void pause(); | |
46 | |
47 virtual WebCore::IntSize naturalSize() const; | |
48 | |
49 virtual bool hasVideo() const; | |
50 | |
51 virtual void setVisible(bool); | |
52 | |
53 virtual float duration() const; | |
54 | |
55 virtual float currentTime() const; | |
56 virtual void seek(float time); | |
57 virtual bool seeking() const; | |
58 | |
59 virtual void setEndTime(float time); | |
60 | |
61 virtual void setRate(float); | |
62 virtual bool paused() const; | |
63 | |
64 virtual void setVolume(float); | |
65 | |
66 virtual WebCore::MediaPlayer::NetworkState networkState() const; | |
67 virtual WebCore::MediaPlayer::ReadyState readyState() const; | |
68 | |
69 virtual float maxTimeSeekable() const; | |
70 virtual float maxTimeBuffered() const; | |
71 | |
72 virtual int dataRate() const; | |
73 virtual void setAutobuffer(bool); | |
74 | |
75 virtual bool totalBytesKnown() const; | |
76 virtual unsigned totalBytes() const; | |
77 virtual unsigned bytesLoaded() const; | |
78 | |
79 virtual void setSize(const WebCore::IntSize&); | |
80 virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); | |
81 | |
82 private: | |
83 friend class WebCore::MediaPlayerPrivate; | |
84 | |
85 WebMediaPlayerClientImpl(); | |
86 | |
87 // Static methods used by WebKit for construction. | |
88 static WebCore::MediaPlayerPrivateInterface* create( | |
89 WebCore::MediaPlayer* player); | |
90 static void getSupportedTypes( | |
91 WTF::HashSet<WebCore::String>& supportedTypes); | |
92 static WebCore::MediaPlayer::SupportsType supportsType( | |
93 const WebCore::String& type, const WebCore::String& codecs); | |
94 | |
95 WebCore::MediaPlayer* m_mediaPlayer; | |
96 WebKit::WebMediaPlayer* m_webMediaPlayer; | |
97 }; | |
98 | |
99 #endif // ENABLE(VIDEO) | |
100 | |
101 #endif // WEBKIT_GLUE_WEBMEDIAPLAYERCLIENT_IMPL_H_ | |
OLD | NEW |