This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes JFrames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrames" Watch "JFrames" New topic
Author

JFrames

Yasser Shaikh
Greenhorn

Joined: Oct 01, 2008
Posts: 21
How to play audio files on JFrames or JPanels.
How to play video files on JFrames or JPanels.
I am trying hard to figure it out.....but all my efforts are in vain..

So Experts please help.


~~yr[:_:]s~~
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
No expert in this, but if I were wanting to do this, I'd first spend a lot of time with Google. What has it told you so far? What avenues have you explored?

Good luck
Milan Agrawal
Greenhorn

Joined: Sep 25, 2008
Posts: 8
Hello,me Milan,a new member to this site.

I think that you need to have link with the dll files to make a audio player.

otherwise you can also search in google for the code.

thank you.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 41868
    
  31
And welcome to JavaRanch, Milan
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42955
    
  73
There are a number of libraries for playing back audio and video - JMF, QuickTime for Java, jVLC, ... The http://faq.javaranch.com/java/OtherOpenSourceProjectsFaq page links to those.

Simple audio playback can be done using the javax.sound package. See http://www.exampledepot.com/egs/javax.sound.sampled/pkg.html for examples.

In the future, please give your posts better subject lines - "JFrames" is rather misleading if you ask about audio/video playback.
[ October 04, 2008: Message edited by: Ulf Dittmer ]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19968
    
  25

JMF also has some support for user interfaces.

javax.media.Player has methods getControlPanelComponent and getVisualComponent for controlling and showing media files. I've been able to play a small movie in Java this way.

I do think that these controls are heavyweight controls, so mixing it with Swing (lightweight controls) may lead to some unexpected results.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFrames