Friday, November 24, 2017

JAVAFX - How to play (youtube) video

/* control on form for media video */
private MediaView mediaView;
..
MediaPlayer mediaPlayer = new MediaPlayer( 
  new Media( "https://www.youtube.com/watch?v=gvKgvW9ujHo" ) );
MediaView.setMediaPlayer( mediaPlayer );            
MediaView.getMediaPlayer().play();

No comments:

Post a Comment