38 import javafx.scene.Parent;
39 import javafx.scene.Scene;
40 import javafx.scene.media.Media;
41 import javafx.scene.media.MediaPlayer;
42 import javafx.stage.Stage;
43
44 /**
45 * An alpha media player with 2 different media views and alpha channels.
46 *
47 * @sampleName Alpha Media Player
48 * @preview preview.png
49 * @see javafx.scene.media.MediaPlayer
50 * @see javafx.scene.media.Media
51 * @related /Media/Advanced Media
52 * @related /Media/Overlay Media Player
53 * @related /Media/Streaming Media Player
54 * @playground arthPos (name="Arth Position", min=-100, max=100)
55 * @playground fierPos (name="Fier Position", min=-100, max=100)
56 * @playground arthRate (name="Arth Rate", min=0.1, max=1)
57 * @playground fierRate (name="Fier Rate", min=0.1, max=1)
58 * @conditionalFeatures WEB
59 */
60 public class AlphaMediaPlayerApp extends Application {
61
62 private String alphaMediaPlayerCss = AlphaMediaPlayerApp.class.getResource("AlphaMediaPlayer.css").toExternalForm();
63 private static final String ARTH_URL = "http://download.oracle.com/otndocs/products/javafx/arth_512.flv";
64 private static final String FIER_URL = "http://download.oracle.com/otndocs/products/javafx/fier_512.flv";
65 PlanetaryPlayerPane planetaryPlayerPane;
66 private MediaPlayer arthPlayer;
67 private MediaPlayer fierPlayer;
68 SimpleDoubleProperty arthPos = new SimpleDoubleProperty(-90.0);
69 SimpleDoubleProperty fierPos = new SimpleDoubleProperty(50.0);
70 SimpleDoubleProperty arthRate = new SimpleDoubleProperty(1.0);
71 SimpleDoubleProperty fierRate = new SimpleDoubleProperty(1.0);
72
73 public Parent createContent() {
74 arthPlayer = new MediaPlayer(new Media(ARTH_URL));
75 arthPlayer.setAutoPlay(true);
76 fierPlayer = new MediaPlayer(new Media(FIER_URL));
77 fierPlayer.setAutoPlay(true);
78
|
38 import javafx.scene.Parent;
39 import javafx.scene.Scene;
40 import javafx.scene.media.Media;
41 import javafx.scene.media.MediaPlayer;
42 import javafx.stage.Stage;
43
44 /**
45 * An alpha media player with 2 different media views and alpha channels.
46 *
47 * @sampleName Alpha Media Player
48 * @preview preview.png
49 * @see javafx.scene.media.MediaPlayer
50 * @see javafx.scene.media.Media
51 * @related /Media/Advanced Media
52 * @related /Media/Overlay Media Player
53 * @related /Media/Streaming Media Player
54 * @playground arthPos (name="Arth Position", min=-100, max=100)
55 * @playground fierPos (name="Fier Position", min=-100, max=100)
56 * @playground arthRate (name="Arth Rate", min=0.1, max=1)
57 * @playground fierRate (name="Fier Rate", min=0.1, max=1)
58 * @conditionalFeatures WEB, MEDIA
59 */
60 public class AlphaMediaPlayerApp extends Application {
61
62 private String alphaMediaPlayerCss = AlphaMediaPlayerApp.class.getResource("AlphaMediaPlayer.css").toExternalForm();
63 private static final String ARTH_URL = "http://download.oracle.com/otndocs/products/javafx/arth_512.flv";
64 private static final String FIER_URL = "http://download.oracle.com/otndocs/products/javafx/fier_512.flv";
65 PlanetaryPlayerPane planetaryPlayerPane;
66 private MediaPlayer arthPlayer;
67 private MediaPlayer fierPlayer;
68 SimpleDoubleProperty arthPos = new SimpleDoubleProperty(-90.0);
69 SimpleDoubleProperty fierPos = new SimpleDoubleProperty(50.0);
70 SimpleDoubleProperty arthRate = new SimpleDoubleProperty(1.0);
71 SimpleDoubleProperty fierRate = new SimpleDoubleProperty(1.0);
72
73 public Parent createContent() {
74 arthPlayer = new MediaPlayer(new Media(ARTH_URL));
75 arthPlayer.setAutoPlay(true);
76 fierPlayer = new MediaPlayer(new Media(FIER_URL));
77 fierPlayer.setAutoPlay(true);
78
|