Skip to content

Instantly share code, notes, and snippets.

@aligoren
Created May 16, 2013 01:48
Show Gist options
  • Save aligoren/5588830 to your computer and use it in GitHub Desktop.
Save aligoren/5588830 to your computer and use it in GitHub Desktop.
package oynatici;
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.scene.paint.Color;
import javafx.stage.Stage;
/**
* Created with IntelliJ IDEA.
* User: ali
* Date: 16.05.2013
* Time: 04:13
* To change this template use File | Settings | File Templates.
*/
public class MedyaOynatici extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
String adres = "C:/Users/admin/Desktop/MediaPlayer/2.avi";
Group root = new Group();
Media medya = new Media(adres);
MediaPlayer oynatan = new MediaPlayer(medya);
MediaView goster = new MediaView(oynatan);
root.getChildren().add(goster);
Scene sahne = new Scene(root, 400, 400, Color.BLACK);
stage.setScene(sahne);
stage.show();
oynatan.play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment