Skip to content

Instantly share code, notes, and snippets.

@brunoborges
Created January 7, 2014 02:26
Show Gist options
  • Save brunoborges/8293770 to your computer and use it in GitHub Desktop.
Save brunoborges/8293770 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<?language javascript?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.media.*?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="640.0" minWidth="640.0" prefHeight="640.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<SplitPane dividerPositions="0.5" focusTraversable="true" layoutX="220.0" layoutY="100.0" orientation="VERTICAL" prefHeight="200.0" prefWidth="363.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items>
<AnchorPane fx:id="mediaPane" minHeight="0.0" minWidth="0.0" prefHeight="107.0" prefWidth="158.0">
<children>
<MediaView fitHeight="480.0" fitWidth="640.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns:fx="http://javafx.com/fxml">
<mediaPlayer>
<MediaPlayer autoPlay="true">
<media>
<Media source="http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv" />
</media>
</MediaPlayer>
</mediaPlayer>
</MediaView>
</children>
</AnchorPane>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0">
<children>
<Button onAction="removeMediaPlayer()" text="Button" />
</children>
</AnchorPane>
</items>
</SplitPane>
</children>
<fx:script>
function removeMediaPlayer(event) {
mediaPane.getChildren().clear();
}
</fx:script>
</AnchorPane>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment