import java.util.*; import java.util.zip.*; import java.util.List; import java.util.regex.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.table.*; import java.io.*; import java.net.*; import java.lang.reflect.*; import java.lang.ref.*; import java.lang.management.*; import java.security.*; import java.security.spec.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.imageio.*; import java.math.*; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.media.Media; import javafx.scene.media.MediaPlayer; import javafx.scene.media.MediaView; import javafx.stage.Stage; import javafx.scene.layout.*; import javafx.geometry.Insets; import javafx.scene.control.Button; import javafx.beans.property.*; import javafx.beans.binding.*; import javafx.scene.paint.Color; public class main { public static void main(String[] args) throws Exception { jfxForceGPU(); fixContextClassLoader(); Player._launch(); } // OK, so they may be inner classes, but must be PUBLIC. public static class Player extends Application { static void _launch() { launch(); } public void start(Stage stage) { // Create and set the Scene. // Numbers are window size (content is not scaled) double w = 540, h = 209; BorderPane root = new BorderPane(); Scene scene = new Scene(root, w, h, Color.BLACK); stage.setScene(scene); // Name and display the Stage. stage.setTitle("Hello Media"); stage.show(); // Create the media source. //String source = getParameters().getRaw().get(0); String source = "/media/CE009E97009E865D__/Downloads/Oblivion (2013)/Oblivion.2013.mp4"; Media media = null; try { media = new Media(new File(source).toURI().toURL().toString()); } catch (MalformedURLException e) { throw new RuntimeException(e); } // Create the player and set to play automatically. MediaPlayer mediaPlayer = new MediaPlayer(media); mediaPlayer.setAutoPlay(true); // Create the media view. MediaView mediaView = new MediaView(mediaPlayer); // Resize Hack DoubleProperty mvw = mediaView.fitWidthProperty(); DoubleProperty mvh = mediaView.fitHeightProperty(); mvw.bind(Bindings.selectDouble(mediaView.sceneProperty(), "width")); mvh.bind(Bindings.selectDouble(mediaView.sceneProperty(), "height")); mediaView.setPreserveRatio(true); root.setCenter(mediaView); } } static void jfxForceGPU() { System.setProperty("prism.forceGPU", "true"); System.setProperty("prism.verbose", "true"); } static void fixContextClassLoader() { Thread.currentThread().setContextClassLoader(myClassLoader()); } static ClassLoader myClassLoader() { return mc().getClassLoader(); } static Class mc() { return getMainClass(); } static Class getMainClass() { try { return Class.forName("main"); } catch (Throwable __e) { throw __e instanceof RuntimeException ? (RuntimeException) __e : new RuntimeException(__e); }} static Class getMainClass(Object o) { try { return (o instanceof Class ? (Class) o : o.getClass()).getClassLoader().loadClass("main"); } catch (Throwable __e) { throw __e instanceof RuntimeException ? (RuntimeException) __e : new RuntimeException(__e); }} }