import au.notzed.jjmpeg.AVIOException;
import au.notzed.jjmpeg.fx.FXPixelReader;
import au.notzed.jjmpeg.io.JJMediaReader;
+import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import static java.lang.Double.min;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executors;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.InvalidationListener;
import javafx.scene.text.Text;
import javafx.scene.transform.Scale;
import javafx.scene.transform.Translate;
+import javafx.stage.FileChooser;
import javafx.stage.Screen;
import javafx.stage.Stage;
List<String> args = getParameters().getUnnamed();
if (args.size() != 1) {
- Alert a = new Alert(Alert.AlertType.ERROR, "Must supply one file.", ButtonType.CLOSE);
- a.showAndWait();
- return;
+ FileChooser fc = new FileChooser();
+ File selected;
+
+ fc.setTitle("Select Video");
+ selected = fc.showOpenDialog(null);
+
+ if (selected == null)
+ return;
+
+ args = List.of(selected.getAbsolutePath());
}
- new Thread(() -> {
- reader(args.get(0));
+ String path = args.get(0);
+
+ Executors.defaultThreadFactory().newThread(() -> {
+ reader(path);
}).start();
}