java - Play Button on a Video Editing program I'm creating not working -
i'm creating video editor , it's going far. need figure out way of playing video frames have stored in array , displaying them on label. i've tried far, doesn't work expected. video frames not playback, instead label displays last frame.
i'm wondering i'm going wrong or need take different approach playing these frames.
frames captured javafx imageview (originally bufferedimage)
@fxml public void playbutton() { (int = 0; < imagelist.size(); i++) { final int ifinal = i; //workaround allow value work in inner class task task = new task<void>() { @override public void call() { try { thread.sleep((long) (1000 / framerate)); previewboxlabel.setgraphic(imagelist.get(ifinal).getimage()); system.out.println("play"); } catch (exception e) { } return null; } }; new thread(task).start(); } }
thanks in advance :)
how about
@fxml public void playbutton() { task task = new task<void>() { @override public void call() throws exception { (final imageview image : imagelist) { platform.runlater(new runnable() { @override public void run() { previewboxlabel.setgraphic(image); } }); thread.sleep((long) (1000 / framerate)); } return null; } }; new thread(task).start(); } }
Comments
Post a Comment