Results 1 to 11 of 11

Thread: media player

  1. #1
    Join Date
    Feb 2014
    Posts
    5
    Rep Power
    0

    Default media player

    i want to design a media player but my program can't play any song it is showing me error "Uncompilable source code - cannot find symbol
    symbol: class MediaPanel
    location: class media.Media
    at media.Media.main(Media.java:28)"
    this is my code.
    package media;
    import java.io.File;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;

    public class Media {

    public static void main(String[] args) {
    JFileChooser fileChooser = new JFileChooser();
    int result = fileChooser.showOpenDialog(null);
    if (result == JFileChooser.APPROVE_OPTION){
    URL mediaURL = null;
    try
    {
    mediaURL = fileChooser.getSelectedFile().toURL();
    }
    catch(MalformedURLException malformedURLException)
    {
    System.err.println("Could not creat URL for the file");
    }
    if (mediaURL != null) {
    JFrame mediaTest = new JFrame("Media Tester");
    mediaTest.setDefaultCloseOperation(JFrame.EXIT_ON_ CLOSE);
    MediaPanel mediaPanel = new MediaPanel(mediaURL);
    mediaTest.add(mediaPanel);

    mediaTest.setSize(300,300);
    mediaTest.setVisible(true);

    }
    }
    }
    }
    i got the code from http://www.deitel.com/articles/java_...JMF_Page2.html
    Last edited by james.chidi@yahoo.com; 02-24-2014 at 10:42 PM. Reason: for easy understanding

  2. #2
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

    Default Re: media player

    It's simply stating that the compiler is unable to find the MediaPanel class. Do you have such a class as part of your source code? If you do, then you'd want to post here where this Java source file for the Media Panel class is located relative to your Media class, the command you used to compile your code, and from which folder/directory you ran the command.

  3. #3
    Join Date
    Feb 2014
    Posts
    5
    Rep Power
    0

    Default Re: media player

    Quote Originally Posted by jashburn View Post
    It's simply stating that the compiler is unable to find the MediaPanel class. Do you have such a class as part of your source code? If you do, then you'd want to post here where this Java source file for the Media Panel class is located relative to your Media class, the command you used to compile your code, and from which folder/directory you ran the command.
    "please if you can help me with the code that will help me play songs and videos" i am a learner.thank you,

  4. #4
    Join Date
    Feb 2014
    Posts
    5
    Rep Power
    0

    Default media player

    i want to design a media player that will help me play songs and videos, and the features i want are volume control button, pause/play button/,stop button, backward and fast forward button. please help me with the code.thank you.

  5. #5
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

    Default Re: media player

    Sorry, I don't understand what you're after. The code cannot compile because the compiler could not find the MediaPanel class. Do you have the source code for this class? Or are you asking for help to write this class? Did you get the code you posted above from somewhere? If you did, maybe you can post here where you got it from so that I may be able to help you figure out where to get the missing code.

  6. #6
    Join Date
    Feb 2014
    Posts
    5
    Rep Power
    0

    Default Re: media player

    yea i got it from somewhere the site is http://www.deitel.com/articles/java_...hJMF_Page.html
    sorry for not telling you at first.

  7. #7
    Join Date
    Feb 2014
    Posts
    5
    Rep Power
    0

    Default Re: media player

    yea i got it from somewhere the site is http://www.deitel.com/articles/java_...JMF_Page2.html
    sorry for not telling you at first.

  8. #8
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

    Default Re: media player

    james.chidi, both of the links you posted are broken. It is actually located at Java Tutorial: Playing Video and Other Media with the Java Media Framework ! One of the first things you need to do is to read through the web page. You'll find that the page contains a download link for the code examples used in the tutorial. The code examples include the missing MedialPanel class.

  9. #9
    8foldpath is offline Member
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    9
    Rep Power
    0

    Default Re: media player

    Swing (Java) - Wikipedia, the free encyclopedia You need to know Swing for the Graphic interface side, then some File,Audio I/O for inputting and outputting streams. If you are new to Java I would not suggest starting of learning Swing. figure out how to play audio first and then go from there.
    Last edited by 8foldpath; 02-25-2014 at 04:15 AM.

  10. #10
    8foldpath is offline Member
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    9
    Rep Power
    0

    Default Re: media player

    You will need the correct package, They are a pain in the ass to find in Google btw: Java Archive Downloads -Java Client Technologies

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default Re: media player

    @OP: I merged your two threads; please don't start more than one thread for a single problem; it's confusing.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Java digital signage Media Player
    By staradder in forum Java Applets
    Replies: 0
    Last Post: 10-03-2011, 04:46 AM
  2. media player
    By rithish in forum AWT / Swing
    Replies: 2
    Last Post: 05-26-2011, 09:42 AM
  3. Need help in removing error in media player
    By mayank04 in forum AWT / Swing
    Replies: 1
    Last Post: 05-03-2011, 02:20 AM
  4. Java media player with subtitles with JVLC or JMF
    By foulkes in forum Advanced Java
    Replies: 0
    Last Post: 02-08-2011, 04:22 PM
  5. JMF: disable media info on a JMF Player
    By MarcioVilanova in forum Advanced Java
    Replies: 0
    Last Post: 08-11-2010, 08:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •