JFFMPEGVideoPlayer { ImageSurface imageSurface = imageSurface(); JPanel buttons = rightAlignedLine(); ImageStreamFromVideoFile stream; { buttons.add("Open", rThread openDialog); bindToComponent(imageSurface, null, rThread closeStream); } visual centerAndSouthWithMargin( jscroll_center_borderless(imageSurface), buttons ); void openDialog swing { new JFileChooser fc; fc.setDialogTitle(title); fc.setCurrentDirectory(defaultDir); play(execFileChooser(fc)); } void play(File videoFile) { if (videoFile == null) ret; stream = new ImageStreamFromVideoFile; stream.open(videoFile); stream.onHaveImage((image, pos) -> { // TODO: sleep imageSurface.setImage(image); }); print(stream.position()); } void closeStream { dispose stream; } }