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

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

Issue 213193010: Restore the HTMLVideoElement-specific prefixed fullscreen API behind a flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revive full-screen-iframe-legacy.html 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 3cc8b3d6c64828ca37e946a7e8259ca623eae76f..4399b983af84cec75bae3b7ce0fd9b34920bb424 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -121,6 +121,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())
@@ -197,6 +208,35 @@ bool HTMLVideoElement::hasAvailableVideoFrame() const
return player()->hasVideo() && player()->readyState() >= MediaPlayer::HaveCurrentData;
}
+void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState)
+{
+ if (isFullscreen())
+ 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