1/*
2 *  Copyright (C) 2010 Igalia S.L
3 *  Copyright (C) 2010 Samsung Electronics
4 *
5 *  This library is free software; you can redistribute it and/or
6 *  modify it under the terms of the GNU Library General Public
7 *  License as published by the Free Software Foundation; either
8 *  version 2 of the License, or (at your option) any later version.
9 *
10 *  This library is distributed in the hope that it will be useful,
11 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 *  Library General Public License for more details.
14 *
15 *  You should have received a copy of the GNU Library General Public License
16 *  along with this library; see the file COPYING.LIB.  If not, write to
17 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 *  Boston, MA 02110-1301, USA.
19 */
20
21#ifndef FullscreenVideoControllerEfl_h
22#define FullscreenVideoControllerEfl_h
23
24#if ENABLE(VIDEO)
25
26#include "GStreamerGWorld.h"
27#include "HTMLMediaElement.h"
28#include <wtf/RefPtr.h>
29
30class FullscreenVideoController {
31    WTF_MAKE_NONCOPYABLE(FullscreenVideoController);
32public:
33    FullscreenVideoController();
34    virtual ~FullscreenVideoController();
35
36    void setMediaElement(WebCore::HTMLMediaElement*);
37    WebCore::HTMLMediaElement* mediaElement() const { return m_mediaElement.get(); }
38
39    void enterFullscreen();
40    void exitFullscreen();
41
42    void exitOnUserRequest();
43    void togglePlay();
44    void beginSeek();
45    void doSeek();
46    void endSeek();
47
48    void hideHud();
49    void showHud(bool);
50    bool updateHudProgressBar();
51
52    float volume() const;
53    void setVolume(float);
54    void volumeChanged();
55    void muteChanged();
56
57private:
58    bool canPlay() const;
59    void play();
60    void pause();
61    void playStateChanged();
62
63    bool muted() const;
64
65    float currentTime() const;
66    void setCurrentTime(float);
67
68    float duration() const;
69    float percentLoaded() const;
70
71    void createHud();
72    void updateHudPosition();
73
74    RefPtr<WebCore::HTMLMediaElement> m_mediaElement;
75    RefPtr<WebCore::GStreamerGWorld> m_gstreamerGWorld;
76
77    uint m_hudTimeoutId;
78    uint m_progressBarUpdateId;
79    uint m_progressBarFillUpdateId;
80    uint m_hscaleUpdateId;
81    uint m_volumeUpdateId;
82    bool m_seekLock;
83    PlatformWidget* m_window;
84    PlatformWidget* m_hudWindow;
85    PlatformWidget* m_timeHScale;
86    PlatformWidget* m_timeLabel;
87    PlatformWidget* m_volumeButton;
88};
89
90#endif
91
92#endif // FullscreenVideoControllerEfl_h
93