Link to home
Start Free TrialLog in
Avatar of HFunakawa
HFunakawaFlag for Japan

asked on

How to play and repeat mpeg format video using jmf in java??

hi all.
Im trying to play mpeg format video with java media framework.
I used this code and it worked.

--------------------------------------------------------------------------------------------------------------------------------------------
      File file = new File("C:\\sample.mpg");
            MediaLocator locator = new MediaLocator(file.toURL());
            DataSource source = Manager.createDataSource(locator);
            Player player = Manager.createRealizedPlayer(source);
            if (player.getVisualComponent() != null) {
                  contentPane.add( player.getVisualComponent(), BorderLayout.CENTER );
            }
            pack();
            player.start();
---------------------------------------------------------------------------------------------------------------------------------------------


I need to repeat the video.
using this code I can play the video only once.

How can I restart the video after finished??
give me code!!
Avatar of krakatoa
krakatoa
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of HFunakawa

ASKER

thank you for answer.
im beginner of java...so im very thankful for code.
any answer??
ASKER CERTIFIED SOLUTION
Avatar of HFunakawa
HFunakawa
Flag of Japan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
found answer bymyself