Skip to content

Commit

Permalink
Allowed video autoplay in iFrame (HTML peer for WebView)
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed Dec 17, 2023
1 parent eede769 commit 76aa905
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public HtmlWebViewPeer(NB base, HTMLElement webViewElement) {
HtmlUtil.setChild(getContainer(), iFrame);
HtmlUtil.setStyleAttribute(iFrame, "width", "100%"); // 100% of <fx-webview>
HtmlUtil.setStyleAttribute(iFrame, "height", "100%"); // 100% of <fx-webview>
// Allowing fullscreen for videos
// Allowing fullscreen and autoplay for videos
HtmlUtil.setAttribute(iFrame, "allowfullscreen", "true");
iFrame.allow = "fullscreen; autoplay";
// 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()).
Expand Down

0 comments on commit 76aa905

Please sign in to comment.