Ankit Sood
Ankit Sood

Reputation: 267

Not able to run full screen you tube video in DJ Native Browser

I want to run full screen you tube video in Swing Native browse, But i am not able to run. i am not getting any exception. in my native browser screen only black color cross button is display on the top left corner of my jFarme. in my 32 bit windows machine its working file. but when i try it on 64 bit windows machine its not working. Please help me if you know something about my problem

Jar's i used :

DJNativeSwing.jar, DJNativeSwing-SWT.jar, org.eclipse.swt.win32.win32.x86_64-4.3.jar

Tryed URL's

https://www.youtube.com/v/hk5IMmEDWH4

https://www.youtube.com/v/b-cr0ewwatk?fs=1

Code

public static void main(String[] args) {
    NativeInterface.open();
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new JFrame("YouTube Viewer");
            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            frame.getContentPane().add(getBrowserPanel(), BorderLayout.CENTER);
            frame.setSize(1024, 800);
            frame.setLocationByPlatform(true);
            frame.setVisible(true);
        }
    });
    NativeInterface.runEventPump();
    // don't forget to properly close native components
    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
        @Override
        public void run() {
            NativeInterface.close();
        }
    }));
}

public static JPanel getBrowserPanel() {
    JPanel webBrowserPanel = new JPanel(new BorderLayout());
    JWebBrowser webBrowser = new JWebBrowser();
    webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
    webBrowser.setBarsVisible(false);
    webBrowser.navigate(URL);
    return webBrowserPanel;
}

Upvotes: 2

Views: 288

Answers (0)

Related Questions