MediaPlayer does not stops or pause

All your problems with Audio, Video and Images.

MediaPlayer does not stops or pause

Postby andreleitao » Fri Apr 03, 2009 8:02 pm

Hi, why when I call mediaplayer.stop() or mediaplayer.pause() is continues playing the sound (a .mid file, for instance)?

E.g.:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. mediaplayer = MediaPlayer.create(MainActivity.getInstance(), R.raw.musicmp3);
  3.  
  4. try {
  5.  
  6.      mp.prepare();
  7.  
  8. } catch (IllegalStateException e) {
  9.  
  10.      e.printStackTrace();
  11.  
  12. } catch (IOException e) {
  13.  
  14.      e.printStackTrace();
  15.  
  16. }
  17.  
  18. mp.start();
  19.  
  20.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


If I call mediaplayer.stop() the music is not stopped. Why that?

Thanks!
andreleitao
Experienced Developer
Experienced Developer
 
Posts: 70
Joined: Tue Mar 10, 2009 9:56 pm
Location: Recife - Brazil

Top

Postby alpesh_harsoda » Fri May 01, 2009 1:12 pm

Hi,
In my application its working perfectly mp.pause and mp.stop after calling mp.prepare.
Regards,
Alpesh Patel,
Logistic Infotech
http://www.logisticinfotech.com
User avatar
alpesh_harsoda
Senior Developer
Senior Developer
 
Posts: 106
Joined: Sat Sep 20, 2008 12:35 pm
Location: Rajkot,Gujarat(India)

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 10 guests