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; import javafx.application.Platform; public class main extends Application { public static void main(String[] args) throws Exception { System.setProperty("prism.forceGPU", "true"); System.setProperty("prism.verbose", "true"); fixContextClassLoader(); Thread _t_0 = new Thread() { public void run() { try { sleepSeconds(4); jfxLater(new Runnable() { public void run() { try { print("Starting second app"); main app = new main(); Stage stage = new Stage(); app.start(stage); } catch (Exception __e) { throw __e instanceof RuntimeException ? (RuntimeException) __e : new RuntimeException(__e); }}}); } catch (Exception _e) { throw _e instanceof RuntimeException ? (RuntimeException) _e : new RuntimeException(_e); } } }; _t_0.start(); 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 volatile StringBuffer local_log = new StringBuffer(); // not redirected static volatile StringBuffer print_log = local_log; // might be redirected, e.g. to main bot // in bytes - will cut to half that static volatile int print_log_max = 1024*1024; static volatile int local_log_max = 100*1024; static void print() { print(""); } // slightly overblown signature to return original object... static A print(A o) { String s = String.valueOf(o) + "\n"; StringBuffer loc = local_log; StringBuffer buf = print_log; int loc_max = print_log_max; if (buf != loc && buf != null) { print_append(buf, s, print_log_max); loc_max = local_log_max; } if (loc != null) print_append(loc, s, loc_max); System.out.print(s); return o; } static void print(long l) { print(String.valueOf(l)); } static void print(char c) { print(String.valueOf(c)); } static void print_append(StringBuffer buf, String s, int max) { synchronized(buf) { buf.append(s); max /= 2; if (buf.length() > max) try { int newLength = max/2; int ofs = buf.length()-newLength; String newString = buf.substring(ofs); buf.setLength(0); buf.append("[...] ").append(newString); } catch (Exception e) { buf.setLength(0); } } } static void sleepSeconds(long s) { if (s > 0) sleep(s*1000); } static void jfxLater(Runnable r) { Platform.runLater(r); } static void fixContextClassLoader() { Thread.currentThread().setContextClassLoader(myClassLoader()); } static void sleep(long ms) { try { Thread.sleep(ms); } catch (Exception e) { throw new RuntimeException(e); } } static void sleep() { try { print("Sleeping."); synchronized(main.class) { main.class.wait(); } } catch (Throwable __e) { throw __e instanceof RuntimeException ? (RuntimeException) __e : new RuntimeException(__e); }} 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); }} }