java - How to start video quick on a JFrame using JMF -


Can anyone tell me what is the best way to play video in JPNL? I am currently working on a learning software where children will be played on video learning to learn something. Videos are stored in some folders. I have worked successfully using JMF but the problem is a bit slow. It takes some time to start the video, although the video is not very big (2-4 MB). What can I do to start it quickly,

U

  public panel media panel Xanel {public static booolan play = false; Public stationary player media player; Public MediaPanel (URL Media URL) {Set Layout (New Border Layout ()); // Use a border layout / use light components for swing compatibility / / component control = mediaplayer.gate controlPanelContent (); } // and MediaPanel constructor throws public zero-play (URL-media-url) noplayer exposition, Canot Relleys Expression, IOE Expansion, Incompatible Source Expansion {Manager.ChatHunt (Manager. LightWiseSecurer, True); Println ("sdfdsg"); Mediaplayer = manager.creditedly released player (media URL); Component Video = Media PlayerGetViewzualcompany (); Add (Video! = Null) (Video); MediaPlayer.start (); Play = true} public zero-stop () {mediaPlayer.stop (); Game = wrong; } Public Zero Play_On () {mediaPlayer.stop (); MediaPlayer.start (); }} Public Class MediaPanel JPanel {Public Static Boolean Game = Wrong; Public stationary player media player; Public MediaPanel (URL Media URL) {Set Layout (New Border Layout ()); } // and MediaPanel constructor throws public zero-play (URL-media-url) noplayer exposition, Canot Relleys Expression, IOE Expansion, Incompatible Source Expansion {Manager.ChatHunt (Manager. LightWiseSecurer, True); Mediaplayer = manager.creditedly released player (media URL); Component Video = Media PlayerGetViewzualcompany (); Add (Video! = Null) (Video); MediaPlayer.start (); Play = true} public zero-stop () {mediaPlayer.stop (); Game = wrong; } Public Zero Play_On () {mediaPlayer.stop (); MediaPlayer.start (); }}  

and the part of the source code where I used this class.

  try {Home.text.setText ("wait. . "); If (Home MediaPlan. Playing == true) Home. MediaPanel.stop (); Home.mediaPanel.play (new url ("file: //c: // users // zubair // workspace // learning kit //" + home.selected_icon "//" + home celled group "+ // V "+ k +" .flv ")); } Grip (Exception E1) {// TODO Auto-Generated Cache Block e1.printStackTrace (); }  

is the age of JMF stone, do you have any stick to it reason?

I recommend using Java FX which supports media support including video support. Java FAX is part of Java 8, and it has been sent with Java 7 (not just on the default cell space). You can run a supported video format (* .flv, * .mp4) along with a few lines of code, and also uses hardware acceleration if available.

Actually you have only one media , a media player and mediaview category:

  Media Me = new media (path. ("Example .flv") Touri () toString ()); Media Player MP = New Media Player (M); Mediaview MV = New Mediaview (MP); // Add a mediaview component to your GUI and you are working. You can start this video: mp.play ();  

Official Oracle Tutorial:

/ P>


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -