How To Allow Youtube Fullscreen Mode In Javafx Web View
Clarification
As an example i give www.youtube.com
which allows you lot to sentry any kind of videos . Below is the minimum code from Oracle Tutorial for displaying a website using using JavaFX WebView
.
The problems are :
-
1) Not allows to get full screen on whatever video .
-
2) Can't continue full Hard disk fifty-fifty information technology is supported by the video.
Question
Why that happens ? I take tried both with the latest Java 8 Update 131
and Java 9 update 171
Lawmaking:
import javafx.application.Application; import javafx.application.Platform; import javafx.scene.Scene; import javafx.scene.layout.BorderPane; import javafx.scene.paint.Colour; import javafx.scene.spider web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.Phase; public class WebViewSample extends Application { private Scene scene; @Override public void showtime(Stage phase) { // create scene stage.setTitle("Web View"); scene = new Scene(new Browser(),Color.Blackness); stage.setScene(scene); stage.show(); } public static void main(Cord[] args) { launch(args); } } class Browser extends BorderPane { final WebView browser = new WebView(); final WebEngine webEngine = browser.getEngine(); public Browser() { //add components setCenter(browser); // load the home page webEngine.load("https://www.youtube.com"); } // JavaScript interface object public class JavaApp { public void exit() { Platform.exit(); } } }
asked May thirty, 2017 at 0:34
GOXR3PLUSGOXR3PLUS
6,359 vii gold badges 35 silver badges 87 statuary badges
1 Answer 1
-
Cannot get full HD
Youtube just supports high quality videos on sure versions of Chrome/IE/Safari/Firefox. (I compiled your program with JDK8 and it supports up to 720p.) Yous can find the below details when clicking "Quality"->"Missing options?"
Below are some browser and operating system combinations that back up YouTube's loftier-quality video formats:
Google Chrome (all operating systems)
Internet Explorer or Edge on Windows 8.1 or newer
Safari on Mac Bone X ten.x or newer
Firefox on Windows seven or newer and on Mac OS X 10.x or newer
-
Cannot become fullscreen
Information technology seems fullscreen mode is not supported by JavaFX WebView because of its own limitations. Hither you can find a bit more caption: http://mail.openjdk.java.net/pipermail/openjfx-dev/2016-Jan/018531.html
answered May 30, 2017 at 2:09
volatilevarvolatilevar
1,516 11 silver badges 16 bronze badges
three
Non the respond you're looking for? Browse other questions tagged java video javafx webview youtube or ask your ain question.
Source: https://stackoverflow.com/questions/44251826/why-javafx-webview-not-allows-fullscreen-mode-on-videos
Posted by: whittendiente.blogspot.com
Hm , not even Coffee ix solves this problem ..... ? , i accept one more question if you know it i will non make it a split one .
Is there whatever manner to set the history of WebEngine?
For case i am trying to add some entries on aWebEngine
history by default but the appreciable list is unmodifiable and i go fault .May thirty, 2017 at four:38
@GOXR3PLUS I don't meet significant changes since 8u131 (new webkit version), so probably not. Almost setting the WebEngine history, I constitute from the source lawmaking (github.com/Debian/openjfx/blob/master/modules/web/src/principal/java/…) that you lot can go the "list" object in line 151 via reflection and modify its content.
May 30, 2017 at 16:00
Thanks for your answer :) Reflection is killing apps in Java 9 though.
May xxx, 2017 at 17:53