Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Unified Diff: Source/core/html/HTMLVideoElement.cpp

Issue 191273002: Revert "Remove the HTMLVideoElement-specific prefixed fullscreen API" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/HTMLVideoElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLVideoElement.cpp
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index d0b8b8d57e1bbd379de5dc66273ee639758867a4..5dacbacc390dee9573b52b3935ee2152861bd16b 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -120,6 +120,17 @@ void HTMLVideoElement::parseAttribute(const QualifiedName& name, const AtomicStr
HTMLMediaElement::parseAttribute(name, value);
}
+bool HTMLVideoElement::supportsFullscreen() const
+{
+ if (!document().page())
+ return false;
+
+ if (!player())
+ return false;
+
+ return true;
+}
+
unsigned HTMLVideoElement::videoWidth() const
{
if (!player())
@@ -196,6 +207,41 @@ bool HTMLVideoElement::hasAvailableVideoFrame() const
return player()->hasVideo() && player()->readyState() >= MediaPlayer::HaveCurrentData;
}
+void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState)
+{
+ if (isFullscreen())
+ return;
+
+ // Generate an exception if this isn't called in response to a user gesture, or if the
+ // element does not support fullscreen.
+ if (userGestureRequiredForFullscreen() && !UserGestureIndicator::processingUserGesture()) {
+ exceptionState.throwDOMException(InvalidStateError, "This element may only enter fullscreen mode in response to a user gesture ('click', for example).");
+ return;
+ }
+ if (!supportsFullscreen()) {
+ exceptionState.throwDOMException(InvalidStateError, "This element does not support fullscreen mode.");
+ return;
+ }
+
+ enterFullscreen();
+}
+
+void HTMLVideoElement::webkitExitFullscreen()
+{
+ if (isFullscreen())
+ exitFullscreen();
+}
+
+bool HTMLVideoElement::webkitSupportsFullscreen()
+{
+ return supportsFullscreen();
+}
+
+bool HTMLVideoElement::webkitDisplayingFullscreen()
+{
+ return isFullscreen();
+}
+
void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument)
{
if (m_imageLoader)
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/HTMLVideoElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698