×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    40

    Problems in player when incoming call

    hi,

    i´m playing a mp3:

    Code:
    InputStream is = getClass().getResourceAsStream(track); // Crear el stream del archivo de sonido
            if (player == null) {
                try {
                    player = Manager.createPlayer(is, "audio/mp3");
                    player.addPlayerListener(this);
                } catch (IOException ex) {
                } catch (MediaException ex) {
                }
    }
    When there are an incoming call, the player stops and doesnt sound anymore, my question is how to handle the incoming call to avoid the player from stopping

    Thanks

  2. #2
    Registered User
    Join Date
    Dec 2009
    Posts
    376

    Re: Problems in player when incoming call

    Player will stop as when call arrives it goes to pause state , and other reason will be that youre speaker will be used for call so it wont be possible to play at the time of call recpetion

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    40

    Re: Problems in player when incoming call

    Thanks for your reply prssupe,

    i realize that the MIDlet goes into paused state, but i didnt think about the speaker. Here is a little explanation of the app, it is a game that has background music, and it has animation and stuff, when the music stops, the game ends, the user has the chance to begin a new game, so the player restart and also the animations. My problem is that when the call comes in and the user answer it or rejects, the player doesnt sounds anymore, but the animation keeps going on, and never stops, because the stop is given when the player reaches the stopped state, even when i quit the game screen and go to the menu, and restart a new game, it continues in the place where it was before leaving, and its all because of the player. If someone could help me, ill be very grateful

    Thanks

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: Problems in player when incoming call

    You are using Canvas, right?

    You could check if either hideNotify() or pauseApp() called when a call comes in and pause the whole game application in there. different device families work in different ways - on Nokia phones pauseApp is not called in this situation.
    The you resume the game in showNotify()

    Hartti

  5. #5
    Registered User
    Join Date
    Nov 2010
    Posts
    40

    Re: Problems in player when incoming call

    thanks hartti,

    i think that would solve the problem, thanmk you very much

Similar Threads

  1. problems in resuming player when stoped in playing mp3
    By one_raghav in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2011-07-14, 22:54
  2. Device Error Exception in player application when call is in progress.
    By prakashvs in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2009-03-09, 06:10
  3. Incoming call problem with media player
    By sinkers in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2007-09-11, 22:41
  4. Replies: 3
    Last Post: 2006-12-14, 06:23
  5. Replies: 0
    Last Post: 2002-07-03, 09:55

Posting Permissions

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