audio {
width: 200px;
- height: 32px;
+ height: 48px;
}
audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
width: 100%;
z-index: 0;
overflow: hidden;
- height: 32px;
+ height: 48px;
text-align: right;
}
video:-webkit-full-page-media::-webkit-media-controls-panel {
- bottom: -32px;
+ bottom: -48px;
}
audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
-webkit-appearance: media-mute-button;
display: -webkit-box;
- width: 32px;
- height: 32px;
+ width: 48px;
+ height: 48px;
}
audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button {
-webkit-appearance: media-play-button;
display: -webkit-box;
- width: 32px;
- height: 32px;
+ width: 48px;
+ height: 48px;
}
audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container {
-webkit-box-pack: end;
-webkit-box-flex: 1;
-webkit-user-select: none;
- height: 32px;
+ height: 48px;
}
audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display {
-webkit-appearance: media-slider;
display: -webkit-box;
-webkit-box-flex: 1;
- height: 32px;
- padding: 0px 2px;
+ height: 48px;
+ padding: 0px 0px;
}
audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container {
audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
-webkit-appearance: media-seek-back-button;
display: -webkit-box;
- width: 32px;
- height: 32px;
+ width: 48px;
+ height: 48px;
}
audio::-webkit-media-controls-seek-forward-button, video::-webkit-media-controls-seek-forward-button {
-webkit-appearance: media-seek-forward-button;
display: -webkit-box;
- width: 32px;
- height: 32px;
+ width: 48px;
+ height: 48px;
}
audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button {
- -webkit-appearance: media-play-button;
+ -webkit-appearance: media-fullscreen-button;
display: -webkit-box;
- width: 32px;
- height: 32px;
+ width: 48px;
+ height: 48px;
}
audio::-webkit-media-controls-rewind-button, video::-webkit-media-controls-rewind-button {
audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button {
-webkit-appearance: media-toggle-closed-captions-button;
display: -webkit-box;
- width: 32px;
- height: 32px
+ width: 48px;
+ height: 48px
}
}
}
-bool paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeAndroid::paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect)
{
bool translucent = false;
if (o && toParentMediaElement(o) && toParentMediaElement(o)->hasTagName(HTMLNames::videoTag))
translucent = true;
- RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::PLAY, translucent);
+ RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::FULLSCREEN, translucent);
return false;
}
virtual String extraMediaControlsStyleSheet();
virtual void adjustSliderThumbSize(RenderObject* o) const;
virtual bool shouldRenderMediaControlPart(ControlPart part, Element* e);
- bool paintMediaMuteButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
- bool paintMediaPlayButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
- bool paintMediaSeekBackButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
- bool paintMediaSeekForwardButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
- bool paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
- bool paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
+ virtual bool paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
+ virtual bool paintMediaMuteButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
+ virtual bool paintMediaPlayButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
+ virtual bool paintMediaSeekBackButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
+ virtual bool paintMediaSeekForwardButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
+ virtual bool paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
+ virtual bool paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r);
virtual bool paintMediaControlsBackground(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect);
+ virtual double mediaControlsFadeInDuration() { return 0.5; }
+ virtual double mediaControlsFadeOutDuration() { return 0.5; }
#endif
virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
virtual IntSize naturalSize() const { return m_naturalSize; }
- virtual bool hasAudio() const { return false; }
- virtual bool hasVideo() const { return false; }
+ virtual bool supportsFullscreen() const = 0;
+ virtual bool hasAudio() const = 0;
+ virtual bool hasVideo() const = 0;
virtual void setVisible(bool);
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
+#if PLATFORM(ANDROID)
+#define TOUCH_DELAY 4
+#endif
+
using namespace std;
namespace WebCore {
, m_opacityAnimationDuration(0)
, m_opacityAnimationFrom(0)
, m_opacityAnimationTo(1.0f)
+#if PLATFORM(ANDROID)
+ , m_lastTouch(0)
+#endif
{
setImageResource(RenderImageResource::create());
}
, m_opacityAnimationDuration(0)
, m_opacityAnimationFrom(0)
, m_opacityAnimationTo(1.0f)
+#if PLATFORM(ANDROID)
+ , m_lastTouch(0)
+#endif
{
setImageResource(RenderImageResource::create());
setIntrinsicSize(intrinsicSize);
// Don't fade if the media element is not visible
if (style()->visibility() != VISIBLE)
return;
-
+
+#if PLATFORM(ANDROID)
+ if (WTF::currentTime() - m_lastTouch > TOUCH_DELAY)
+ m_mouseOver = false;
+ else
+ m_mouseOver = true;
+#endif
+
bool shouldHideController = !m_mouseOver && !media->canPlay();
// Do fading manually, css animations don't work with shadow trees
void RenderMedia::forwardEvent(Event* event)
{
+#if PLATFORM(ANDROID)
+ if (event->isMouseEvent())
+ m_lastTouch = WTF::currentTime();
+#endif
+
if (event->isMouseEvent() && m_controlsShadowRoot) {
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
IntPoint point(mouseEvent->absoluteLocation());
double m_opacityAnimationDuration;
float m_opacityAnimationFrom;
float m_opacityAnimationTo;
+#if PLATFORM(ANDROID)
+ double m_lastTouch;
+#endif
};
inline RenderMedia* toRenderMedia(RenderObject* object)
{ "ic_media_pause.png", 0, 0 }, // MUTE
{ "ic_media_rew.png", 0, 0 }, // REWIND
{ "ic_media_ff.png", 0, 0 }, // FORWARD
+ { "ic_media_fullscreen.png", 0, 0 }, // FULLSCREEN
{ "btn_media_player_disabled.9.png", 0, 0 }, // BACKGROUND_SLIDER
{ "scrubber_track_holo_dark.9.png", 0, 0 }, // SLIDER_TRACK
{ "scrubber_control_holo.png", 0, 0 } // SLIDER_THUMB
case MUTE:
case REWIND:
case FORWARD:
+ case FULLSCREEN:
{
imageIndex = buttonType + 1;
paint.setColor(backgroundColor);
/**
* Button types
*/
- enum { PAUSE, PLAY, MUTE, REWIND, FORWARD, BACKGROUND_SLIDER, SLIDER_TRACK, SLIDER_THUMB };
+ enum { PAUSE, PLAY, MUTE, REWIND, FORWARD, FULLSCREEN, BACKGROUND_SLIDER, SLIDER_TRACK, SLIDER_THUMB };
/**
* Slider dimensions
*/
return;
m_paused = true;
+ m_player->playbackStateChanged();
env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_pause);
checkException(env);
}
m_currentTime = duration();
m_player->timeChanged();
m_paused = true;
+ m_player->playbackStateChanged();
m_hasVideo = false;
m_networkState = MediaPlayer::Idle;
}
void MediaPlayerPrivate::onPaused()
{
m_paused = true;
+ m_player->playbackStateChanged();
m_hasVideo = false;
m_networkState = MediaPlayer::Idle;
m_player->playbackStateChanged();
return;
m_paused = false;
+ m_player->playbackStateChanged();
if (m_currentTime == duration())
m_currentTime = 0;
m_player->sizeChanged();
}
- bool hasAudio() { return false; } // do not display the audio UI
- bool hasVideo() { return m_hasVideo; }
- bool suppportsFullscreen() { return true; }
+ virtual bool hasAudio() const { return false; } // do not display the audio UI
+ virtual bool hasVideo() const { return m_hasVideo; }
+ virtual bool supportsFullscreen() const { return true; }
MediaPlayerVideoPrivate(MediaPlayer* player) : MediaPlayerPrivate(player)
{
return;
m_paused = false;
+ m_player->playbackStateChanged();
env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_play);
checkException(env);
}
- bool hasAudio() { return true; }
- bool hasVideo() { return false; }
- bool suppportsFullscreen() { return false; }
+ virtual bool hasAudio() const { return true; }
+ virtual bool hasVideo() const { return false; }
+ virtual bool supportsFullscreen() const { return false; }
float maxTimeSeekable() const
{