title: Swing apllication with embedded JavaFX WebView won't play html5 video only sound
body: <p>In my Swing application I needed support for rendering html. So I embedded a JavaFX WebView in my Swing application. Now on some html pages I use the new html5 -Tag to play a video. This works perfectly on Windows and Linux. But on MacOS I only hear the sound and see a black video frame and the time track in the bottom.</p>
  
  <p>Here is an SSCCE I got from <a href="https://gist.github.com/anjackson/1640654" rel="nofollow">github</a>. I just changed the url to one that contains a html5 video-tag example. Would be great, if you MacOS users could try it and tell me if the same happens on you computer. And of course any idea to fix this is appreciated.</p>
  
  <p>SSCCE:</p>
  
  <pre><code>    import java.awt.BorderLayout;
  import java.awt.Dimension;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  import javafx.application.Platform;
  import javafx.collections.ObservableList;
  import javafx.embed.swing.JFXPanel;
  import javafx.scene.Group;
  import javafx.scene.Node;
  import javafx.scene.Scene;
  import javafx.scene.web.WebEngine;
  import javafx.scene.web.WebView;
  import javafx.stage.Stage;
  
  import javax.swing.JButton;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.SwingUtilities;
  
  import com.sun.javafx.application.PlatformImpl;
  
  /**
   * SwingFXWebView
   */
  public class JavaFXTest extends JPanel
  {
      private Stage     stage;
      private WebView   browser;
      private JFXPanel  jfxPanel;
      private JButton   swingButton;
      private WebEngine webEngine;
      private Object    geo;
  
      public JavaFXTest()
      {
          this.initComponents();
      }
  
      public static void main(final String... args)
      {
          // Run this later:
          SwingUtilities.invokeLater(new Runnable()
          {
              @Override
              public void run()
              {
                  final JFrame frame = new JFrame();
                  frame.getContentPane().add(new JavaFXTest());
                  frame.setMinimumSize(new Dimension(640, 480));
                  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  frame.setVisible(true);
              }
          });
      }
  
      private void initComponents()
      {
          this.jfxPanel = new JFXPanel();
          this.createScene();
          this.setLayout(new BorderLayout());
          this.add(this.jfxPanel, BorderLayout.CENTER);
          this.swingButton = new JButton();
          this.swingButton.addActionListener(new ActionListener()
          {
  
              @Override
              public void actionPerformed(final ActionEvent e)
              {
                  Platform.runLater(new Runnable()
                  {
  
                      @Override
                      public void run()
                      {
                          JavaFXTest.this.webEngine.reload();
                      }
                  });
              }
          });
          this.swingButton.setText("Reload");
          this.add(this.swingButton, BorderLayout.SOUTH);
      }
  
      /**
       * createScene Note: Key is that Scene needs to be created and run on
       * "FX user thread" NOT on the AWT-EventQueue Thread
       */
      private void createScene()
      {
          PlatformImpl.startup(new Runnable()
          {
              @Override
              public void run()
              {
                  JavaFXTest.this.stage = new Stage();
                  JavaFXTest.this.stage.setTitle("Hello Java FX");
                  JavaFXTest.this.stage.setResizable(true);
                  final Group root = new Group();
                  final Scene scene = new Scene(root, 80, 20);
                  JavaFXTest.this.stage.setScene(scene);
                  // Set up the embedded browser:
                  JavaFXTest.this.browser = new WebView();
                  JavaFXTest.this.webEngine = JavaFXTest.this.browser.getEngine();
                  JavaFXTest.this.webEngine.load("http://camendesign.com/code/video_for_everybody/test.html");
                  final ObservableList&lt;Node&gt; children = root.getChildren();
                  children.add(JavaFXTest.this.browser);
                  JavaFXTest.this.jfxPanel.setScene(scene);
              }
          });
      }
  }
  </code></pre>