0

I have problem with showing video in JavaFx Media:

public void showVideo(File videoFile) {
    scrollPane.setHvalue(scrollPane.getHmin());
    scrollPane.setVvalue(scrollPane.getVmin());

    Media media = new Media("http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv");
    final MediaPlayer mediaPlayer = new MediaPlayer(media);
    final MediaView mediaContent = new MediaView(mediaPlayer);

    HBox menuBox = new HBox();
    menuBox.setAlignment(Pos.CENTER);
    menuBox.getChildren().addAll(playButton, stopButton);
    VBox videoBox = new VBox();
    videoBox.setAlignment(Pos.CENTER);
    videoBox.getChildren().addAll(mediaContent, menuBox);

    playButtonListener(mediaPlayer);
    stopButtonListener(mediaPlayer);

    mediaPlayer.setOnEndOfMedia(new Runnable() {
        @Override public void run() {
            playButton.setGraphic(WindowUtil.createIcon(IconsConstants.ICON_PLAYER_REPEAT));
            mediaPlayer.stop();
            playButtonListener(mediaPlayer);
        }
    });

    scrollPane.setContent(videoBox);
}

I know that the code isn't wrong because in my coworker system it shows. I try to show flv file. I saw question: JavaFX video not playing

I have windows 10 N with K-Lite standart codec and jdk-8u65-windows-x64 Java and I installed feature pack for windows 10 like in link above. And I don't know what can be the problem.

Community
  • 1
  • 1
xav9211
  • 191
  • 1
  • 3
  • 14
  • JavaFX supports FLV-Files containing VP6 video and MP3 audio. Maybe the file you trying to play does not match the requirements? – Dennis Kriechel Dec 11 '15 at 12:14
  • I edited how it works in my coworker system (but not mine) in Media constructor by giving link. The same link. – xav9211 Dec 11 '15 at 12:40

1 Answers1

0

Ok, problem solved. I update feature pack and now it's working. Probably previous version of feature pack for windows 10 N doesn't have codecs which I need.

xav9211
  • 191
  • 1
  • 3
  • 14