this is a videoplayer in javafx.how we can support mkv,vob,avi etc extension ? is this possible to use gstreamer in javafx to support other extension? how can we use gstreamer or if not then plz say any other way to make the videoplayer other extension supported...
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Slider;
import javafx.scene.layout.VBox;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class MoviePlayer extends Application {
/**
*
*/
public static void main(String args[])
{
launch(args);
}
@Override
public void start(Stage arg0) throws Exception {
final Stage stage=new Stage();
stage.setTitle("Video Player");
Group root = new Group();
Media media = new Media("file:///C:/Users/vi/downloads/Video/a.mp4");
final MediaPlayer player=new MediaPlayer(media);
MediaView view=new MediaView(player);
// System.out.println("media.Width"+media.getWidth());
final VBox vbox=new VBox();
Slider slider=new Slider();
root.getChildren().add(view);
root.getChildren().add(vbox);
root.getChildren().add(slider);
Scene scene=new Scene(root, 400,400,Color.BLACK);
stage.setScene(scene);
stage.show();
player.play();
player.setOnReady(new Runnable() {
@Override
public void run() {
int w=player.getMedia().getWidth();
int h=player.getMedia().getHeight();
stage.setMinWidth(w);
stage.setMinHeight(h);
vbox.setMinSize(w,100 );
vbox.setTranslateY(h);
}
});
}
}