I'm using MPlayer in my java application. According to its doc, it's needed that I tell to MPlayer the window ID for embedding it. I'm doing this like that:
long winid = 0; //Window ID.
if (osName.startsWith("Windows")){
final Class<?> cl = Class.forName("sun.awt.windows.WComponentPeer");
java.lang.reflect.Field f = cl.getDeclaredField("hwnd");
f.setAccessible(true);
winid = f.getLong(overlay.getPeer()); //overlay is a canvas where MPlayer is embedded.
}
System.out.println(winid);
However, the getPeer() method is deprecated. I would want to know if there's a workaround for it.
Thanks a lot for the help.