From 9d4928f80b730979367effe4971367ed29c46703 Mon Sep 17 00:00:00 2001 From: Bruno Salmon Date: Sun, 26 Nov 2023 15:23:39 +0000 Subject: [PATCH] Allowed videos to be played fullscreen in HtmlWebViewPeer --- .../kit/mapper/peers/javafxweb/spi/gwt/HtmlWebViewPeer.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webfx-kit/webfx-kit-javafxweb-peers-gwt/src/main/java/dev/webfx/kit/mapper/peers/javafxweb/spi/gwt/HtmlWebViewPeer.java b/webfx-kit/webfx-kit-javafxweb-peers-gwt/src/main/java/dev/webfx/kit/mapper/peers/javafxweb/spi/gwt/HtmlWebViewPeer.java index d168743cc..856312031 100644 --- a/webfx-kit/webfx-kit-javafxweb-peers-gwt/src/main/java/dev/webfx/kit/mapper/peers/javafxweb/spi/gwt/HtmlWebViewPeer.java +++ b/webfx-kit/webfx-kit-javafxweb-peers-gwt/src/main/java/dev/webfx/kit/mapper/peers/javafxweb/spi/gwt/HtmlWebViewPeer.java @@ -26,6 +26,11 @@ public HtmlWebViewPeer() { public HtmlWebViewPeer(NB base, HTMLIFrameElement iFrame) { super(base, iFrame); this.iFrame = iFrame; + // Allowing fullscreen for videos + HtmlUtil.setAttribute(iFrame, "allowfullscreen", "true"); + // Error management. Actually this listener is never called by the browser for an unknown reason. So if it's + // important for the application code to be aware of errors (ex: network errors), webfx provides an alternative + // iFrame loading mode called prefetch which is able to report such errors (see updateUrl()). iFrame.onerror = e -> { reportError(); return null;