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

WebView: playing embedded youtube video creates hundreds of threads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8
    • javafx
    • Win64

    • web

      We have embedded a youtube video in a WebView. The video works fine. However, while playing the video there are a lot of threads created. The threads are created and finished very quickly. It seems as if there was one thread per frame... It does not matter which video is used. For the demo below I picked a random video.

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      public class WebViewVideoTest extends Application
      {
        public static void main(String[] args)
        {
          Application.launch(args);
        }
        
        @Override
        public void start(Stage primaryStage) throws Exception
        {
          WebView wv = new WebView();
          wv.getEngine().loadContent("<html><head/><body><iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/tfd5p1JqUsw\" frameborder=\"0\" allowfullscreen></iframe></body></html>");
          
          primaryStage.setScene(new Scene(wv));
          primaryStage.show();
        }
      }

            stayer Kirill Kirichenko (Inactive)
            wlehmann Werner Lehmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: