Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094657

Web View cannot play anything on youtube

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8u45
    • javafx
    • I used 8u45 on both OSX 10.10 and Windows 8.1

      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);
         }
      }

            stayer Kirill Kirichenko (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: