×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    5

    Problem in playing video from memorycard

    hi all...
    Please help me to play video from file system (memory card).

    by using memoryRoot i am finding the path of memory card.
    after that passing this path varaible to the playsound()...
    here is a code....
    //////////////////////////////////////////////////////////////////////
    String memoryRoot = System.getProperty("fileconn.dir.memorycard");//System.getProperty("fileconn.dir.music");
    playSound(0,memoryRoot);
    Player wel=null;
    public void playSound(int w,String s)
    {
    try{

    if(wel==null)
    {
    wel = Manager.createPlayer(new DataInputStream(getClass().getResourceAsStream(s+"/Diwali.mid")),"audio/midi");
    System.out.println(" in playsound of gamecanvas wel "+wel.getState());
    }
    if(wel.getState()!=Player.STARTED )
    {
    wel.setLoopCount(-1);
    wel.start();
    }

    }catch(Exception e){System.out.println("error in playsiund "+e);}
    }
    ////////////////////////////////////////////////////////////////////////////////////////////


    i kept Diwali.mid in th E Drive of S40_SDK_3rd_Edition_Feature_Pack_2 emulator
    when program is running it is showing path properly. but when i create the player it is showing the ERROR

    javax.microedition.media.MediaException: Failed to fetch media data

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Problem in playing video from memorycard

    Quote Originally Posted by dreamsunlimited View Post
    hi all...
    i kept Diwali.mid in th E Drive of S40_SDK_3rd_Edition_Feature_Pack_2 emulator
    when program is running it is showing path properly. but when i create the player it is showing the ERROR

    javax.microedition.media.MediaException: Failed to fetch media data
    You can give a try to execute the same app on the real device, emulator might not be able to play the video.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    5

    Re: Problem in playing video from memorycard

    thanks Raj...............
    my problem is solved. now it is running at emulator also.

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    39

    Re: Problem in playing video from memorycard

    what was the issue earlier ?

  5. #5
    Registered User
    Join Date
    Jul 2010
    Posts
    5

    Re: Problem in playing video from memorycard

    Before I am using this line code...
    Wrong Way : wel = Manager.createPlayer(new DataInputStream(getClass().getResourceAsStream(s+"/Diwali.mid")),"audio/midi");

    but now creating player directly without using of streaming.
    Right Way : wel = Manager.createPlayer((s+"Diwali.mid"));
    and earlier i was using one extra "/".. :-)

  6. #6
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Problem in playing video from memorycard

    the extra '/' is very unlikely to have anything to do with your issue.
    fyi, getRessourceAsStream accesses ressources embedded in the application, while createPlayer takes a locator for a ressource outside the application, like a web server url or a file on the phone.

Similar Threads

  1. Problem Playing FLV video files
    By tarun.WRT in forum Symbian
    Replies: 0
    Last Post: 2010-08-20, 07:52
  2. Problem Playing Video Using TV Out on N96
    By Tshifhiwa in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2010-02-23, 07:43
  3. a problem when playing high-solution video
    By longxj in forum Mobile Java General
    Replies: 7
    Last Post: 2009-08-09, 13:15
  4. problem while playing video files
    By akshay0912 in forum Mobile Java General
    Replies: 4
    Last Post: 2009-04-27, 06:56
  5. video playback from memorycard with fullscreen (nim - format)??
    By chris.dah in forum Mobile Java General
    Replies: 0
    Last Post: 2003-04-16, 10:18

Posting Permissions

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