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 );

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
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of HFunakawa


thank you for answer.
im beginner of im very thankful for code.
any answer??
Avatar of HFunakawa
Flag of Japan image

Link to home
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