video:-webkit-full-screen::-webkit-media-controls-panel {
- position: relative;
+ -webkit-transform-origin: left bottom;
+ position: fixed;
left: 0px;
bottom: 0px;
width: 1280px;
video:-webkit-full-screen::-webkit-media-controls-panel {
- position: relative;
+ -webkit-transform-origin: left bottom;
+ position: fixed;
left: 0px;
bottom: 0px;
width: 720px;
ROTATE_270,
ROTATE_ERROR
};
+
+int HTMLMediaElement::s_rotation = ROTATE_0;
#endif
using namespace HTMLNames;
#if ENABLE(TIZEN_GSTREAMER_VIDEO)
, m_suspended(false)
#endif
-#if ENABLE(TIZEN_DEVICE_ROTATION)
- , m_rotation(ROTATE_0)
-#endif
{
LOG(Media, "HTMLMediaElement::HTMLMediaElement");
document->registerForMediaVolumeCallbacks(this);
#if ENABLE(TIZEN_DEVICE_ROTATION)
bool HTMLMediaElement::isHorizontal()
{
- return (m_rotation == ROTATE_90 || m_rotation == ROTATE_270) ? true : false;
+ return (s_rotation == ROTATE_90 || s_rotation == ROTATE_270) ? true : false;
}
bool HTMLMediaElement::isVertical()
{
- return (m_rotation == ROTATE_0 || m_rotation == ROTATE_180) ? true : false;
+ return (s_rotation == ROTATE_0 || s_rotation == ROTATE_180) ? true : false;
}
void HTMLMediaElement::registerRotationCallback()
return;
int rotation = that->calcRotation(x, y, z);
- if (rotation == ROTATE_ERROR || rotation == that->m_rotation)
+ if (rotation == ROTATE_ERROR || rotation == s_rotation)
return;
- that->m_rotation = rotation;
+ s_rotation = rotation;
}
#endif
}
}
+#if ENABLE(TIZEN_FULLSCREEN_API)
+void HTMLMediaElement::updateMediaControlsStyle()
+{
+ if (hasMediaControls())
+ mediaControls()->updateMediaControlScale();
+
+ recalcStyle(Node::Force);
+}
+#endif
+
void HTMLMediaElement::didBecomeFullscreenElement()
{
if (hasMediaControls())
#endif
#if ENABLE(TIZEN_DEVICE_ROTATION)
- bool isHorizontal();
- bool isVertical();
+ static bool isHorizontal();
+ static bool isVertical();
+#endif
- int rotation() { return m_rotation; }
+#if ENABLE(TIZEN_FULLSCREEN_API)
+ void updateMediaControlsStyle();
#endif
protected:
#endif
#if ENABLE(TIZEN_DEVICE_ROTATION)
sensor_h m_handle;
- int m_rotation;
+ static int s_rotation;
#endif
};
#include "TextTrackCue.h"
#endif
+#if ENABLE(TIZEN_FULLSCREEN_API)
+#include "Settings.h"
+#endif
+
using namespace std;
namespace WebCore {
static const double timeWithoutMouseMovementBeforeHidingControls = 3;
+#if ENABLE(TIZEN_FULLSCREEN_API)
+const IntSize compareResolution(720, 1280);
+#endif
MediaControlRootElement::MediaControlRootElement(Document* document)
: MediaControls(document)
m_volumeSlider->setVolume(m_mediaController->volume());
}
+#if ENABLE(TIZEN_FULLSCREEN_API)
+void MediaControlRootElement::updateMediaControlScale()
+{
+ if (!document()->page())
+ return;
+
+ double scaleFactor = 1 / document()->page()->chrome()->contentsScaleFactor();
+
+#if ENABLE(TIZEN_DEVICE_ROTATION)
+ Settings* settings = document()->settings();
+ if (settings && settings->deviceWidth() != compareResolution.width())
+ scaleFactor *= (settings->deviceWidth() / static_cast<double>(HTMLMediaElement::isHorizontal() ? compareResolution.height() : compareResolution.width()));
+#endif
+
+ m_panel->setInlineStyleProperty(CSSPropertyWebkitTransform, "scale(" + String::number(scaleFactor) + ", " + String::number(scaleFactor) + ")", false);
+}
+#endif
+
void MediaControlRootElement::enteredFullscreen()
{
m_isFullscreen = true;
if (Page* page = document()->page()) {
page->chrome()->setCursorHiddenUntilMouseMoves(true);
+ }
-#if ENABLE(TIZEN_GSTREAMER_VIDEO) && ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
- float scaleFactor = page->chrome()->contentsScaleFactor();
- if (scaleFactor > 0)
- m_panel->setInlineStyleProperty(CSSPropertyZoom, 1 / scaleFactor, CSSPrimitiveValue::CSS_NUMBER);
+#if ENABLE(TIZEN_FULLSCREEN_API)
+ updateMediaControlScale();
#endif
- }
#if !ENABLE(TIZEN_GSTREAMER_VIDEO)
startHideFullscreenControlsTimer();
// And if we reenter fullscreen we also want the panel in the standard position.
m_panel->resetPosition();
-#if ENABLE(TIZEN_GSTREAMER_VIDEO) && ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
- m_panel->removeInlineStyleProperty(CSSPropertyZoom);
+#if ENABLE(TIZEN_FULLSCREEN_API)
+ m_panel->removeInlineStyleProperty(CSSPropertyWebkitTransform);
#endif
#if !ENABLE(TIZEN_GSTREAMER_VIDEO)
void enteredFullscreen();
void exitedFullscreen();
+#if ENABLE(TIZEN_FULLSCREEN_API)
+ void updateMediaControlScale();
+#endif
void reportedError();
void loadedMetadata();
virtual void enteredFullscreen() = 0;
virtual void exitedFullscreen() = 0;
+#if ENABLE(TIZEN_FULLSCREEN_API)
+ virtual void updateMediaControlScale() = 0;
+#endif
virtual void reportedError() = 0;
virtual void loadedMetadata() = 0;
void WebFullScreenManager::updateMediaControlsStyle()
{
ASSERT(m_element);
- m_element->recalcStyle(Node::Force);
+ HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(m_element.get());
+ if (mediaElement)
+ mediaElement->updateMediaControlsStyle();
}
#endif