The code below opens a web view with youtube. None of the videos will play. It says "An error occurred, please try again later."
This is the third most popular website on the planet so it's a bit bad.
I know there have been problems with https and media. I tried to embed youtube on my own site with http in the iframe src. But in developer tools I see that the media is still fetched with the https scheme. I suspect that might be something new.
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class WebViewer extends Application
{
@Override
public void start(Stage stage)
{
stage.setTitle("Youtube");
stage.setWidth(700);
stage.setHeight(500);
Scene scene = new Scene(new Group());
VBox root = new VBox();
final WebView browser = new WebView();
final WebEngine webEngine = browser.getEngine();
webEngine.load("http://youtube.com");
root.getChildren().addAll(browser);
scene.setRoot(root);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args)
{
launch(args);
}
}
This is the third most popular website on the planet so it's a bit bad.
I know there have been problems with https and media. I tried to embed youtube on my own site with http in the iframe src. But in developer tools I see that the media is still fetched with the https scheme. I suspect that might be something new.
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class WebViewer extends Application
{
@Override
public void start(Stage stage)
{
stage.setTitle("Youtube");
stage.setWidth(700);
stage.setHeight(500);
Scene scene = new Scene(new Group());
VBox root = new VBox();
final WebView browser = new WebView();
final WebEngine webEngine = browser.getEngine();
webEngine.load("http://youtube.com");
root.getChildren().addAll(browser);
scene.setRoot(root);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args)
{
launch(args);
}
}
- duplicates
-
JDK-8091132 Support JavaFX MediaPlayer over HTTPS
- Resolved