title: spring boot javafx load video from resource folder
body: <p>Hi i have a spring boot javafx app. I want to load video from <code>resources/video/a.mp4</code> . </p>
  
  <pre><code>final Media m = new Media(getClass().getResource("/video/a.mp4").toString());
          this.player = new MediaPlayer(m);
          final MediaView view = new MediaView(player);
          final DoubleProperty width = view.fitWidthProperty();
          final DoubleProperty height = view.fitHeightProperty();
          width.bind(Bindings.selectDouble(view.sceneProperty(), "width"));
          height.bind(Bindings.selectDouble(view.sceneProperty(), "height"));
          view.setPreserveRatio(true);
          mainlayout.getChildren().add(view);
          player.play();
  </code></pre>
  
  <p>The code above not playing video. Always showing nullpointer exception.</p>